// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "bnema.dev/ermite/internal/domain" "bnema.dev/ermite/internal/ports" mock "github.com/stretchr/testify/mock" ) // NewEventService creates a new instance of EventService. 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 NewEventService(t interface { mock.TestingT Cleanup(func()) }) *EventService { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &EventService{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // EventService is an autogenerated mock type for the EventService type type EventService struct { mock.Mock } type EventService_Expecter struct { mock *mock.Mock } func (_m *EventService) EXPECT() *EventService_Expecter { return &EventService_Expecter{mock: &_m.Mock} } // Watch provides a mock function for the type EventService func (_mock *EventService) Watch(ctx context.Context, p domain.Principal, params ports.WatchParams, send func(ports.WatchEvent) error) error { ret := _mock.Called(ctx, p, params, send) if len(ret) == 0 { panic("no return value specified for Watch") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, ports.WatchParams, func(ports.WatchEvent) error) error); ok { r0 = returnFunc(ctx, p, params, send) } else { r0 = ret.Error(0) } return r0 } // EventService_Watch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Watch' type EventService_Watch_Call struct { *mock.Call } // Watch is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - params ports.WatchParams // - send func(ports.WatchEvent) error func (_e *EventService_Expecter) Watch(ctx any, p any, params any, send any) *EventService_Watch_Call { return &EventService_Watch_Call{Call: _e.mock.On("Watch", ctx, p, params, send)} } func (_c *EventService_Watch_Call) Run(run func(ctx context.Context, p domain.Principal, params ports.WatchParams, send func(ports.WatchEvent) error)) *EventService_Watch_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Principal if args[1] != nil { arg1 = args[1].(domain.Principal) } var arg2 ports.WatchParams if args[2] != nil { arg2 = args[2].(ports.WatchParams) } var arg3 func(ports.WatchEvent) error if args[3] != nil { arg3 = args[3].(func(ports.WatchEvent) error) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *EventService_Watch_Call) Return(err error) *EventService_Watch_Call { _c.Call.Return(err) return _c } func (_c *EventService_Watch_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, params ports.WatchParams, send func(ports.WatchEvent) error) error) *EventService_Watch_Call { _c.Call.Return(run) return _c }