// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "bnema.dev/ermite/internal/domain" mock "github.com/stretchr/testify/mock" ) // NewIssueLinkStore creates a new instance of IssueLinkStore. 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 NewIssueLinkStore(t interface { mock.TestingT Cleanup(func()) }) *IssueLinkStore { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &IssueLinkStore{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // IssueLinkStore is an autogenerated mock type for the IssueLinkStore type type IssueLinkStore struct { mock.Mock } type IssueLinkStore_Expecter struct { mock *mock.Mock } func (_m *IssueLinkStore) EXPECT() *IssueLinkStore_Expecter { return &IssueLinkStore_Expecter{mock: &_m.Mock} } // LinksOfIssue provides a mock function for the type IssueLinkStore func (_mock *IssueLinkStore) LinksOfIssue(ctx context.Context, repo domain.RepoName, issue int64, limit int) ([]domain.IssueLink, error) { ret := _mock.Called(ctx, repo, issue, limit) if len(ret) == 0 { panic("no return value specified for LinksOfIssue") } var r0 []domain.IssueLink var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, int64, int) ([]domain.IssueLink, error)); ok { return returnFunc(ctx, repo, issue, limit) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, int64, int) []domain.IssueLink); ok { r0 = returnFunc(ctx, repo, issue, limit) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]domain.IssueLink) } } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, int64, int) error); ok { r1 = returnFunc(ctx, repo, issue, limit) } else { r1 = ret.Error(1) } return r0, r1 } // IssueLinkStore_LinksOfIssue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LinksOfIssue' type IssueLinkStore_LinksOfIssue_Call struct { *mock.Call } // LinksOfIssue is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - issue int64 // - limit int func (_e *IssueLinkStore_Expecter) LinksOfIssue(ctx any, repo any, issue any, limit any) *IssueLinkStore_LinksOfIssue_Call { return &IssueLinkStore_LinksOfIssue_Call{Call: _e.mock.On("LinksOfIssue", ctx, repo, issue, limit)} } func (_c *IssueLinkStore_LinksOfIssue_Call) Run(run func(ctx context.Context, repo domain.RepoName, issue int64, limit int)) *IssueLinkStore_LinksOfIssue_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.RepoName if args[1] != nil { arg1 = args[1].(domain.RepoName) } var arg2 int64 if args[2] != nil { arg2 = args[2].(int64) } var arg3 int if args[3] != nil { arg3 = args[3].(int) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *IssueLinkStore_LinksOfIssue_Call) Return(issueLinks []domain.IssueLink, err error) *IssueLinkStore_LinksOfIssue_Call { _c.Call.Return(issueLinks, err) return _c } func (_c *IssueLinkStore_LinksOfIssue_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, issue int64, limit int) ([]domain.IssueLink, error)) *IssueLinkStore_LinksOfIssue_Call { _c.Call.Return(run) return _c } // LinksOfMergeRequest provides a mock function for the type IssueLinkStore func (_mock *IssueLinkStore) LinksOfMergeRequest(ctx context.Context, repo domain.RepoName, mr int64) ([]domain.IssueLink, error) { ret := _mock.Called(ctx, repo, mr) if len(ret) == 0 { panic("no return value specified for LinksOfMergeRequest") } var r0 []domain.IssueLink var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, int64) ([]domain.IssueLink, error)); ok { return returnFunc(ctx, repo, mr) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, int64) []domain.IssueLink); ok { r0 = returnFunc(ctx, repo, mr) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]domain.IssueLink) } } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, int64) error); ok { r1 = returnFunc(ctx, repo, mr) } else { r1 = ret.Error(1) } return r0, r1 } // IssueLinkStore_LinksOfMergeRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LinksOfMergeRequest' type IssueLinkStore_LinksOfMergeRequest_Call struct { *mock.Call } // LinksOfMergeRequest is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - mr int64 func (_e *IssueLinkStore_Expecter) LinksOfMergeRequest(ctx any, repo any, mr any) *IssueLinkStore_LinksOfMergeRequest_Call { return &IssueLinkStore_LinksOfMergeRequest_Call{Call: _e.mock.On("LinksOfMergeRequest", ctx, repo, mr)} } func (_c *IssueLinkStore_LinksOfMergeRequest_Call) Run(run func(ctx context.Context, repo domain.RepoName, mr int64)) *IssueLinkStore_LinksOfMergeRequest_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.RepoName if args[1] != nil { arg1 = args[1].(domain.RepoName) } var arg2 int64 if args[2] != nil { arg2 = args[2].(int64) } run( arg0, arg1, arg2, ) }) return _c } func (_c *IssueLinkStore_LinksOfMergeRequest_Call) Return(issueLinks []domain.IssueLink, err error) *IssueLinkStore_LinksOfMergeRequest_Call { _c.Call.Return(issueLinks, err) return _c } func (_c *IssueLinkStore_LinksOfMergeRequest_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, mr int64) ([]domain.IssueLink, error)) *IssueLinkStore_LinksOfMergeRequest_Call { _c.Call.Return(run) return _c } // ReplaceLinks provides a mock function for the type IssueLinkStore func (_mock *IssueLinkStore) ReplaceLinks(ctx context.Context, repo domain.RepoName, mr int64, issues []int64, closes []int64) ([]domain.IssueLink, []domain.IssueLink, error) { ret := _mock.Called(ctx, repo, mr, issues, closes) if len(ret) == 0 { panic("no return value specified for ReplaceLinks") } var r0 []domain.IssueLink var r1 []domain.IssueLink var r2 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, int64, []int64, []int64) ([]domain.IssueLink, []domain.IssueLink, error)); ok { return returnFunc(ctx, repo, mr, issues, closes) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, int64, []int64, []int64) []domain.IssueLink); ok { r0 = returnFunc(ctx, repo, mr, issues, closes) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]domain.IssueLink) } } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, int64, []int64, []int64) []domain.IssueLink); ok { r1 = returnFunc(ctx, repo, mr, issues, closes) } else { if ret.Get(1) != nil { r1 = ret.Get(1).([]domain.IssueLink) } } if returnFunc, ok := ret.Get(2).(func(context.Context, domain.RepoName, int64, []int64, []int64) error); ok { r2 = returnFunc(ctx, repo, mr, issues, closes) } else { r2 = ret.Error(2) } return r0, r1, r2 } // IssueLinkStore_ReplaceLinks_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReplaceLinks' type IssueLinkStore_ReplaceLinks_Call struct { *mock.Call } // ReplaceLinks is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - mr int64 // - issues []int64 // - closes []int64 func (_e *IssueLinkStore_Expecter) ReplaceLinks(ctx any, repo any, mr any, issues any, closes any) *IssueLinkStore_ReplaceLinks_Call { return &IssueLinkStore_ReplaceLinks_Call{Call: _e.mock.On("ReplaceLinks", ctx, repo, mr, issues, closes)} } func (_c *IssueLinkStore_ReplaceLinks_Call) Run(run func(ctx context.Context, repo domain.RepoName, mr int64, issues []int64, closes []int64)) *IssueLinkStore_ReplaceLinks_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.RepoName if args[1] != nil { arg1 = args[1].(domain.RepoName) } var arg2 int64 if args[2] != nil { arg2 = args[2].(int64) } var arg3 []int64 if args[3] != nil { arg3 = args[3].([]int64) } var arg4 []int64 if args[4] != nil { arg4 = args[4].([]int64) } run( arg0, arg1, arg2, arg3, arg4, ) }) return _c } func (_c *IssueLinkStore_ReplaceLinks_Call) Return(added []domain.IssueLink, removed []domain.IssueLink, err error) *IssueLinkStore_ReplaceLinks_Call { _c.Call.Return(added, removed, err) return _c } func (_c *IssueLinkStore_ReplaceLinks_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, mr int64, issues []int64, closes []int64) ([]domain.IssueLink, []domain.IssueLink, error)) *IssueLinkStore_ReplaceLinks_Call { _c.Call.Return(run) return _c }