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 scan
import (
2020-03-12 12:30:12 +01:00
context "context"
2020-12-14 06:34:35 +01:00
artifact "github.com/goharbor/harbor/src/controller/artifact"
2020-02-22 06:29:58 +01:00
2020-12-14 06:34:35 +01:00
daoscan "github.com/goharbor/harbor/src/pkg/scan/dao/scan"
2020-02-22 06:29:58 +01:00
mock "github.com/stretchr/testify/mock"
2021-05-18 08:01:59 +02:00
models "github.com/goharbor/harbor/src/pkg/allowlist/models"
2020-12-14 06:34:35 +01:00
2020-03-24 13:45:45 +01:00
scan "github.com/goharbor/harbor/src/controller/scan"
2020-02-22 06:29:58 +01:00
)
// Controller is an autogenerated mock type for the Controller type
type Controller struct {
mock . Mock
}
2020-12-14 06:34:35 +01:00
// DeleteReports provides a mock function with given fields: ctx, digests
func ( _m * Controller ) DeleteReports ( ctx context . Context , digests ... string ) error {
2020-02-22 06:29:58 +01:00
_va := make ( [ ] interface { } , len ( digests ) )
for _i := range digests {
_va [ _i ] = digests [ _i ]
}
var _ca [ ] interface { }
2020-12-14 06:34:35 +01:00
_ca = append ( _ca , ctx )
2020-02-22 06:29:58 +01:00
_ca = append ( _ca , _va ... )
ret := _m . Called ( _ca ... )
var r0 error
2020-12-14 06:34:35 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , ... string ) error ) ; ok {
r0 = rf ( ctx , digests ... )
2020-02-22 06:29:58 +01:00
} else {
r0 = ret . Error ( 0 )
}
return r0
}
2020-03-12 12:30:12 +01:00
// GetReport provides a mock function with given fields: ctx, _a1, mimeTypes
func ( _m * Controller ) GetReport ( ctx context . Context , _a1 * artifact . Artifact , mimeTypes [ ] string ) ( [ ] * daoscan . Report , error ) {
ret := _m . Called ( ctx , _a1 , mimeTypes )
2020-02-22 06:29:58 +01:00
var r0 [ ] * daoscan . Report
2023-03-11 01:16:11 +01:00
var r1 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * artifact . Artifact , [ ] string ) ( [ ] * daoscan . Report , error ) ) ; ok {
return rf ( ctx , _a1 , mimeTypes )
}
2020-03-12 12:30:12 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * artifact . Artifact , [ ] string ) [ ] * daoscan . Report ) ; ok {
r0 = rf ( ctx , _a1 , mimeTypes )
2020-02-22 06:29:58 +01:00
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( [ ] * daoscan . Report )
}
}
2020-03-12 12:30:12 +01:00
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , * artifact . Artifact , [ ] string ) error ) ; ok {
r1 = rf ( ctx , _a1 , mimeTypes )
2020-02-22 06:29:58 +01:00
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2022-06-28 12:12:38 +02:00
// GetScanLog provides a mock function with given fields: ctx, art, uuid
func ( _m * Controller ) GetScanLog ( ctx context . Context , art * artifact . Artifact , uuid string ) ( [ ] byte , error ) {
ret := _m . Called ( ctx , art , uuid )
2020-02-22 06:29:58 +01:00
var r0 [ ] byte
2023-03-11 01:16:11 +01:00
var r1 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * artifact . Artifact , string ) ( [ ] byte , error ) ) ; ok {
return rf ( ctx , art , uuid )
}
2022-06-28 12:12:38 +02:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * artifact . Artifact , string ) [ ] byte ) ; ok {
r0 = rf ( ctx , art , uuid )
2020-02-22 06:29:58 +01:00
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( [ ] byte )
}
}
2022-06-28 12:12:38 +02:00
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , * artifact . Artifact , string ) error ) ; ok {
r1 = rf ( ctx , art , uuid )
2020-02-22 06:29:58 +01:00
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2021-05-18 08:01:59 +02:00
// GetSummary provides a mock function with given fields: ctx, _a1, mimeTypes
func ( _m * Controller ) GetSummary ( ctx context . Context , _a1 * artifact . Artifact , mimeTypes [ ] string ) ( map [ string ] interface { } , error ) {
ret := _m . Called ( ctx , _a1 , mimeTypes )
2020-02-22 06:29:58 +01:00
var r0 map [ string ] interface { }
2023-03-11 01:16:11 +01:00
var r1 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * artifact . Artifact , [ ] string ) ( map [ string ] interface { } , error ) ) ; ok {
return rf ( ctx , _a1 , mimeTypes )
}
2021-05-18 08:01:59 +02:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * artifact . Artifact , [ ] string ) map [ string ] interface { } ) ; ok {
r0 = rf ( ctx , _a1 , mimeTypes )
2020-02-22 06:29:58 +01:00
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( map [ string ] interface { } )
}
}
2021-05-18 08:01:59 +02:00
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , * artifact . Artifact , [ ] string ) error ) ; ok {
r1 = rf ( ctx , _a1 , mimeTypes )
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2023-03-08 04:25:40 +01:00
// GetVulnerable provides a mock function with given fields: ctx, _a1, allowlist, allowlistIsExpired
func ( _m * Controller ) GetVulnerable ( ctx context . Context , _a1 * artifact . Artifact , allowlist models . CVESet , allowlistIsExpired bool ) ( * scan . Vulnerable , error ) {
ret := _m . Called ( ctx , _a1 , allowlist , allowlistIsExpired )
2021-05-18 08:01:59 +02:00
var r0 * scan . Vulnerable
2023-03-11 01:16:11 +01:00
var r1 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * artifact . Artifact , models . CVESet , bool ) ( * scan . Vulnerable , error ) ) ; ok {
return rf ( ctx , _a1 , allowlist , allowlistIsExpired )
}
2023-03-08 04:25:40 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * artifact . Artifact , models . CVESet , bool ) * scan . Vulnerable ) ; ok {
r0 = rf ( ctx , _a1 , allowlist , allowlistIsExpired )
2021-05-18 08:01:59 +02:00
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( * scan . Vulnerable )
}
}
2023-03-08 04:25:40 +01:00
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , * artifact . Artifact , models . CVESet , bool ) error ) ; ok {
r1 = rf ( ctx , _a1 , allowlist , allowlistIsExpired )
2020-02-22 06:29:58 +01:00
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2020-03-12 12:30:12 +01:00
// Scan provides a mock function with given fields: ctx, _a1, options
func ( _m * Controller ) Scan ( ctx context . Context , _a1 * artifact . Artifact , options ... scan . Option ) error {
2020-02-22 06:29:58 +01:00
_va := make ( [ ] interface { } , len ( options ) )
for _i := range options {
_va [ _i ] = options [ _i ]
}
var _ca [ ] interface { }
2020-03-12 12:30:12 +01:00
_ca = append ( _ca , ctx , _a1 )
2020-02-22 06:29:58 +01:00
_ca = append ( _ca , _va ... )
ret := _m . Called ( _ca ... )
var r0 error
2020-03-12 12:30:12 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * artifact . Artifact , ... scan . Option ) error ) ; ok {
r0 = rf ( ctx , _a1 , options ... )
2020-02-22 06:29:58 +01:00
} else {
r0 = ret . Error ( 0 )
}
return r0
}
2020-12-14 06:34:35 +01:00
// ScanAll provides a mock function with given fields: ctx, trigger, async
func ( _m * Controller ) ScanAll ( ctx context . Context , trigger string , async bool ) ( int64 , error ) {
ret := _m . Called ( ctx , trigger , async )
var r0 int64
2023-03-11 01:16:11 +01:00
var r1 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string , bool ) ( int64 , error ) ) ; ok {
return rf ( ctx , trigger , async )
}
2020-12-14 06:34:35 +01:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string , bool ) int64 ) ; ok {
r0 = rf ( ctx , trigger , async )
} else {
r0 = ret . Get ( 0 ) . ( int64 )
}
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , string , bool ) error ) ; ok {
r1 = rf ( ctx , trigger , async )
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2021-08-15 11:21:39 +02:00
2024-04-09 10:07:47 +02:00
// Stop provides a mock function with given fields: ctx, _a1, capType
func ( _m * Controller ) Stop ( ctx context . Context , _a1 * artifact . Artifact , capType string ) error {
ret := _m . Called ( ctx , _a1 , capType )
2021-08-15 11:21:39 +02:00
var r0 error
2024-04-09 10:07:47 +02:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * artifact . Artifact , string ) error ) ; ok {
r0 = rf ( ctx , _a1 , capType )
2021-08-15 11:21:39 +02:00
} else {
r0 = ret . Error ( 0 )
}
return r0
}
2022-06-07 10:04:33 +02:00
2023-06-05 09:12:54 +02:00
// StopScanAll provides a mock function with given fields: ctx, executionID, async
func ( _m * Controller ) StopScanAll ( ctx context . Context , executionID int64 , async bool ) error {
ret := _m . Called ( ctx , executionID , async )
var r0 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , int64 , bool ) error ) ; ok {
r0 = rf ( ctx , executionID , async )
} else {
r0 = ret . Error ( 0 )
}
return r0
}
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
}