mock

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InitialiserMock

type InitialiserMock struct {
	// DoGetConsumerFunc mocks the DoGetConsumer method.
	DoGetConsumerFunc func(contextMoqParam context.Context, s1 string, s2 string, kafkaConfig *config.KafkaConfig) (kafka.IConsumerGroup, error)

	// DoGetGraphDBFunc mocks the DoGetGraphDB method.
	DoGetGraphDBFunc func(contextMoqParam context.Context) (*graph.DB, error)

	// DoGetHealthCheckFunc mocks the DoGetHealthCheck method.
	DoGetHealthCheckFunc func(configMoqParam *config.Config, s1 string, s2 string, s3 string) (healthcheck.HealthCheck, error)

	// DoGetImportErrorReporterFunc mocks the DoGetImportErrorReporter method.
	DoGetImportErrorReporterFunc func(kafkaProducer reporter.KafkaProducer, s string) (reporter.ImportErrorReporter, error)

	// DoGetProducerFunc mocks the DoGetProducer method.
	DoGetProducerFunc func(contextMoqParam context.Context, s string, kafkaConfig *config.KafkaConfig) (kafka.IProducer, error)
	// contains filtered or unexported fields
}

InitialiserMock is a mock implementation of initialise.Initialiser.

func TestSomethingThatUsesInitialiser(t *testing.T) {

	// make and configure a mocked initialise.Initialiser
	mockedInitialiser := &InitialiserMock{
		DoGetConsumerFunc: func(contextMoqParam context.Context, s1 string, s2 string, kafkaConfig *config.KafkaConfig) (kafka.IConsumerGroup, error) {
			panic("mock out the DoGetConsumer method")
		},
		DoGetGraphDBFunc: func(contextMoqParam context.Context) (*graph.DB, error) {
			panic("mock out the DoGetGraphDB method")
		},
		DoGetHealthCheckFunc: func(configMoqParam *config.Config, s1 string, s2 string, s3 string) (healthcheck.HealthCheck, error) {
			panic("mock out the DoGetHealthCheck method")
		},
		DoGetImportErrorReporterFunc: func(kafkaProducer reporter.KafkaProducer, s string) (reporter.ImportErrorReporter, error) {
			panic("mock out the DoGetImportErrorReporter method")
		},
		DoGetProducerFunc: func(contextMoqParam context.Context, s string, kafkaConfig *config.KafkaConfig) (kafka.IProducer, error) {
			panic("mock out the DoGetProducer method")
		},
	}

	// use mockedInitialiser in code that requires initialise.Initialiser
	// and then make assertions.

}

func (*InitialiserMock) DoGetConsumer

func (mock *InitialiserMock) DoGetConsumer(contextMoqParam context.Context, s1 string, s2 string, kafkaConfig *config.KafkaConfig) (kafka.IConsumerGroup, error)

DoGetConsumer calls DoGetConsumerFunc.

func (*InitialiserMock) DoGetConsumerCalls

func (mock *InitialiserMock) DoGetConsumerCalls() []struct {
	ContextMoqParam context.Context
	S1              string
	S2              string
	KafkaConfig     *config.KafkaConfig
}

DoGetConsumerCalls gets all the calls that were made to DoGetConsumer. Check the length with:

len(mockedInitialiser.DoGetConsumerCalls())

func (*InitialiserMock) DoGetGraphDB

func (mock *InitialiserMock) DoGetGraphDB(contextMoqParam context.Context) (*graph.DB, error)

DoGetGraphDB calls DoGetGraphDBFunc.

func (*InitialiserMock) DoGetGraphDBCalls

func (mock *InitialiserMock) DoGetGraphDBCalls() []struct {
	ContextMoqParam context.Context
}

DoGetGraphDBCalls gets all the calls that were made to DoGetGraphDB. Check the length with:

len(mockedInitialiser.DoGetGraphDBCalls())

func (*InitialiserMock) DoGetHealthCheck

func (mock *InitialiserMock) DoGetHealthCheck(configMoqParam *config.Config, s1 string, s2 string, s3 string) (healthcheck.HealthCheck, error)

DoGetHealthCheck calls DoGetHealthCheckFunc.

func (*InitialiserMock) DoGetHealthCheckCalls

func (mock *InitialiserMock) DoGetHealthCheckCalls() []struct {
	ConfigMoqParam *config.Config
	S1             string
	S2             string
	S3             string
}

DoGetHealthCheckCalls gets all the calls that were made to DoGetHealthCheck. Check the length with:

len(mockedInitialiser.DoGetHealthCheckCalls())

func (*InitialiserMock) DoGetImportErrorReporter

func (mock *InitialiserMock) DoGetImportErrorReporter(kafkaProducer reporter.KafkaProducer, s string) (reporter.ImportErrorReporter, error)

DoGetImportErrorReporter calls DoGetImportErrorReporterFunc.

func (*InitialiserMock) DoGetImportErrorReporterCalls

func (mock *InitialiserMock) DoGetImportErrorReporterCalls() []struct {
	KafkaProducer reporter.KafkaProducer
	S             string
}

DoGetImportErrorReporterCalls gets all the calls that were made to DoGetImportErrorReporter. Check the length with:

len(mockedInitialiser.DoGetImportErrorReporterCalls())

func (*InitialiserMock) DoGetProducer

func (mock *InitialiserMock) DoGetProducer(contextMoqParam context.Context, s string, kafkaConfig *config.KafkaConfig) (kafka.IProducer, error)

DoGetProducer calls DoGetProducerFunc.

func (*InitialiserMock) DoGetProducerCalls

func (mock *InitialiserMock) DoGetProducerCalls() []struct {
	ContextMoqParam context.Context
	S               string
	KafkaConfig     *config.KafkaConfig
}

DoGetProducerCalls gets all the calls that were made to DoGetProducer. Check the length with:

len(mockedInitialiser.DoGetProducerCalls())

Jump to

Keyboard shortcuts

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