// 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" ) // NewPushHookService creates a new instance of PushHookService. 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 NewPushHookService(t interface { mock.TestingT Cleanup(func()) }) *PushHookService { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &PushHookService{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // PushHookService is an autogenerated mock type for the PushHookService type type PushHookService struct { mock.Mock } type PushHookService_Expecter struct { mock *mock.Mock } func (_m *PushHookService) EXPECT() *PushHookService_Expecter { return &PushHookService_Expecter{mock: &_m.Mock} } // Check provides a mock function for the type PushHookService func (_mock *PushHookService) Check(ctx context.Context, p domain.Principal, name domain.RepoName, updates []domain.RefUpdate, objects ports.PushObjects) error { ret := _mock.Called(ctx, p, name, updates, objects) if len(ret) == 0 { panic("no return value specified for Check") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, []domain.RefUpdate, ports.PushObjects) error); ok { r0 = returnFunc(ctx, p, name, updates, objects) } else { r0 = ret.Error(0) } return r0 } // PushHookService_Check_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Check' type PushHookService_Check_Call struct { *mock.Call } // Check is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - name domain.RepoName // - updates []domain.RefUpdate // - objects ports.PushObjects func (_e *PushHookService_Expecter) Check(ctx any, p any, name any, updates any, objects any) *PushHookService_Check_Call { return &PushHookService_Check_Call{Call: _e.mock.On("Check", ctx, p, name, updates, objects)} } func (_c *PushHookService_Check_Call) Run(run func(ctx context.Context, p domain.Principal, name domain.RepoName, updates []domain.RefUpdate, objects ports.PushObjects)) *PushHookService_Check_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 domain.RepoName if args[2] != nil { arg2 = args[2].(domain.RepoName) } var arg3 []domain.RefUpdate if args[3] != nil { arg3 = args[3].([]domain.RefUpdate) } var arg4 ports.PushObjects if args[4] != nil { arg4 = args[4].(ports.PushObjects) } run( arg0, arg1, arg2, arg3, arg4, ) }) return _c } func (_c *PushHookService_Check_Call) Return(err error) *PushHookService_Check_Call { _c.Call.Return(err) return _c } func (_c *PushHookService_Check_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, name domain.RepoName, updates []domain.RefUpdate, objects ports.PushObjects) error) *PushHookService_Check_Call { _c.Call.Return(run) return _c } // Record provides a mock function for the type PushHookService func (_mock *PushHookService) Record(ctx context.Context, p domain.Principal, name domain.RepoName, updates []domain.RefUpdate) error { ret := _mock.Called(ctx, p, name, updates) if len(ret) == 0 { panic("no return value specified for Record") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, []domain.RefUpdate) error); ok { r0 = returnFunc(ctx, p, name, updates) } else { r0 = ret.Error(0) } return r0 } // PushHookService_Record_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Record' type PushHookService_Record_Call struct { *mock.Call } // Record is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - name domain.RepoName // - updates []domain.RefUpdate func (_e *PushHookService_Expecter) Record(ctx any, p any, name any, updates any) *PushHookService_Record_Call { return &PushHookService_Record_Call{Call: _e.mock.On("Record", ctx, p, name, updates)} } func (_c *PushHookService_Record_Call) Run(run func(ctx context.Context, p domain.Principal, name domain.RepoName, updates []domain.RefUpdate)) *PushHookService_Record_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 domain.RepoName if args[2] != nil { arg2 = args[2].(domain.RepoName) } var arg3 []domain.RefUpdate if args[3] != nil { arg3 = args[3].([]domain.RefUpdate) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *PushHookService_Record_Call) Return(err error) *PushHookService_Record_Call { _c.Call.Return(err) return _c } func (_c *PushHookService_Record_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, name domain.RepoName, updates []domain.RefUpdate) error) *PushHookService_Record_Call { _c.Call.Return(run) return _c }