mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-03 12:29:36 +08:00
4fedff6d47
#28378 --------- Signed-off-by: sunby <sunbingyi1992@gmail.com>
196 lines
5.8 KiB
Go
196 lines
5.8 KiB
Go
// Code generated by mockery v2.32.4. DO NOT EDIT.
|
|
|
|
package syncmgr
|
|
|
|
import (
|
|
context "context"
|
|
|
|
conc "github.com/milvus-io/milvus/pkg/util/conc"
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
|
|
msgpb "github.com/milvus-io/milvus-proto/go-api/v2/msgpb"
|
|
)
|
|
|
|
// 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
|
|
}
|
|
|
|
// GetEarliestPosition provides a mock function with given fields: channel
|
|
func (_m *MockSyncManager) GetEarliestPosition(channel string) *msgpb.MsgPosition {
|
|
ret := _m.Called(channel)
|
|
|
|
var r0 *msgpb.MsgPosition
|
|
if rf, ok := ret.Get(0).(func(string) *msgpb.MsgPosition); ok {
|
|
r0 = rf(channel)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*msgpb.MsgPosition)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// MockSyncManager_GetEarliestPosition_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEarliestPosition'
|
|
type MockSyncManager_GetEarliestPosition_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// GetEarliestPosition is a helper method to define mock.On call
|
|
// - channel string
|
|
func (_e *MockSyncManager_Expecter) GetEarliestPosition(channel interface{}) *MockSyncManager_GetEarliestPosition_Call {
|
|
return &MockSyncManager_GetEarliestPosition_Call{Call: _e.mock.On("GetEarliestPosition", channel)}
|
|
}
|
|
|
|
func (_c *MockSyncManager_GetEarliestPosition_Call) Run(run func(channel string)) *MockSyncManager_GetEarliestPosition_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(string))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockSyncManager_GetEarliestPosition_Call) Return(_a0 *msgpb.MsgPosition) *MockSyncManager_GetEarliestPosition_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockSyncManager_GetEarliestPosition_Call) RunAndReturn(run func(string) *msgpb.MsgPosition) *MockSyncManager_GetEarliestPosition_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// SyncData provides a mock function with given fields: ctx, task
|
|
func (_m *MockSyncManager) SyncData(ctx context.Context, task Task) *conc.Future[error] {
|
|
ret := _m.Called(ctx, task)
|
|
|
|
var r0 *conc.Future[error]
|
|
if rf, ok := ret.Get(0).(func(context.Context, Task) *conc.Future[error]); ok {
|
|
r0 = rf(ctx, task)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*conc.Future[error])
|
|
}
|
|
}
|
|
|
|
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
|
|
// - task Task
|
|
func (_e *MockSyncManager_Expecter) SyncData(ctx interface{}, task interface{}) *MockSyncManager_SyncData_Call {
|
|
return &MockSyncManager_SyncData_Call{Call: _e.mock.On("SyncData", ctx, task)}
|
|
}
|
|
|
|
func (_c *MockSyncManager_SyncData_Call) Run(run func(ctx context.Context, task Task)) *MockSyncManager_SyncData_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(Task))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockSyncManager_SyncData_Call) Return(_a0 *conc.Future[error]) *MockSyncManager_SyncData_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockSyncManager_SyncData_Call) RunAndReturn(run func(context.Context, Task) *conc.Future[error]) *MockSyncManager_SyncData_Call {
|
|
_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
|
|
}
|