1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package mocks
6
7import (
8 "context"
9
10 "bnema.dev/ermite/internal/domain"
11 mock "github.com/stretchr/testify/mock"
12)
13
14// 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.
15// The first argument is typically a *testing.T value.
16func NewIssueLinkStore(t interface {
17 mock.TestingT
18 Cleanup(func())
19}) *IssueLinkStore {
20 if helper, ok := t.(interface{ Helper() }); ok {
21 helper.Helper()
22 }
23
24 mock := &IssueLinkStore{}
25 mock.Mock.Test(t)
26
27 t.Cleanup(func() {
28 if helper, ok := t.(interface{ Helper() }); ok {
29 helper.Helper()
30 }
31 mock.AssertExpectations(t)
32 })
33
34 return mock
35}
36
37// IssueLinkStore is an autogenerated mock type for the IssueLinkStore type
38type IssueLinkStore struct {
39 mock.Mock
40}
41
42type IssueLinkStore_Expecter struct {
43 mock *mock.Mock
44}
45
46func (_m *IssueLinkStore) EXPECT() *IssueLinkStore_Expecter {
47 return &IssueLinkStore_Expecter{mock: &_m.Mock}
48}
49
50// LinksOfIssue provides a mock function for the type IssueLinkStore
51func (_mock *IssueLinkStore) LinksOfIssue(ctx context.Context, repo domain.RepoName, issue int64, limit int) ([]domain.IssueLink, error) {
52 ret := _mock.Called(ctx, repo, issue, limit)
53
54 if len(ret) == 0 {
55 panic("no return value specified for LinksOfIssue")
56 }
57
58 var r0 []domain.IssueLink
59 var r1 error
60 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, int64, int) ([]domain.IssueLink, error)); ok {
61 return returnFunc(ctx, repo, issue, limit)
62 }
63 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, int64, int) []domain.IssueLink); ok {
64 r0 = returnFunc(ctx, repo, issue, limit)
65 } else {
66 if ret.Get(0) != nil {
67 r0 = ret.Get(0).([]domain.IssueLink)
68 }
69 }
70 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, int64, int) error); ok {
71 r1 = returnFunc(ctx, repo, issue, limit)
72 } else {
73 r1 = ret.Error(1)
74 }
75 return r0, r1
76}
77
78// IssueLinkStore_LinksOfIssue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LinksOfIssue'
79type IssueLinkStore_LinksOfIssue_Call struct {
80 *mock.Call
81}
82
83// LinksOfIssue is a helper method to define mock.On call
84// - ctx context.Context
85// - repo domain.RepoName
86// - issue int64
87// - limit int
88func (_e *IssueLinkStore_Expecter) LinksOfIssue(ctx any, repo any, issue any, limit any) *IssueLinkStore_LinksOfIssue_Call {
89 return &IssueLinkStore_LinksOfIssue_Call{Call: _e.mock.On("LinksOfIssue", ctx, repo, issue, limit)}
90}
91
92func (_c *IssueLinkStore_LinksOfIssue_Call) Run(run func(ctx context.Context, repo domain.RepoName, issue int64, limit int)) *IssueLinkStore_LinksOfIssue_Call {
93 _c.Call.Run(func(args mock.Arguments) {
94 var arg0 context.Context
95 if args[0] != nil {
96 arg0 = args[0].(context.Context)
97 }
98 var arg1 domain.RepoName
99 if args[1] != nil {
100 arg1 = args[1].(domain.RepoName)
101 }
102 var arg2 int64
103 if args[2] != nil {
104 arg2 = args[2].(int64)
105 }
106 var arg3 int
107 if args[3] != nil {
108 arg3 = args[3].(int)
109 }
110 run(
111 arg0,
112 arg1,
113 arg2,
114 arg3,
115 )
116 })
117 return _c
118}
119
120func (_c *IssueLinkStore_LinksOfIssue_Call) Return(issueLinks []domain.IssueLink, err error) *IssueLinkStore_LinksOfIssue_Call {
121 _c.Call.Return(issueLinks, err)
122 return _c
123}
124
125func (_c *IssueLinkStore_LinksOfIssue_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, issue int64, limit int) ([]domain.IssueLink, error)) *IssueLinkStore_LinksOfIssue_Call {
126 _c.Call.Return(run)
127 return _c
128}
129
130// LinksOfMergeRequest provides a mock function for the type IssueLinkStore
131func (_mock *IssueLinkStore) LinksOfMergeRequest(ctx context.Context, repo domain.RepoName, mr int64) ([]domain.IssueLink, error) {
132 ret := _mock.Called(ctx, repo, mr)
133
134 if len(ret) == 0 {
135 panic("no return value specified for LinksOfMergeRequest")
136 }
137
138 var r0 []domain.IssueLink
139 var r1 error
140 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, int64) ([]domain.IssueLink, error)); ok {
141 return returnFunc(ctx, repo, mr)
142 }
143 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, int64) []domain.IssueLink); ok {
144 r0 = returnFunc(ctx, repo, mr)
145 } else {
146 if ret.Get(0) != nil {
147 r0 = ret.Get(0).([]domain.IssueLink)
148 }
149 }
150 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, int64) error); ok {
151 r1 = returnFunc(ctx, repo, mr)
152 } else {
153 r1 = ret.Error(1)
154 }
155 return r0, r1
156}
157
158// IssueLinkStore_LinksOfMergeRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LinksOfMergeRequest'
159type IssueLinkStore_LinksOfMergeRequest_Call struct {
160 *mock.Call
161}
162
163// LinksOfMergeRequest is a helper method to define mock.On call
164// - ctx context.Context
165// - repo domain.RepoName
166// - mr int64
167func (_e *IssueLinkStore_Expecter) LinksOfMergeRequest(ctx any, repo any, mr any) *IssueLinkStore_LinksOfMergeRequest_Call {
168 return &IssueLinkStore_LinksOfMergeRequest_Call{Call: _e.mock.On("LinksOfMergeRequest", ctx, repo, mr)}
169}
170
171func (_c *IssueLinkStore_LinksOfMergeRequest_Call) Run(run func(ctx context.Context, repo domain.RepoName, mr int64)) *IssueLinkStore_LinksOfMergeRequest_Call {
172 _c.Call.Run(func(args mock.Arguments) {
173 var arg0 context.Context
174 if args[0] != nil {
175 arg0 = args[0].(context.Context)
176 }
177 var arg1 domain.RepoName
178 if args[1] != nil {
179 arg1 = args[1].(domain.RepoName)
180 }
181 var arg2 int64
182 if args[2] != nil {
183 arg2 = args[2].(int64)
184 }
185 run(
186 arg0,
187 arg1,
188 arg2,
189 )
190 })
191 return _c
192}
193
194func (_c *IssueLinkStore_LinksOfMergeRequest_Call) Return(issueLinks []domain.IssueLink, err error) *IssueLinkStore_LinksOfMergeRequest_Call {
195 _c.Call.Return(issueLinks, err)
196 return _c
197}
198
199func (_c *IssueLinkStore_LinksOfMergeRequest_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, mr int64) ([]domain.IssueLink, error)) *IssueLinkStore_LinksOfMergeRequest_Call {
200 _c.Call.Return(run)
201 return _c
202}
203
204// ReplaceLinks provides a mock function for the type IssueLinkStore
205func (_mock *IssueLinkStore) ReplaceLinks(ctx context.Context, repo domain.RepoName, mr int64, issues []int64, closes []int64) ([]domain.IssueLink, []domain.IssueLink, error) {
206 ret := _mock.Called(ctx, repo, mr, issues, closes)
207
208 if len(ret) == 0 {
209 panic("no return value specified for ReplaceLinks")
210 }
211
212 var r0 []domain.IssueLink
213 var r1 []domain.IssueLink
214 var r2 error
215 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, int64, []int64, []int64) ([]domain.IssueLink, []domain.IssueLink, error)); ok {
216 return returnFunc(ctx, repo, mr, issues, closes)
217 }
218 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, int64, []int64, []int64) []domain.IssueLink); ok {
219 r0 = returnFunc(ctx, repo, mr, issues, closes)
220 } else {
221 if ret.Get(0) != nil {
222 r0 = ret.Get(0).([]domain.IssueLink)
223 }
224 }
225 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, int64, []int64, []int64) []domain.IssueLink); ok {
226 r1 = returnFunc(ctx, repo, mr, issues, closes)
227 } else {
228 if ret.Get(1) != nil {
229 r1 = ret.Get(1).([]domain.IssueLink)
230 }
231 }
232 if returnFunc, ok := ret.Get(2).(func(context.Context, domain.RepoName, int64, []int64, []int64) error); ok {
233 r2 = returnFunc(ctx, repo, mr, issues, closes)
234 } else {
235 r2 = ret.Error(2)
236 }
237 return r0, r1, r2
238}
239
240// IssueLinkStore_ReplaceLinks_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReplaceLinks'
241type IssueLinkStore_ReplaceLinks_Call struct {
242 *mock.Call
243}
244
245// ReplaceLinks is a helper method to define mock.On call
246// - ctx context.Context
247// - repo domain.RepoName
248// - mr int64
249// - issues []int64
250// - closes []int64
251func (_e *IssueLinkStore_Expecter) ReplaceLinks(ctx any, repo any, mr any, issues any, closes any) *IssueLinkStore_ReplaceLinks_Call {
252 return &IssueLinkStore_ReplaceLinks_Call{Call: _e.mock.On("ReplaceLinks", ctx, repo, mr, issues, closes)}
253}
254
255func (_c *IssueLinkStore_ReplaceLinks_Call) Run(run func(ctx context.Context, repo domain.RepoName, mr int64, issues []int64, closes []int64)) *IssueLinkStore_ReplaceLinks_Call {
256 _c.Call.Run(func(args mock.Arguments) {
257 var arg0 context.Context
258 if args[0] != nil {
259 arg0 = args[0].(context.Context)
260 }
261 var arg1 domain.RepoName
262 if args[1] != nil {
263 arg1 = args[1].(domain.RepoName)
264 }
265 var arg2 int64
266 if args[2] != nil {
267 arg2 = args[2].(int64)
268 }
269 var arg3 []int64
270 if args[3] != nil {
271 arg3 = args[3].([]int64)
272 }
273 var arg4 []int64
274 if args[4] != nil {
275 arg4 = args[4].([]int64)
276 }
277 run(
278 arg0,
279 arg1,
280 arg2,
281 arg3,
282 arg4,
283 )
284 })
285 return _c
286}
287
288func (_c *IssueLinkStore_ReplaceLinks_Call) Return(added []domain.IssueLink, removed []domain.IssueLink, err error) *IssueLinkStore_ReplaceLinks_Call {
289 _c.Call.Return(added, removed, err)
290 return _c
291}
292
293func (_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 {
294 _c.Call.Return(run)
295 return _c
296}