// 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" ) // NewRepoService creates a new instance of RepoService. 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 NewRepoService(t interface { mock.TestingT Cleanup(func()) }) *RepoService { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &RepoService{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // RepoService is an autogenerated mock type for the RepoService type type RepoService struct { mock.Mock } type RepoService_Expecter struct { mock *mock.Mock } func (_m *RepoService) EXPECT() *RepoService_Expecter { return &RepoService_Expecter{mock: &_m.Mock} } // Create provides a mock function for the type RepoService func (_mock *RepoService) Create(ctx context.Context, p domain.Principal, params ports.CreateRepoParams) (domain.Repo, error) { ret := _mock.Called(ctx, p, params) if len(ret) == 0 { panic("no return value specified for Create") } var r0 domain.Repo var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, ports.CreateRepoParams) (domain.Repo, error)); ok { return returnFunc(ctx, p, params) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, ports.CreateRepoParams) domain.Repo); ok { r0 = returnFunc(ctx, p, params) } else { r0 = ret.Get(0).(domain.Repo) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, ports.CreateRepoParams) error); ok { r1 = returnFunc(ctx, p, params) } else { r1 = ret.Error(1) } return r0, r1 } // RepoService_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' type RepoService_Create_Call struct { *mock.Call } // Create is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - params ports.CreateRepoParams func (_e *RepoService_Expecter) Create(ctx any, p any, params any) *RepoService_Create_Call { return &RepoService_Create_Call{Call: _e.mock.On("Create", ctx, p, params)} } func (_c *RepoService_Create_Call) Run(run func(ctx context.Context, p domain.Principal, params ports.CreateRepoParams)) *RepoService_Create_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.CreateRepoParams if args[2] != nil { arg2 = args[2].(ports.CreateRepoParams) } run( arg0, arg1, arg2, ) }) return _c } func (_c *RepoService_Create_Call) Return(repo domain.Repo, err error) *RepoService_Create_Call { _c.Call.Return(repo, err) return _c } func (_c *RepoService_Create_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, params ports.CreateRepoParams) (domain.Repo, error)) *RepoService_Create_Call { _c.Call.Return(run) return _c } // Delete provides a mock function for the type RepoService func (_mock *RepoService) Delete(ctx context.Context, p domain.Principal, name domain.RepoName) error { ret := _mock.Called(ctx, p, name) if len(ret) == 0 { panic("no return value specified for Delete") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName) error); ok { r0 = returnFunc(ctx, p, name) } else { r0 = ret.Error(0) } return r0 } // RepoService_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' type RepoService_Delete_Call struct { *mock.Call } // Delete is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - name domain.RepoName func (_e *RepoService_Expecter) Delete(ctx any, p any, name any) *RepoService_Delete_Call { return &RepoService_Delete_Call{Call: _e.mock.On("Delete", ctx, p, name)} } func (_c *RepoService_Delete_Call) Run(run func(ctx context.Context, p domain.Principal, name domain.RepoName)) *RepoService_Delete_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) } run( arg0, arg1, arg2, ) }) return _c } func (_c *RepoService_Delete_Call) Return(err error) *RepoService_Delete_Call { _c.Call.Return(err) return _c } func (_c *RepoService_Delete_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, name domain.RepoName) error) *RepoService_Delete_Call { _c.Call.Return(run) return _c } // Get provides a mock function for the type RepoService func (_mock *RepoService) Get(ctx context.Context, p domain.Principal, name domain.RepoName) (domain.Repo, error) { ret := _mock.Called(ctx, p, name) if len(ret) == 0 { panic("no return value specified for Get") } var r0 domain.Repo var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName) (domain.Repo, error)); ok { return returnFunc(ctx, p, name) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName) domain.Repo); ok { r0 = returnFunc(ctx, p, name) } else { r0 = ret.Get(0).(domain.Repo) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName) error); ok { r1 = returnFunc(ctx, p, name) } else { r1 = ret.Error(1) } return r0, r1 } // RepoService_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type RepoService_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - name domain.RepoName func (_e *RepoService_Expecter) Get(ctx any, p any, name any) *RepoService_Get_Call { return &RepoService_Get_Call{Call: _e.mock.On("Get", ctx, p, name)} } func (_c *RepoService_Get_Call) Run(run func(ctx context.Context, p domain.Principal, name domain.RepoName)) *RepoService_Get_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) } run( arg0, arg1, arg2, ) }) return _c } func (_c *RepoService_Get_Call) Return(repo domain.Repo, err error) *RepoService_Get_Call { _c.Call.Return(repo, err) return _c } func (_c *RepoService_Get_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, name domain.RepoName) (domain.Repo, error)) *RepoService_Get_Call { _c.Call.Return(run) return _c } // ListPage provides a mock function for the type RepoService func (_mock *RepoService) ListPage(ctx context.Context, p domain.Principal, size int, token string) (ports.RepoPage, error) { ret := _mock.Called(ctx, p, size, token) if len(ret) == 0 { panic("no return value specified for ListPage") } var r0 ports.RepoPage var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, int, string) (ports.RepoPage, error)); ok { return returnFunc(ctx, p, size, token) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, int, string) ports.RepoPage); ok { r0 = returnFunc(ctx, p, size, token) } else { r0 = ret.Get(0).(ports.RepoPage) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, int, string) error); ok { r1 = returnFunc(ctx, p, size, token) } else { r1 = ret.Error(1) } return r0, r1 } // RepoService_ListPage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListPage' type RepoService_ListPage_Call struct { *mock.Call } // ListPage is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - size int // - token string func (_e *RepoService_Expecter) ListPage(ctx any, p any, size any, token any) *RepoService_ListPage_Call { return &RepoService_ListPage_Call{Call: _e.mock.On("ListPage", ctx, p, size, token)} } func (_c *RepoService_ListPage_Call) Run(run func(ctx context.Context, p domain.Principal, size int, token string)) *RepoService_ListPage_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 int if args[2] != nil { arg2 = args[2].(int) } var arg3 string if args[3] != nil { arg3 = args[3].(string) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *RepoService_ListPage_Call) Return(repoPage ports.RepoPage, err error) *RepoService_ListPage_Call { _c.Call.Return(repoPage, err) return _c } func (_c *RepoService_ListPage_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, size int, token string) (ports.RepoPage, error)) *RepoService_ListPage_Call { _c.Call.Return(run) return _c } // Update provides a mock function for the type RepoService func (_mock *RepoService) Update(ctx context.Context, p domain.Principal, name domain.RepoName, params ports.UpdateRepoParams) (domain.Repo, error) { ret := _mock.Called(ctx, p, name, params) if len(ret) == 0 { panic("no return value specified for Update") } var r0 domain.Repo var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, ports.UpdateRepoParams) (domain.Repo, error)); ok { return returnFunc(ctx, p, name, params) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, ports.UpdateRepoParams) domain.Repo); ok { r0 = returnFunc(ctx, p, name, params) } else { r0 = ret.Get(0).(domain.Repo) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, ports.UpdateRepoParams) error); ok { r1 = returnFunc(ctx, p, name, params) } else { r1 = ret.Error(1) } return r0, r1 } // RepoService_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' type RepoService_Update_Call struct { *mock.Call } // Update is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - name domain.RepoName // - params ports.UpdateRepoParams func (_e *RepoService_Expecter) Update(ctx any, p any, name any, params any) *RepoService_Update_Call { return &RepoService_Update_Call{Call: _e.mock.On("Update", ctx, p, name, params)} } func (_c *RepoService_Update_Call) Run(run func(ctx context.Context, p domain.Principal, name domain.RepoName, params ports.UpdateRepoParams)) *RepoService_Update_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 ports.UpdateRepoParams if args[3] != nil { arg3 = args[3].(ports.UpdateRepoParams) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *RepoService_Update_Call) Return(repo domain.Repo, err error) *RepoService_Update_Call { _c.Call.Return(repo, err) return _c } func (_c *RepoService_Update_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, name domain.RepoName, params ports.UpdateRepoParams) (domain.Repo, error)) *RepoService_Update_Call { _c.Call.Return(run) return _c } // View provides a mock function for the type RepoService func (_mock *RepoService) View(ctx context.Context, repo domain.Repo) (ports.RepoView, error) { ret := _mock.Called(ctx, repo) if len(ret) == 0 { panic("no return value specified for View") } var r0 ports.RepoView var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Repo) (ports.RepoView, error)); ok { return returnFunc(ctx, repo) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Repo) ports.RepoView); ok { r0 = returnFunc(ctx, repo) } else { r0 = ret.Get(0).(ports.RepoView) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Repo) error); ok { r1 = returnFunc(ctx, repo) } else { r1 = ret.Error(1) } return r0, r1 } // RepoService_View_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'View' type RepoService_View_Call struct { *mock.Call } // View is a helper method to define mock.On call // - ctx context.Context // - repo domain.Repo func (_e *RepoService_Expecter) View(ctx any, repo any) *RepoService_View_Call { return &RepoService_View_Call{Call: _e.mock.On("View", ctx, repo)} } func (_c *RepoService_View_Call) Run(run func(ctx context.Context, repo domain.Repo)) *RepoService_View_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Repo if args[1] != nil { arg1 = args[1].(domain.Repo) } run( arg0, arg1, ) }) return _c } func (_c *RepoService_View_Call) Return(repoView ports.RepoView, err error) *RepoService_View_Call { _c.Call.Return(repoView, err) return _c } func (_c *RepoService_View_Call) RunAndReturn(run func(ctx context.Context, repo domain.Repo) (ports.RepoView, error)) *RepoService_View_Call { _c.Call.Return(run) return _c }