Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthHandlerMock ¶
type AuthHandlerMock struct {
Required *PermissionCheckCalls
}
func NewAuthHandlerMock ¶
func NewAuthHandlerMock() *AuthHandlerMock
func (AuthHandlerMock) Require ¶
func (a AuthHandlerMock) Require(required auth.Permissions, handler http.HandlerFunc) http.HandlerFunc
type CSVRowReaderMock ¶
type CSVRowReaderMock struct { // CloseFunc mocks the Close method. CloseFunc func() error // ReadFunc mocks the Read method. ReadFunc func() (string, error) // contains filtered or unexported fields }
CSVRowReaderMock is a mock implementation of CSVRowReader.
func TestSomethingThatUsesCSVRowReader(t *testing.T) { // make and configure a mocked CSVRowReader mockedCSVRowReader := &CSVRowReaderMock{ CloseFunc: func() error { panic("TODO: mock out the Close method") }, ReadFunc: func() (string, error) { panic("TODO: mock out the Read method") }, } // TODO: use mockedCSVRowReader in code that requires CSVRowReader // and then make assertions. }
func (*CSVRowReaderMock) CloseCalls ¶
func (mock *CSVRowReaderMock) CloseCalls() []struct { }
CloseCalls gets all the calls that were made to Close. Check the length with:
len(mockedCSVRowReader.CloseCalls())
func (*CSVRowReaderMock) Read ¶
func (mock *CSVRowReaderMock) Read() (string, error)
Read calls ReadFunc.
func (*CSVRowReaderMock) ReadCalls ¶
func (mock *CSVRowReaderMock) ReadCalls() []struct { }
ReadCalls gets all the calls that were made to Read. Check the length with:
len(mockedCSVRowReader.ReadCalls())
type CheckPermissionFunc ¶
type CheckPermissionFunc func(handler http.HandlerFunc) http.HandlerFunc
type DownloadsGeneratorMock ¶
type DownloadsGeneratorMock struct { // GenerateFunc mocks the Generate method. GenerateFunc func(ctx context.Context, datasetID string, instanceID string, edition string, version string) error // contains filtered or unexported fields }
DownloadsGeneratorMock is a mock implementation of api.DownloadsGenerator.
func TestSomethingThatUsesDownloadsGenerator(t *testing.T) { // make and configure a mocked api.DownloadsGenerator mockedDownloadsGenerator := &DownloadsGeneratorMock{ GenerateFunc: func(ctx context.Context, datasetID string, instanceID string, edition string, version string) error { panic("mock out the Generate method") }, } // use mockedDownloadsGenerator in code that requires api.DownloadsGenerator // and then make assertions. }
func (*DownloadsGeneratorMock) Generate ¶
func (mock *DownloadsGeneratorMock) Generate(ctx context.Context, datasetID string, instanceID string, edition string, version string) error
Generate calls GenerateFunc.
func (*DownloadsGeneratorMock) GenerateCalls ¶
func (mock *DownloadsGeneratorMock) GenerateCalls() []struct { Ctx context.Context DatasetID string InstanceID string Edition string Version string }
GenerateCalls gets all the calls that were made to Generate. Check the length with:
len(mockedDownloadsGenerator.GenerateCalls())
type GenerateDownloadsEventMock ¶
type GenerateDownloadsEventMock struct { // MarshalFunc mocks the Marshal method. MarshalFunc func(s interface{}) ([]byte, error) // contains filtered or unexported fields }
GenerateDownloadsEventMock is a mock implementation of GenerateDownloadsEvent.
func TestSomethingThatUsesGenerateDownloadsEvent(t *testing.T) { // make and configure a mocked GenerateDownloadsEvent mockedGenerateDownloadsEvent := &GenerateDownloadsEventMock{ MarshalFunc: func(s interface{}) ([]byte, error) { panic("TODO: mock out the Marshal method") }, } // TODO: use mockedGenerateDownloadsEvent in code that requires GenerateDownloadsEvent // and then make assertions. }
func (*GenerateDownloadsEventMock) Marshal ¶
func (mock *GenerateDownloadsEventMock) Marshal(s interface{}) ([]byte, error)
Marshal calls MarshalFunc.
func (*GenerateDownloadsEventMock) MarshalCalls ¶
func (mock *GenerateDownloadsEventMock) MarshalCalls() []struct { S interface{} }
MarshalCalls gets all the calls that were made to Marshal. Check the length with:
len(mockedGenerateDownloadsEvent.MarshalCalls())
type KafkaProducerMock ¶
type KafkaProducerMock struct { // OutputFunc mocks the Output method. OutputFunc func() chan []byte // contains filtered or unexported fields }
KafkaProducerMock is a mock implementation of KafkaProducer.
func TestSomethingThatUsesKafkaProducer(t *testing.T) { // make and configure a mocked KafkaProducer mockedKafkaProducer := &KafkaProducerMock{ OutputFunc: func() chan []byte { panic("TODO: mock out the Output method") }, } // TODO: use mockedKafkaProducer in code that requires KafkaProducer // and then make assertions. }
func (*KafkaProducerMock) Output ¶
func (mock *KafkaProducerMock) Output() chan []byte
Output calls OutputFunc.
func (*KafkaProducerMock) OutputCalls ¶
func (mock *KafkaProducerMock) OutputCalls() []struct { }
OutputCalls gets all the calls that were made to Output. Check the length with:
len(mockedKafkaProducer.OutputCalls())
type PermissionCheckCalls ¶
type PermissionCheckCalls struct {
Calls int
}