util

package
v0.0.0-...-affaa53 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
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 = ""
)
View Source
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

View Source
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 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

NewSubscriberDeployment creates a new v1.Deployment instance.

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

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

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

PerformPublishRequest performs a test publish request.

func PerformPublishRequestWithHeaders

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

PerformPublishRequestWithHeaders performs a test publish request with HTTP headers.

Types

This section is empty.

Jump to

Keyboard shortcuts

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