func (s *Scenario) AssertServedBy(service string) error {
	if s.CapturedRequest.Service != service {
		return fmt.Errorf("expected the request to be served by %v but it was served by %v", service, s.CapturedRequest.Service)
	}
	return nil
}
AssertServedBy returns an error if the captured request was not served by the expected service
package state
import (
	"fmt"
	"strings"
	"sigs.k8s.io/ingress-controller-conformance/test/http"
)
type Scenario struct {
	Namespace   string
	IngressName string
	SecretName string
	CapturedRequest  *http.CapturedRequest
	CapturedResponse *http.CapturedResponse
	IPOrFQDN string
}
func New() *Scenario {
	return &Scenario{}
}
func (s *Scenario) CaptureRoundTrip(method, scheme, hostname, path string) error {
	capturedRequest, capturedResponse, err := http.CaptureRoundTrip(method, scheme, hostname, path, s.IPOrFQDN)
	if err != nil {
		return err
	}
	s.CapturedRequest = capturedRequest
	s.CapturedResponse = capturedResponse
	return nil
}
func (s *Scenario) AssertStatusCode(statusCode int) error {
	if s.CapturedResponse.StatusCode != statusCode {
		return fmt.Errorf("expected status code %v but %v was returned", statusCode, s.CapturedResponse.StatusCode)
	}
	return nil
}