// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "io" "bnema.dev/ermite/internal/domain" "bnema.dev/ermite/internal/ports" mock "github.com/stretchr/testify/mock" ) // NewBrowseService creates a new instance of BrowseService. 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 NewBrowseService(t interface { mock.TestingT Cleanup(func()) }) *BrowseService { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &BrowseService{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // BrowseService is an autogenerated mock type for the BrowseService type type BrowseService struct { mock.Mock } type BrowseService_Expecter struct { mock *mock.Mock } func (_m *BrowseService) EXPECT() *BrowseService_Expecter { return &BrowseService_Expecter{mock: &_m.Mock} } // GetCommit provides a mock function for the type BrowseService func (_mock *BrowseService) GetCommit(ctx context.Context, p domain.Principal, repo domain.RepoName, rev domain.Revision) (domain.CommitDetail, error) { ret := _mock.Called(ctx, p, repo, rev) if len(ret) == 0 { panic("no return value specified for GetCommit") } var r0 domain.CommitDetail var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, domain.Revision) (domain.CommitDetail, error)); ok { return returnFunc(ctx, p, repo, rev) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, domain.Revision) domain.CommitDetail); ok { r0 = returnFunc(ctx, p, repo, rev) } else { r0 = ret.Get(0).(domain.CommitDetail) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, domain.Revision) error); ok { r1 = returnFunc(ctx, p, repo, rev) } else { r1 = ret.Error(1) } return r0, r1 } // BrowseService_GetCommit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCommit' type BrowseService_GetCommit_Call struct { *mock.Call } // GetCommit is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - repo domain.RepoName // - rev domain.Revision func (_e *BrowseService_Expecter) GetCommit(ctx any, p any, repo any, rev any) *BrowseService_GetCommit_Call { return &BrowseService_GetCommit_Call{Call: _e.mock.On("GetCommit", ctx, p, repo, rev)} } func (_c *BrowseService_GetCommit_Call) Run(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, rev domain.Revision)) *BrowseService_GetCommit_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.Revision if args[3] != nil { arg3 = args[3].(domain.Revision) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *BrowseService_GetCommit_Call) Return(commitDetail domain.CommitDetail, err error) *BrowseService_GetCommit_Call { _c.Call.Return(commitDetail, err) return _c } func (_c *BrowseService_GetCommit_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, rev domain.Revision) (domain.CommitDetail, error)) *BrowseService_GetCommit_Call { _c.Call.Return(run) return _c } // GetTree provides a mock function for the type BrowseService func (_mock *BrowseService) GetTree(ctx context.Context, p domain.Principal, repo domain.RepoName, rev domain.Revision, path domain.TreePath, includeLastCommit bool) (domain.Tree, error) { ret := _mock.Called(ctx, p, repo, rev, path, includeLastCommit) if len(ret) == 0 { panic("no return value specified for GetTree") } var r0 domain.Tree var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, domain.Revision, domain.TreePath, bool) (domain.Tree, error)); ok { return returnFunc(ctx, p, repo, rev, path, includeLastCommit) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, domain.Revision, domain.TreePath, bool) domain.Tree); ok { r0 = returnFunc(ctx, p, repo, rev, path, includeLastCommit) } else { r0 = ret.Get(0).(domain.Tree) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, domain.Revision, domain.TreePath, bool) error); ok { r1 = returnFunc(ctx, p, repo, rev, path, includeLastCommit) } else { r1 = ret.Error(1) } return r0, r1 } // BrowseService_GetTree_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTree' type BrowseService_GetTree_Call struct { *mock.Call } // GetTree is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - repo domain.RepoName // - rev domain.Revision // - path domain.TreePath // - includeLastCommit bool func (_e *BrowseService_Expecter) GetTree(ctx any, p any, repo any, rev any, path any, includeLastCommit any) *BrowseService_GetTree_Call { return &BrowseService_GetTree_Call{Call: _e.mock.On("GetTree", ctx, p, repo, rev, path, includeLastCommit)} } func (_c *BrowseService_GetTree_Call) Run(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, rev domain.Revision, path domain.TreePath, includeLastCommit bool)) *BrowseService_GetTree_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.Revision if args[3] != nil { arg3 = args[3].(domain.Revision) } var arg4 domain.TreePath if args[4] != nil { arg4 = args[4].(domain.TreePath) } var arg5 bool if args[5] != nil { arg5 = args[5].(bool) } run( arg0, arg1, arg2, arg3, arg4, arg5, ) }) return _c } func (_c *BrowseService_GetTree_Call) Return(tree domain.Tree, err error) *BrowseService_GetTree_Call { _c.Call.Return(tree, err) return _c } func (_c *BrowseService_GetTree_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, rev domain.Revision, path domain.TreePath, includeLastCommit bool) (domain.Tree, error)) *BrowseService_GetTree_Call { _c.Call.Return(run) return _c } // ListCommits provides a mock function for the type BrowseService func (_mock *BrowseService) ListCommits(ctx context.Context, p domain.Principal, repo domain.RepoName, params ports.ListCommitsParams) (ports.HistoryPage, error) { ret := _mock.Called(ctx, p, repo, params) if len(ret) == 0 { panic("no return value specified for ListCommits") } var r0 ports.HistoryPage var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, ports.ListCommitsParams) (ports.HistoryPage, error)); ok { return returnFunc(ctx, p, repo, params) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, ports.ListCommitsParams) ports.HistoryPage); ok { r0 = returnFunc(ctx, p, repo, params) } else { r0 = ret.Get(0).(ports.HistoryPage) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, ports.ListCommitsParams) error); ok { r1 = returnFunc(ctx, p, repo, params) } else { r1 = ret.Error(1) } return r0, r1 } // BrowseService_ListCommits_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListCommits' type BrowseService_ListCommits_Call struct { *mock.Call } // ListCommits is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - repo domain.RepoName // - params ports.ListCommitsParams func (_e *BrowseService_Expecter) ListCommits(ctx any, p any, repo any, params any) *BrowseService_ListCommits_Call { return &BrowseService_ListCommits_Call{Call: _e.mock.On("ListCommits", ctx, p, repo, params)} } func (_c *BrowseService_ListCommits_Call) Run(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, params ports.ListCommitsParams)) *BrowseService_ListCommits_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.ListCommitsParams if args[3] != nil { arg3 = args[3].(ports.ListCommitsParams) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *BrowseService_ListCommits_Call) Return(historyPage ports.HistoryPage, err error) *BrowseService_ListCommits_Call { _c.Call.Return(historyPage, err) return _c } func (_c *BrowseService_ListCommits_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, params ports.ListCommitsParams) (ports.HistoryPage, error)) *BrowseService_ListCommits_Call { _c.Call.Return(run) return _c } // ListPaths provides a mock function for the type BrowseService func (_mock *BrowseService) ListPaths(ctx context.Context, p domain.Principal, repo domain.RepoName, rev domain.Revision) (domain.PathList, error) { ret := _mock.Called(ctx, p, repo, rev) if len(ret) == 0 { panic("no return value specified for ListPaths") } var r0 domain.PathList var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, domain.Revision) (domain.PathList, error)); ok { return returnFunc(ctx, p, repo, rev) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, domain.Revision) domain.PathList); ok { r0 = returnFunc(ctx, p, repo, rev) } else { r0 = ret.Get(0).(domain.PathList) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, domain.Revision) error); ok { r1 = returnFunc(ctx, p, repo, rev) } else { r1 = ret.Error(1) } return r0, r1 } // BrowseService_ListPaths_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListPaths' type BrowseService_ListPaths_Call struct { *mock.Call } // ListPaths is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - repo domain.RepoName // - rev domain.Revision func (_e *BrowseService_Expecter) ListPaths(ctx any, p any, repo any, rev any) *BrowseService_ListPaths_Call { return &BrowseService_ListPaths_Call{Call: _e.mock.On("ListPaths", ctx, p, repo, rev)} } func (_c *BrowseService_ListPaths_Call) Run(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, rev domain.Revision)) *BrowseService_ListPaths_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.Revision if args[3] != nil { arg3 = args[3].(domain.Revision) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *BrowseService_ListPaths_Call) Return(pathList domain.PathList, err error) *BrowseService_ListPaths_Call { _c.Call.Return(pathList, err) return _c } func (_c *BrowseService_ListPaths_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, rev domain.Revision) (domain.PathList, error)) *BrowseService_ListPaths_Call { _c.Call.Return(run) return _c } // ListRefs provides a mock function for the type BrowseService func (_mock *BrowseService) ListRefs(ctx context.Context, p domain.Principal, repo domain.RepoName, params ports.ListRefsParams) (ports.RefPage, error) { ret := _mock.Called(ctx, p, repo, params) if len(ret) == 0 { panic("no return value specified for ListRefs") } var r0 ports.RefPage var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, ports.ListRefsParams) (ports.RefPage, error)); ok { return returnFunc(ctx, p, repo, params) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, ports.ListRefsParams) ports.RefPage); ok { r0 = returnFunc(ctx, p, repo, params) } else { r0 = ret.Get(0).(ports.RefPage) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, ports.ListRefsParams) error); ok { r1 = returnFunc(ctx, p, repo, params) } else { r1 = ret.Error(1) } return r0, r1 } // BrowseService_ListRefs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListRefs' type BrowseService_ListRefs_Call struct { *mock.Call } // ListRefs is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - repo domain.RepoName // - params ports.ListRefsParams func (_e *BrowseService_Expecter) ListRefs(ctx any, p any, repo any, params any) *BrowseService_ListRefs_Call { return &BrowseService_ListRefs_Call{Call: _e.mock.On("ListRefs", ctx, p, repo, params)} } func (_c *BrowseService_ListRefs_Call) Run(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, params ports.ListRefsParams)) *BrowseService_ListRefs_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.ListRefsParams if args[3] != nil { arg3 = args[3].(ports.ListRefsParams) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *BrowseService_ListRefs_Call) Return(refPage ports.RefPage, err error) *BrowseService_ListRefs_Call { _c.Call.Return(refPage, err) return _c } func (_c *BrowseService_ListRefs_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, params ports.ListRefsParams) (ports.RefPage, error)) *BrowseService_ListRefs_Call { _c.Call.Return(run) return _c } // OpenBlob provides a mock function for the type BrowseService func (_mock *BrowseService) OpenBlob(ctx context.Context, p domain.Principal, repo domain.RepoName, rev domain.Revision, path domain.TreePath) (domain.BlobInfo, io.ReadCloser, error) { ret := _mock.Called(ctx, p, repo, rev, path) if len(ret) == 0 { panic("no return value specified for OpenBlob") } var r0 domain.BlobInfo var r1 io.ReadCloser var r2 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, domain.Revision, domain.TreePath) (domain.BlobInfo, io.ReadCloser, error)); ok { return returnFunc(ctx, p, repo, rev, path) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, domain.Revision, domain.TreePath) domain.BlobInfo); ok { r0 = returnFunc(ctx, p, repo, rev, path) } else { r0 = ret.Get(0).(domain.BlobInfo) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, domain.Revision, domain.TreePath) io.ReadCloser); ok { r1 = returnFunc(ctx, p, repo, rev, path) } else { if ret.Get(1) != nil { r1 = ret.Get(1).(io.ReadCloser) } } if returnFunc, ok := ret.Get(2).(func(context.Context, domain.Principal, domain.RepoName, domain.Revision, domain.TreePath) error); ok { r2 = returnFunc(ctx, p, repo, rev, path) } else { r2 = ret.Error(2) } return r0, r1, r2 } // BrowseService_OpenBlob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OpenBlob' type BrowseService_OpenBlob_Call struct { *mock.Call } // OpenBlob is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - repo domain.RepoName // - rev domain.Revision // - path domain.TreePath func (_e *BrowseService_Expecter) OpenBlob(ctx any, p any, repo any, rev any, path any) *BrowseService_OpenBlob_Call { return &BrowseService_OpenBlob_Call{Call: _e.mock.On("OpenBlob", ctx, p, repo, rev, path)} } func (_c *BrowseService_OpenBlob_Call) Run(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, rev domain.Revision, path domain.TreePath)) *BrowseService_OpenBlob_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.Revision if args[3] != nil { arg3 = args[3].(domain.Revision) } var arg4 domain.TreePath if args[4] != nil { arg4 = args[4].(domain.TreePath) } run( arg0, arg1, arg2, arg3, arg4, ) }) return _c } func (_c *BrowseService_OpenBlob_Call) Return(blobInfo domain.BlobInfo, readCloser io.ReadCloser, err error) *BrowseService_OpenBlob_Call { _c.Call.Return(blobInfo, readCloser, err) return _c } func (_c *BrowseService_OpenBlob_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, rev domain.Revision, path domain.TreePath) (domain.BlobInfo, io.ReadCloser, error)) *BrowseService_OpenBlob_Call { _c.Call.Return(run) return _c } // ResolveRevision provides a mock function for the type BrowseService func (_mock *BrowseService) ResolveRevision(ctx context.Context, p domain.Principal, repo domain.RepoName, rev domain.Revision) (domain.ResolvedRevision, error) { ret := _mock.Called(ctx, p, repo, rev) if len(ret) == 0 { panic("no return value specified for ResolveRevision") } var r0 domain.ResolvedRevision var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, domain.Revision) (domain.ResolvedRevision, error)); ok { return returnFunc(ctx, p, repo, rev) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, domain.Revision) domain.ResolvedRevision); ok { r0 = returnFunc(ctx, p, repo, rev) } else { r0 = ret.Get(0).(domain.ResolvedRevision) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, domain.Revision) error); ok { r1 = returnFunc(ctx, p, repo, rev) } else { r1 = ret.Error(1) } return r0, r1 } // BrowseService_ResolveRevision_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResolveRevision' type BrowseService_ResolveRevision_Call struct { *mock.Call } // ResolveRevision is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - repo domain.RepoName // - rev domain.Revision func (_e *BrowseService_Expecter) ResolveRevision(ctx any, p any, repo any, rev any) *BrowseService_ResolveRevision_Call { return &BrowseService_ResolveRevision_Call{Call: _e.mock.On("ResolveRevision", ctx, p, repo, rev)} } func (_c *BrowseService_ResolveRevision_Call) Run(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, rev domain.Revision)) *BrowseService_ResolveRevision_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.Revision if args[3] != nil { arg3 = args[3].(domain.Revision) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *BrowseService_ResolveRevision_Call) Return(resolvedRevision domain.ResolvedRevision, err error) *BrowseService_ResolveRevision_Call { _c.Call.Return(resolvedRevision, err) return _c } func (_c *BrowseService_ResolveRevision_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, rev domain.Revision) (domain.ResolvedRevision, error)) *BrowseService_ResolveRevision_Call { _c.Call.Return(run) return _c }