Documentation ¶
Index ¶
- type ClientMock
- func (mock *ClientMock) Checker(ctx context.Context, check *health.CheckState) error
- func (mock *ClientMock) CheckerCalls() []struct{ ... }
- func (mock *ClientMock) GetJob(ctx context.Context, reqheader sdk.Headers, jobID string) (*sdk.RespHeaders, *models.Job, error)
- func (mock *ClientMock) GetJobCalls() []struct{ ... }
- func (mock *ClientMock) GetJobs(ctx context.Context, reqheader sdk.Headers, options sdk.Options) (*sdk.RespHeaders, *models.Jobs, error)
- func (mock *ClientMock) GetJobsCalls() []struct{ ... }
- func (mock *ClientMock) GetTask(ctx context.Context, reqHeaders sdk.Headers, jobID string, taskName string) (*sdk.RespHeaders, *models.Task, error)
- func (mock *ClientMock) GetTaskCalls() []struct{ ... }
- func (mock *ClientMock) GetTasks(ctx context.Context, reqHeaders sdk.Headers, jobID string) (*sdk.RespHeaders, *models.Tasks, error)
- func (mock *ClientMock) GetTasksCalls() []struct{ ... }
- func (mock *ClientMock) Health() *healthcheck.Client
- func (mock *ClientMock) HealthCalls() []struct{}
- func (mock *ClientMock) PatchJob(ctx context.Context, reqHeaders sdk.Headers, jobID string, ...) (*sdk.RespHeaders, error)
- func (mock *ClientMock) PatchJobCalls() []struct{ ... }
- func (mock *ClientMock) PostJob(ctx context.Context, reqHeaders sdk.Headers) (*sdk.RespHeaders, *models.Job, error)
- func (mock *ClientMock) PostJobCalls() []struct{ ... }
- func (mock *ClientMock) PostTask(ctx context.Context, reqHeaders sdk.Headers, jobID string, ...) (*sdk.RespHeaders, *models.Task, error)
- func (mock *ClientMock) PostTaskCalls() []struct{ ... }
- func (mock *ClientMock) PutJobNumberOfTasks(ctx context.Context, reqHeaders sdk.Headers, jobID string, numTasks string) (*sdk.RespHeaders, error)
- func (mock *ClientMock) PutJobNumberOfTasksCalls() []struct{ ... }
- func (mock *ClientMock) PutTaskNumberOfDocs(ctx context.Context, reqHeaders sdk.Headers, jobID string, taskName string, ...) (*sdk.RespHeaders, error)
- func (mock *ClientMock) PutTaskNumberOfDocsCalls() []struct{ ... }
- func (mock *ClientMock) URL() string
- func (mock *ClientMock) URLCalls() []struct{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientMock ¶
type ClientMock struct { // CheckerFunc mocks the Checker method. CheckerFunc func(ctx context.Context, check *health.CheckState) error // GetJobFunc mocks the GetJob method. GetJobFunc func(ctx context.Context, reqheader sdk.Headers, jobID string) (*sdk.RespHeaders, *models.Job, error) // GetJobsFunc mocks the GetJobs method. GetJobsFunc func(ctx context.Context, reqheader sdk.Headers, options sdk.Options) (*sdk.RespHeaders, *models.Jobs, error) // GetTaskFunc mocks the GetTask method. GetTaskFunc func(ctx context.Context, reqHeaders sdk.Headers, jobID string, taskName string) (*sdk.RespHeaders, *models.Task, error) // GetTasksFunc mocks the GetTasks method. GetTasksFunc func(ctx context.Context, reqHeaders sdk.Headers, jobID string) (*sdk.RespHeaders, *models.Tasks, error) // HealthFunc mocks the Health method. HealthFunc func() *healthcheck.Client // PatchJobFunc mocks the PatchJob method. PatchJobFunc func(ctx context.Context, reqHeaders sdk.Headers, jobID string, patchList []sdk.PatchOperation) (*sdk.RespHeaders, error) // PostJobFunc mocks the PostJob method. PostJobFunc func(ctx context.Context, reqHeaders sdk.Headers) (*sdk.RespHeaders, *models.Job, error) // PostTaskFunc mocks the PostTask method. PostTaskFunc func(ctx context.Context, reqHeaders sdk.Headers, jobID string, taskToCreate models.TaskToCreate) (*sdk.RespHeaders, *models.Task, error) // PutJobNumberOfTasksFunc mocks the PutJobNumberOfTasks method. PutJobNumberOfTasksFunc func(ctx context.Context, reqHeaders sdk.Headers, jobID string, numTasks string) (*sdk.RespHeaders, error) // PutTaskNumberOfDocsFunc mocks the PutTaskNumberOfDocs method. PutTaskNumberOfDocsFunc func(ctx context.Context, reqHeaders sdk.Headers, jobID string, taskName string, docCount string) (*sdk.RespHeaders, error) // URLFunc mocks the URL method. URLFunc func() string // contains filtered or unexported fields }
ClientMock is a mock implementation of sdk.Client.
func TestSomethingThatUsesClient(t *testing.T) { // make and configure a mocked sdk.Client mockedClient := &ClientMock{ CheckerFunc: func(ctx context.Context, check *health.CheckState) error { panic("mock out the Checker method") }, GetJobFunc: func(ctx context.Context, reqheader sdk.Headers, jobID string) (*sdk.RespHeaders, *models.Job, error) { panic("mock out the GetJob method") }, GetJobsFunc: func(ctx context.Context, reqheader sdk.Headers, options sdk.Options) (*sdk.RespHeaders, *models.Jobs, error) { panic("mock out the GetJobs method") }, GetTaskFunc: func(ctx context.Context, reqHeaders sdk.Headers, jobID string, taskName string) (*sdk.RespHeaders, *models.Task, error) { panic("mock out the GetTask method") }, GetTasksFunc: func(ctx context.Context, reqHeaders sdk.Headers, jobID string) (*sdk.RespHeaders, *models.Tasks, error) { panic("mock out the GetTasks method") }, HealthFunc: func() *healthcheck.Client { panic("mock out the Health method") }, PatchJobFunc: func(ctx context.Context, reqHeaders sdk.Headers, jobID string, patchList []sdk.PatchOperation) (*sdk.RespHeaders, error) { panic("mock out the PatchJob method") }, PostJobFunc: func(ctx context.Context, reqHeaders sdk.Headers) (*sdk.RespHeaders, *models.Job, error) { panic("mock out the PostJob method") }, PostTaskFunc: func(ctx context.Context, reqHeaders sdk.Headers, jobID string, taskToCreate models.TaskToCreate) (*sdk.RespHeaders, *models.Task, error) { panic("mock out the PostTask method") }, PutJobNumberOfTasksFunc: func(ctx context.Context, reqHeaders sdk.Headers, jobID string, numTasks string) (*sdk.RespHeaders, error) { panic("mock out the PutJobNumberOfTasks method") }, PutTaskNumberOfDocsFunc: func(ctx context.Context, reqHeaders sdk.Headers, jobID string, taskName string, docCount string) (*sdk.RespHeaders, error) { panic("mock out the PutTaskNumberOfDocs method") }, URLFunc: func() string { panic("mock out the URL method") }, } // use mockedClient in code that requires sdk.Client // and then make assertions. }
func (*ClientMock) Checker ¶ added in v0.16.1
func (mock *ClientMock) Checker(ctx context.Context, check *health.CheckState) error
Checker calls CheckerFunc.
func (*ClientMock) CheckerCalls ¶ added in v0.16.1
func (mock *ClientMock) CheckerCalls() []struct { Ctx context.Context Check *health.CheckState }
CheckerCalls gets all the calls that were made to Checker. Check the length with:
len(mockedClient.CheckerCalls())
func (*ClientMock) GetJob ¶ added in v0.20.0
func (mock *ClientMock) GetJob(ctx context.Context, reqheader sdk.Headers, jobID string) (*sdk.RespHeaders, *models.Job, error)
GetJob calls GetJobFunc.
func (*ClientMock) GetJobCalls ¶ added in v0.20.0
func (mock *ClientMock) GetJobCalls() []struct { Ctx context.Context Reqheader sdk.Headers JobID string }
GetJobCalls gets all the calls that were made to GetJob. Check the length with:
len(mockedClient.GetJobCalls())
func (*ClientMock) GetJobs ¶ added in v0.20.0
func (mock *ClientMock) GetJobs(ctx context.Context, reqheader sdk.Headers, options sdk.Options) (*sdk.RespHeaders, *models.Jobs, error)
GetJobs calls GetJobsFunc.
func (*ClientMock) GetJobsCalls ¶ added in v0.20.0
func (mock *ClientMock) GetJobsCalls() []struct { Ctx context.Context Reqheader sdk.Headers Options sdk.Options }
GetJobsCalls gets all the calls that were made to GetJobs. Check the length with:
len(mockedClient.GetJobsCalls())
func (*ClientMock) GetTask ¶ added in v0.18.0
func (mock *ClientMock) GetTask(ctx context.Context, reqHeaders sdk.Headers, jobID string, taskName string) (*sdk.RespHeaders, *models.Task, error)
GetTask calls GetTaskFunc.
func (*ClientMock) GetTaskCalls ¶ added in v0.18.0
func (mock *ClientMock) GetTaskCalls() []struct { Ctx context.Context ReqHeaders sdk.Headers JobID string TaskName string }
GetTaskCalls gets all the calls that were made to GetTask. Check the length with:
len(mockedClient.GetTaskCalls())
func (*ClientMock) GetTasks ¶ added in v0.20.0
func (mock *ClientMock) GetTasks(ctx context.Context, reqHeaders sdk.Headers, jobID string) (*sdk.RespHeaders, *models.Tasks, error)
GetTasks calls GetTasksFunc.
func (*ClientMock) GetTasksCalls ¶ added in v0.20.0
func (mock *ClientMock) GetTasksCalls() []struct { Ctx context.Context ReqHeaders sdk.Headers JobID string }
GetTasksCalls gets all the calls that were made to GetTasks. Check the length with:
len(mockedClient.GetTasksCalls())
func (*ClientMock) Health ¶ added in v0.16.1
func (mock *ClientMock) Health() *healthcheck.Client
Health calls HealthFunc.
func (*ClientMock) HealthCalls ¶ added in v0.16.1
func (mock *ClientMock) HealthCalls() []struct { }
HealthCalls gets all the calls that were made to Health. Check the length with:
len(mockedClient.HealthCalls())
func (*ClientMock) PatchJob ¶ added in v0.17.0
func (mock *ClientMock) PatchJob(ctx context.Context, reqHeaders sdk.Headers, jobID string, patchList []sdk.PatchOperation) (*sdk.RespHeaders, error)
PatchJob calls PatchJobFunc.
func (*ClientMock) PatchJobCalls ¶ added in v0.17.0
func (mock *ClientMock) PatchJobCalls() []struct { Ctx context.Context ReqHeaders sdk.Headers JobID string PatchList []sdk.PatchOperation }
PatchJobCalls gets all the calls that were made to PatchJob. Check the length with:
len(mockedClient.PatchJobCalls())
func (*ClientMock) PostJob ¶
func (mock *ClientMock) PostJob(ctx context.Context, reqHeaders sdk.Headers) (*sdk.RespHeaders, *models.Job, error)
PostJob calls PostJobFunc.
func (*ClientMock) PostJobCalls ¶
func (mock *ClientMock) PostJobCalls() []struct { Ctx context.Context ReqHeaders sdk.Headers }
PostJobCalls gets all the calls that were made to PostJob. Check the length with:
len(mockedClient.PostJobCalls())
func (*ClientMock) PostTask ¶ added in v0.19.0
func (mock *ClientMock) PostTask(ctx context.Context, reqHeaders sdk.Headers, jobID string, taskToCreate models.TaskToCreate) (*sdk.RespHeaders, *models.Task, error)
PostTask calls PostTaskFunc.
func (*ClientMock) PostTaskCalls ¶ added in v0.19.0
func (mock *ClientMock) PostTaskCalls() []struct { Ctx context.Context ReqHeaders sdk.Headers JobID string TaskToCreate models.TaskToCreate }
PostTaskCalls gets all the calls that were made to PostTask. Check the length with:
len(mockedClient.PostTaskCalls())
func (*ClientMock) PutJobNumberOfTasks ¶ added in v0.20.0
func (mock *ClientMock) PutJobNumberOfTasks(ctx context.Context, reqHeaders sdk.Headers, jobID string, numTasks string) (*sdk.RespHeaders, error)
PutJobNumberOfTasks calls PutJobNumberOfTasksFunc.
func (*ClientMock) PutJobNumberOfTasksCalls ¶ added in v0.20.0
func (mock *ClientMock) PutJobNumberOfTasksCalls() []struct { Ctx context.Context ReqHeaders sdk.Headers JobID string NumTasks string }
PutJobNumberOfTasksCalls gets all the calls that were made to PutJobNumberOfTasks. Check the length with:
len(mockedClient.PutJobNumberOfTasksCalls())
func (*ClientMock) PutTaskNumberOfDocs ¶ added in v0.24.0
func (mock *ClientMock) PutTaskNumberOfDocs(ctx context.Context, reqHeaders sdk.Headers, jobID string, taskName string, docCount string) (*sdk.RespHeaders, error)
PutTaskNumberOfDocs calls PutTaskNumberOfDocsFunc.
func (*ClientMock) PutTaskNumberOfDocsCalls ¶ added in v0.24.0
func (mock *ClientMock) PutTaskNumberOfDocsCalls() []struct { Ctx context.Context ReqHeaders sdk.Headers JobID string TaskName string DocCount string }
PutTaskNumberOfDocsCalls gets all the calls that were made to PutTaskNumberOfDocs. Check the length with:
len(mockedClient.PutTaskNumberOfDocsCalls())
func (*ClientMock) URLCalls ¶ added in v0.16.1
func (mock *ClientMock) URLCalls() []struct { }
URLCalls gets all the calls that were made to URL. Check the length with:
len(mockedClient.URLCalls())