2022-08-22 08:21:13 +02:00
// Code generated by mockery v2.14.0. 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 )
var r0 int64
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * q . Query ) int64 ) ; ok {
r0 = rf ( ctx , query )
} else {
r0 = ret . Get ( 0 ) . ( int64 )
}
var r1 error
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 ... )
var r0 int64
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 )
}
var r1 error
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 )
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 )
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 )
var r0 * task . Execution
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 )
}
}
var r1 error
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 )
var r0 [ ] * task . Execution
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 )
}
}
var r1 error
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 )
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 )
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 )
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 )
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
// 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 )
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
2022-08-22 08:21:13 +02:00
type mockConstructorTestingTNewExecutionManager interface {
2022-06-07 10:04:33 +02:00
mock . TestingT
Cleanup ( func ( ) )
}
// 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.
2022-08-22 08:21:13 +02:00
func NewExecutionManager ( t mockConstructorTestingTNewExecutionManager ) * ExecutionManager {
2022-06-07 10:04:33 +02:00
mock := & ExecutionManager { }
mock . Mock . Test ( t )
t . Cleanup ( func ( ) { mock . AssertExpectations ( t ) } )
return mock
}