testing

package
v0.24.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChannelName      = "TestChannelName"
	ChannelNamespace = "TestChannelNamespace"

	TopicName = "TestChannelNamespace.TestChannelName" // Match util.go TopicName() Implementation For Channel Name/Namespace Above

	PartitionKey         = "TestPartitionKey"
	EventId              = "TestEventId"
	EventType            = "com.cloudevents.readme.sent"
	EventSource          = "http://localhost:8080/"
	EventDataContentType = "application/json"
	EventSubject         = "TestEventSubject"
	EventDataSchema      = "TestEventDataSchema"
	EventDataKey         = "TestEventDataKey"
	EventDataValue       = "TestEventDataValue"
)

Test Data

Variables

View Source
var EventDataJson, _ = json.Marshal(map[string]string{EventDataKey: EventDataValue})

Test Data

Functions

func CreateBindingMessage

func CreateBindingMessage(cloudEventVersion string) binding.Message

Utility Function For Creating A CloudEvents sdk-go BindingMessage

func CreateChannelReference

func CreateChannelReference(name string, namespace string) eventingChannel.ChannelReference

Utility Function For Creating A Test ChannelReference (Knative)

func CreateCloudEvent

func CreateCloudEvent(cloudEventVersion string) *event.Event

Utility Function For Creating A Test CloudEvent

func CreateKafkaChannel

func CreateKafkaChannel(name string, namespace string, ready corev1.ConditionStatus) *kafkav1beta1.KafkaChannel

func GetProducerMessageHeader

func GetProducerMessageHeader(t *testing.T, headers []sarama.RecordHeader, headerKey string) *sarama.RecordHeader

Utility Function For Acquiring A Kafka Message Header With The Specified Key

func ValidateProducerMessageHeader

func ValidateProducerMessageHeader(t *testing.T, headers []sarama.RecordHeader, headerKey string, headerValue string)

Utility Function For Validating A Kafka Message Header Is Present With Specified Value

Types

type MockKafkaChannelLister

type MockKafkaChannelLister struct {
	// contains filtered or unexported fields
}

func NewMockKafkaChannelLister

func NewMockKafkaChannelLister(name string, namespace string, exists bool, ready corev1.ConditionStatus, err bool) MockKafkaChannelLister

func (MockKafkaChannelLister) KafkaChannels

func (MockKafkaChannelLister) List

type MockKafkaChannelNamespaceLister

type MockKafkaChannelNamespaceLister struct {
	// contains filtered or unexported fields
}

func NewMockKafkaChannelNamespaceLister

func NewMockKafkaChannelNamespaceLister(name string, namespace string, exists bool, ready corev1.ConditionStatus, err bool) MockKafkaChannelNamespaceLister

func (MockKafkaChannelNamespaceLister) Get

func (MockKafkaChannelNamespaceLister) List

Jump to

Keyboard shortcuts

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