util

package
v0.0.0-...-a52e8f6 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2020 License: Apache-2.0 Imports: 9 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 = ""
)

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 PerformPublishV1Request

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

PerformPublishV1Request performs a test publish request.

func PerformPublishV1RequestWithHeaders

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

PerformPublishV1RequestWithHeaders performs a test publish request with HTTP headers.

func PerformPublishV2RequestWithHeaders

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

PerformPublishV2RequestWithHeaders 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