// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "github.com/bnema/gordon/internal/domain" mock "github.com/stretchr/testify/mock" ) // NewMockEventPublisher creates a new instance of MockEventPublisher. 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 NewMockEventPublisher(t interface { mock.TestingT Cleanup(func()) }) *MockEventPublisher { mock := &MockEventPublisher{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockEventPublisher is an autogenerated mock type for the EventPublisher type type MockEventPublisher struct { mock.Mock } type MockEventPublisher_Expecter struct { mock *mock.Mock } func (_m *MockEventPublisher) EXPECT() *MockEventPublisher_Expecter { return &MockEventPublisher_Expecter{mock: &_m.Mock} } // Publish provides a mock function for the type MockEventPublisher func (_mock *MockEventPublisher) Publish(eventType domain.EventType, payload any) error { ret := _mock.Called(eventType, payload) if len(ret) == 0 { panic("no return value specified for Publish") } var r0 error if returnFunc, ok := ret.Get(0).(func(domain.EventType, any) error); ok { r0 = returnFunc(eventType, payload) } else { r0 = ret.Error(0) } return r0 } // MockEventPublisher_Publish_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Publish' type MockEventPublisher_Publish_Call struct { *mock.Call } // Publish is a helper method to define mock.On call // - eventType domain.EventType // - payload any func (_e *MockEventPublisher_Expecter) Publish(eventType any, payload any) *MockEventPublisher_Publish_Call { return &MockEventPublisher_Publish_Call{Call: _e.mock.On("Publish", eventType, payload)} } func (_c *MockEventPublisher_Publish_Call) Run(run func(eventType domain.EventType, payload any)) *MockEventPublisher_Publish_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 domain.EventType if args[0] != nil { arg0 = args[0].(domain.EventType) } var arg1 any if args[1] != nil { arg1 = args[1].(any) } run( arg0, arg1, ) }) return _c } func (_c *MockEventPublisher_Publish_Call) Return(err error) *MockEventPublisher_Publish_Call { _c.Call.Return(err) return _c } func (_c *MockEventPublisher_Publish_Call) RunAndReturn(run func(eventType domain.EventType, payload any) error) *MockEventPublisher_Publish_Call { _c.Call.Return(run) return _c }