Documentation ¶
Index ¶
- type JobStorerMock
- func (mock *JobStorerMock) AcquireJobLock(ctx context.Context, id string) (string, error)
- func (mock *JobStorerMock) AcquireJobLockCalls() []struct{ ... }
- func (mock *JobStorerMock) CreateJob(ctx context.Context, id string) (job models.Job, err error)
- func (mock *JobStorerMock) CreateJobCalls() []struct{ ... }
- func (mock *JobStorerMock) GetJob(ctx context.Context, id string) (job models.Job, err error)
- func (mock *JobStorerMock) GetJobCalls() []struct{ ... }
- func (mock *JobStorerMock) GetJobs(ctx context.Context) (job models.Jobs, err error)
- func (mock *JobStorerMock) GetJobsCalls() []struct{ ... }
- func (mock *JobStorerMock) PutNumberOfTasks(ctx context.Context, id string, count int) error
- func (mock *JobStorerMock) PutNumberOfTasksCalls() []struct{ ... }
- func (mock *JobStorerMock) UnlockJob(lockID string) error
- func (mock *JobStorerMock) UnlockJobCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JobStorerMock ¶ added in v0.5.0
type JobStorerMock struct { // AcquireJobLockFunc mocks the AcquireJobLock method. AcquireJobLockFunc func(ctx context.Context, id string) (string, error) // CreateJobFunc mocks the CreateJob method. CreateJobFunc func(ctx context.Context, id string) (models.Job, error) // GetJobFunc mocks the GetJob method. GetJobFunc func(ctx context.Context, id string) (models.Job, error) // GetJobsFunc mocks the GetJobs method. GetJobsFunc func(ctx context.Context) (models.Jobs, error) // PutNumberOfTasksFunc mocks the PutNumberOfTasks method. PutNumberOfTasksFunc func(ctx context.Context, id string, count int) error // UnlockJobFunc mocks the UnlockJob method. UnlockJobFunc func(lockID string) error // contains filtered or unexported fields }
JobStorerMock is a mock implementation of api.JobStorer.
func TestSomethingThatUsesJobStorer(t *testing.T) { // make and configure a mocked api.JobStorer mockedJobStorer := &JobStorerMock{ AcquireJobLockFunc: func(ctx context.Context, id string) (string, error) { panic("mock out the AcquireJobLock method") }, CreateJobFunc: func(ctx context.Context, id string) (models.Job, error) { panic("mock out the CreateJob method") }, GetJobFunc: func(ctx context.Context, id string) (models.Job, error) { panic("mock out the GetJob method") }, GetJobsFunc: func(ctx context.Context) (models.Jobs, error) { panic("mock out the GetJobs method") }, PutNumberOfTasksFunc: func(ctx context.Context, id string, count int) error { panic("mock out the PutNumberOfTasks method") }, UnlockJobFunc: func(lockID string) error { panic("mock out the UnlockJob method") }, } // use mockedJobStorer in code that requires api.JobStorer // and then make assertions. }
func (*JobStorerMock) AcquireJobLock ¶ added in v0.5.0
AcquireJobLock calls AcquireJobLockFunc.
func (*JobStorerMock) AcquireJobLockCalls ¶ added in v0.6.0
func (mock *JobStorerMock) AcquireJobLockCalls() []struct { Ctx context.Context ID string }
AcquireJobLockCalls gets all the calls that were made to AcquireJobLock. Check the length with:
len(mockedJobStorer.AcquireJobLockCalls())
func (*JobStorerMock) CreateJobCalls ¶ added in v0.6.0
func (mock *JobStorerMock) CreateJobCalls() []struct { Ctx context.Context ID string }
CreateJobCalls gets all the calls that were made to CreateJob. Check the length with:
len(mockedJobStorer.CreateJobCalls())
func (*JobStorerMock) GetJobCalls ¶ added in v0.6.0
func (mock *JobStorerMock) GetJobCalls() []struct { Ctx context.Context ID string }
GetJobCalls gets all the calls that were made to GetJob. Check the length with:
len(mockedJobStorer.GetJobCalls())
func (*JobStorerMock) GetJobsCalls ¶ added in v0.6.0
func (mock *JobStorerMock) GetJobsCalls() []struct { Ctx context.Context }
GetJobsCalls gets all the calls that were made to GetJobs. Check the length with:
len(mockedJobStorer.GetJobsCalls())
func (*JobStorerMock) PutNumberOfTasks ¶ added in v0.6.0
PutNumberOfTasks calls PutNumberOfTasksFunc.
func (*JobStorerMock) PutNumberOfTasksCalls ¶ added in v0.6.0
func (mock *JobStorerMock) PutNumberOfTasksCalls() []struct { Ctx context.Context ID string Count int }
PutNumberOfTasksCalls gets all the calls that were made to PutNumberOfTasks. Check the length with:
len(mockedJobStorer.PutNumberOfTasksCalls())
func (*JobStorerMock) UnlockJob ¶ added in v0.5.0
func (mock *JobStorerMock) UnlockJob(lockID string) error
UnlockJob calls UnlockJobFunc.
func (*JobStorerMock) UnlockJobCalls ¶ added in v0.6.0
func (mock *JobStorerMock) UnlockJobCalls() []struct { LockID string }
UnlockJobCalls gets all the calls that were made to UnlockJob. Check the length with:
len(mockedJobStorer.UnlockJobCalls())