router/pkg/pubsub/kafka/mocks.go (195 lines of code) (raw):

// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package kafka import ( "context" mock "github.com/stretchr/testify/mock" "github.com/wundergraph/graphql-go-tools/v2/pkg/engine/resolve" ) // NewMockAdapter creates a new instance of MockAdapter. 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 NewMockAdapter(t interface { mock.TestingT Cleanup(func()) }) *MockAdapter { mock := &MockAdapter{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockAdapter is an autogenerated mock type for the Adapter type type MockAdapter struct { mock.Mock } type MockAdapter_Expecter struct { mock *mock.Mock } func (_m *MockAdapter) EXPECT() *MockAdapter_Expecter { return &MockAdapter_Expecter{mock: &_m.Mock} } // Publish provides a mock function for the type MockAdapter func (_mock *MockAdapter) Publish(ctx context.Context, event PublishEventConfiguration) error { ret := _mock.Called(ctx, event) if len(ret) == 0 { panic("no return value specified for Publish") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, PublishEventConfiguration) error); ok { r0 = returnFunc(ctx, event) } else { r0 = ret.Error(0) } return r0 } // MockAdapter_Publish_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Publish' type MockAdapter_Publish_Call struct { *mock.Call } // Publish is a helper method to define mock.On call // - ctx context.Context // - event PublishEventConfiguration func (_e *MockAdapter_Expecter) Publish(ctx interface{}, event interface{}) *MockAdapter_Publish_Call { return &MockAdapter_Publish_Call{Call: _e.mock.On("Publish", ctx, event)} } func (_c *MockAdapter_Publish_Call) Run(run func(ctx context.Context, event PublishEventConfiguration)) *MockAdapter_Publish_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 PublishEventConfiguration if args[1] != nil { arg1 = args[1].(PublishEventConfiguration) } run( arg0, arg1, ) }) return _c } func (_c *MockAdapter_Publish_Call) Return(err error) *MockAdapter_Publish_Call { _c.Call.Return(err) return _c } func (_c *MockAdapter_Publish_Call) RunAndReturn(run func(ctx context.Context, event PublishEventConfiguration) error) *MockAdapter_Publish_Call { _c.Call.Return(run) return _c } // Shutdown provides a mock function for the type MockAdapter func (_mock *MockAdapter) Shutdown(ctx context.Context) error { ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for Shutdown") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok { r0 = returnFunc(ctx) } else { r0 = ret.Error(0) } return r0 } // MockAdapter_Shutdown_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Shutdown' type MockAdapter_Shutdown_Call struct { *mock.Call } // Shutdown is a helper method to define mock.On call // - ctx context.Context func (_e *MockAdapter_Expecter) Shutdown(ctx interface{}) *MockAdapter_Shutdown_Call { return &MockAdapter_Shutdown_Call{Call: _e.mock.On("Shutdown", ctx)} } func (_c *MockAdapter_Shutdown_Call) Run(run func(ctx context.Context)) *MockAdapter_Shutdown_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } run( arg0, ) }) return _c } func (_c *MockAdapter_Shutdown_Call) Return(err error) *MockAdapter_Shutdown_Call { _c.Call.Return(err) return _c } func (_c *MockAdapter_Shutdown_Call) RunAndReturn(run func(ctx context.Context) error) *MockAdapter_Shutdown_Call { _c.Call.Return(run) return _c } // Startup provides a mock function for the type MockAdapter func (_mock *MockAdapter) Startup(ctx context.Context) error { ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for Startup") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok { r0 = returnFunc(ctx) } else { r0 = ret.Error(0) } return r0 } // MockAdapter_Startup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Startup' type MockAdapter_Startup_Call struct { *mock.Call } // Startup is a helper method to define mock.On call // - ctx context.Context func (_e *MockAdapter_Expecter) Startup(ctx interface{}) *MockAdapter_Startup_Call { return &MockAdapter_Startup_Call{Call: _e.mock.On("Startup", ctx)} } func (_c *MockAdapter_Startup_Call) Run(run func(ctx context.Context)) *MockAdapter_Startup_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } run( arg0, ) }) return _c } func (_c *MockAdapter_Startup_Call) Return(err error) *MockAdapter_Startup_Call { _c.Call.Return(err) return _c } func (_c *MockAdapter_Startup_Call) RunAndReturn(run func(ctx context.Context) error) *MockAdapter_Startup_Call { _c.Call.Return(run) return _c } // Subscribe provides a mock function for the type MockAdapter func (_mock *MockAdapter) Subscribe(ctx context.Context, event SubscriptionEventConfiguration, updater resolve.SubscriptionUpdater) error { ret := _mock.Called(ctx, event, updater) if len(ret) == 0 { panic("no return value specified for Subscribe") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, SubscriptionEventConfiguration, resolve.SubscriptionUpdater) error); ok { r0 = returnFunc(ctx, event, updater) } else { r0 = ret.Error(0) } return r0 } // MockAdapter_Subscribe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Subscribe' type MockAdapter_Subscribe_Call struct { *mock.Call } // Subscribe is a helper method to define mock.On call // - ctx context.Context // - event SubscriptionEventConfiguration // - updater resolve.SubscriptionUpdater func (_e *MockAdapter_Expecter) Subscribe(ctx interface{}, event interface{}, updater interface{}) *MockAdapter_Subscribe_Call { return &MockAdapter_Subscribe_Call{Call: _e.mock.On("Subscribe", ctx, event, updater)} } func (_c *MockAdapter_Subscribe_Call) Run(run func(ctx context.Context, event SubscriptionEventConfiguration, updater resolve.SubscriptionUpdater)) *MockAdapter_Subscribe_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 SubscriptionEventConfiguration if args[1] != nil { arg1 = args[1].(SubscriptionEventConfiguration) } var arg2 resolve.SubscriptionUpdater if args[2] != nil { arg2 = args[2].(resolve.SubscriptionUpdater) } run( arg0, arg1, arg2, ) }) return _c } func (_c *MockAdapter_Subscribe_Call) Return(err error) *MockAdapter_Subscribe_Call { _c.Call.Return(err) return _c } func (_c *MockAdapter_Subscribe_Call) RunAndReturn(run func(ctx context.Context, event SubscriptionEventConfiguration, updater resolve.SubscriptionUpdater) error) *MockAdapter_Subscribe_Call { _c.Call.Return(run) return _c }