mirror of https://github.com/goharbor/harbor.git
110 lines
2.5 KiB
Go
110 lines
2.5 KiB
Go
// Code generated by mockery v2.22.1. DO NOT EDIT.
|
|
|
|
package jobmonitor
|
|
|
|
import (
|
|
context "context"
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// RedisClient is an autogenerated mock type for the RedisClient type
|
|
type RedisClient struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// AllJobTypes provides a mock function with given fields: ctx
|
|
func (_m *RedisClient) AllJobTypes(ctx context.Context) ([]string, error) {
|
|
ret := _m.Called(ctx)
|
|
|
|
var r0 []string
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context) ([]string, error)); ok {
|
|
return rf(ctx)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context) []string); ok {
|
|
r0 = rf(ctx)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]string)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
|
|
r1 = rf(ctx)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// PauseJob provides a mock function with given fields: ctx, jobName
|
|
func (_m *RedisClient) PauseJob(ctx context.Context, jobName string) error {
|
|
ret := _m.Called(ctx, jobName)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
|
|
r0 = rf(ctx, jobName)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// StopPendingJobs provides a mock function with given fields: ctx, jobType
|
|
func (_m *RedisClient) StopPendingJobs(ctx context.Context, jobType string) ([]string, error) {
|
|
ret := _m.Called(ctx, jobType)
|
|
|
|
var r0 []string
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) ([]string, error)); ok {
|
|
return rf(ctx, jobType)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) []string); ok {
|
|
r0 = rf(ctx, jobType)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]string)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
|
r1 = rf(ctx, jobType)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// UnpauseJob provides a mock function with given fields: ctx, jobName
|
|
func (_m *RedisClient) UnpauseJob(ctx context.Context, jobName string) error {
|
|
ret := _m.Called(ctx, jobName)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
|
|
r0 = rf(ctx, jobName)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
type mockConstructorTestingTNewRedisClient interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}
|
|
|
|
// NewRedisClient creates a new instance of RedisClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
|
func NewRedisClient(t mockConstructorTestingTNewRedisClient) *RedisClient {
|
|
mock := &RedisClient{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|