2023-11-05 07:37:25 +01:00
// Code generated by mockery v2.35.4. DO NOT EDIT.
2020-02-22 06:29:58 +01:00
package scanner
import (
2020-11-12 08:33:13 +01:00
context "context"
2020-03-26 07:00:11 +01:00
controllerscanner "github.com/goharbor/harbor/src/controller/scanner"
2020-02-22 06:29:58 +01:00
mock "github.com/stretchr/testify/mock"
2020-03-24 13:45:45 +01:00
q "github.com/goharbor/harbor/src/lib/q"
2020-03-03 09:41:54 +01:00
2020-02-22 06:29:58 +01:00
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
}
2021-03-01 05:02:40 +01:00
// CreateRegistration provides a mock function with given fields: ctx, registration
func ( _m * Controller ) CreateRegistration ( ctx context . Context , registration * scanner . Registration ) ( string , error ) {
ret := _m . Called ( ctx , registration )
2020-02-22 06:29:58 +01:00
var r0 string
2023-03-11 01:16:11 +01:00
var r1 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * scanner . Registration ) ( string , error ) ) ; ok {
return rf ( ctx , registration )
}
2021-03-01 05:02:40 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * scanner . Registration ) string ) ; ok {
r0 = rf ( ctx , registration )
2020-02-22 06:29:58 +01:00
} else {
r0 = ret . Get ( 0 ) . ( string )
}
2021-03-01 05:02:40 +01:00
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , * scanner . Registration ) error ) ; ok {
r1 = rf ( ctx , registration )
2020-02-22 06:29:58 +01:00
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2021-03-01 05:02:40 +01:00
// DeleteRegistration provides a mock function with given fields: ctx, registrationUUID
func ( _m * Controller ) DeleteRegistration ( ctx context . Context , registrationUUID string ) ( * scanner . Registration , error ) {
ret := _m . Called ( ctx , registrationUUID )
2020-02-22 06:29:58 +01:00
var r0 * scanner . Registration
2023-03-11 01:16:11 +01:00
var r1 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string ) ( * scanner . Registration , error ) ) ; ok {
return rf ( ctx , registrationUUID )
}
2021-03-01 05:02:40 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string ) * scanner . Registration ) ; ok {
r0 = rf ( ctx , registrationUUID )
2020-02-22 06:29:58 +01:00
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( * scanner . Registration )
}
}
2021-03-01 05:02:40 +01:00
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , string ) error ) ; ok {
r1 = rf ( ctx , registrationUUID )
2020-02-22 06:29:58 +01:00
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2021-03-01 05:02:40 +01:00
// GetMetadata provides a mock function with given fields: ctx, registrationUUID
func ( _m * Controller ) GetMetadata ( ctx context . Context , registrationUUID string ) ( * v1 . ScannerAdapterMetadata , error ) {
ret := _m . Called ( ctx , registrationUUID )
2020-02-22 06:29:58 +01:00
var r0 * v1 . ScannerAdapterMetadata
2023-03-11 01:16:11 +01:00
var r1 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string ) ( * v1 . ScannerAdapterMetadata , error ) ) ; ok {
return rf ( ctx , registrationUUID )
}
2021-03-01 05:02:40 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string ) * v1 . ScannerAdapterMetadata ) ; ok {
r0 = rf ( ctx , registrationUUID )
2020-02-22 06:29:58 +01:00
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( * v1 . ScannerAdapterMetadata )
}
}
2021-03-01 05:02:40 +01:00
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , string ) error ) ; ok {
r1 = rf ( ctx , registrationUUID )
2020-02-22 06:29:58 +01:00
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2021-03-01 05:02:40 +01:00
// GetRegistration provides a mock function with given fields: ctx, registrationUUID
func ( _m * Controller ) GetRegistration ( ctx context . Context , registrationUUID string ) ( * scanner . Registration , error ) {
ret := _m . Called ( ctx , registrationUUID )
2020-02-22 06:29:58 +01:00
var r0 * scanner . Registration
2023-03-11 01:16:11 +01:00
var r1 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string ) ( * scanner . Registration , error ) ) ; ok {
return rf ( ctx , registrationUUID )
}
2021-03-01 05:02:40 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string ) * scanner . Registration ) ; ok {
r0 = rf ( ctx , registrationUUID )
2020-02-22 06:29:58 +01:00
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( * scanner . Registration )
}
}
2021-03-01 05:02:40 +01:00
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , string ) error ) ; ok {
r1 = rf ( ctx , registrationUUID )
2020-02-22 06:29:58 +01:00
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2020-11-12 08:33:13 +01:00
// GetRegistrationByProject provides a mock function with given fields: ctx, projectID, options
func ( _m * Controller ) GetRegistrationByProject ( ctx context . Context , projectID int64 , options ... controllerscanner . Option ) ( * scanner . Registration , error ) {
2020-03-03 09:41:54 +01:00
_va := make ( [ ] interface { } , len ( options ) )
for _i := range options {
_va [ _i ] = options [ _i ]
}
var _ca [ ] interface { }
2020-11-12 08:33:13 +01:00
_ca = append ( _ca , ctx , projectID )
2020-03-03 09:41:54 +01:00
_ca = append ( _ca , _va ... )
ret := _m . Called ( _ca ... )
2020-02-22 06:29:58 +01:00
var r0 * scanner . Registration
2023-03-11 01:16:11 +01:00
var r1 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , int64 , ... controllerscanner . Option ) ( * scanner . Registration , error ) ) ; ok {
return rf ( ctx , projectID , options ... )
}
2020-11-12 08:33:13 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , int64 , ... controllerscanner . Option ) * scanner . Registration ) ; ok {
r0 = rf ( ctx , projectID , options ... )
2020-02-22 06:29:58 +01:00
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( * scanner . Registration )
}
}
2020-11-12 08:33:13 +01:00
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , int64 , ... controllerscanner . Option ) error ) ; ok {
r1 = rf ( ctx , projectID , options ... )
2020-02-22 06:29:58 +01:00
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2021-03-03 05:23:36 +01:00
// GetTotalOfRegistrations provides a mock function with given fields: ctx, query
func ( _m * Controller ) GetTotalOfRegistrations ( ctx context . Context , query * q . Query ) ( int64 , error ) {
ret := _m . Called ( ctx , query )
var r0 int64
2023-03-11 01:16:11 +01:00
var r1 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * q . Query ) ( int64 , error ) ) ; ok {
return rf ( ctx , query )
}
2021-03-03 05:23:36 +01:00
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
}
2021-03-01 05:02:40 +01:00
// ListRegistrations provides a mock function with given fields: ctx, query
func ( _m * Controller ) ListRegistrations ( ctx context . Context , query * q . Query ) ( [ ] * scanner . Registration , error ) {
ret := _m . Called ( ctx , query )
2020-02-22 06:29:58 +01:00
var r0 [ ] * scanner . Registration
2023-03-11 01:16:11 +01:00
var r1 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * q . Query ) ( [ ] * scanner . Registration , error ) ) ; ok {
return rf ( ctx , query )
}
2021-03-01 05:02:40 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * q . Query ) [ ] * scanner . Registration ) ; ok {
r0 = rf ( ctx , query )
2020-02-22 06:29:58 +01:00
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( [ ] * scanner . Registration )
}
}
2021-03-01 05:02:40 +01:00
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , * q . Query ) error ) ; ok {
r1 = rf ( ctx , query )
2020-02-22 06:29:58 +01:00
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2021-03-01 05:02:40 +01:00
// Ping provides a mock function with given fields: ctx, registration
func ( _m * Controller ) Ping ( ctx context . Context , registration * scanner . Registration ) ( * v1 . ScannerAdapterMetadata , error ) {
ret := _m . Called ( ctx , registration )
2020-02-22 06:29:58 +01:00
var r0 * v1 . ScannerAdapterMetadata
2023-03-11 01:16:11 +01:00
var r1 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * scanner . Registration ) ( * v1 . ScannerAdapterMetadata , error ) ) ; ok {
return rf ( ctx , registration )
}
2021-03-01 05:02:40 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * scanner . Registration ) * v1 . ScannerAdapterMetadata ) ; ok {
r0 = rf ( ctx , registration )
2020-02-22 06:29:58 +01:00
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( * v1 . ScannerAdapterMetadata )
}
}
2021-03-01 05:02:40 +01:00
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , * scanner . Registration ) error ) ; ok {
r1 = rf ( ctx , registration )
2020-02-22 06:29:58 +01:00
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2021-03-01 05:02:40 +01:00
// RegistrationExists provides a mock function with given fields: ctx, registrationUUID
func ( _m * Controller ) RegistrationExists ( ctx context . Context , registrationUUID string ) bool {
ret := _m . Called ( ctx , registrationUUID )
2020-02-22 06:29:58 +01:00
var r0 bool
2021-03-01 05:02:40 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string ) bool ) ; ok {
r0 = rf ( ctx , registrationUUID )
2020-02-22 06:29:58 +01:00
} else {
r0 = ret . Get ( 0 ) . ( bool )
}
return r0
}
2021-03-01 05:02:40 +01:00
// SetDefaultRegistration provides a mock function with given fields: ctx, registrationUUID
func ( _m * Controller ) SetDefaultRegistration ( ctx context . Context , registrationUUID string ) error {
ret := _m . Called ( ctx , registrationUUID )
2020-02-22 06:29:58 +01:00
var r0 error
2021-03-01 05:02:40 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string ) error ) ; ok {
r0 = rf ( ctx , registrationUUID )
2020-02-22 06:29:58 +01:00
} else {
r0 = ret . Error ( 0 )
}
return r0
}
2020-11-12 08:33:13 +01:00
// SetRegistrationByProject provides a mock function with given fields: ctx, projectID, scannerID
func ( _m * Controller ) SetRegistrationByProject ( ctx context . Context , projectID int64 , scannerID string ) error {
ret := _m . Called ( ctx , projectID , scannerID )
2020-02-22 06:29:58 +01:00
var r0 error
2020-11-12 08:33:13 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , int64 , string ) error ) ; ok {
r0 = rf ( ctx , projectID , scannerID )
2020-02-22 06:29:58 +01:00
} else {
r0 = ret . Error ( 0 )
}
return r0
}
2021-03-01 05:02:40 +01:00
// UpdateRegistration provides a mock function with given fields: ctx, registration
func ( _m * Controller ) UpdateRegistration ( ctx context . Context , registration * scanner . Registration ) error {
ret := _m . Called ( ctx , registration )
2020-02-22 06:29:58 +01:00
var r0 error
2021-03-01 05:02:40 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * scanner . Registration ) error ) ; ok {
r0 = rf ( ctx , registration )
2020-02-22 06:29:58 +01:00
} else {
r0 = ret . Error ( 0 )
}
return r0
}
2022-06-07 10:04:33 +02:00
2023-11-05 07:37:25 +01:00
// 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.
// The first argument is typically a *testing.T value.
func NewController ( t interface {
2022-06-07 10:04:33 +02:00
mock . TestingT
Cleanup ( func ( ) )
2023-11-05 07:37:25 +01:00
} ) * Controller {
2022-06-07 10:04:33 +02:00
mock := & Controller { }
mock . Mock . Test ( t )
t . Cleanup ( func ( ) { mock . AssertExpectations ( t ) } )
return mock
}