harbor/src/testing/controller/jobservice/scheduler_controller.go

171 lines
4.8 KiB
Go

// Code generated by mockery v2.35.4. DO NOT EDIT.
package jobservice
import (
context "context"
mock "github.com/stretchr/testify/mock"
q "github.com/goharbor/harbor/src/lib/q"
scheduler "github.com/goharbor/harbor/src/pkg/scheduler"
)
// SchedulerController is an autogenerated mock type for the SchedulerController type
type SchedulerController struct {
mock.Mock
}
// Count provides a mock function with given fields: ctx, query
func (_m *SchedulerController) Count(ctx context.Context, query *q.Query) (int64, error) {
ret := _m.Called(ctx, query)
var r0 int64
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *q.Query) (int64, error)); ok {
return rf(ctx, query)
}
if rf, ok := ret.Get(0).(func(context.Context, *q.Query) int64); ok {
r0 = rf(ctx, query)
} else {
r0 = ret.Get(0).(int64)
}
if rf, ok := ret.Get(1).(func(context.Context, *q.Query) error); ok {
r1 = rf(ctx, query)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Create provides a mock function with given fields: ctx, vendorType, cronType, cron, callbackFuncName, policy, extrasParam
func (_m *SchedulerController) Create(ctx context.Context, vendorType string, cronType string, cron string, callbackFuncName string, policy interface{}, extrasParam map[string]interface{}) (int64, error) {
ret := _m.Called(ctx, vendorType, cronType, cron, callbackFuncName, policy, extrasParam)
var r0 int64
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, interface{}, map[string]interface{}) (int64, error)); ok {
return rf(ctx, vendorType, cronType, cron, callbackFuncName, policy, extrasParam)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, interface{}, map[string]interface{}) int64); ok {
r0 = rf(ctx, vendorType, cronType, cron, callbackFuncName, policy, extrasParam)
} else {
r0 = ret.Get(0).(int64)
}
if rf, ok := ret.Get(1).(func(context.Context, string, string, string, string, interface{}, map[string]interface{}) error); ok {
r1 = rf(ctx, vendorType, cronType, cron, callbackFuncName, policy, extrasParam)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Delete provides a mock function with given fields: ctx, vendorType
func (_m *SchedulerController) Delete(ctx context.Context, vendorType string) error {
ret := _m.Called(ctx, vendorType)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
r0 = rf(ctx, vendorType)
} else {
r0 = ret.Error(0)
}
return r0
}
// Get provides a mock function with given fields: ctx, vendorType
func (_m *SchedulerController) Get(ctx context.Context, vendorType string) (*scheduler.Schedule, error) {
ret := _m.Called(ctx, vendorType)
var r0 *scheduler.Schedule
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) (*scheduler.Schedule, error)); ok {
return rf(ctx, vendorType)
}
if rf, ok := ret.Get(0).(func(context.Context, string) *scheduler.Schedule); ok {
r0 = rf(ctx, vendorType)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*scheduler.Schedule)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, vendorType)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// List provides a mock function with given fields: ctx, query
func (_m *SchedulerController) List(ctx context.Context, query *q.Query) ([]*scheduler.Schedule, error) {
ret := _m.Called(ctx, query)
var r0 []*scheduler.Schedule
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *q.Query) ([]*scheduler.Schedule, error)); ok {
return rf(ctx, query)
}
if rf, ok := ret.Get(0).(func(context.Context, *q.Query) []*scheduler.Schedule); ok {
r0 = rf(ctx, query)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*scheduler.Schedule)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *q.Query) error); ok {
r1 = rf(ctx, query)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Paused provides a mock function with given fields: ctx
func (_m *SchedulerController) Paused(ctx context.Context) (bool, error) {
ret := _m.Called(ctx)
var r0 bool
var r1 error
if rf, ok := ret.Get(0).(func(context.Context) (bool, error)); ok {
return rf(ctx)
}
if rf, ok := ret.Get(0).(func(context.Context) bool); ok {
r0 = rf(ctx)
} else {
r0 = ret.Get(0).(bool)
}
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = rf(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// NewSchedulerController creates a new instance of SchedulerController. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewSchedulerController(t interface {
mock.TestingT
Cleanup(func())
}) *SchedulerController {
mock := &SchedulerController{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}