mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 20:09:57 +08:00
7f7c71ea7d
Co-authored-by:: aoiasd <zhicheng.yue@zilliz.com> Signed-off-by: jaime <yun.zhang@zilliz.com>
201 lines
6.8 KiB
Go
201 lines
6.8 KiB
Go
// Code generated by mockery v2.32.4. DO NOT EDIT.
|
|
|
|
package proxy
|
|
|
|
import (
|
|
context "context"
|
|
|
|
types "github.com/milvus-io/milvus/internal/types"
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// MockShardClientManager is an autogenerated mock type for the shardClientMgr type
|
|
type MockShardClientManager struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type MockShardClientManager_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *MockShardClientManager) EXPECT() *MockShardClientManager_Expecter {
|
|
return &MockShardClientManager_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// Close provides a mock function with given fields:
|
|
func (_m *MockShardClientManager) Close() {
|
|
_m.Called()
|
|
}
|
|
|
|
// MockShardClientManager_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
|
|
type MockShardClientManager_Close_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Close is a helper method to define mock.On call
|
|
func (_e *MockShardClientManager_Expecter) Close() *MockShardClientManager_Close_Call {
|
|
return &MockShardClientManager_Close_Call{Call: _e.mock.On("Close")}
|
|
}
|
|
|
|
func (_c *MockShardClientManager_Close_Call) Run(run func()) *MockShardClientManager_Close_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run()
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockShardClientManager_Close_Call) Return() *MockShardClientManager_Close_Call {
|
|
_c.Call.Return()
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockShardClientManager_Close_Call) RunAndReturn(run func()) *MockShardClientManager_Close_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// GetClient provides a mock function with given fields: ctx, nodeID
|
|
func (_m *MockShardClientManager) GetClient(ctx context.Context, nodeID int64) (types.QueryNodeClient, error) {
|
|
ret := _m.Called(ctx, nodeID)
|
|
|
|
var r0 types.QueryNodeClient
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, int64) (types.QueryNodeClient, error)); ok {
|
|
return rf(ctx, nodeID)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, int64) types.QueryNodeClient); ok {
|
|
r0 = rf(ctx, nodeID)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(types.QueryNodeClient)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, int64) error); ok {
|
|
r1 = rf(ctx, nodeID)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// MockShardClientManager_GetClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetClient'
|
|
type MockShardClientManager_GetClient_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// GetClient is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - nodeID int64
|
|
func (_e *MockShardClientManager_Expecter) GetClient(ctx interface{}, nodeID interface{}) *MockShardClientManager_GetClient_Call {
|
|
return &MockShardClientManager_GetClient_Call{Call: _e.mock.On("GetClient", ctx, nodeID)}
|
|
}
|
|
|
|
func (_c *MockShardClientManager_GetClient_Call) Run(run func(ctx context.Context, nodeID int64)) *MockShardClientManager_GetClient_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(int64))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockShardClientManager_GetClient_Call) Return(_a0 types.QueryNodeClient, _a1 error) *MockShardClientManager_GetClient_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockShardClientManager_GetClient_Call) RunAndReturn(run func(context.Context, int64) (types.QueryNodeClient, error)) *MockShardClientManager_GetClient_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// SetClientCreatorFunc provides a mock function with given fields: creator
|
|
func (_m *MockShardClientManager) SetClientCreatorFunc(creator queryNodeCreatorFunc) {
|
|
_m.Called(creator)
|
|
}
|
|
|
|
// MockShardClientManager_SetClientCreatorFunc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetClientCreatorFunc'
|
|
type MockShardClientManager_SetClientCreatorFunc_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// SetClientCreatorFunc is a helper method to define mock.On call
|
|
// - creator queryNodeCreatorFunc
|
|
func (_e *MockShardClientManager_Expecter) SetClientCreatorFunc(creator interface{}) *MockShardClientManager_SetClientCreatorFunc_Call {
|
|
return &MockShardClientManager_SetClientCreatorFunc_Call{Call: _e.mock.On("SetClientCreatorFunc", creator)}
|
|
}
|
|
|
|
func (_c *MockShardClientManager_SetClientCreatorFunc_Call) Run(run func(creator queryNodeCreatorFunc)) *MockShardClientManager_SetClientCreatorFunc_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(queryNodeCreatorFunc))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockShardClientManager_SetClientCreatorFunc_Call) Return() *MockShardClientManager_SetClientCreatorFunc_Call {
|
|
_c.Call.Return()
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockShardClientManager_SetClientCreatorFunc_Call) RunAndReturn(run func(queryNodeCreatorFunc)) *MockShardClientManager_SetClientCreatorFunc_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// UpdateShardLeaders provides a mock function with given fields: oldLeaders, newLeaders
|
|
func (_m *MockShardClientManager) UpdateShardLeaders(oldLeaders map[string][]nodeInfo, newLeaders map[string][]nodeInfo) error {
|
|
ret := _m.Called(oldLeaders, newLeaders)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(map[string][]nodeInfo, map[string][]nodeInfo) error); ok {
|
|
r0 = rf(oldLeaders, newLeaders)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// MockShardClientManager_UpdateShardLeaders_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateShardLeaders'
|
|
type MockShardClientManager_UpdateShardLeaders_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// UpdateShardLeaders is a helper method to define mock.On call
|
|
// - oldLeaders map[string][]nodeInfo
|
|
// - newLeaders map[string][]nodeInfo
|
|
func (_e *MockShardClientManager_Expecter) UpdateShardLeaders(oldLeaders interface{}, newLeaders interface{}) *MockShardClientManager_UpdateShardLeaders_Call {
|
|
return &MockShardClientManager_UpdateShardLeaders_Call{Call: _e.mock.On("UpdateShardLeaders", oldLeaders, newLeaders)}
|
|
}
|
|
|
|
func (_c *MockShardClientManager_UpdateShardLeaders_Call) Run(run func(oldLeaders map[string][]nodeInfo, newLeaders map[string][]nodeInfo)) *MockShardClientManager_UpdateShardLeaders_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(map[string][]nodeInfo), args[1].(map[string][]nodeInfo))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockShardClientManager_UpdateShardLeaders_Call) Return(_a0 error) *MockShardClientManager_UpdateShardLeaders_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockShardClientManager_UpdateShardLeaders_Call) RunAndReturn(run func(map[string][]nodeInfo, map[string][]nodeInfo) error) *MockShardClientManager_UpdateShardLeaders_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// NewMockShardClientManager creates a new instance of MockShardClientManager. 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 NewMockShardClientManager(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *MockShardClientManager {
|
|
mock := &MockShardClientManager{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|