harbor/src/testing/api/scanner/controller.go

233 lines
5.6 KiB
Go
Raw Normal View History

// Code generated by mockery v1.0.0. DO NOT EDIT.
package scanner
import (
q "github.com/goharbor/harbor/src/pkg/q"
mock "github.com/stretchr/testify/mock"
scanner "github.com/goharbor/harbor/src/pkg/scan/dao/scanner"
v1 "github.com/goharbor/harbor/src/pkg/scan/rest/v1"
)
// Controller is an autogenerated mock type for the Controller type
type Controller struct {
mock.Mock
}
// CreateRegistration provides a mock function with given fields: registration
func (_m *Controller) CreateRegistration(registration *scanner.Registration) (string, error) {
ret := _m.Called(registration)
var r0 string
if rf, ok := ret.Get(0).(func(*scanner.Registration) string); ok {
r0 = rf(registration)
} else {
r0 = ret.Get(0).(string)
}
var r1 error
if rf, ok := ret.Get(1).(func(*scanner.Registration) error); ok {
r1 = rf(registration)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// DeleteRegistration provides a mock function with given fields: registrationUUID
func (_m *Controller) DeleteRegistration(registrationUUID string) (*scanner.Registration, error) {
ret := _m.Called(registrationUUID)
var r0 *scanner.Registration
if rf, ok := ret.Get(0).(func(string) *scanner.Registration); ok {
r0 = rf(registrationUUID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*scanner.Registration)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(string) error); ok {
r1 = rf(registrationUUID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetMetadata provides a mock function with given fields: registrationUUID
func (_m *Controller) GetMetadata(registrationUUID string) (*v1.ScannerAdapterMetadata, error) {
ret := _m.Called(registrationUUID)
var r0 *v1.ScannerAdapterMetadata
if rf, ok := ret.Get(0).(func(string) *v1.ScannerAdapterMetadata); ok {
r0 = rf(registrationUUID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v1.ScannerAdapterMetadata)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(string) error); ok {
r1 = rf(registrationUUID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetRegistration provides a mock function with given fields: registrationUUID
func (_m *Controller) GetRegistration(registrationUUID string) (*scanner.Registration, error) {
ret := _m.Called(registrationUUID)
var r0 *scanner.Registration
if rf, ok := ret.Get(0).(func(string) *scanner.Registration); ok {
r0 = rf(registrationUUID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*scanner.Registration)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(string) error); ok {
r1 = rf(registrationUUID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetRegistrationByProject provides a mock function with given fields: projectID
func (_m *Controller) GetRegistrationByProject(projectID int64) (*scanner.Registration, error) {
ret := _m.Called(projectID)
var r0 *scanner.Registration
if rf, ok := ret.Get(0).(func(int64) *scanner.Registration); ok {
r0 = rf(projectID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*scanner.Registration)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(int64) error); ok {
r1 = rf(projectID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ListRegistrations provides a mock function with given fields: query
func (_m *Controller) ListRegistrations(query *q.Query) ([]*scanner.Registration, error) {
ret := _m.Called(query)
var r0 []*scanner.Registration
if rf, ok := ret.Get(0).(func(*q.Query) []*scanner.Registration); ok {
r0 = rf(query)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*scanner.Registration)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(*q.Query) error); ok {
r1 = rf(query)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Ping provides a mock function with given fields: registration
func (_m *Controller) Ping(registration *scanner.Registration) (*v1.ScannerAdapterMetadata, error) {
ret := _m.Called(registration)
var r0 *v1.ScannerAdapterMetadata
if rf, ok := ret.Get(0).(func(*scanner.Registration) *v1.ScannerAdapterMetadata); ok {
r0 = rf(registration)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v1.ScannerAdapterMetadata)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(*scanner.Registration) error); ok {
r1 = rf(registration)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// RegistrationExists provides a mock function with given fields: registrationUUID
func (_m *Controller) RegistrationExists(registrationUUID string) bool {
ret := _m.Called(registrationUUID)
var r0 bool
if rf, ok := ret.Get(0).(func(string) bool); ok {
r0 = rf(registrationUUID)
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// SetDefaultRegistration provides a mock function with given fields: registrationUUID
func (_m *Controller) SetDefaultRegistration(registrationUUID string) error {
ret := _m.Called(registrationUUID)
var r0 error
if rf, ok := ret.Get(0).(func(string) error); ok {
r0 = rf(registrationUUID)
} else {
r0 = ret.Error(0)
}
return r0
}
// SetRegistrationByProject provides a mock function with given fields: projectID, scannerID
func (_m *Controller) SetRegistrationByProject(projectID int64, scannerID string) error {
ret := _m.Called(projectID, scannerID)
var r0 error
if rf, ok := ret.Get(0).(func(int64, string) error); ok {
r0 = rf(projectID, scannerID)
} else {
r0 = ret.Error(0)
}
return r0
}
// UpdateRegistration provides a mock function with given fields: registration
func (_m *Controller) UpdateRegistration(registration *scanner.Registration) error {
ret := _m.Called(registration)
var r0 error
if rf, ok := ret.Get(0).(func(*scanner.Registration) error); ok {
r0 = rf(registration)
} else {
r0 = ret.Error(0)
}
return r0
}