2023-11-04 12:10:17 +08:00
// Code generated by mockery v2.32.4. DO NOT EDIT.
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"
2023-11-15 15:24:18 +08:00
msgpb "github.com/milvus-io/milvus-proto/go-api/v2/msgpb"
2023-11-04 12:10:17 +08:00
)
// 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 }
}
// Block provides a mock function with given fields: segmentID
func ( _m * MockSyncManager ) Block ( segmentID int64 ) {
_m . Called ( segmentID )
}
// MockSyncManager_Block_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Block'
type MockSyncManager_Block_Call struct {
* mock . Call
}
// Block is a helper method to define mock.On call
// - segmentID int64
func ( _e * MockSyncManager_Expecter ) Block ( segmentID interface { } ) * MockSyncManager_Block_Call {
return & MockSyncManager_Block_Call { Call : _e . mock . On ( "Block" , segmentID ) }
}
func ( _c * MockSyncManager_Block_Call ) Run ( run func ( segmentID int64 ) ) * MockSyncManager_Block_Call {
_c . Call . Run ( func ( args mock . Arguments ) {
run ( args [ 0 ] . ( int64 ) )
} )
return _c
}
func ( _c * MockSyncManager_Block_Call ) Return ( ) * MockSyncManager_Block_Call {
_c . Call . Return ( )
return _c
}
func ( _c * MockSyncManager_Block_Call ) RunAndReturn ( run func ( int64 ) ) * MockSyncManager_Block_Call {
_c . Call . Return ( run )
return _c
}
2023-11-16 00:22:20 +08:00
// GetEarliestPosition provides a mock function with given fields: channel
2023-12-07 11:50:36 +08:00
func ( _m * MockSyncManager ) GetEarliestPosition ( channel string ) ( int64 , * msgpb . MsgPosition ) {
2023-11-15 15:24:18 +08:00
ret := _m . Called ( channel )
2023-12-07 11:50:36 +08:00
var r0 int64
var r1 * msgpb . MsgPosition
if rf , ok := ret . Get ( 0 ) . ( func ( string ) ( int64 , * msgpb . MsgPosition ) ) ; ok {
return rf ( channel )
}
if rf , ok := ret . Get ( 0 ) . ( func ( string ) int64 ) ; ok {
2023-11-15 15:24:18 +08:00
r0 = rf ( channel )
} else {
2023-12-07 11:50:36 +08:00
r0 = ret . Get ( 0 ) . ( int64 )
}
if rf , ok := ret . Get ( 1 ) . ( func ( string ) * msgpb . MsgPosition ) ; ok {
r1 = rf ( channel )
} else {
if ret . Get ( 1 ) != nil {
r1 = ret . Get ( 1 ) . ( * msgpb . MsgPosition )
2023-11-15 15:24:18 +08:00
}
}
2023-12-07 11:50:36 +08:00
return r0 , r1
2023-11-15 15:24:18 +08:00
}
2023-11-16 00:22:20 +08:00
// MockSyncManager_GetEarliestPosition_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEarliestPosition'
type MockSyncManager_GetEarliestPosition_Call struct {
2023-11-15 15:24:18 +08:00
* mock . Call
}
2023-11-16 00:22:20 +08:00
// GetEarliestPosition is a helper method to define mock.On call
2023-11-15 15:24:18 +08:00
// - channel string
2023-11-16 00:22:20 +08:00
func ( _e * MockSyncManager_Expecter ) GetEarliestPosition ( channel interface { } ) * MockSyncManager_GetEarliestPosition_Call {
return & MockSyncManager_GetEarliestPosition_Call { Call : _e . mock . On ( "GetEarliestPosition" , channel ) }
2023-11-15 15:24:18 +08:00
}
2023-11-16 00:22:20 +08:00
func ( _c * MockSyncManager_GetEarliestPosition_Call ) Run ( run func ( channel string ) ) * MockSyncManager_GetEarliestPosition_Call {
2023-11-15 15:24:18 +08:00
_c . Call . Run ( func ( args mock . Arguments ) {
run ( args [ 0 ] . ( string ) )
} )
return _c
}
2023-12-07 11:50:36 +08:00
func ( _c * MockSyncManager_GetEarliestPosition_Call ) Return ( _a0 int64 , _a1 * msgpb . MsgPosition ) * MockSyncManager_GetEarliestPosition_Call {
_c . Call . Return ( _a0 , _a1 )
2023-11-15 15:24:18 +08:00
return _c
}
2023-12-07 11:50:36 +08:00
func ( _c * MockSyncManager_GetEarliestPosition_Call ) RunAndReturn ( run func ( string ) ( int64 , * msgpb . MsgPosition ) ) * MockSyncManager_GetEarliestPosition_Call {
2023-11-15 15:24:18 +08:00
_c . Call . Return ( run )
return _c
}
2023-11-04 12:10:17 +08:00
// SyncData provides a mock function with given fields: ctx, task
2023-11-23 17:26:24 +08:00
func ( _m * MockSyncManager ) SyncData ( ctx context . Context , task Task ) * conc . Future [ error ] {
2023-11-04 12:10:17 +08:00
ret := _m . Called ( ctx , task )
2023-11-15 15:24:18 +08:00
var r0 * conc . Future [ error ]
2023-11-23 17:26:24 +08:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , Task ) * conc . Future [ error ] ) ; ok {
2023-11-04 12:10:17 +08:00
r0 = rf ( ctx , task )
} else {
2023-11-15 15:24:18 +08:00
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( * conc . Future [ error ] )
}
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
// - ctx context.Context
2023-11-23 17:26:24 +08:00
// - task Task
2023-11-04 12:10:17 +08:00
func ( _e * MockSyncManager_Expecter ) SyncData ( ctx interface { } , task interface { } ) * MockSyncManager_SyncData_Call {
return & MockSyncManager_SyncData_Call { Call : _e . mock . On ( "SyncData" , ctx , task ) }
}
2023-11-23 17:26:24 +08:00
func ( _c * MockSyncManager_SyncData_Call ) Run ( run func ( ctx context . Context , task Task ) ) * MockSyncManager_SyncData_Call {
2023-11-04 12:10:17 +08:00
_c . Call . Run ( func ( args mock . Arguments ) {
2023-11-23 17:26:24 +08:00
run ( args [ 0 ] . ( context . Context ) , args [ 1 ] . ( Task ) )
2023-11-04 12:10:17 +08:00
} )
return _c
}
2023-11-15 15:24:18 +08:00
func ( _c * MockSyncManager_SyncData_Call ) Return ( _a0 * conc . Future [ error ] ) * MockSyncManager_SyncData_Call {
2023-11-04 12:10:17 +08:00
_c . Call . Return ( _a0 )
return _c
}
2023-11-23 17:26:24 +08:00
func ( _c * MockSyncManager_SyncData_Call ) RunAndReturn ( run func ( context . Context , Task ) * conc . Future [ error ] ) * MockSyncManager_SyncData_Call {
2023-11-04 12:10:17 +08:00
_c . Call . Return ( run )
return _c
}
// Unblock provides a mock function with given fields: segmentID
func ( _m * MockSyncManager ) Unblock ( segmentID int64 ) {
_m . Called ( segmentID )
}
// MockSyncManager_Unblock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unblock'
type MockSyncManager_Unblock_Call struct {
* mock . Call
}
// Unblock is a helper method to define mock.On call
// - segmentID int64
func ( _e * MockSyncManager_Expecter ) Unblock ( segmentID interface { } ) * MockSyncManager_Unblock_Call {
return & MockSyncManager_Unblock_Call { Call : _e . mock . On ( "Unblock" , segmentID ) }
}
func ( _c * MockSyncManager_Unblock_Call ) Run ( run func ( segmentID int64 ) ) * MockSyncManager_Unblock_Call {
_c . Call . Run ( func ( args mock . Arguments ) {
run ( args [ 0 ] . ( int64 ) )
} )
return _c
}
func ( _c * MockSyncManager_Unblock_Call ) Return ( ) * MockSyncManager_Unblock_Call {
_c . Call . Return ( )
return _c
}
func ( _c * MockSyncManager_Unblock_Call ) RunAndReturn ( run func ( int64 ) ) * MockSyncManager_Unblock_Call {
_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
}