util

package
v0.0.0-...-1ac4f16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// publish request
	TestSourceID                = "test-source-id"
	TestSourceIDInHeader        = "test-source-id-in-header"
	TestEventType               = "test-event-type"
	TestEventTypeVersion        = "v1"
	TestEventTypeVersionInvalid = "#"
	TestEventTime               = "2012-11-01T22:08:41+00:00"
	TestEventTimeInvalid        = "2012-11-01T22"
	TestEventID                 = "4ea567cf-812b-49d9-a4b2-cb5ddf464094"
	TestEventIDInvalid          = "4ea567cf"
	TestSourceIdInvalid         = "invalid/sourceId"
	TestData                    = "{'key':'value'}"
	TestDataEmpty               = ""
)
View Source
const (
	SubServer1EventsPath  = "/v1/events"
	SubServer1StatusPath  = "/v1/status"
	SubServer1ResultsPath = "/v1/results"
	SubServer2EventsPath  = "/v2/events"
	SubServer2StatusPath  = "/v2/status"
	SubServer2ResultsPath = "/v2/results"
)

Subscribers Servers API paths

View Source
const (
	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{})

func BuildDefaultTestBadPayload

func BuildDefaultTestBadPayload() string

func BuildDefaultTestPayload

func BuildDefaultTestPayload() string

func BuildDefaultTestPayloadWithEmptyData

func BuildDefaultTestPayloadWithEmptyData() string

func BuildDefaultTestPayloadWithoutData

func BuildDefaultTestPayloadWithoutData() string

func BuildDefaultTestPayloadWithoutEventTime

func BuildDefaultTestPayloadWithoutEventTime() string

func BuildDefaultTestPayloadWithoutEventType

func BuildDefaultTestPayloadWithoutEventType() string

func BuildDefaultTestPayloadWithoutEventTypeVersion

func BuildDefaultTestPayloadWithoutEventTypeVersion() string

func BuildDefaultTestPayloadWithoutSourceId

func BuildDefaultTestPayloadWithoutSourceId() string

func BuildDefaultTestSubject

func BuildDefaultTestSubject() string

func BuildDefaultTestSubjectAndPayload

func BuildDefaultTestSubjectAndPayload() (string, string)

func BuildTestPayload

func BuildTestPayload(sourceID, eventType, eventTypeVersion, eventID, eventTime, data string) string

func Logger

func Logger(h http.Handler) http.Handler

Logger ...

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

func NewSubscriberServerV1

func NewSubscriberServerV1() *httptest.Server

NewSubscriberServerV1 ...

func NewSubscriberServerV2

func NewSubscriberServerV2() *httptest.Server

NewSubscriberServerV2 ...

func NewSubscriberServerWithPort

func NewSubscriberServerWithPort(port int, stop chan bool) *http.Server

NewSubscriberServerWithPort ...

func NewSubscriberService

func NewSubscriberService() *apiv1.Service

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

func PerformPublishRequest(t *testing.T, publishURL string, payload string) ([]byte, int)

func PerformPublishRequestWithHeaders

func PerformPublishRequestWithHeaders(t *testing.T, publishURL string, payload string, headers map[string]string) ([]byte, int)

func VerifyReceivedMsg

func VerifyReceivedMsg(t *testing.T, a string, b []byte)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL