testing

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertTimestampIsISO8601 added in v0.16.0

func AssertTimestampIsISO8601(t TestingT, timestampStr string, msgAndArgs ...interface{})

AssertTimestampIsISO8601 verifies that a timestamp string is a valid ISO 8601 / RFC3339 timestamp.

Types

type Config

type Config struct {
	Provider destregistry.Provider
	Dest     *models.Destination
	Consumer MessageConsumer
	// Optional asserter for provider-specific message checks
	Asserter MessageAsserter
}

Config is used to initialize the test suite

type Message

type Message struct {
	Data     []byte
	Metadata map[string]string
	// Raw contains the provider-specific message type (e.g. amqp.Delivery, http.Request)
	Raw interface{}
}

Message represents a message that was received by the consumer

type MessageAsserter

type MessageAsserter interface {
	// AssertMessage is called after the base assertions to allow provider-specific checks
	AssertMessage(t TestingT, msg Message, event models.Event)
}

MessageAsserter allows providers to add their own assertions on the raw message

type MessageConsumer

type MessageConsumer interface {
	// Consume returns a channel that receives messages
	Consume() <-chan Message
	// Close stops consuming messages
	Close() error
}

MessageConsumer is the interface that providers must implement

type PublisherSuite

type PublisherSuite struct {
	suite.Suite
	// contains filtered or unexported fields
}

PublisherSuite is the base test suite that providers should embed

func (*PublisherSuite) InitSuite

func (s *PublisherSuite) InitSuite(cfg Config)

func (*PublisherSuite) SetupTest

func (s *PublisherSuite) SetupTest()

func (*PublisherSuite) TearDownTest

func (s *PublisherSuite) TearDownTest()

func (*PublisherSuite) TestBasicPublish

func (s *PublisherSuite) TestBasicPublish()

func (*PublisherSuite) TestClosePublisherDuringConcurrentPublish

func (s *PublisherSuite) TestClosePublisherDuringConcurrentPublish()

func (*PublisherSuite) TestConcurrentPublish

func (s *PublisherSuite) TestConcurrentPublish()

func (*PublisherSuite) TestPublishWithDeliveryMetadata added in v0.8.0

func (s *PublisherSuite) TestPublishWithDeliveryMetadata()

type TestingT

type TestingT interface {
	Errorf(format string, args ...interface{})
	FailNow()
	Helper()
}

TestingT is a subset of testing.T that we need for assertions

Jump to

Keyboard shortcuts

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