// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "bnema.dev/ermite/internal/domain" mock "github.com/stretchr/testify/mock" ) // NewEventBus creates a new instance of EventBus. 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 NewEventBus(t interface { mock.TestingT Cleanup(func()) }) *EventBus { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &EventBus{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // EventBus is an autogenerated mock type for the EventBus type type EventBus struct { mock.Mock } type EventBus_Expecter struct { mock *mock.Mock } func (_m *EventBus) EXPECT() *EventBus_Expecter { return &EventBus_Expecter{mock: &_m.Mock} } // Publish provides a mock function for the type EventBus func (_mock *EventBus) Publish(ctx context.Context, ev domain.Event) { _mock.Called(ctx, ev) return } // EventBus_Publish_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Publish' type EventBus_Publish_Call struct { *mock.Call } // Publish is a helper method to define mock.On call // - ctx context.Context // - ev domain.Event func (_e *EventBus_Expecter) Publish(ctx any, ev any) *EventBus_Publish_Call { return &EventBus_Publish_Call{Call: _e.mock.On("Publish", ctx, ev)} } func (_c *EventBus_Publish_Call) Run(run func(ctx context.Context, ev domain.Event)) *EventBus_Publish_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Event if args[1] != nil { arg1 = args[1].(domain.Event) } run( arg0, arg1, ) }) return _c } func (_c *EventBus_Publish_Call) Return() *EventBus_Publish_Call { _c.Call.Return() return _c } func (_c *EventBus_Publish_Call) RunAndReturn(run func(ctx context.Context, ev domain.Event)) *EventBus_Publish_Call { _c.Run(run) return _c } // Subscribe provides a mock function for the type EventBus func (_mock *EventBus) Subscribe(ctx context.Context) <-chan domain.Event { ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for Subscribe") } var r0 <-chan domain.Event if returnFunc, ok := ret.Get(0).(func(context.Context) <-chan domain.Event); ok { r0 = returnFunc(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(<-chan domain.Event) } } return r0 } // EventBus_Subscribe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Subscribe' type EventBus_Subscribe_Call struct { *mock.Call } // Subscribe is a helper method to define mock.On call // - ctx context.Context func (_e *EventBus_Expecter) Subscribe(ctx any) *EventBus_Subscribe_Call { return &EventBus_Subscribe_Call{Call: _e.mock.On("Subscribe", ctx)} } func (_c *EventBus_Subscribe_Call) Run(run func(ctx context.Context)) *EventBus_Subscribe_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 *EventBus_Subscribe_Call) Return(eventCh <-chan domain.Event) *EventBus_Subscribe_Call { _c.Call.Return(eventCh) return _c } func (_c *EventBus_Subscribe_Call) RunAndReturn(run func(ctx context.Context) <-chan domain.Event) *EventBus_Subscribe_Call { _c.Call.Return(run) return _c }