Documentation ¶
Index ¶
- Constants
- func AssertExpectedError(t *testing.T, body []byte, actualStatusCode int, expectedStatusCode int, ...)
- func BuildDefaultTestBadPayload() string
- func BuildDefaultTestPayload() string
- func BuildDefaultTestPayloadWithEmptyData() string
- func BuildDefaultTestPayloadWithoutData() string
- func BuildDefaultTestPayloadWithoutEventTime() string
- func BuildDefaultTestPayloadWithoutEventType() string
- func BuildDefaultTestPayloadWithoutEventTypeVersion() string
- func BuildDefaultTestPayloadWithoutSourceID() string
- func BuildTestPayload(sourceID, eventType, eventTypeVersion, eventID, eventTime, data string) string
- func Logger(h http.Handler) http.Handler
- func NewEventActivation(name string, namespace string, sourceID string) *eaApis.EventActivation
- func NewSubscriberDeployment(sbscrImg string) *appsv1.Deployment
- func NewSubscriberServerV1() *httptest.Server
- func NewSubscriberServerV2() *httptest.Server
- func NewSubscriberServerWithPort(port int, stop chan bool) *http.Server
- func NewSubscriberService() *apiv1.Service
- func NewSubscription(name string, namespace string, subscriberEventEndpointURL string, ...) *apiv1.Subscription
- func PerformPublishRequest(t *testing.T, publishURL string, payload string) ([]byte, int)
- func PerformPublishRequestWithHeaders(t *testing.T, publishURL string, payload string, headers map[string]string) ([]byte, int)
Constants ¶
const ( // TestSourceID used in the tests TestSourceID = "test-source-id" // TestEventType used in the tests TestEventType = "test-event-type" // TestEventTypeVersion used in the tests TestEventTypeVersion = "v1" // TestEventTypeVersionInvalid used in the tests TestEventTypeVersionInvalid = "#" // TestEventTime used in the tests TestEventTime = "2012-11-01T22:08:41+00:00" // TestEventTimeInvalid used in the tests TestEventTimeInvalid = "2012-11-01T22" // TestEventID used in the tests TestEventID = "4ea567cf-812b-49d9-a4b2-cb5ddf464094" // TestEventIDInvalid used in the tests TestEventIDInvalid = "4ea567cf" // TestSourceIDInvalid used in the tests TestSourceIDInvalid = "source/Id" // TestData used in the tests TestData = "{'key':'value'}" // TestDataEmpty used in the tests TestDataEmpty = "" )
const ( SubServer1EventsPath = "/v1/events" SubServer1StatusPath = "/v1/status" SubServer1ResultsPath = "/v1/results" SubServer2EventsPath = "/v2/events" SubServer2StatusPath = "/v2/status" SubServer2ResultsPath = "/v2/results" SubServer3EventsPath = "/v3/events" SubServer3StatusPath = "/v3/status" SubServer3ResultsPath = "/v3/results" )
Subscribers Servers API paths
const (
// SubscriberName used in the tests
SubscriberName = "test-core-event-bus-subscriber"
)
Variables ¶
This section is empty.
Functions ¶
func AssertExpectedError ¶
func AssertExpectedError(t *testing.T, body []byte, actualStatusCode int, expectedStatusCode int, errorField interface{}, errorType interface{})
AssertExpectedError asserts an expected status-code and error.
func BuildDefaultTestBadPayload ¶
func BuildDefaultTestBadPayload() string
BuildDefaultTestBadPayload returns a default test bad payload.
func BuildDefaultTestPayload ¶
func BuildDefaultTestPayload() string
BuildDefaultTestPayload returns a default test payload.
func BuildDefaultTestPayloadWithEmptyData ¶
func BuildDefaultTestPayloadWithEmptyData() string
BuildDefaultTestPayloadWithEmptyData returns a default test payload with empty data
func BuildDefaultTestPayloadWithoutData ¶
func BuildDefaultTestPayloadWithoutData() string
BuildDefaultTestPayloadWithoutData returns a default test payload without the data
func BuildDefaultTestPayloadWithoutEventTime ¶
func BuildDefaultTestPayloadWithoutEventTime() string
BuildDefaultTestPayloadWithoutEventTime returns a default test payload without the event-time
func BuildDefaultTestPayloadWithoutEventType ¶
func BuildDefaultTestPayloadWithoutEventType() string
BuildDefaultTestPayloadWithoutEventType returns a default test payload without the event-type.
func BuildDefaultTestPayloadWithoutEventTypeVersion ¶
func BuildDefaultTestPayloadWithoutEventTypeVersion() string
BuildDefaultTestPayloadWithoutEventTypeVersion returns a default test payload without the event-type-version.
func BuildDefaultTestPayloadWithoutSourceID ¶
func BuildDefaultTestPayloadWithoutSourceID() string
BuildDefaultTestPayloadWithoutSourceID returns a default test payload without the source-id.
func BuildTestPayload ¶
func BuildTestPayload(sourceID, eventType, eventTypeVersion, eventID, eventTime, data string) string
BuildTestPayload returns a test payload.
func NewEventActivation ¶
func NewEventActivation(name string, namespace string, sourceID string) *eaApis.EventActivation
NewEventActivation creates a new event activation
func NewSubscriberDeployment ¶
func NewSubscriberDeployment(sbscrImg string) *appsv1.Deployment
NewSubscriberDeployment creates a new v1.Deployment instance.
func NewSubscriberServerV1 ¶
NewSubscriberServerV1 ...
func NewSubscriberServerV2 ¶
NewSubscriberServerV2 ...
func NewSubscriberServerWithPort ¶
NewSubscriberServerWithPort ...
func NewSubscriberService ¶
NewSubscriberService creates a new v1.Service instance.
func NewSubscription ¶
func NewSubscription(name string, namespace string, subscriberEventEndpointURL string, eventType string, eventTypeVersion string, sourceID string) *apiv1.Subscription
NewSubscription creates a new subscription
func PerformPublishRequest ¶
PerformPublishRequest performs a test publish request.
Types ¶
This section is empty.