clean up unused mock file&& regenerate mocks (#17025)

clean up unused mock file&& re gen_mocks

Signed-off-by: yminer <yminer@vmware.com>
This commit is contained in:
MinerYang 2022-06-17 18:19:23 +08:00 committed by GitHub
parent 9a3cb4a041
commit e9378ea00e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 43 additions and 170 deletions

View File

@ -1,84 +0,0 @@
// Code generated by mockery v2.1.0. DO NOT EDIT.
package jobservice
import (
context "context"
jobservice "github.com/goharbor/harbor/src/controller/jobservice"
mock "github.com/stretchr/testify/mock"
q "github.com/goharbor/harbor/src/lib/q"
)
// ExecutionController is an autogenerated mock type for the ExecutionController type
type ExecutionController struct {
mock.Mock
}
// Count provides a mock function with given fields: ctx, vendorType, query
func (_m *ExecutionController) Count(ctx context.Context, vendorType string, query *q.Query) (int64, error) {
ret := _m.Called(ctx, vendorType, query)
var r0 int64
if rf, ok := ret.Get(0).(func(context.Context, string, *q.Query) int64); ok {
r0 = rf(ctx, vendorType, query)
} else {
r0 = ret.Get(0).(int64)
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string, *q.Query) error); ok {
r1 = rf(ctx, vendorType, query)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Get provides a mock function with given fields: ctx, vendorType, executionID
func (_m *ExecutionController) Get(ctx context.Context, vendorType string, executionID int64) (*jobservice.Execution, error) {
ret := _m.Called(ctx, vendorType, executionID)
var r0 *jobservice.Execution
if rf, ok := ret.Get(0).(func(context.Context, string, int64) *jobservice.Execution); ok {
r0 = rf(ctx, vendorType, executionID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*jobservice.Execution)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string, int64) error); ok {
r1 = rf(ctx, vendorType, executionID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// List provides a mock function with given fields: ctx, vendorType, query
func (_m *ExecutionController) List(ctx context.Context, vendorType string, query *q.Query) ([]*jobservice.Execution, error) {
ret := _m.Called(ctx, vendorType, query)
var r0 []*jobservice.Execution
if rf, ok := ret.Get(0).(func(context.Context, string, *q.Query) []*jobservice.Execution); ok {
r0 = rf(ctx, vendorType, query)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*jobservice.Execution)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string, *q.Query) error); ok {
r1 = rf(ctx, vendorType, query)
} else {
r1 = ret.Error(1)
}
return r0, r1
}

View File

@ -1,86 +0,0 @@
// Code generated by mockery v2.1.0. DO NOT EDIT.
package jobservice
import (
context "context"
jobservice "github.com/goharbor/harbor/src/controller/jobservice"
mock "github.com/stretchr/testify/mock"
q "github.com/goharbor/harbor/src/lib/q"
)
// TaskController is an autogenerated mock type for the TaskController type
type TaskController struct {
mock.Mock
}
// Get provides a mock function with given fields: ctx, vendorType, id
func (_m *TaskController) Get(ctx context.Context, vendorType string, id int64) (*jobservice.Task, error) {
ret := _m.Called(ctx, vendorType, id)
var r0 *jobservice.Task
if rf, ok := ret.Get(0).(func(context.Context, string, int64) *jobservice.Task); ok {
r0 = rf(ctx, vendorType, id)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*jobservice.Task)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string, int64) error); ok {
r1 = rf(ctx, vendorType, id)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetLog provides a mock function with given fields: ctx, vendorType, id
func (_m *TaskController) GetLog(ctx context.Context, vendorType string, id int64) ([]byte, error) {
ret := _m.Called(ctx, vendorType, id)
var r0 []byte
if rf, ok := ret.Get(0).(func(context.Context, string, int64) []byte); ok {
r0 = rf(ctx, vendorType, id)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]byte)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string, int64) error); ok {
r1 = rf(ctx, vendorType, id)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// List provides a mock function with given fields: ctx, vendorType, query
func (_m *TaskController) List(ctx context.Context, vendorType string, query *q.Query) ([]*jobservice.Task, error) {
ret := _m.Called(ctx, vendorType, query)
var r0 []*jobservice.Task
if rf, ok := ret.Get(0).(func(context.Context, string, *q.Query) []*jobservice.Task); ok {
r0 = rf(ctx, vendorType, query)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*jobservice.Task)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string, *q.Query) error); ok {
r1 = rf(ctx, vendorType, query)
} else {
r1 = ret.Error(1)
}
return r0, r1
}

View File

@ -0,0 +1,43 @@
// Code generated by mockery v2.12.3. DO NOT EDIT.
package systemartifact
import (
context "context"
mock "github.com/stretchr/testify/mock"
)
// Controller is an autogenerated mock type for the Controller type
type Controller struct {
mock.Mock
}
// Start provides a mock function with given fields: ctx, async, trigger
func (_m *Controller) Start(ctx context.Context, async bool, trigger string) error {
ret := _m.Called(ctx, async, trigger)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, bool, string) error); ok {
r0 = rf(ctx, async, trigger)
} else {
r0 = ret.Error(0)
}
return r0
}
type NewControllerT interface {
mock.TestingT
Cleanup(func())
}
// NewController creates a new instance of Controller. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewController(t NewControllerT) *Controller {
mock := &Controller{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}