2024-04-11 05:37:59 +02:00
// Code generated by mockery v2.42.2. DO NOT EDIT.
2020-07-01 18:12:43 +02:00
package task
import (
context "context"
q "github.com/goharbor/harbor/src/lib/q"
mock "github.com/stretchr/testify/mock"
task "github.com/goharbor/harbor/src/pkg/task"
2020-09-22 11:47:04 +02:00
time "time"
2020-07-01 18:12:43 +02:00
)
2020-09-22 11:47:04 +02:00
// ExecutionManager is an autogenerated mock type for the ExecutionManager type
type ExecutionManager struct {
2020-07-01 18:12:43 +02:00
mock . Mock
}
2020-08-06 10:59:38 +02:00
// Count provides a mock function with given fields: ctx, query
2020-09-22 11:47:04 +02:00
func ( _m * ExecutionManager ) Count ( ctx context . Context , query * q . Query ) ( int64 , error ) {
2020-08-06 10:59:38 +02:00
ret := _m . Called ( ctx , query )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for Count" )
}
2020-08-06 10:59:38 +02:00
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 )
}
2020-08-06 10:59:38 +02: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
}
2020-07-01 18:12:43 +02:00
// Create provides a mock function with given fields: ctx, vendorType, vendorID, trigger, extraAttrs
2020-09-22 11:47:04 +02:00
func ( _m * ExecutionManager ) Create ( ctx context . Context , vendorType string , vendorID int64 , trigger string , extraAttrs ... map [ string ] interface { } ) ( int64 , error ) {
2020-07-01 18:12:43 +02:00
_va := make ( [ ] interface { } , len ( extraAttrs ) )
for _i := range extraAttrs {
_va [ _i ] = extraAttrs [ _i ]
}
var _ca [ ] interface { }
_ca = append ( _ca , ctx , vendorType , vendorID , trigger )
_ca = append ( _ca , _va ... )
ret := _m . Called ( _ca ... )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for Create" )
}
2020-07-01 18:12:43 +02:00
var r0 int64
2023-03-11 01:16:11 +01:00
var r1 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string , int64 , string , ... map [ string ] interface { } ) ( int64 , error ) ) ; ok {
return rf ( ctx , vendorType , vendorID , trigger , extraAttrs ... )
}
2020-07-01 18:12:43 +02:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string , int64 , string , ... map [ string ] interface { } ) int64 ) ; ok {
r0 = rf ( ctx , vendorType , vendorID , trigger , extraAttrs ... )
} else {
r0 = ret . Get ( 0 ) . ( int64 )
}
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , string , int64 , string , ... map [ string ] interface { } ) error ) ; ok {
r1 = rf ( ctx , vendorType , vendorID , trigger , extraAttrs ... )
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
// Delete provides a mock function with given fields: ctx, id
2020-09-22 11:47:04 +02:00
func ( _m * ExecutionManager ) Delete ( ctx context . Context , id int64 ) error {
2020-07-01 18:12:43 +02:00
ret := _m . Called ( ctx , id )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for Delete" )
}
2020-07-01 18:12:43 +02:00
var r0 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , int64 ) error ) ; ok {
r0 = rf ( ctx , id )
} else {
r0 = ret . Error ( 0 )
}
return r0
}
2021-03-03 04:45:33 +01:00
// DeleteByVendor provides a mock function with given fields: ctx, vendorType, vendorID
func ( _m * ExecutionManager ) DeleteByVendor ( ctx context . Context , vendorType string , vendorID int64 ) error {
ret := _m . Called ( ctx , vendorType , vendorID )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for DeleteByVendor" )
}
2021-03-03 04:45:33 +01:00
var r0 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string , int64 ) error ) ; ok {
r0 = rf ( ctx , vendorType , vendorID )
} else {
r0 = ret . Error ( 0 )
}
return r0
}
2020-07-01 18:12:43 +02:00
// Get provides a mock function with given fields: ctx, id
2020-09-22 11:47:04 +02:00
func ( _m * ExecutionManager ) Get ( ctx context . Context , id int64 ) ( * task . Execution , error ) {
2020-07-01 18:12:43 +02:00
ret := _m . Called ( ctx , id )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for Get" )
}
2020-07-01 18:12:43 +02:00
var r0 * task . Execution
2023-03-11 01:16:11 +01:00
var r1 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , int64 ) ( * task . Execution , error ) ) ; ok {
return rf ( ctx , id )
}
2020-07-01 18:12:43 +02:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , int64 ) * task . Execution ) ; ok {
r0 = rf ( ctx , id )
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( * task . Execution )
}
}
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , int64 ) error ) ; ok {
r1 = rf ( ctx , id )
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
// List provides a mock function with given fields: ctx, query
2020-09-22 11:47:04 +02:00
func ( _m * ExecutionManager ) List ( ctx context . Context , query * q . Query ) ( [ ] * task . Execution , error ) {
2020-07-01 18:12:43 +02:00
ret := _m . Called ( ctx , query )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for List" )
}
2020-07-01 18:12:43 +02:00
var r0 [ ] * task . Execution
2023-03-11 01:16:11 +01:00
var r1 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * q . Query ) ( [ ] * task . Execution , error ) ) ; ok {
return rf ( ctx , query )
}
2020-07-01 18:12:43 +02:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * q . Query ) [ ] * task . Execution ) ; ok {
r0 = rf ( ctx , query )
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( [ ] * task . Execution )
}
}
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
}
// MarkDone provides a mock function with given fields: ctx, id, message
2020-09-22 11:47:04 +02:00
func ( _m * ExecutionManager ) MarkDone ( ctx context . Context , id int64 , message string ) error {
2020-07-01 18:12:43 +02:00
ret := _m . Called ( ctx , id , message )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for MarkDone" )
}
2020-07-01 18:12:43 +02:00
var r0 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , int64 , string ) error ) ; ok {
r0 = rf ( ctx , id , message )
} else {
r0 = ret . Error ( 0 )
}
return r0
}
// MarkError provides a mock function with given fields: ctx, id, message
2020-09-22 11:47:04 +02:00
func ( _m * ExecutionManager ) MarkError ( ctx context . Context , id int64 , message string ) error {
2020-07-01 18:12:43 +02:00
ret := _m . Called ( ctx , id , message )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for MarkError" )
}
2020-07-01 18:12:43 +02:00
var r0 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , int64 , string ) error ) ; ok {
r0 = rf ( ctx , id , message )
} else {
r0 = ret . Error ( 0 )
}
return r0
}
// Stop provides a mock function with given fields: ctx, id
2020-09-22 11:47:04 +02:00
func ( _m * ExecutionManager ) Stop ( ctx context . Context , id int64 ) error {
2020-07-01 18:12:43 +02:00
ret := _m . Called ( ctx , id )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for Stop" )
}
2020-07-01 18:12:43 +02:00
var r0 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , int64 ) error ) ; ok {
r0 = rf ( ctx , id )
} else {
r0 = ret . Error ( 0 )
}
return r0
}
2020-09-22 11:47:04 +02:00
// StopAndWait provides a mock function with given fields: ctx, id, timeout
func ( _m * ExecutionManager ) StopAndWait ( ctx context . Context , id int64 , timeout time . Duration ) error {
ret := _m . Called ( ctx , id , timeout )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for StopAndWait" )
}
2020-09-22 11:47:04 +02:00
var r0 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , int64 , time . Duration ) error ) ; ok {
r0 = rf ( ctx , id , timeout )
} else {
r0 = ret . Error ( 0 )
}
return r0
}
2021-01-08 03:10:31 +01:00
2024-03-26 05:52:17 +01:00
// StopAndWaitWithError provides a mock function with given fields: ctx, id, timeout, origError
func ( _m * ExecutionManager ) StopAndWaitWithError ( ctx context . Context , id int64 , timeout time . Duration , origError error ) error {
ret := _m . Called ( ctx , id , timeout , origError )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for StopAndWaitWithError" )
}
2024-03-26 05:52:17 +01:00
var r0 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , int64 , time . Duration , error ) error ) ; ok {
r0 = rf ( ctx , id , timeout , origError )
} else {
r0 = ret . Error ( 0 )
}
return r0
}
2021-01-08 03:10:31 +01:00
// UpdateExtraAttrs provides a mock function with given fields: ctx, id, extraAttrs
func ( _m * ExecutionManager ) UpdateExtraAttrs ( ctx context . Context , id int64 , extraAttrs map [ string ] interface { } ) error {
ret := _m . Called ( ctx , id , extraAttrs )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for UpdateExtraAttrs" )
}
2021-01-08 03:10:31 +01:00
var r0 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , int64 , map [ string ] interface { } ) error ) ; ok {
r0 = rf ( ctx , id , extraAttrs )
} else {
r0 = ret . Error ( 0 )
}
return r0
}
2022-06-07 10:04:33 +02:00
2023-11-05 07:37:25 +01:00
// NewExecutionManager creates a new instance of ExecutionManager. 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 NewExecutionManager ( t interface {
2022-06-07 10:04:33 +02:00
mock . TestingT
Cleanup ( func ( ) )
2023-11-05 07:37:25 +01:00
} ) * ExecutionManager {
2022-06-07 10:04:33 +02:00
mock := & ExecutionManager { }
mock . Mock . Test ( t )
t . Cleanup ( func ( ) { mock . AssertExpectations ( t ) } )
return mock
}