2024-05-30 13:37:44 +08:00
// Code generated by mockery v2.32.4. DO NOT EDIT.
2023-11-04 12:10:17 +08:00
package syncmgr
import (
context "context"
2023-11-15 15:24:18 +08:00
conc "github.com/milvus-io/milvus/pkg/util/conc"
2023-11-04 12:10:17 +08:00
mock "github.com/stretchr/testify/mock"
)
// MockSyncManager is an autogenerated mock type for the SyncManager type
type MockSyncManager struct {
mock . Mock
}
type MockSyncManager_Expecter struct {
mock * mock . Mock
}
func ( _m * MockSyncManager ) EXPECT ( ) * MockSyncManager_Expecter {
return & MockSyncManager_Expecter { mock : & _m . Mock }
}
2024-06-05 10:05:50 +08:00
// SyncData provides a mock function with given fields: ctx, task, callbacks
func ( _m * MockSyncManager ) SyncData ( ctx context . Context , task Task , callbacks ... func ( error ) error ) * conc . Future [ struct { } ] {
_va := make ( [ ] interface { } , len ( callbacks ) )
for _i := range callbacks {
_va [ _i ] = callbacks [ _i ]
2023-11-15 15:24:18 +08:00
}
2024-06-05 10:05:50 +08:00
var _ca [ ] interface { }
_ca = append ( _ca , ctx , task )
_ca = append ( _ca , _va ... )
ret := _m . Called ( _ca ... )
2023-11-04 12:10:17 +08:00
2024-04-29 10:59:26 +08:00
var r0 * conc . Future [ struct { } ]
2024-06-05 10:05:50 +08:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , Task , ... func ( error ) error ) * conc . Future [ struct { } ] ) ; ok {
r0 = rf ( ctx , task , callbacks ... )
2023-11-04 12:10:17 +08:00
} else {
2023-11-15 15:24:18 +08:00
if ret . Get ( 0 ) != nil {
2024-04-29 10:59:26 +08:00
r0 = ret . Get ( 0 ) . ( * conc . Future [ struct { } ] )
2023-11-15 15:24:18 +08:00
}
2023-11-04 12:10:17 +08:00
}
return r0
}
// MockSyncManager_SyncData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SyncData'
type MockSyncManager_SyncData_Call struct {
* mock . Call
}
// SyncData is a helper method to define mock.On call
2024-05-28 14:19:42 +08:00
// - ctx context.Context
// - task Task
2024-06-05 10:05:50 +08:00
// - callbacks ...func(error) error
func ( _e * MockSyncManager_Expecter ) SyncData ( ctx interface { } , task interface { } , callbacks ... interface { } ) * MockSyncManager_SyncData_Call {
return & MockSyncManager_SyncData_Call { Call : _e . mock . On ( "SyncData" ,
append ( [ ] interface { } { ctx , task } , callbacks ... ) ... ) }
2023-11-04 12:10:17 +08:00
}
2024-06-05 10:05:50 +08:00
func ( _c * MockSyncManager_SyncData_Call ) Run ( run func ( ctx context . Context , task Task , callbacks ... func ( error ) error ) ) * MockSyncManager_SyncData_Call {
2023-11-04 12:10:17 +08:00
_c . Call . Run ( func ( args mock . Arguments ) {
2024-06-05 10:05:50 +08:00
variadicArgs := make ( [ ] func ( error ) error , len ( args ) - 2 )
for i , a := range args [ 2 : ] {
if a != nil {
variadicArgs [ i ] = a . ( func ( error ) error )
}
}
run ( args [ 0 ] . ( context . Context ) , args [ 1 ] . ( Task ) , variadicArgs ... )
2023-11-04 12:10:17 +08:00
} )
return _c
}
2024-04-29 10:59:26 +08:00
func ( _c * MockSyncManager_SyncData_Call ) Return ( _a0 * conc . Future [ struct { } ] ) * MockSyncManager_SyncData_Call {
2023-11-04 12:10:17 +08:00
_c . Call . Return ( _a0 )
return _c
}
2024-06-05 10:05:50 +08:00
func ( _c * MockSyncManager_SyncData_Call ) RunAndReturn ( run func ( context . Context , Task , ... func ( error ) error ) * conc . Future [ struct { } ] ) * MockSyncManager_SyncData_Call {
2023-11-04 12:10:17 +08:00
_c . Call . Return ( run )
return _c
}
// NewMockSyncManager creates a new instance of MockSyncManager. 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 NewMockSyncManager ( t interface {
mock . TestingT
Cleanup ( func ( ) )
} ) * MockSyncManager {
mock := & MockSyncManager { }
mock . Mock . Test ( t )
t . Cleanup ( func ( ) { mock . AssertExpectations ( t ) } )
return mock
}