Documentation ¶
Index ¶
- type DatasetAPIMock
- func (mock *DatasetAPIMock) Checker(contextMoqParam context.Context, checkState *healthcheck.CheckState) error
- func (mock *DatasetAPIMock) CheckerCalls() []struct{ ... }
- func (mock *DatasetAPIMock) GetInstance(ctx context.Context, userAuthToken string, serviceAuthToken string, ...) (dataset.Instance, string, error)
- func (mock *DatasetAPIMock) GetInstanceCalls() []struct{ ... }
- func (mock *DatasetAPIMock) GetMetadataURL(id string, edition string, version string) string
- func (mock *DatasetAPIMock) GetMetadataURLCalls() []struct{ ... }
- func (mock *DatasetAPIMock) GetOptions(ctx context.Context, userAuthToken string, serviceAuthToken string, ...) (dataset.Options, error)
- func (mock *DatasetAPIMock) GetOptionsCalls() []struct{ ... }
- func (mock *DatasetAPIMock) GetOptionsInBatches(ctx context.Context, userAuthToken string, serviceAuthToken string, ...) (dataset.Options, error)
- func (mock *DatasetAPIMock) GetOptionsInBatchesCalls() []struct{ ... }
- func (mock *DatasetAPIMock) GetVersion(ctx context.Context, userAuthToken string, serviceAuthToken string, ...) (dataset.Version, error)
- func (mock *DatasetAPIMock) GetVersionCalls() []struct{ ... }
- func (mock *DatasetAPIMock) GetVersionDimensions(ctx context.Context, userAuthToken string, serviceAuthToken string, ...) (dataset.VersionDimensions, error)
- func (mock *DatasetAPIMock) GetVersionDimensionsCalls() []struct{ ... }
- func (mock *DatasetAPIMock) GetVersionMetadata(ctx context.Context, userAuthToken string, serviceAuthToken string, ...) (dataset.Metadata, error)
- func (mock *DatasetAPIMock) GetVersionMetadataCalls() []struct{ ... }
- func (mock *DatasetAPIMock) PutVersion(ctx context.Context, userAuthToken string, serviceAuthToken string, ...) error
- func (mock *DatasetAPIMock) PutVersionCalls() []struct{ ... }
- type FilterStoreMock
- func (mock *FilterStoreMock) Checker(contextMoqParam context.Context, checkState *healthcheck.CheckState) error
- func (mock *FilterStoreMock) CheckerCalls() []struct{ ... }
- func (mock *FilterStoreMock) GetFilter(ctx context.Context, filterID string) (*filterCli.Model, error)
- func (mock *FilterStoreMock) GetFilterCalls() []struct{ ... }
- func (mock *FilterStoreMock) PutCSVData(ctx context.Context, filterID string, downloadItem filterCli.Download) error
- func (mock *FilterStoreMock) PutCSVDataCalls() []struct{ ... }
- func (mock *FilterStoreMock) PutStateAsEmpty(ctx context.Context, filterJobID string) error
- func (mock *FilterStoreMock) PutStateAsEmptyCalls() []struct{ ... }
- func (mock *FilterStoreMock) PutStateAsError(ctx context.Context, filterJobID string) error
- func (mock *FilterStoreMock) PutStateAsErrorCalls() []struct{ ... }
- type HTTPServerMock
- type HealthCheckerMock
- func (mock *HealthCheckerMock) AddCheck(name string, checker healthcheck.Checker) error
- func (mock *HealthCheckerMock) AddCheckCalls() []struct{ ... }
- func (mock *HealthCheckerMock) Handler(w http.ResponseWriter, req *http.Request)
- func (mock *HealthCheckerMock) HandlerCalls() []struct{ ... }
- func (mock *HealthCheckerMock) Start(ctx context.Context)
- func (mock *HealthCheckerMock) StartCalls() []struct{ ... }
- func (mock *HealthCheckerMock) Stop()
- func (mock *HealthCheckerMock) StopCalls() []struct{}
- type InitialiserMock
- func (mock *InitialiserMock) DoGetDatasetAPIClient(cfg *config.Config) service.DatasetAPI
- func (mock *InitialiserMock) DoGetDatasetAPIClientCalls() []struct{ ... }
- func (mock *InitialiserMock) DoGetFileStore(cfg *config.Config) (*file.Store, error)
- func (mock *InitialiserMock) DoGetFileStoreCalls() []struct{ ... }
- func (mock *InitialiserMock) DoGetFilterStore(cfg *config.Config, serviceAuthToken string) service.FilterStore
- func (mock *InitialiserMock) DoGetFilterStoreCalls() []struct{ ... }
- func (mock *InitialiserMock) DoGetHTTPServer(bindAddr string, router http.Handler) service.HTTPServer
- func (mock *InitialiserMock) DoGetHTTPServerCalls() []struct{ ... }
- func (mock *InitialiserMock) DoGetHealthCheck(cfg *config.Config, buildTime string, gitCommit string, version string) (service.HealthChecker, error)
- func (mock *InitialiserMock) DoGetHealthCheckCalls() []struct{ ... }
- func (mock *InitialiserMock) DoGetKafkaConsumer(ctx context.Context, kafkaCfg *config.KafkaConfig) (kafka.IConsumerGroup, error)
- func (mock *InitialiserMock) DoGetKafkaConsumerCalls() []struct{ ... }
- func (mock *InitialiserMock) DoGetKafkaProducer(ctx context.Context, cfg *config.Config) (kafka.IProducer, error)
- func (mock *InitialiserMock) DoGetKafkaProducerCalls() []struct{ ... }
- func (mock *InitialiserMock) DoGetObservationStore(ctx context.Context) (*graph.DB, error)
- func (mock *InitialiserMock) DoGetObservationStoreCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatasetAPIMock ¶
type DatasetAPIMock struct { // CheckerFunc mocks the Checker method. CheckerFunc func(contextMoqParam context.Context, checkState *healthcheck.CheckState) error // GetInstanceFunc mocks the GetInstance method. GetInstanceFunc func(ctx context.Context, userAuthToken string, serviceAuthToken string, collectionID string, instanceID string, ifMatch string) (dataset.Instance, string, error) // GetMetadataURLFunc mocks the GetMetadataURL method. GetMetadataURLFunc func(id string, edition string, version string) string // GetOptionsFunc mocks the GetOptions method. GetOptionsFunc func(ctx context.Context, userAuthToken string, serviceAuthToken string, collectionID string, id string, edition string, version string, dimension string, q *dataset.QueryParams) (dataset.Options, error) // GetOptionsInBatchesFunc mocks the GetOptionsInBatches method. GetOptionsInBatchesFunc func(ctx context.Context, userAuthToken string, serviceAuthToken string, collectionID string, id string, edition string, version string, dimension string, batchSize int, maxWorkers int) (dataset.Options, error) // GetVersionFunc mocks the GetVersion method. GetVersionFunc func(ctx context.Context, userAuthToken string, serviceAuthToken string, downloadServiceAuthToken string, collectionID string, datasetID string, edition string, version string) (dataset.Version, error) // GetVersionDimensionsFunc mocks the GetVersionDimensions method. GetVersionDimensionsFunc func(ctx context.Context, userAuthToken string, serviceAuthToken string, collectionID string, id string, edition string, version string) (dataset.VersionDimensions, error) // GetVersionMetadataFunc mocks the GetVersionMetadata method. GetVersionMetadataFunc func(ctx context.Context, userAuthToken string, serviceAuthToken string, collectionID string, id string, edition string, version string) (dataset.Metadata, error) // PutVersionFunc mocks the PutVersion method. PutVersionFunc func(ctx context.Context, userAuthToken string, serviceAuthToken string, collectionID string, datasetID string, edition string, version string, m dataset.Version) error // contains filtered or unexported fields }
DatasetAPIMock is a mock implementation of service.DatasetAPI.
func TestSomethingThatUsesDatasetAPI(t *testing.T) { // make and configure a mocked service.DatasetAPI mockedDatasetAPI := &DatasetAPIMock{ CheckerFunc: func(contextMoqParam context.Context, checkState *healthcheck.CheckState) error { panic("mock out the Checker method") }, GetInstanceFunc: func(ctx context.Context, userAuthToken string, serviceAuthToken string, collectionID string, instanceID string, ifMatch string) (dataset.Instance, string, error) { panic("mock out the GetInstance method") }, GetMetadataURLFunc: func(id string, edition string, version string) string { panic("mock out the GetMetadataURL method") }, GetOptionsFunc: func(ctx context.Context, userAuthToken string, serviceAuthToken string, collectionID string, id string, edition string, version string, dimension string, q *dataset.QueryParams) (dataset.Options, error) { panic("mock out the GetOptions method") }, GetOptionsInBatchesFunc: func(ctx context.Context, userAuthToken string, serviceAuthToken string, collectionID string, id string, edition string, version string, dimension string, batchSize int, maxWorkers int) (dataset.Options, error) { panic("mock out the GetOptionsInBatches method") }, GetVersionFunc: func(ctx context.Context, userAuthToken string, serviceAuthToken string, downloadServiceAuthToken string, collectionID string, datasetID string, edition string, version string) (dataset.Version, error) { panic("mock out the GetVersion method") }, GetVersionDimensionsFunc: func(ctx context.Context, userAuthToken string, serviceAuthToken string, collectionID string, id string, edition string, version string) (dataset.VersionDimensions, error) { panic("mock out the GetVersionDimensions method") }, GetVersionMetadataFunc: func(ctx context.Context, userAuthToken string, serviceAuthToken string, collectionID string, id string, edition string, version string) (dataset.Metadata, error) { panic("mock out the GetVersionMetadata method") }, PutVersionFunc: func(ctx context.Context, userAuthToken string, serviceAuthToken string, collectionID string, datasetID string, edition string, version string, m dataset.Version) error { panic("mock out the PutVersion method") }, } // use mockedDatasetAPI in code that requires service.DatasetAPI // and then make assertions. }
func (*DatasetAPIMock) Checker ¶
func (mock *DatasetAPIMock) Checker(contextMoqParam context.Context, checkState *healthcheck.CheckState) error
Checker calls CheckerFunc.
func (*DatasetAPIMock) CheckerCalls ¶
func (mock *DatasetAPIMock) CheckerCalls() []struct { ContextMoqParam context.Context CheckState *healthcheck.CheckState }
CheckerCalls gets all the calls that were made to Checker. Check the length with:
len(mockedDatasetAPI.CheckerCalls())
func (*DatasetAPIMock) GetInstance ¶
func (mock *DatasetAPIMock) GetInstance(ctx context.Context, userAuthToken string, serviceAuthToken string, collectionID string, instanceID string, ifMatch string) (dataset.Instance, string, error)
GetInstance calls GetInstanceFunc.
func (*DatasetAPIMock) GetInstanceCalls ¶
func (mock *DatasetAPIMock) GetInstanceCalls() []struct { Ctx context.Context UserAuthToken string ServiceAuthToken string CollectionID string InstanceID string IfMatch string }
GetInstanceCalls gets all the calls that were made to GetInstance. Check the length with:
len(mockedDatasetAPI.GetInstanceCalls())
func (*DatasetAPIMock) GetMetadataURL ¶
func (mock *DatasetAPIMock) GetMetadataURL(id string, edition string, version string) string
GetMetadataURL calls GetMetadataURLFunc.
func (*DatasetAPIMock) GetMetadataURLCalls ¶
func (mock *DatasetAPIMock) GetMetadataURLCalls() []struct { ID string Edition string Version string }
GetMetadataURLCalls gets all the calls that were made to GetMetadataURL. Check the length with:
len(mockedDatasetAPI.GetMetadataURLCalls())
func (*DatasetAPIMock) GetOptions ¶
func (mock *DatasetAPIMock) GetOptions(ctx context.Context, userAuthToken string, serviceAuthToken string, collectionID string, id string, edition string, version string, dimension string, q *dataset.QueryParams) (dataset.Options, error)
GetOptions calls GetOptionsFunc.
func (*DatasetAPIMock) GetOptionsCalls ¶
func (mock *DatasetAPIMock) GetOptionsCalls() []struct { Ctx context.Context UserAuthToken string ServiceAuthToken string CollectionID string ID string Edition string Version string Dimension string Q *dataset.QueryParams }
GetOptionsCalls gets all the calls that were made to GetOptions. Check the length with:
len(mockedDatasetAPI.GetOptionsCalls())
func (*DatasetAPIMock) GetOptionsInBatches ¶
func (mock *DatasetAPIMock) GetOptionsInBatches(ctx context.Context, userAuthToken string, serviceAuthToken string, collectionID string, id string, edition string, version string, dimension string, batchSize int, maxWorkers int) (dataset.Options, error)
GetOptionsInBatches calls GetOptionsInBatchesFunc.
func (*DatasetAPIMock) GetOptionsInBatchesCalls ¶
func (mock *DatasetAPIMock) GetOptionsInBatchesCalls() []struct { Ctx context.Context UserAuthToken string ServiceAuthToken string CollectionID string ID string Edition string Version string Dimension string BatchSize int MaxWorkers int }
GetOptionsInBatchesCalls gets all the calls that were made to GetOptionsInBatches. Check the length with:
len(mockedDatasetAPI.GetOptionsInBatchesCalls())
func (*DatasetAPIMock) GetVersion ¶
func (mock *DatasetAPIMock) GetVersion(ctx context.Context, userAuthToken string, serviceAuthToken string, downloadServiceAuthToken string, collectionID string, datasetID string, edition string, version string) (dataset.Version, error)
GetVersion calls GetVersionFunc.
func (*DatasetAPIMock) GetVersionCalls ¶
func (mock *DatasetAPIMock) GetVersionCalls() []struct { Ctx context.Context UserAuthToken string ServiceAuthToken string DownloadServiceAuthToken string CollectionID string DatasetID string Edition string Version string }
GetVersionCalls gets all the calls that were made to GetVersion. Check the length with:
len(mockedDatasetAPI.GetVersionCalls())
func (*DatasetAPIMock) GetVersionDimensions ¶
func (mock *DatasetAPIMock) GetVersionDimensions(ctx context.Context, userAuthToken string, serviceAuthToken string, collectionID string, id string, edition string, version string) (dataset.VersionDimensions, error)
GetVersionDimensions calls GetVersionDimensionsFunc.
func (*DatasetAPIMock) GetVersionDimensionsCalls ¶
func (mock *DatasetAPIMock) GetVersionDimensionsCalls() []struct { Ctx context.Context UserAuthToken string ServiceAuthToken string CollectionID string ID string Edition string Version string }
GetVersionDimensionsCalls gets all the calls that were made to GetVersionDimensions. Check the length with:
len(mockedDatasetAPI.GetVersionDimensionsCalls())
func (*DatasetAPIMock) GetVersionMetadata ¶
func (mock *DatasetAPIMock) GetVersionMetadata(ctx context.Context, userAuthToken string, serviceAuthToken string, collectionID string, id string, edition string, version string) (dataset.Metadata, error)
GetVersionMetadata calls GetVersionMetadataFunc.
func (*DatasetAPIMock) GetVersionMetadataCalls ¶
func (mock *DatasetAPIMock) GetVersionMetadataCalls() []struct { Ctx context.Context UserAuthToken string ServiceAuthToken string CollectionID string ID string Edition string Version string }
GetVersionMetadataCalls gets all the calls that were made to GetVersionMetadata. Check the length with:
len(mockedDatasetAPI.GetVersionMetadataCalls())
func (*DatasetAPIMock) PutVersion ¶
func (mock *DatasetAPIMock) PutVersion(ctx context.Context, userAuthToken string, serviceAuthToken string, collectionID string, datasetID string, edition string, version string, m dataset.Version) error
PutVersion calls PutVersionFunc.
func (*DatasetAPIMock) PutVersionCalls ¶
func (mock *DatasetAPIMock) PutVersionCalls() []struct { Ctx context.Context UserAuthToken string ServiceAuthToken string CollectionID string DatasetID string Edition string Version string M dataset.Version }
PutVersionCalls gets all the calls that were made to PutVersion. Check the length with:
len(mockedDatasetAPI.PutVersionCalls())
type FilterStoreMock ¶
type FilterStoreMock struct { // CheckerFunc mocks the Checker method. CheckerFunc func(contextMoqParam context.Context, checkState *healthcheck.CheckState) error // GetFilterFunc mocks the GetFilter method. GetFilterFunc func(ctx context.Context, filterID string) (*filterCli.Model, error) // PutCSVDataFunc mocks the PutCSVData method. PutCSVDataFunc func(ctx context.Context, filterID string, downloadItem filterCli.Download) error // PutStateAsEmptyFunc mocks the PutStateAsEmpty method. PutStateAsEmptyFunc func(ctx context.Context, filterJobID string) error // PutStateAsErrorFunc mocks the PutStateAsError method. PutStateAsErrorFunc func(ctx context.Context, filterJobID string) error // contains filtered or unexported fields }
FilterStoreMock is a mock implementation of service.FilterStore.
func TestSomethingThatUsesFilterStore(t *testing.T) { // make and configure a mocked service.FilterStore mockedFilterStore := &FilterStoreMock{ CheckerFunc: func(contextMoqParam context.Context, checkState *healthcheck.CheckState) error { panic("mock out the Checker method") }, GetFilterFunc: func(ctx context.Context, filterID string) (*filterCli.Model, error) { panic("mock out the GetFilter method") }, PutCSVDataFunc: func(ctx context.Context, filterID string, downloadItem filterCli.Download) error { panic("mock out the PutCSVData method") }, PutStateAsEmptyFunc: func(ctx context.Context, filterJobID string) error { panic("mock out the PutStateAsEmpty method") }, PutStateAsErrorFunc: func(ctx context.Context, filterJobID string) error { panic("mock out the PutStateAsError method") }, } // use mockedFilterStore in code that requires service.FilterStore // and then make assertions. }
func (*FilterStoreMock) Checker ¶
func (mock *FilterStoreMock) Checker(contextMoqParam context.Context, checkState *healthcheck.CheckState) error
Checker calls CheckerFunc.
func (*FilterStoreMock) CheckerCalls ¶
func (mock *FilterStoreMock) CheckerCalls() []struct { ContextMoqParam context.Context CheckState *healthcheck.CheckState }
CheckerCalls gets all the calls that were made to Checker. Check the length with:
len(mockedFilterStore.CheckerCalls())
func (*FilterStoreMock) GetFilter ¶
func (mock *FilterStoreMock) GetFilter(ctx context.Context, filterID string) (*filterCli.Model, error)
GetFilter calls GetFilterFunc.
func (*FilterStoreMock) GetFilterCalls ¶
func (mock *FilterStoreMock) GetFilterCalls() []struct { Ctx context.Context FilterID string }
GetFilterCalls gets all the calls that were made to GetFilter. Check the length with:
len(mockedFilterStore.GetFilterCalls())
func (*FilterStoreMock) PutCSVData ¶
func (mock *FilterStoreMock) PutCSVData(ctx context.Context, filterID string, downloadItem filterCli.Download) error
PutCSVData calls PutCSVDataFunc.
func (*FilterStoreMock) PutCSVDataCalls ¶
func (mock *FilterStoreMock) PutCSVDataCalls() []struct { Ctx context.Context FilterID string DownloadItem filterCli.Download }
PutCSVDataCalls gets all the calls that were made to PutCSVData. Check the length with:
len(mockedFilterStore.PutCSVDataCalls())
func (*FilterStoreMock) PutStateAsEmpty ¶
func (mock *FilterStoreMock) PutStateAsEmpty(ctx context.Context, filterJobID string) error
PutStateAsEmpty calls PutStateAsEmptyFunc.
func (*FilterStoreMock) PutStateAsEmptyCalls ¶
func (mock *FilterStoreMock) PutStateAsEmptyCalls() []struct { Ctx context.Context FilterJobID string }
PutStateAsEmptyCalls gets all the calls that were made to PutStateAsEmpty. Check the length with:
len(mockedFilterStore.PutStateAsEmptyCalls())
func (*FilterStoreMock) PutStateAsError ¶
func (mock *FilterStoreMock) PutStateAsError(ctx context.Context, filterJobID string) error
PutStateAsError calls PutStateAsErrorFunc.
func (*FilterStoreMock) PutStateAsErrorCalls ¶
func (mock *FilterStoreMock) PutStateAsErrorCalls() []struct { Ctx context.Context FilterJobID string }
PutStateAsErrorCalls gets all the calls that were made to PutStateAsError. Check the length with:
len(mockedFilterStore.PutStateAsErrorCalls())
type HTTPServerMock ¶
type HTTPServerMock struct { // ListenAndServeFunc mocks the ListenAndServe method. ListenAndServeFunc func() error // ShutdownFunc mocks the Shutdown method. ShutdownFunc func(ctx context.Context) error // contains filtered or unexported fields }
HTTPServerMock is a mock implementation of service.HTTPServer.
func TestSomethingThatUsesHTTPServer(t *testing.T) { // make and configure a mocked service.HTTPServer mockedHTTPServer := &HTTPServerMock{ ListenAndServeFunc: func() error { panic("mock out the ListenAndServe method") }, ShutdownFunc: func(ctx context.Context) error { panic("mock out the Shutdown method") }, } // use mockedHTTPServer in code that requires service.HTTPServer // and then make assertions. }
func (*HTTPServerMock) ListenAndServe ¶
func (mock *HTTPServerMock) ListenAndServe() error
ListenAndServe calls ListenAndServeFunc.
func (*HTTPServerMock) ListenAndServeCalls ¶
func (mock *HTTPServerMock) ListenAndServeCalls() []struct { }
ListenAndServeCalls gets all the calls that were made to ListenAndServe. Check the length with:
len(mockedHTTPServer.ListenAndServeCalls())
func (*HTTPServerMock) Shutdown ¶
func (mock *HTTPServerMock) Shutdown(ctx context.Context) error
Shutdown calls ShutdownFunc.
func (*HTTPServerMock) ShutdownCalls ¶
func (mock *HTTPServerMock) ShutdownCalls() []struct { Ctx context.Context }
ShutdownCalls gets all the calls that were made to Shutdown. Check the length with:
len(mockedHTTPServer.ShutdownCalls())
type HealthCheckerMock ¶
type HealthCheckerMock struct { // AddCheckFunc mocks the AddCheck method. AddCheckFunc func(name string, checker healthcheck.Checker) error // HandlerFunc mocks the Handler method. HandlerFunc func(w http.ResponseWriter, req *http.Request) // StartFunc mocks the Start method. StartFunc func(ctx context.Context) // StopFunc mocks the Stop method. StopFunc func() // contains filtered or unexported fields }
HealthCheckerMock is a mock implementation of service.HealthChecker.
func TestSomethingThatUsesHealthChecker(t *testing.T) { // make and configure a mocked service.HealthChecker mockedHealthChecker := &HealthCheckerMock{ AddCheckFunc: func(name string, checker healthcheck.Checker) error { panic("mock out the AddCheck method") }, HandlerFunc: func(w http.ResponseWriter, req *http.Request) { panic("mock out the Handler method") }, StartFunc: func(ctx context.Context) { panic("mock out the Start method") }, StopFunc: func() { panic("mock out the Stop method") }, } // use mockedHealthChecker in code that requires service.HealthChecker // and then make assertions. }
func (*HealthCheckerMock) AddCheck ¶
func (mock *HealthCheckerMock) AddCheck(name string, checker healthcheck.Checker) error
AddCheck calls AddCheckFunc.
func (*HealthCheckerMock) AddCheckCalls ¶
func (mock *HealthCheckerMock) AddCheckCalls() []struct { Name string Checker healthcheck.Checker }
AddCheckCalls gets all the calls that were made to AddCheck. Check the length with:
len(mockedHealthChecker.AddCheckCalls())
func (*HealthCheckerMock) Handler ¶
func (mock *HealthCheckerMock) Handler(w http.ResponseWriter, req *http.Request)
Handler calls HandlerFunc.
func (*HealthCheckerMock) HandlerCalls ¶
func (mock *HealthCheckerMock) HandlerCalls() []struct { W http.ResponseWriter Req *http.Request }
HandlerCalls gets all the calls that were made to Handler. Check the length with:
len(mockedHealthChecker.HandlerCalls())
func (*HealthCheckerMock) Start ¶
func (mock *HealthCheckerMock) Start(ctx context.Context)
Start calls StartFunc.
func (*HealthCheckerMock) StartCalls ¶
func (mock *HealthCheckerMock) StartCalls() []struct { Ctx context.Context }
StartCalls gets all the calls that were made to Start. Check the length with:
len(mockedHealthChecker.StartCalls())
func (*HealthCheckerMock) StopCalls ¶
func (mock *HealthCheckerMock) StopCalls() []struct { }
StopCalls gets all the calls that were made to Stop. Check the length with:
len(mockedHealthChecker.StopCalls())
type InitialiserMock ¶
type InitialiserMock struct { // DoGetDatasetAPIClientFunc mocks the DoGetDatasetAPIClient method. DoGetDatasetAPIClientFunc func(cfg *config.Config) service.DatasetAPI // DoGetFileStoreFunc mocks the DoGetFileStore method. DoGetFileStoreFunc func(cfg *config.Config) (*file.Store, error) // DoGetFilterStoreFunc mocks the DoGetFilterStore method. DoGetFilterStoreFunc func(cfg *config.Config, serviceAuthToken string) service.FilterStore // DoGetHTTPServerFunc mocks the DoGetHTTPServer method. DoGetHTTPServerFunc func(bindAddr string, router http.Handler) service.HTTPServer // DoGetHealthCheckFunc mocks the DoGetHealthCheck method. DoGetHealthCheckFunc func(cfg *config.Config, buildTime string, gitCommit string, version string) (service.HealthChecker, error) // DoGetKafkaConsumerFunc mocks the DoGetKafkaConsumer method. DoGetKafkaConsumerFunc func(ctx context.Context, kafkaCfg *config.KafkaConfig) (kafka.IConsumerGroup, error) // DoGetKafkaProducerFunc mocks the DoGetKafkaProducer method. DoGetKafkaProducerFunc func(ctx context.Context, cfg *config.Config) (kafka.IProducer, error) // DoGetObservationStoreFunc mocks the DoGetObservationStore method. DoGetObservationStoreFunc func(ctx context.Context) (*graph.DB, error) // contains filtered or unexported fields }
InitialiserMock is a mock implementation of service.Initialiser.
func TestSomethingThatUsesInitialiser(t *testing.T) { // make and configure a mocked service.Initialiser mockedInitialiser := &InitialiserMock{ DoGetDatasetAPIClientFunc: func(cfg *config.Config) service.DatasetAPI { panic("mock out the DoGetDatasetAPIClient method") }, DoGetFileStoreFunc: func(cfg *config.Config, vaultClient *vault.Client) (*file.Store, error) { panic("mock out the DoGetFileStore method") }, DoGetFilterStoreFunc: func(cfg *config.Config, serviceAuthToken string) service.FilterStore { panic("mock out the DoGetFilterStore method") }, DoGetHTTPServerFunc: func(bindAddr string, router http.Handler) service.HTTPServer { panic("mock out the DoGetHTTPServer method") }, DoGetHealthCheckFunc: func(cfg *config.Config, buildTime string, gitCommit string, version string) (service.HealthChecker, error) { panic("mock out the DoGetHealthCheck method") }, DoGetKafkaConsumerFunc: func(ctx context.Context, kafkaCfg *config.KafkaConfig) (kafka.IConsumerGroup, error) { panic("mock out the DoGetKafkaConsumer method") }, DoGetKafkaProducerFunc: func(ctx context.Context, cfg *config.Config) (kafka.IProducer, error) { panic("mock out the DoGetKafkaProducer method") }, DoGetObservationStoreFunc: func(ctx context.Context) (*graph.DB, error) { panic("mock out the DoGetObservationStore method") }, DoGetVaultFunc: func(cfg *config.Config, retries int) (*vault.Client, error) { panic("mock out the DoGetVault method") }, } // use mockedInitialiser in code that requires service.Initialiser // and then make assertions. }
func (*InitialiserMock) DoGetDatasetAPIClient ¶
func (mock *InitialiserMock) DoGetDatasetAPIClient(cfg *config.Config) service.DatasetAPI
DoGetDatasetAPIClient calls DoGetDatasetAPIClientFunc.
func (*InitialiserMock) DoGetDatasetAPIClientCalls ¶
func (mock *InitialiserMock) DoGetDatasetAPIClientCalls() []struct { Cfg *config.Config }
DoGetDatasetAPIClientCalls gets all the calls that were made to DoGetDatasetAPIClient. Check the length with:
len(mockedInitialiser.DoGetDatasetAPIClientCalls())
func (*InitialiserMock) DoGetFileStore ¶
DoGetFileStore calls DoGetFileStoreFunc.
func (*InitialiserMock) DoGetFileStoreCalls ¶
func (mock *InitialiserMock) DoGetFileStoreCalls() []struct { Cfg *config.Config }
DoGetFileStoreCalls gets all the calls that were made to DoGetFileStore. Check the length with:
len(mockedInitialiser.DoGetFileStoreCalls())
func (*InitialiserMock) DoGetFilterStore ¶
func (mock *InitialiserMock) DoGetFilterStore(cfg *config.Config, serviceAuthToken string) service.FilterStore
DoGetFilterStore calls DoGetFilterStoreFunc.
func (*InitialiserMock) DoGetFilterStoreCalls ¶
func (mock *InitialiserMock) DoGetFilterStoreCalls() []struct { Cfg *config.Config ServiceAuthToken string }
DoGetFilterStoreCalls gets all the calls that were made to DoGetFilterStore. Check the length with:
len(mockedInitialiser.DoGetFilterStoreCalls())
func (*InitialiserMock) DoGetHTTPServer ¶
func (mock *InitialiserMock) DoGetHTTPServer(bindAddr string, router http.Handler) service.HTTPServer
DoGetHTTPServer calls DoGetHTTPServerFunc.
func (*InitialiserMock) DoGetHTTPServerCalls ¶
func (mock *InitialiserMock) DoGetHTTPServerCalls() []struct { BindAddr string Router http.Handler }
DoGetHTTPServerCalls gets all the calls that were made to DoGetHTTPServer. Check the length with:
len(mockedInitialiser.DoGetHTTPServerCalls())
func (*InitialiserMock) DoGetHealthCheck ¶
func (mock *InitialiserMock) DoGetHealthCheck(cfg *config.Config, buildTime string, gitCommit string, version string) (service.HealthChecker, error)
DoGetHealthCheck calls DoGetHealthCheckFunc.
func (*InitialiserMock) DoGetHealthCheckCalls ¶
func (mock *InitialiserMock) DoGetHealthCheckCalls() []struct { Cfg *config.Config BuildTime string GitCommit string Version string }
DoGetHealthCheckCalls gets all the calls that were made to DoGetHealthCheck. Check the length with:
len(mockedInitialiser.DoGetHealthCheckCalls())
func (*InitialiserMock) DoGetKafkaConsumer ¶
func (mock *InitialiserMock) DoGetKafkaConsumer(ctx context.Context, kafkaCfg *config.KafkaConfig) (kafka.IConsumerGroup, error)
DoGetKafkaConsumer calls DoGetKafkaConsumerFunc.
func (*InitialiserMock) DoGetKafkaConsumerCalls ¶
func (mock *InitialiserMock) DoGetKafkaConsumerCalls() []struct { Ctx context.Context KafkaCfg *config.KafkaConfig }
DoGetKafkaConsumerCalls gets all the calls that were made to DoGetKafkaConsumer. Check the length with:
len(mockedInitialiser.DoGetKafkaConsumerCalls())
func (*InitialiserMock) DoGetKafkaProducer ¶
func (mock *InitialiserMock) DoGetKafkaProducer(ctx context.Context, cfg *config.Config) (kafka.IProducer, error)
DoGetKafkaProducer calls DoGetKafkaProducerFunc.
func (*InitialiserMock) DoGetKafkaProducerCalls ¶
func (mock *InitialiserMock) DoGetKafkaProducerCalls() []struct { Ctx context.Context Cfg *config.Config }
DoGetKafkaProducerCalls gets all the calls that were made to DoGetKafkaProducer. Check the length with:
len(mockedInitialiser.DoGetKafkaProducerCalls())
func (*InitialiserMock) DoGetObservationStore ¶
DoGetObservationStore calls DoGetObservationStoreFunc.
func (*InitialiserMock) DoGetObservationStoreCalls ¶
func (mock *InitialiserMock) DoGetObservationStoreCalls() []struct { Ctx context.Context }
DoGetObservationStoreCalls gets all the calls that were made to DoGetObservationStore. Check the length with:
len(mockedInitialiser.DoGetObservationStoreCalls())