mock

package
v3.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MessageMock

type MessageMock struct {
	// CommitFunc mocks the Commit method.
	CommitFunc func()

	// CommitAndReleaseFunc mocks the CommitAndRelease method.
	CommitAndReleaseFunc func()

	// ContextFunc mocks the Context method.
	ContextFunc func() context.Context

	// GetDataFunc mocks the GetData method.
	GetDataFunc func() []byte

	// GetHeaderFunc mocks the GetHeader method.
	GetHeaderFunc func(key string) string

	// MarkFunc mocks the Mark method.
	MarkFunc func()

	// OffsetFunc mocks the Offset method.
	OffsetFunc func() int64

	// ReleaseFunc mocks the Release method.
	ReleaseFunc func()

	// UpstreamDoneFunc mocks the UpstreamDone method.
	UpstreamDoneFunc func() chan struct{}
	// contains filtered or unexported fields
}

MessageMock is a mock implementation of interfaces.Message.

func TestSomethingThatUsesMessage(t *testing.T) {

	// make and configure a mocked interfaces.Message
	mockedMessage := &MessageMock{
		CommitFunc: func()  {
			panic("mock out the Commit method")
		},
		CommitAndReleaseFunc: func()  {
			panic("mock out the CommitAndRelease method")
		},
		ContextFunc: func() context.Context {
			panic("mock out the Context method")
		},
		GetDataFunc: func() []byte {
			panic("mock out the GetData method")
		},
		GetHeaderFunc: func(key string) string {
			panic("mock out the GetHeader method")
		},
		MarkFunc: func()  {
			panic("mock out the Mark method")
		},
		OffsetFunc: func() int64 {
			panic("mock out the Offset method")
		},
		ReleaseFunc: func()  {
			panic("mock out the Release method")
		},
		UpstreamDoneFunc: func() chan struct{} {
			panic("mock out the UpstreamDone method")
		},
	}

	// use mockedMessage in code that requires interfaces.Message
	// and then make assertions.

}

func (*MessageMock) Commit

func (mock *MessageMock) Commit()

Commit calls CommitFunc.

func (*MessageMock) CommitAndRelease

func (mock *MessageMock) CommitAndRelease()

CommitAndRelease calls CommitAndReleaseFunc.

func (*MessageMock) CommitAndReleaseCalls

func (mock *MessageMock) CommitAndReleaseCalls() []struct {
}

CommitAndReleaseCalls gets all the calls that were made to CommitAndRelease. Check the length with:

len(mockedMessage.CommitAndReleaseCalls())

func (*MessageMock) CommitCalls

func (mock *MessageMock) CommitCalls() []struct {
}

CommitCalls gets all the calls that were made to Commit. Check the length with:

len(mockedMessage.CommitCalls())

func (*MessageMock) Context added in v3.4.0

func (mock *MessageMock) Context() context.Context

Context calls ContextFunc.

func (*MessageMock) ContextCalls added in v3.4.0

func (mock *MessageMock) ContextCalls() []struct {
}

ContextCalls gets all the calls that were made to Context. Check the length with:

len(mockedMessage.ContextCalls())

func (*MessageMock) GetData

func (mock *MessageMock) GetData() []byte

GetData calls GetDataFunc.

func (*MessageMock) GetDataCalls

func (mock *MessageMock) GetDataCalls() []struct {
}

GetDataCalls gets all the calls that were made to GetData. Check the length with:

len(mockedMessage.GetDataCalls())

func (*MessageMock) GetHeader added in v3.4.0

func (mock *MessageMock) GetHeader(key string) string

GetHeader calls GetHeaderFunc.

func (*MessageMock) GetHeaderCalls added in v3.4.0

func (mock *MessageMock) GetHeaderCalls() []struct {
	Key string
}

GetHeaderCalls gets all the calls that were made to GetHeader. Check the length with:

len(mockedMessage.GetHeaderCalls())

func (*MessageMock) Mark

func (mock *MessageMock) Mark()

Mark calls MarkFunc.

func (*MessageMock) MarkCalls

func (mock *MessageMock) MarkCalls() []struct {
}

MarkCalls gets all the calls that were made to Mark. Check the length with:

len(mockedMessage.MarkCalls())

func (*MessageMock) Offset

func (mock *MessageMock) Offset() int64

Offset calls OffsetFunc.

func (*MessageMock) OffsetCalls

func (mock *MessageMock) OffsetCalls() []struct {
}

OffsetCalls gets all the calls that were made to Offset. Check the length with:

len(mockedMessage.OffsetCalls())

func (*MessageMock) Release

func (mock *MessageMock) Release()

Release calls ReleaseFunc.

func (*MessageMock) ReleaseCalls

func (mock *MessageMock) ReleaseCalls() []struct {
}

ReleaseCalls gets all the calls that were made to Release. Check the length with:

len(mockedMessage.ReleaseCalls())

func (*MessageMock) UpstreamDone

func (mock *MessageMock) UpstreamDone() chan struct{}

UpstreamDone calls UpstreamDoneFunc.

func (*MessageMock) UpstreamDoneCalls

func (mock *MessageMock) UpstreamDoneCalls() []struct {
}

UpstreamDoneCalls gets all the calls that were made to UpstreamDone. Check the length with:

len(mockedMessage.UpstreamDoneCalls())

type SaramaAsyncProducerMock

type SaramaAsyncProducerMock struct {
	// AbortTxnFunc mocks the AbortTxn method.
	AbortTxnFunc func() error

	// AddMessageToTxnFunc mocks the AddMessageToTxn method.
	AddMessageToTxnFunc func(msg *sarama.ConsumerMessage, groupId string, metadata *string) error

	// AddOffsetsToTxnFunc mocks the AddOffsetsToTxn method.
	AddOffsetsToTxnFunc func(offsets map[string][]*sarama.PartitionOffsetMetadata, groupId string) error

	// AsyncCloseFunc mocks the AsyncClose method.
	AsyncCloseFunc func()

	// BeginTxnFunc mocks the BeginTxn method.
	BeginTxnFunc func() error

	// CloseFunc mocks the Close method.
	CloseFunc func() error

	// CommitTxnFunc mocks the CommitTxn method.
	CommitTxnFunc func() error

	// ErrorsFunc mocks the Errors method.
	ErrorsFunc func() <-chan *sarama.ProducerError

	// InputFunc mocks the Input method.
	InputFunc func() chan<- *sarama.ProducerMessage

	// IsTransactionalFunc mocks the IsTransactional method.
	IsTransactionalFunc func() bool

	// SuccessesFunc mocks the Successes method.
	SuccessesFunc func() <-chan *sarama.ProducerMessage

	// TxnStatusFunc mocks the TxnStatus method.
	TxnStatusFunc func() sarama.ProducerTxnStatusFlag
	// contains filtered or unexported fields
}

SaramaAsyncProducerMock is a mock implementation of interfaces.SaramaAsyncProducer.

func TestSomethingThatUsesSaramaAsyncProducer(t *testing.T) {

	// make and configure a mocked interfaces.SaramaAsyncProducer
	mockedSaramaAsyncProducer := &SaramaAsyncProducerMock{
		AbortTxnFunc: func() error {
			panic("mock out the AbortTxn method")
		},
		AddMessageToTxnFunc: func(msg *sarama.ConsumerMessage, groupId string, metadata *string) error {
			panic("mock out the AddMessageToTxn method")
		},
		AddOffsetsToTxnFunc: func(offsets map[string][]*sarama.PartitionOffsetMetadata, groupId string) error {
			panic("mock out the AddOffsetsToTxn method")
		},
		AsyncCloseFunc: func()  {
			panic("mock out the AsyncClose method")
		},
		BeginTxnFunc: func() error {
			panic("mock out the BeginTxn method")
		},
		CloseFunc: func() error {
			panic("mock out the Close method")
		},
		CommitTxnFunc: func() error {
			panic("mock out the CommitTxn method")
		},
		ErrorsFunc: func() <-chan *sarama.ProducerError {
			panic("mock out the Errors method")
		},
		InputFunc: func() chan<- *sarama.ProducerMessage {
			panic("mock out the Input method")
		},
		IsTransactionalFunc: func() bool {
			panic("mock out the IsTransactional method")
		},
		SuccessesFunc: func() <-chan *sarama.ProducerMessage {
			panic("mock out the Successes method")
		},
		TxnStatusFunc: func() sarama.ProducerTxnStatusFlag {
			panic("mock out the TxnStatus method")
		},
	}

	// use mockedSaramaAsyncProducer in code that requires interfaces.SaramaAsyncProducer
	// and then make assertions.

}

func (*SaramaAsyncProducerMock) AbortTxn added in v3.6.0

func (mock *SaramaAsyncProducerMock) AbortTxn() error

AbortTxn calls AbortTxnFunc.

func (*SaramaAsyncProducerMock) AbortTxnCalls added in v3.6.0

func (mock *SaramaAsyncProducerMock) AbortTxnCalls() []struct {
}

AbortTxnCalls gets all the calls that were made to AbortTxn. Check the length with:

len(mockedSaramaAsyncProducer.AbortTxnCalls())

func (*SaramaAsyncProducerMock) AddMessageToTxn added in v3.6.0

func (mock *SaramaAsyncProducerMock) AddMessageToTxn(msg *sarama.ConsumerMessage, groupId string, metadata *string) error

AddMessageToTxn calls AddMessageToTxnFunc.

func (*SaramaAsyncProducerMock) AddMessageToTxnCalls added in v3.6.0

func (mock *SaramaAsyncProducerMock) AddMessageToTxnCalls() []struct {
	Msg      *sarama.ConsumerMessage
	GroupId  string
	Metadata *string
}

AddMessageToTxnCalls gets all the calls that were made to AddMessageToTxn. Check the length with:

len(mockedSaramaAsyncProducer.AddMessageToTxnCalls())

func (*SaramaAsyncProducerMock) AddOffsetsToTxn added in v3.6.0

func (mock *SaramaAsyncProducerMock) AddOffsetsToTxn(offsets map[string][]*sarama.PartitionOffsetMetadata, groupId string) error

AddOffsetsToTxn calls AddOffsetsToTxnFunc.

func (*SaramaAsyncProducerMock) AddOffsetsToTxnCalls added in v3.6.0

func (mock *SaramaAsyncProducerMock) AddOffsetsToTxnCalls() []struct {
	Offsets map[string][]*sarama.PartitionOffsetMetadata
	GroupId string
}

AddOffsetsToTxnCalls gets all the calls that were made to AddOffsetsToTxn. Check the length with:

len(mockedSaramaAsyncProducer.AddOffsetsToTxnCalls())

func (*SaramaAsyncProducerMock) AsyncClose

func (mock *SaramaAsyncProducerMock) AsyncClose()

AsyncClose calls AsyncCloseFunc.

func (*SaramaAsyncProducerMock) AsyncCloseCalls

func (mock *SaramaAsyncProducerMock) AsyncCloseCalls() []struct {
}

AsyncCloseCalls gets all the calls that were made to AsyncClose. Check the length with:

len(mockedSaramaAsyncProducer.AsyncCloseCalls())

func (*SaramaAsyncProducerMock) BeginTxn added in v3.6.0

func (mock *SaramaAsyncProducerMock) BeginTxn() error

BeginTxn calls BeginTxnFunc.

func (*SaramaAsyncProducerMock) BeginTxnCalls added in v3.6.0

func (mock *SaramaAsyncProducerMock) BeginTxnCalls() []struct {
}

BeginTxnCalls gets all the calls that were made to BeginTxn. Check the length with:

len(mockedSaramaAsyncProducer.BeginTxnCalls())

func (*SaramaAsyncProducerMock) Close

func (mock *SaramaAsyncProducerMock) Close() error

Close calls CloseFunc.

func (*SaramaAsyncProducerMock) CloseCalls

func (mock *SaramaAsyncProducerMock) CloseCalls() []struct {
}

CloseCalls gets all the calls that were made to Close. Check the length with:

len(mockedSaramaAsyncProducer.CloseCalls())

func (*SaramaAsyncProducerMock) CommitTxn added in v3.6.0

func (mock *SaramaAsyncProducerMock) CommitTxn() error

CommitTxn calls CommitTxnFunc.

func (*SaramaAsyncProducerMock) CommitTxnCalls added in v3.6.0

func (mock *SaramaAsyncProducerMock) CommitTxnCalls() []struct {
}

CommitTxnCalls gets all the calls that were made to CommitTxn. Check the length with:

len(mockedSaramaAsyncProducer.CommitTxnCalls())

func (*SaramaAsyncProducerMock) Errors

func (mock *SaramaAsyncProducerMock) Errors() <-chan *sarama.ProducerError

Errors calls ErrorsFunc.

func (*SaramaAsyncProducerMock) ErrorsCalls

func (mock *SaramaAsyncProducerMock) ErrorsCalls() []struct {
}

ErrorsCalls gets all the calls that were made to Errors. Check the length with:

len(mockedSaramaAsyncProducer.ErrorsCalls())

func (*SaramaAsyncProducerMock) Input

func (mock *SaramaAsyncProducerMock) Input() chan<- *sarama.ProducerMessage

Input calls InputFunc.

func (*SaramaAsyncProducerMock) InputCalls

func (mock *SaramaAsyncProducerMock) InputCalls() []struct {
}

InputCalls gets all the calls that were made to Input. Check the length with:

len(mockedSaramaAsyncProducer.InputCalls())

func (*SaramaAsyncProducerMock) IsTransactional added in v3.6.0

func (mock *SaramaAsyncProducerMock) IsTransactional() bool

IsTransactional calls IsTransactionalFunc.

func (*SaramaAsyncProducerMock) IsTransactionalCalls added in v3.6.0

func (mock *SaramaAsyncProducerMock) IsTransactionalCalls() []struct {
}

IsTransactionalCalls gets all the calls that were made to IsTransactional. Check the length with:

len(mockedSaramaAsyncProducer.IsTransactionalCalls())

func (*SaramaAsyncProducerMock) Successes

func (mock *SaramaAsyncProducerMock) Successes() <-chan *sarama.ProducerMessage

Successes calls SuccessesFunc.

func (*SaramaAsyncProducerMock) SuccessesCalls

func (mock *SaramaAsyncProducerMock) SuccessesCalls() []struct {
}

SuccessesCalls gets all the calls that were made to Successes. Check the length with:

len(mockedSaramaAsyncProducer.SuccessesCalls())

func (*SaramaAsyncProducerMock) TxnStatus added in v3.6.0

TxnStatus calls TxnStatusFunc.

func (*SaramaAsyncProducerMock) TxnStatusCalls added in v3.6.0

func (mock *SaramaAsyncProducerMock) TxnStatusCalls() []struct {
}

TxnStatusCalls gets all the calls that were made to TxnStatus. Check the length with:

len(mockedSaramaAsyncProducer.TxnStatusCalls())

type SaramaBrokerMock

type SaramaBrokerMock struct {
	// AddrFunc mocks the Addr method.
	AddrFunc func() string

	// CloseFunc mocks the Close method.
	CloseFunc func() error

	// ConnectedFunc mocks the Connected method.
	ConnectedFunc func() (bool, error)

	// GetMetadataFunc mocks the GetMetadata method.
	GetMetadataFunc func(request *sarama.MetadataRequest) (*sarama.MetadataResponse, error)

	// OpenFunc mocks the Open method.
	OpenFunc func(conf *sarama.Config) error
	// contains filtered or unexported fields
}

SaramaBrokerMock is a mock implementation of interfaces.SaramaBroker.

func TestSomethingThatUsesSaramaBroker(t *testing.T) {

	// make and configure a mocked interfaces.SaramaBroker
	mockedSaramaBroker := &SaramaBrokerMock{
		AddrFunc: func() string {
			panic("mock out the Addr method")
		},
		CloseFunc: func() error {
			panic("mock out the Close method")
		},
		ConnectedFunc: func() (bool, error) {
			panic("mock out the Connected method")
		},
		GetMetadataFunc: func(request *sarama.MetadataRequest) (*sarama.MetadataResponse, error) {
			panic("mock out the GetMetadata method")
		},
		OpenFunc: func(conf *sarama.Config) error {
			panic("mock out the Open method")
		},
	}

	// use mockedSaramaBroker in code that requires interfaces.SaramaBroker
	// and then make assertions.

}

func (*SaramaBrokerMock) Addr

func (mock *SaramaBrokerMock) Addr() string

Addr calls AddrFunc.

func (*SaramaBrokerMock) AddrCalls

func (mock *SaramaBrokerMock) AddrCalls() []struct {
}

AddrCalls gets all the calls that were made to Addr. Check the length with:

len(mockedSaramaBroker.AddrCalls())

func (*SaramaBrokerMock) Close

func (mock *SaramaBrokerMock) Close() error

Close calls CloseFunc.

func (*SaramaBrokerMock) CloseCalls

func (mock *SaramaBrokerMock) CloseCalls() []struct {
}

CloseCalls gets all the calls that were made to Close. Check the length with:

len(mockedSaramaBroker.CloseCalls())

func (*SaramaBrokerMock) Connected

func (mock *SaramaBrokerMock) Connected() (bool, error)

Connected calls ConnectedFunc.

func (*SaramaBrokerMock) ConnectedCalls

func (mock *SaramaBrokerMock) ConnectedCalls() []struct {
}

ConnectedCalls gets all the calls that were made to Connected. Check the length with:

len(mockedSaramaBroker.ConnectedCalls())

func (*SaramaBrokerMock) GetMetadata

func (mock *SaramaBrokerMock) GetMetadata(request *sarama.MetadataRequest) (*sarama.MetadataResponse, error)

GetMetadata calls GetMetadataFunc.

func (*SaramaBrokerMock) GetMetadataCalls

func (mock *SaramaBrokerMock) GetMetadataCalls() []struct {
	Request *sarama.MetadataRequest
}

GetMetadataCalls gets all the calls that were made to GetMetadata. Check the length with:

len(mockedSaramaBroker.GetMetadataCalls())

func (*SaramaBrokerMock) Open

func (mock *SaramaBrokerMock) Open(conf *sarama.Config) error

Open calls OpenFunc.

func (*SaramaBrokerMock) OpenCalls

func (mock *SaramaBrokerMock) OpenCalls() []struct {
	Conf *sarama.Config
}

OpenCalls gets all the calls that were made to Open. Check the length with:

len(mockedSaramaBroker.OpenCalls())

type SaramaConsumerGroupClaimMock

type SaramaConsumerGroupClaimMock struct {
	// HighWaterMarkOffsetFunc mocks the HighWaterMarkOffset method.
	HighWaterMarkOffsetFunc func() int64

	// InitialOffsetFunc mocks the InitialOffset method.
	InitialOffsetFunc func() int64

	// MessagesFunc mocks the Messages method.
	MessagesFunc func() <-chan *sarama.ConsumerMessage

	// PartitionFunc mocks the Partition method.
	PartitionFunc func() int32

	// TopicFunc mocks the Topic method.
	TopicFunc func() string
	// contains filtered or unexported fields
}

SaramaConsumerGroupClaimMock is a mock implementation of interfaces.SaramaConsumerGroupClaim.

func TestSomethingThatUsesSaramaConsumerGroupClaim(t *testing.T) {

	// make and configure a mocked interfaces.SaramaConsumerGroupClaim
	mockedSaramaConsumerGroupClaim := &SaramaConsumerGroupClaimMock{
		HighWaterMarkOffsetFunc: func() int64 {
			panic("mock out the HighWaterMarkOffset method")
		},
		InitialOffsetFunc: func() int64 {
			panic("mock out the InitialOffset method")
		},
		MessagesFunc: func() <-chan *sarama.ConsumerMessage {
			panic("mock out the Messages method")
		},
		PartitionFunc: func() int32 {
			panic("mock out the Partition method")
		},
		TopicFunc: func() string {
			panic("mock out the Topic method")
		},
	}

	// use mockedSaramaConsumerGroupClaim in code that requires interfaces.SaramaConsumerGroupClaim
	// and then make assertions.

}

func (*SaramaConsumerGroupClaimMock) HighWaterMarkOffset

func (mock *SaramaConsumerGroupClaimMock) HighWaterMarkOffset() int64

HighWaterMarkOffset calls HighWaterMarkOffsetFunc.

func (*SaramaConsumerGroupClaimMock) HighWaterMarkOffsetCalls

func (mock *SaramaConsumerGroupClaimMock) HighWaterMarkOffsetCalls() []struct {
}

HighWaterMarkOffsetCalls gets all the calls that were made to HighWaterMarkOffset. Check the length with:

len(mockedSaramaConsumerGroupClaim.HighWaterMarkOffsetCalls())

func (*SaramaConsumerGroupClaimMock) InitialOffset

func (mock *SaramaConsumerGroupClaimMock) InitialOffset() int64

InitialOffset calls InitialOffsetFunc.

func (*SaramaConsumerGroupClaimMock) InitialOffsetCalls

func (mock *SaramaConsumerGroupClaimMock) InitialOffsetCalls() []struct {
}

InitialOffsetCalls gets all the calls that were made to InitialOffset. Check the length with:

len(mockedSaramaConsumerGroupClaim.InitialOffsetCalls())

func (*SaramaConsumerGroupClaimMock) Messages

func (mock *SaramaConsumerGroupClaimMock) Messages() <-chan *sarama.ConsumerMessage

Messages calls MessagesFunc.

func (*SaramaConsumerGroupClaimMock) MessagesCalls

func (mock *SaramaConsumerGroupClaimMock) MessagesCalls() []struct {
}

MessagesCalls gets all the calls that were made to Messages. Check the length with:

len(mockedSaramaConsumerGroupClaim.MessagesCalls())

func (*SaramaConsumerGroupClaimMock) Partition

func (mock *SaramaConsumerGroupClaimMock) Partition() int32

Partition calls PartitionFunc.

func (*SaramaConsumerGroupClaimMock) PartitionCalls

func (mock *SaramaConsumerGroupClaimMock) PartitionCalls() []struct {
}

PartitionCalls gets all the calls that were made to Partition. Check the length with:

len(mockedSaramaConsumerGroupClaim.PartitionCalls())

func (*SaramaConsumerGroupClaimMock) Topic

func (mock *SaramaConsumerGroupClaimMock) Topic() string

Topic calls TopicFunc.

func (*SaramaConsumerGroupClaimMock) TopicCalls

func (mock *SaramaConsumerGroupClaimMock) TopicCalls() []struct {
}

TopicCalls gets all the calls that were made to Topic. Check the length with:

len(mockedSaramaConsumerGroupClaim.TopicCalls())

type SaramaConsumerGroupMock

type SaramaConsumerGroupMock struct {
	// CloseFunc mocks the Close method.
	CloseFunc func() error

	// ConsumeFunc mocks the Consume method.
	ConsumeFunc func(ctx context.Context, topics []string, handler sarama.ConsumerGroupHandler) error

	// ErrorsFunc mocks the Errors method.
	ErrorsFunc func() <-chan error

	// PauseFunc mocks the Pause method.
	PauseFunc func(partitions map[string][]int32)

	// PauseAllFunc mocks the PauseAll method.
	PauseAllFunc func()

	// ResumeFunc mocks the Resume method.
	ResumeFunc func(partitions map[string][]int32)

	// ResumeAllFunc mocks the ResumeAll method.
	ResumeAllFunc func()
	// contains filtered or unexported fields
}

SaramaConsumerGroupMock is a mock implementation of interfaces.SaramaConsumerGroup.

func TestSomethingThatUsesSaramaConsumerGroup(t *testing.T) {

	// make and configure a mocked interfaces.SaramaConsumerGroup
	mockedSaramaConsumerGroup := &SaramaConsumerGroupMock{
		CloseFunc: func() error {
			panic("mock out the Close method")
		},
		ConsumeFunc: func(ctx context.Context, topics []string, handler sarama.ConsumerGroupHandler) error {
			panic("mock out the Consume method")
		},
		ErrorsFunc: func() <-chan error {
			panic("mock out the Errors method")
		},
		PauseFunc: func(partitions map[string][]int32)  {
			panic("mock out the Pause method")
		},
		PauseAllFunc: func()  {
			panic("mock out the PauseAll method")
		},
		ResumeFunc: func(partitions map[string][]int32)  {
			panic("mock out the Resume method")
		},
		ResumeAllFunc: func()  {
			panic("mock out the ResumeAll method")
		},
	}

	// use mockedSaramaConsumerGroup in code that requires interfaces.SaramaConsumerGroup
	// and then make assertions.

}

func (*SaramaConsumerGroupMock) Close

func (mock *SaramaConsumerGroupMock) Close() error

Close calls CloseFunc.

func (*SaramaConsumerGroupMock) CloseCalls

func (mock *SaramaConsumerGroupMock) CloseCalls() []struct {
}

CloseCalls gets all the calls that were made to Close. Check the length with:

len(mockedSaramaConsumerGroup.CloseCalls())

func (*SaramaConsumerGroupMock) Consume

func (mock *SaramaConsumerGroupMock) Consume(ctx context.Context, topics []string, handler sarama.ConsumerGroupHandler) error

Consume calls ConsumeFunc.

func (*SaramaConsumerGroupMock) ConsumeCalls

func (mock *SaramaConsumerGroupMock) ConsumeCalls() []struct {
	Ctx     context.Context
	Topics  []string
	Handler sarama.ConsumerGroupHandler
}

ConsumeCalls gets all the calls that were made to Consume. Check the length with:

len(mockedSaramaConsumerGroup.ConsumeCalls())

func (*SaramaConsumerGroupMock) Errors

func (mock *SaramaConsumerGroupMock) Errors() <-chan error

Errors calls ErrorsFunc.

func (*SaramaConsumerGroupMock) ErrorsCalls

func (mock *SaramaConsumerGroupMock) ErrorsCalls() []struct {
}

ErrorsCalls gets all the calls that were made to Errors. Check the length with:

len(mockedSaramaConsumerGroup.ErrorsCalls())

func (*SaramaConsumerGroupMock) Pause added in v3.3.2

func (mock *SaramaConsumerGroupMock) Pause(partitions map[string][]int32)

Pause calls PauseFunc.

func (*SaramaConsumerGroupMock) PauseAll added in v3.3.2

func (mock *SaramaConsumerGroupMock) PauseAll()

PauseAll calls PauseAllFunc.

func (*SaramaConsumerGroupMock) PauseAllCalls added in v3.6.0

func (mock *SaramaConsumerGroupMock) PauseAllCalls() []struct {
}

PauseAllCalls gets all the calls that were made to PauseAll. Check the length with:

len(mockedSaramaConsumerGroup.PauseAllCalls())

func (*SaramaConsumerGroupMock) PauseCalls added in v3.6.0

func (mock *SaramaConsumerGroupMock) PauseCalls() []struct {
	Partitions map[string][]int32
}

PauseCalls gets all the calls that were made to Pause. Check the length with:

len(mockedSaramaConsumerGroup.PauseCalls())

func (*SaramaConsumerGroupMock) Resume added in v3.3.2

func (mock *SaramaConsumerGroupMock) Resume(partitions map[string][]int32)

Resume calls ResumeFunc.

func (*SaramaConsumerGroupMock) ResumeAll added in v3.3.2

func (mock *SaramaConsumerGroupMock) ResumeAll()

ResumeAll calls ResumeAllFunc.

func (*SaramaConsumerGroupMock) ResumeAllCalls added in v3.6.0

func (mock *SaramaConsumerGroupMock) ResumeAllCalls() []struct {
}

ResumeAllCalls gets all the calls that were made to ResumeAll. Check the length with:

len(mockedSaramaConsumerGroup.ResumeAllCalls())

func (*SaramaConsumerGroupMock) ResumeCalls added in v3.6.0

func (mock *SaramaConsumerGroupMock) ResumeCalls() []struct {
	Partitions map[string][]int32
}

ResumeCalls gets all the calls that were made to Resume. Check the length with:

len(mockedSaramaConsumerGroup.ResumeCalls())

type SaramaConsumerGroupSessionMock

type SaramaConsumerGroupSessionMock struct {
	// ClaimsFunc mocks the Claims method.
	ClaimsFunc func() map[string][]int32

	// CommitFunc mocks the Commit method.
	CommitFunc func()

	// ContextFunc mocks the Context method.
	ContextFunc func() context.Context

	// GenerationIDFunc mocks the GenerationID method.
	GenerationIDFunc func() int32

	// MarkMessageFunc mocks the MarkMessage method.
	MarkMessageFunc func(msg *sarama.ConsumerMessage, metadata string)

	// MarkOffsetFunc mocks the MarkOffset method.
	MarkOffsetFunc func(topic string, partition int32, offset int64, metadata string)

	// MemberIDFunc mocks the MemberID method.
	MemberIDFunc func() string

	// ResetOffsetFunc mocks the ResetOffset method.
	ResetOffsetFunc func(topic string, partition int32, offset int64, metadata string)
	// contains filtered or unexported fields
}

SaramaConsumerGroupSessionMock is a mock implementation of interfaces.SaramaConsumerGroupSession.

func TestSomethingThatUsesSaramaConsumerGroupSession(t *testing.T) {

	// make and configure a mocked interfaces.SaramaConsumerGroupSession
	mockedSaramaConsumerGroupSession := &SaramaConsumerGroupSessionMock{
		ClaimsFunc: func() map[string][]int32 {
			panic("mock out the Claims method")
		},
		CommitFunc: func()  {
			panic("mock out the Commit method")
		},
		ContextFunc: func() context.Context {
			panic("mock out the Context method")
		},
		GenerationIDFunc: func() int32 {
			panic("mock out the GenerationID method")
		},
		MarkMessageFunc: func(msg *sarama.ConsumerMessage, metadata string)  {
			panic("mock out the MarkMessage method")
		},
		MarkOffsetFunc: func(topic string, partition int32, offset int64, metadata string)  {
			panic("mock out the MarkOffset method")
		},
		MemberIDFunc: func() string {
			panic("mock out the MemberID method")
		},
		ResetOffsetFunc: func(topic string, partition int32, offset int64, metadata string)  {
			panic("mock out the ResetOffset method")
		},
	}

	// use mockedSaramaConsumerGroupSession in code that requires interfaces.SaramaConsumerGroupSession
	// and then make assertions.

}

func (*SaramaConsumerGroupSessionMock) Claims

func (mock *SaramaConsumerGroupSessionMock) Claims() map[string][]int32

Claims calls ClaimsFunc.

func (*SaramaConsumerGroupSessionMock) ClaimsCalls

func (mock *SaramaConsumerGroupSessionMock) ClaimsCalls() []struct {
}

ClaimsCalls gets all the calls that were made to Claims. Check the length with:

len(mockedSaramaConsumerGroupSession.ClaimsCalls())

func (*SaramaConsumerGroupSessionMock) Commit

func (mock *SaramaConsumerGroupSessionMock) Commit()

Commit calls CommitFunc.

func (*SaramaConsumerGroupSessionMock) CommitCalls

func (mock *SaramaConsumerGroupSessionMock) CommitCalls() []struct {
}

CommitCalls gets all the calls that were made to Commit. Check the length with:

len(mockedSaramaConsumerGroupSession.CommitCalls())

func (*SaramaConsumerGroupSessionMock) Context

Context calls ContextFunc.

func (*SaramaConsumerGroupSessionMock) ContextCalls

func (mock *SaramaConsumerGroupSessionMock) ContextCalls() []struct {
}

ContextCalls gets all the calls that were made to Context. Check the length with:

len(mockedSaramaConsumerGroupSession.ContextCalls())

func (*SaramaConsumerGroupSessionMock) GenerationID

func (mock *SaramaConsumerGroupSessionMock) GenerationID() int32

GenerationID calls GenerationIDFunc.

func (*SaramaConsumerGroupSessionMock) GenerationIDCalls

func (mock *SaramaConsumerGroupSessionMock) GenerationIDCalls() []struct {
}

GenerationIDCalls gets all the calls that were made to GenerationID. Check the length with:

len(mockedSaramaConsumerGroupSession.GenerationIDCalls())

func (*SaramaConsumerGroupSessionMock) MarkMessage

func (mock *SaramaConsumerGroupSessionMock) MarkMessage(msg *sarama.ConsumerMessage, metadata string)

MarkMessage calls MarkMessageFunc.

func (*SaramaConsumerGroupSessionMock) MarkMessageCalls

func (mock *SaramaConsumerGroupSessionMock) MarkMessageCalls() []struct {
	Msg      *sarama.ConsumerMessage
	Metadata string
}

MarkMessageCalls gets all the calls that were made to MarkMessage. Check the length with:

len(mockedSaramaConsumerGroupSession.MarkMessageCalls())

func (*SaramaConsumerGroupSessionMock) MarkOffset

func (mock *SaramaConsumerGroupSessionMock) MarkOffset(topic string, partition int32, offset int64, metadata string)

MarkOffset calls MarkOffsetFunc.

func (*SaramaConsumerGroupSessionMock) MarkOffsetCalls

func (mock *SaramaConsumerGroupSessionMock) MarkOffsetCalls() []struct {
	Topic     string
	Partition int32
	Offset    int64
	Metadata  string
}

MarkOffsetCalls gets all the calls that were made to MarkOffset. Check the length with:

len(mockedSaramaConsumerGroupSession.MarkOffsetCalls())

func (*SaramaConsumerGroupSessionMock) MemberID

func (mock *SaramaConsumerGroupSessionMock) MemberID() string

MemberID calls MemberIDFunc.

func (*SaramaConsumerGroupSessionMock) MemberIDCalls

func (mock *SaramaConsumerGroupSessionMock) MemberIDCalls() []struct {
}

MemberIDCalls gets all the calls that were made to MemberID. Check the length with:

len(mockedSaramaConsumerGroupSession.MemberIDCalls())

func (*SaramaConsumerGroupSessionMock) ResetOffset

func (mock *SaramaConsumerGroupSessionMock) ResetOffset(topic string, partition int32, offset int64, metadata string)

ResetOffset calls ResetOffsetFunc.

func (*SaramaConsumerGroupSessionMock) ResetOffsetCalls

func (mock *SaramaConsumerGroupSessionMock) ResetOffsetCalls() []struct {
	Topic     string
	Partition int32
	Offset    int64
	Metadata  string
}

ResetOffsetCalls gets all the calls that were made to ResetOffset. Check the length with:

len(mockedSaramaConsumerGroupSession.ResetOffsetCalls())

Jump to

Keyboard shortcuts

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