testing

package
v0.36.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NonValidatingNewSyncProducerFn

func NonValidatingNewSyncProducerFn(mockSyncProducer sarama.SyncProducer) wrapper.NewSyncProducerFnType

Non-Validating NewSyncProducer Function

func RestoreNewSyncProducerFn

func RestoreNewSyncProducerFn()

Restore The NewSyncProducerFn To Official Production Value

func StubNewSyncProducerFn

func StubNewSyncProducerFn(stubNewSyncProducerFn wrapper.NewSyncProducerFnType)

Replace The NewSyncProducerFn With Specified Mock / Test Value

func ValidatingNewSyncProducerFn

func ValidatingNewSyncProducerFn(t *testing.T,
	expectedBrokers []string,
	expectedConfig *sarama.Config,
	mockSyncProducer sarama.SyncProducer) wrapper.NewSyncProducerFnType

Validating NewSyncProducer Function

Types

type MockSyncProducer

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

func NewMockSyncProducer

func NewMockSyncProducer() *MockSyncProducer

func (*MockSyncProducer) Close

func (p *MockSyncProducer) Close() error

func (*MockSyncProducer) Closed

func (p *MockSyncProducer) Closed() bool

func (*MockSyncProducer) GetMessage

func (p *MockSyncProducer) GetMessage() sarama.ProducerMessage

func (*MockSyncProducer) SendMessage

func (p *MockSyncProducer) SendMessage(msg *sarama.ProducerMessage) (partition int32, offset int64, err error)

func (*MockSyncProducer) SendMessages

func (p *MockSyncProducer) SendMessages(_ []*sarama.ProducerMessage) error

Jump to

Keyboard shortcuts

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