milvus/internal/mocks/streamingnode/server/mock_flusher/mock_FlushMsgHandler.go

181 lines
6.6 KiB
Go

// Code generated by mockery v2.46.0. DO NOT EDIT.
package mock_flusher
import (
context "context"
"github.com/milvus-io/milvus/pkg/v2/streaming/util/message"
mock "github.com/stretchr/testify/mock"
)
// MockFlushMsgHandler is an autogenerated mock type for the FlushMsgHandler type
type MockFlushMsgHandler struct {
mock.Mock
}
type MockFlushMsgHandler_Expecter struct {
mock *mock.Mock
}
func (_m *MockFlushMsgHandler) EXPECT() *MockFlushMsgHandler_Expecter {
return &MockFlushMsgHandler_Expecter{mock: &_m.Mock}
}
// HandleCreateSegment provides a mock function with given fields: ctx, vchannel, createSegmentMsg
func (_m *MockFlushMsgHandler) HandleCreateSegment(ctx context.Context, vchannel string, createSegmentMsg message.ImmutableCreateSegmentMessageV2) error {
ret := _m.Called(ctx, vchannel, createSegmentMsg)
if len(ret) == 0 {
panic("no return value specified for HandleCreateSegment")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, message.ImmutableCreateSegmentMessageV2) error); ok {
r0 = rf(ctx, vchannel, createSegmentMsg)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockFlushMsgHandler_HandleCreateSegment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HandleCreateSegment'
type MockFlushMsgHandler_HandleCreateSegment_Call struct {
*mock.Call
}
// HandleCreateSegment is a helper method to define mock.On call
// - ctx context.Context
// - vchannel string
// - createSegmentMsg message.specializedImmutableMessage[*messagespb.CreateSegmentMessageHeader,*messagespb.CreateSegmentMessageBody]
func (_e *MockFlushMsgHandler_Expecter) HandleCreateSegment(ctx interface{}, vchannel interface{}, createSegmentMsg interface{}) *MockFlushMsgHandler_HandleCreateSegment_Call {
return &MockFlushMsgHandler_HandleCreateSegment_Call{Call: _e.mock.On("HandleCreateSegment", ctx, vchannel, createSegmentMsg)}
}
func (_c *MockFlushMsgHandler_HandleCreateSegment_Call) Run(run func(ctx context.Context, vchannel string, createSegmentMsg message.ImmutableCreateSegmentMessageV2)) *MockFlushMsgHandler_HandleCreateSegment_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string), args[2].(message.ImmutableCreateSegmentMessageV2))
})
return _c
}
func (_c *MockFlushMsgHandler_HandleCreateSegment_Call) Return(_a0 error) *MockFlushMsgHandler_HandleCreateSegment_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockFlushMsgHandler_HandleCreateSegment_Call) RunAndReturn(run func(context.Context, string, message.ImmutableCreateSegmentMessageV2) error) *MockFlushMsgHandler_HandleCreateSegment_Call {
_c.Call.Return(run)
return _c
}
// HandleFlush provides a mock function with given fields: vchannel, flushMsg
func (_m *MockFlushMsgHandler) HandleFlush(vchannel string, flushMsg message.ImmutableFlushMessageV2) error {
ret := _m.Called(vchannel, flushMsg)
if len(ret) == 0 {
panic("no return value specified for HandleFlush")
}
var r0 error
if rf, ok := ret.Get(0).(func(string, message.ImmutableFlushMessageV2) error); ok {
r0 = rf(vchannel, flushMsg)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockFlushMsgHandler_HandleFlush_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HandleFlush'
type MockFlushMsgHandler_HandleFlush_Call struct {
*mock.Call
}
// HandleFlush is a helper method to define mock.On call
// - vchannel string
// - flushMsg message.specializedImmutableMessage[*messagespb.FlushMessageHeader,*messagespb.FlushMessageBody]
func (_e *MockFlushMsgHandler_Expecter) HandleFlush(vchannel interface{}, flushMsg interface{}) *MockFlushMsgHandler_HandleFlush_Call {
return &MockFlushMsgHandler_HandleFlush_Call{Call: _e.mock.On("HandleFlush", vchannel, flushMsg)}
}
func (_c *MockFlushMsgHandler_HandleFlush_Call) Run(run func(vchannel string, flushMsg message.ImmutableFlushMessageV2)) *MockFlushMsgHandler_HandleFlush_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(string), args[1].(message.ImmutableFlushMessageV2))
})
return _c
}
func (_c *MockFlushMsgHandler_HandleFlush_Call) Return(_a0 error) *MockFlushMsgHandler_HandleFlush_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockFlushMsgHandler_HandleFlush_Call) RunAndReturn(run func(string, message.ImmutableFlushMessageV2) error) *MockFlushMsgHandler_HandleFlush_Call {
_c.Call.Return(run)
return _c
}
// HandleManualFlush provides a mock function with given fields: vchannel, flushMsg
func (_m *MockFlushMsgHandler) HandleManualFlush(vchannel string, flushMsg message.ImmutableManualFlushMessageV2) error {
ret := _m.Called(vchannel, flushMsg)
if len(ret) == 0 {
panic("no return value specified for HandleManualFlush")
}
var r0 error
if rf, ok := ret.Get(0).(func(string, message.ImmutableManualFlushMessageV2) error); ok {
r0 = rf(vchannel, flushMsg)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockFlushMsgHandler_HandleManualFlush_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HandleManualFlush'
type MockFlushMsgHandler_HandleManualFlush_Call struct {
*mock.Call
}
// HandleManualFlush is a helper method to define mock.On call
// - vchannel string
// - flushMsg message.specializedImmutableMessage[*messagespb.ManualFlushMessageHeader,*messagespb.ManualFlushMessageBody]
func (_e *MockFlushMsgHandler_Expecter) HandleManualFlush(vchannel interface{}, flushMsg interface{}) *MockFlushMsgHandler_HandleManualFlush_Call {
return &MockFlushMsgHandler_HandleManualFlush_Call{Call: _e.mock.On("HandleManualFlush", vchannel, flushMsg)}
}
func (_c *MockFlushMsgHandler_HandleManualFlush_Call) Run(run func(vchannel string, flushMsg message.ImmutableManualFlushMessageV2)) *MockFlushMsgHandler_HandleManualFlush_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(string), args[1].(message.ImmutableManualFlushMessageV2))
})
return _c
}
func (_c *MockFlushMsgHandler_HandleManualFlush_Call) Return(_a0 error) *MockFlushMsgHandler_HandleManualFlush_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockFlushMsgHandler_HandleManualFlush_Call) RunAndReturn(run func(string, message.ImmutableManualFlushMessageV2) error) *MockFlushMsgHandler_HandleManualFlush_Call {
_c.Call.Return(run)
return _c
}
// NewMockFlushMsgHandler creates a new instance of MockFlushMsgHandler. 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 NewMockFlushMsgHandler(t interface {
mock.TestingT
Cleanup(func())
}) *MockFlushMsgHandler {
mock := &MockFlushMsgHandler{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}