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// NewMergeRequestStore creates a new instance of MergeRequestStore. 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 NewMergeRequestStore(t interface {
17 mock.TestingT
18 Cleanup(func())
19}) *MergeRequestStore {
20 if helper, ok := t.(interface{ Helper() }); ok {
21 helper.Helper()
22 }
23
24 mock := &MergeRequestStore{}
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// MergeRequestStore is an autogenerated mock type for the MergeRequestStore type
38type MergeRequestStore struct {
39 mock.Mock
40}
41
42type MergeRequestStore_Expecter struct {
43 mock *mock.Mock
44}
45
46func (_m *MergeRequestStore) EXPECT() *MergeRequestStore_Expecter {
47 return &MergeRequestStore_Expecter{mock: &_m.Mock}
48}
49
50// CountOpen provides a mock function for the type MergeRequestStore
51func (_mock *MergeRequestStore) CountOpen(ctx context.Context, repo domain.RepoName) (int, error) {
52 ret := _mock.Called(ctx, repo)
53
54 if len(ret) == 0 {
55 panic("no return value specified for CountOpen")
56 }
57
58 var r0 int
59 var r1 error
60 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName) (int, error)); ok {
61 return returnFunc(ctx, repo)
62 }
63 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName) int); ok {
64 r0 = returnFunc(ctx, repo)
65 } else {
66 r0 = ret.Get(0).(int)
67 }
68 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName) error); ok {
69 r1 = returnFunc(ctx, repo)
70 } else {
71 r1 = ret.Error(1)
72 }
73 return r0, r1
74}
75
76// MergeRequestStore_CountOpen_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountOpen'
77type MergeRequestStore_CountOpen_Call struct {
78 *mock.Call
79}
80
81// CountOpen is a helper method to define mock.On call
82// - ctx context.Context
83// - repo domain.RepoName
84func (_e *MergeRequestStore_Expecter) CountOpen(ctx any, repo any) *MergeRequestStore_CountOpen_Call {
85 return &MergeRequestStore_CountOpen_Call{Call: _e.mock.On("CountOpen", ctx, repo)}
86}
87
88func (_c *MergeRequestStore_CountOpen_Call) Run(run func(ctx context.Context, repo domain.RepoName)) *MergeRequestStore_CountOpen_Call {
89 _c.Call.Run(func(args mock.Arguments) {
90 var arg0 context.Context
91 if args[0] != nil {
92 arg0 = args[0].(context.Context)
93 }
94 var arg1 domain.RepoName
95 if args[1] != nil {
96 arg1 = args[1].(domain.RepoName)
97 }
98 run(
99 arg0,
100 arg1,
101 )
102 })
103 return _c
104}
105
106func (_c *MergeRequestStore_CountOpen_Call) Return(n int, err error) *MergeRequestStore_CountOpen_Call {
107 _c.Call.Return(n, err)
108 return _c
109}
110
111func (_c *MergeRequestStore_CountOpen_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName) (int, error)) *MergeRequestStore_CountOpen_Call {
112 _c.Call.Return(run)
113 return _c
114}
115
116// Create provides a mock function for the type MergeRequestStore
117func (_mock *MergeRequestStore) Create(ctx context.Context, mr domain.MergeRequest) (domain.MergeRequest, error) {
118 ret := _mock.Called(ctx, mr)
119
120 if len(ret) == 0 {
121 panic("no return value specified for Create")
122 }
123
124 var r0 domain.MergeRequest
125 var r1 error
126 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.MergeRequest) (domain.MergeRequest, error)); ok {
127 return returnFunc(ctx, mr)
128 }
129 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.MergeRequest) domain.MergeRequest); ok {
130 r0 = returnFunc(ctx, mr)
131 } else {
132 r0 = ret.Get(0).(domain.MergeRequest)
133 }
134 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.MergeRequest) error); ok {
135 r1 = returnFunc(ctx, mr)
136 } else {
137 r1 = ret.Error(1)
138 }
139 return r0, r1
140}
141
142// MergeRequestStore_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create'
143type MergeRequestStore_Create_Call struct {
144 *mock.Call
145}
146
147// Create is a helper method to define mock.On call
148// - ctx context.Context
149// - mr domain.MergeRequest
150func (_e *MergeRequestStore_Expecter) Create(ctx any, mr any) *MergeRequestStore_Create_Call {
151 return &MergeRequestStore_Create_Call{Call: _e.mock.On("Create", ctx, mr)}
152}
153
154func (_c *MergeRequestStore_Create_Call) Run(run func(ctx context.Context, mr domain.MergeRequest)) *MergeRequestStore_Create_Call {
155 _c.Call.Run(func(args mock.Arguments) {
156 var arg0 context.Context
157 if args[0] != nil {
158 arg0 = args[0].(context.Context)
159 }
160 var arg1 domain.MergeRequest
161 if args[1] != nil {
162 arg1 = args[1].(domain.MergeRequest)
163 }
164 run(
165 arg0,
166 arg1,
167 )
168 })
169 return _c
170}
171
172func (_c *MergeRequestStore_Create_Call) Return(mergeRequest domain.MergeRequest, err error) *MergeRequestStore_Create_Call {
173 _c.Call.Return(mergeRequest, err)
174 return _c
175}
176
177func (_c *MergeRequestStore_Create_Call) RunAndReturn(run func(ctx context.Context, mr domain.MergeRequest) (domain.MergeRequest, error)) *MergeRequestStore_Create_Call {
178 _c.Call.Return(run)
179 return _c
180}
181
182// Get provides a mock function for the type MergeRequestStore
183func (_mock *MergeRequestStore) Get(ctx context.Context, repo domain.RepoName, number int64) (domain.MergeRequest, error) {
184 ret := _mock.Called(ctx, repo, number)
185
186 if len(ret) == 0 {
187 panic("no return value specified for Get")
188 }
189
190 var r0 domain.MergeRequest
191 var r1 error
192 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, int64) (domain.MergeRequest, error)); ok {
193 return returnFunc(ctx, repo, number)
194 }
195 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, int64) domain.MergeRequest); ok {
196 r0 = returnFunc(ctx, repo, number)
197 } else {
198 r0 = ret.Get(0).(domain.MergeRequest)
199 }
200 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, int64) error); ok {
201 r1 = returnFunc(ctx, repo, number)
202 } else {
203 r1 = ret.Error(1)
204 }
205 return r0, r1
206}
207
208// MergeRequestStore_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
209type MergeRequestStore_Get_Call struct {
210 *mock.Call
211}
212
213// Get is a helper method to define mock.On call
214// - ctx context.Context
215// - repo domain.RepoName
216// - number int64
217func (_e *MergeRequestStore_Expecter) Get(ctx any, repo any, number any) *MergeRequestStore_Get_Call {
218 return &MergeRequestStore_Get_Call{Call: _e.mock.On("Get", ctx, repo, number)}
219}
220
221func (_c *MergeRequestStore_Get_Call) Run(run func(ctx context.Context, repo domain.RepoName, number int64)) *MergeRequestStore_Get_Call {
222 _c.Call.Run(func(args mock.Arguments) {
223 var arg0 context.Context
224 if args[0] != nil {
225 arg0 = args[0].(context.Context)
226 }
227 var arg1 domain.RepoName
228 if args[1] != nil {
229 arg1 = args[1].(domain.RepoName)
230 }
231 var arg2 int64
232 if args[2] != nil {
233 arg2 = args[2].(int64)
234 }
235 run(
236 arg0,
237 arg1,
238 arg2,
239 )
240 })
241 return _c
242}
243
244func (_c *MergeRequestStore_Get_Call) Return(mergeRequest domain.MergeRequest, err error) *MergeRequestStore_Get_Call {
245 _c.Call.Return(mergeRequest, err)
246 return _c
247}
248
249func (_c *MergeRequestStore_Get_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, number int64) (domain.MergeRequest, error)) *MergeRequestStore_Get_Call {
250 _c.Call.Return(run)
251 return _c
252}
253
254// GetComment provides a mock function for the type MergeRequestStore
255func (_mock *MergeRequestStore) GetComment(ctx context.Context, repo domain.RepoName, number int64, id int64) (domain.Comment, error) {
256 ret := _mock.Called(ctx, repo, number, id)
257
258 if len(ret) == 0 {
259 panic("no return value specified for GetComment")
260 }
261
262 var r0 domain.Comment
263 var r1 error
264 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, int64, int64) (domain.Comment, error)); ok {
265 return returnFunc(ctx, repo, number, id)
266 }
267 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, int64, int64) domain.Comment); ok {
268 r0 = returnFunc(ctx, repo, number, id)
269 } else {
270 r0 = ret.Get(0).(domain.Comment)
271 }
272 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, int64, int64) error); ok {
273 r1 = returnFunc(ctx, repo, number, id)
274 } else {
275 r1 = ret.Error(1)
276 }
277 return r0, r1
278}
279
280// MergeRequestStore_GetComment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetComment'
281type MergeRequestStore_GetComment_Call struct {
282 *mock.Call
283}
284
285// GetComment is a helper method to define mock.On call
286// - ctx context.Context
287// - repo domain.RepoName
288// - number int64
289// - id int64
290func (_e *MergeRequestStore_Expecter) GetComment(ctx any, repo any, number any, id any) *MergeRequestStore_GetComment_Call {
291 return &MergeRequestStore_GetComment_Call{Call: _e.mock.On("GetComment", ctx, repo, number, id)}
292}
293
294func (_c *MergeRequestStore_GetComment_Call) Run(run func(ctx context.Context, repo domain.RepoName, number int64, id int64)) *MergeRequestStore_GetComment_Call {
295 _c.Call.Run(func(args mock.Arguments) {
296 var arg0 context.Context
297 if args[0] != nil {
298 arg0 = args[0].(context.Context)
299 }
300 var arg1 domain.RepoName
301 if args[1] != nil {
302 arg1 = args[1].(domain.RepoName)
303 }
304 var arg2 int64
305 if args[2] != nil {
306 arg2 = args[2].(int64)
307 }
308 var arg3 int64
309 if args[3] != nil {
310 arg3 = args[3].(int64)
311 }
312 run(
313 arg0,
314 arg1,
315 arg2,
316 arg3,
317 )
318 })
319 return _c
320}
321
322func (_c *MergeRequestStore_GetComment_Call) Return(comment domain.Comment, err error) *MergeRequestStore_GetComment_Call {
323 _c.Call.Return(comment, err)
324 return _c
325}
326
327func (_c *MergeRequestStore_GetComment_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, number int64, id int64) (domain.Comment, error)) *MergeRequestStore_GetComment_Call {
328 _c.Call.Return(run)
329 return _c
330}
331
332// GetRead provides a mock function for the type MergeRequestStore
333func (_mock *MergeRequestStore) GetRead(ctx context.Context, repo domain.RepoName, number int64) (domain.ObjectID, error) {
334 ret := _mock.Called(ctx, repo, number)
335
336 if len(ret) == 0 {
337 panic("no return value specified for GetRead")
338 }
339
340 var r0 domain.ObjectID
341 var r1 error
342 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, int64) (domain.ObjectID, error)); ok {
343 return returnFunc(ctx, repo, number)
344 }
345 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, int64) domain.ObjectID); ok {
346 r0 = returnFunc(ctx, repo, number)
347 } else {
348 r0 = ret.Get(0).(domain.ObjectID)
349 }
350 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, int64) error); ok {
351 r1 = returnFunc(ctx, repo, number)
352 } else {
353 r1 = ret.Error(1)
354 }
355 return r0, r1
356}
357
358// MergeRequestStore_GetRead_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRead'
359type MergeRequestStore_GetRead_Call struct {
360 *mock.Call
361}
362
363// GetRead is a helper method to define mock.On call
364// - ctx context.Context
365// - repo domain.RepoName
366// - number int64
367func (_e *MergeRequestStore_Expecter) GetRead(ctx any, repo any, number any) *MergeRequestStore_GetRead_Call {
368 return &MergeRequestStore_GetRead_Call{Call: _e.mock.On("GetRead", ctx, repo, number)}
369}
370
371func (_c *MergeRequestStore_GetRead_Call) Run(run func(ctx context.Context, repo domain.RepoName, number int64)) *MergeRequestStore_GetRead_Call {
372 _c.Call.Run(func(args mock.Arguments) {
373 var arg0 context.Context
374 if args[0] != nil {
375 arg0 = args[0].(context.Context)
376 }
377 var arg1 domain.RepoName
378 if args[1] != nil {
379 arg1 = args[1].(domain.RepoName)
380 }
381 var arg2 int64
382 if args[2] != nil {
383 arg2 = args[2].(int64)
384 }
385 run(
386 arg0,
387 arg1,
388 arg2,
389 )
390 })
391 return _c
392}
393
394func (_c *MergeRequestStore_GetRead_Call) Return(objectID domain.ObjectID, err error) *MergeRequestStore_GetRead_Call {
395 _c.Call.Return(objectID, err)
396 return _c
397}
398
399func (_c *MergeRequestStore_GetRead_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, number int64) (domain.ObjectID, error)) *MergeRequestStore_GetRead_Call {
400 _c.Call.Return(run)
401 return _c
402}
403
404// List provides a mock function for the type MergeRequestStore
405func (_mock *MergeRequestStore) List(ctx context.Context, repo domain.RepoName) ([]domain.MergeRequest, error) {
406 ret := _mock.Called(ctx, repo)
407
408 if len(ret) == 0 {
409 panic("no return value specified for List")
410 }
411
412 var r0 []domain.MergeRequest
413 var r1 error
414 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName) ([]domain.MergeRequest, error)); ok {
415 return returnFunc(ctx, repo)
416 }
417 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName) []domain.MergeRequest); ok {
418 r0 = returnFunc(ctx, repo)
419 } else {
420 if ret.Get(0) != nil {
421 r0 = ret.Get(0).([]domain.MergeRequest)
422 }
423 }
424 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName) error); ok {
425 r1 = returnFunc(ctx, repo)
426 } else {
427 r1 = ret.Error(1)
428 }
429 return r0, r1
430}
431
432// MergeRequestStore_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List'
433type MergeRequestStore_List_Call struct {
434 *mock.Call
435}
436
437// List is a helper method to define mock.On call
438// - ctx context.Context
439// - repo domain.RepoName
440func (_e *MergeRequestStore_Expecter) List(ctx any, repo any) *MergeRequestStore_List_Call {
441 return &MergeRequestStore_List_Call{Call: _e.mock.On("List", ctx, repo)}
442}
443
444func (_c *MergeRequestStore_List_Call) Run(run func(ctx context.Context, repo domain.RepoName)) *MergeRequestStore_List_Call {
445 _c.Call.Run(func(args mock.Arguments) {
446 var arg0 context.Context
447 if args[0] != nil {
448 arg0 = args[0].(context.Context)
449 }
450 var arg1 domain.RepoName
451 if args[1] != nil {
452 arg1 = args[1].(domain.RepoName)
453 }
454 run(
455 arg0,
456 arg1,
457 )
458 })
459 return _c
460}
461
462func (_c *MergeRequestStore_List_Call) Return(mergeRequests []domain.MergeRequest, err error) *MergeRequestStore_List_Call {
463 _c.Call.Return(mergeRequests, err)
464 return _c
465}
466
467func (_c *MergeRequestStore_List_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName) ([]domain.MergeRequest, error)) *MergeRequestStore_List_Call {
468 _c.Call.Return(run)
469 return _c
470}
471
472// ListComments provides a mock function for the type MergeRequestStore
473func (_mock *MergeRequestStore) ListComments(ctx context.Context, repo domain.RepoName, number int64) ([]domain.Comment, error) {
474 ret := _mock.Called(ctx, repo, number)
475
476 if len(ret) == 0 {
477 panic("no return value specified for ListComments")
478 }
479
480 var r0 []domain.Comment
481 var r1 error
482 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, int64) ([]domain.Comment, error)); ok {
483 return returnFunc(ctx, repo, number)
484 }
485 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, int64) []domain.Comment); ok {
486 r0 = returnFunc(ctx, repo, number)
487 } else {
488 if ret.Get(0) != nil {
489 r0 = ret.Get(0).([]domain.Comment)
490 }
491 }
492 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, int64) error); ok {
493 r1 = returnFunc(ctx, repo, number)
494 } else {
495 r1 = ret.Error(1)
496 }
497 return r0, r1
498}
499
500// MergeRequestStore_ListComments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListComments'
501type MergeRequestStore_ListComments_Call struct {
502 *mock.Call
503}
504
505// ListComments is a helper method to define mock.On call
506// - ctx context.Context
507// - repo domain.RepoName
508// - number int64
509func (_e *MergeRequestStore_Expecter) ListComments(ctx any, repo any, number any) *MergeRequestStore_ListComments_Call {
510 return &MergeRequestStore_ListComments_Call{Call: _e.mock.On("ListComments", ctx, repo, number)}
511}
512
513func (_c *MergeRequestStore_ListComments_Call) Run(run func(ctx context.Context, repo domain.RepoName, number int64)) *MergeRequestStore_ListComments_Call {
514 _c.Call.Run(func(args mock.Arguments) {
515 var arg0 context.Context
516 if args[0] != nil {
517 arg0 = args[0].(context.Context)
518 }
519 var arg1 domain.RepoName
520 if args[1] != nil {
521 arg1 = args[1].(domain.RepoName)
522 }
523 var arg2 int64
524 if args[2] != nil {
525 arg2 = args[2].(int64)
526 }
527 run(
528 arg0,
529 arg1,
530 arg2,
531 )
532 })
533 return _c
534}
535
536func (_c *MergeRequestStore_ListComments_Call) Return(comments []domain.Comment, err error) *MergeRequestStore_ListComments_Call {
537 _c.Call.Return(comments, err)
538 return _c
539}
540
541func (_c *MergeRequestStore_ListComments_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, number int64) ([]domain.Comment, error)) *MergeRequestStore_ListComments_Call {
542 _c.Call.Return(run)
543 return _c
544}
545
546// ListOpen provides a mock function for the type MergeRequestStore
547func (_mock *MergeRequestStore) ListOpen(ctx context.Context, repo domain.RepoName) ([]domain.MergeRequest, error) {
548 ret := _mock.Called(ctx, repo)
549
550 if len(ret) == 0 {
551 panic("no return value specified for ListOpen")
552 }
553
554 var r0 []domain.MergeRequest
555 var r1 error
556 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName) ([]domain.MergeRequest, error)); ok {
557 return returnFunc(ctx, repo)
558 }
559 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName) []domain.MergeRequest); ok {
560 r0 = returnFunc(ctx, repo)
561 } else {
562 if ret.Get(0) != nil {
563 r0 = ret.Get(0).([]domain.MergeRequest)
564 }
565 }
566 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName) error); ok {
567 r1 = returnFunc(ctx, repo)
568 } else {
569 r1 = ret.Error(1)
570 }
571 return r0, r1
572}
573
574// MergeRequestStore_ListOpen_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListOpen'
575type MergeRequestStore_ListOpen_Call struct {
576 *mock.Call
577}
578
579// ListOpen is a helper method to define mock.On call
580// - ctx context.Context
581// - repo domain.RepoName
582func (_e *MergeRequestStore_Expecter) ListOpen(ctx any, repo any) *MergeRequestStore_ListOpen_Call {
583 return &MergeRequestStore_ListOpen_Call{Call: _e.mock.On("ListOpen", ctx, repo)}
584}
585
586func (_c *MergeRequestStore_ListOpen_Call) Run(run func(ctx context.Context, repo domain.RepoName)) *MergeRequestStore_ListOpen_Call {
587 _c.Call.Run(func(args mock.Arguments) {
588 var arg0 context.Context
589 if args[0] != nil {
590 arg0 = args[0].(context.Context)
591 }
592 var arg1 domain.RepoName
593 if args[1] != nil {
594 arg1 = args[1].(domain.RepoName)
595 }
596 run(
597 arg0,
598 arg1,
599 )
600 })
601 return _c
602}
603
604func (_c *MergeRequestStore_ListOpen_Call) Return(mergeRequests []domain.MergeRequest, err error) *MergeRequestStore_ListOpen_Call {
605 _c.Call.Return(mergeRequests, err)
606 return _c
607}
608
609func (_c *MergeRequestStore_ListOpen_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName) ([]domain.MergeRequest, error)) *MergeRequestStore_ListOpen_Call {
610 _c.Call.Return(run)
611 return _c
612}
613
614// OpenBySource provides a mock function for the type MergeRequestStore
615func (_mock *MergeRequestStore) OpenBySource(ctx context.Context, repo domain.RepoName, branches []string, limit int) ([]int64, bool, error) {
616 ret := _mock.Called(ctx, repo, branches, limit)
617
618 if len(ret) == 0 {
619 panic("no return value specified for OpenBySource")
620 }
621
622 var r0 []int64
623 var r1 bool
624 var r2 error
625 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, []string, int) ([]int64, bool, error)); ok {
626 return returnFunc(ctx, repo, branches, limit)
627 }
628 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, []string, int) []int64); ok {
629 r0 = returnFunc(ctx, repo, branches, limit)
630 } else {
631 if ret.Get(0) != nil {
632 r0 = ret.Get(0).([]int64)
633 }
634 }
635 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, []string, int) bool); ok {
636 r1 = returnFunc(ctx, repo, branches, limit)
637 } else {
638 r1 = ret.Get(1).(bool)
639 }
640 if returnFunc, ok := ret.Get(2).(func(context.Context, domain.RepoName, []string, int) error); ok {
641 r2 = returnFunc(ctx, repo, branches, limit)
642 } else {
643 r2 = ret.Error(2)
644 }
645 return r0, r1, r2
646}
647
648// MergeRequestStore_OpenBySource_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OpenBySource'
649type MergeRequestStore_OpenBySource_Call struct {
650 *mock.Call
651}
652
653// OpenBySource is a helper method to define mock.On call
654// - ctx context.Context
655// - repo domain.RepoName
656// - branches []string
657// - limit int
658func (_e *MergeRequestStore_Expecter) OpenBySource(ctx any, repo any, branches any, limit any) *MergeRequestStore_OpenBySource_Call {
659 return &MergeRequestStore_OpenBySource_Call{Call: _e.mock.On("OpenBySource", ctx, repo, branches, limit)}
660}
661
662func (_c *MergeRequestStore_OpenBySource_Call) Run(run func(ctx context.Context, repo domain.RepoName, branches []string, limit int)) *MergeRequestStore_OpenBySource_Call {
663 _c.Call.Run(func(args mock.Arguments) {
664 var arg0 context.Context
665 if args[0] != nil {
666 arg0 = args[0].(context.Context)
667 }
668 var arg1 domain.RepoName
669 if args[1] != nil {
670 arg1 = args[1].(domain.RepoName)
671 }
672 var arg2 []string
673 if args[2] != nil {
674 arg2 = args[2].([]string)
675 }
676 var arg3 int
677 if args[3] != nil {
678 arg3 = args[3].(int)
679 }
680 run(
681 arg0,
682 arg1,
683 arg2,
684 arg3,
685 )
686 })
687 return _c
688}
689
690func (_c *MergeRequestStore_OpenBySource_Call) Return(numbers []int64, truncated bool, err error) *MergeRequestStore_OpenBySource_Call {
691 _c.Call.Return(numbers, truncated, err)
692 return _c
693}
694
695func (_c *MergeRequestStore_OpenBySource_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, branches []string, limit int) ([]int64, bool, error)) *MergeRequestStore_OpenBySource_Call {
696 _c.Call.Return(run)
697 return _c
698}
699
700// OpenByTarget provides a mock function for the type MergeRequestStore
701func (_mock *MergeRequestStore) OpenByTarget(ctx context.Context, repo domain.RepoName, branches []string, limit int) ([]int64, bool, error) {
702 ret := _mock.Called(ctx, repo, branches, limit)
703
704 if len(ret) == 0 {
705 panic("no return value specified for OpenByTarget")
706 }
707
708 var r0 []int64
709 var r1 bool
710 var r2 error
711 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, []string, int) ([]int64, bool, error)); ok {
712 return returnFunc(ctx, repo, branches, limit)
713 }
714 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, []string, int) []int64); ok {
715 r0 = returnFunc(ctx, repo, branches, limit)
716 } else {
717 if ret.Get(0) != nil {
718 r0 = ret.Get(0).([]int64)
719 }
720 }
721 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, []string, int) bool); ok {
722 r1 = returnFunc(ctx, repo, branches, limit)
723 } else {
724 r1 = ret.Get(1).(bool)
725 }
726 if returnFunc, ok := ret.Get(2).(func(context.Context, domain.RepoName, []string, int) error); ok {
727 r2 = returnFunc(ctx, repo, branches, limit)
728 } else {
729 r2 = ret.Error(2)
730 }
731 return r0, r1, r2
732}
733
734// MergeRequestStore_OpenByTarget_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OpenByTarget'
735type MergeRequestStore_OpenByTarget_Call struct {
736 *mock.Call
737}
738
739// OpenByTarget is a helper method to define mock.On call
740// - ctx context.Context
741// - repo domain.RepoName
742// - branches []string
743// - limit int
744func (_e *MergeRequestStore_Expecter) OpenByTarget(ctx any, repo any, branches any, limit any) *MergeRequestStore_OpenByTarget_Call {
745 return &MergeRequestStore_OpenByTarget_Call{Call: _e.mock.On("OpenByTarget", ctx, repo, branches, limit)}
746}
747
748func (_c *MergeRequestStore_OpenByTarget_Call) Run(run func(ctx context.Context, repo domain.RepoName, branches []string, limit int)) *MergeRequestStore_OpenByTarget_Call {
749 _c.Call.Run(func(args mock.Arguments) {
750 var arg0 context.Context
751 if args[0] != nil {
752 arg0 = args[0].(context.Context)
753 }
754 var arg1 domain.RepoName
755 if args[1] != nil {
756 arg1 = args[1].(domain.RepoName)
757 }
758 var arg2 []string
759 if args[2] != nil {
760 arg2 = args[2].([]string)
761 }
762 var arg3 int
763 if args[3] != nil {
764 arg3 = args[3].(int)
765 }
766 run(
767 arg0,
768 arg1,
769 arg2,
770 arg3,
771 )
772 })
773 return _c
774}
775
776func (_c *MergeRequestStore_OpenByTarget_Call) Return(numbers []int64, truncated bool, err error) *MergeRequestStore_OpenByTarget_Call {
777 _c.Call.Return(numbers, truncated, err)
778 return _c
779}
780
781func (_c *MergeRequestStore_OpenByTarget_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, branches []string, limit int) ([]int64, bool, error)) *MergeRequestStore_OpenByTarget_Call {
782 _c.Call.Return(run)
783 return _c
784}
785
786// SaveComment provides a mock function for the type MergeRequestStore
787func (_mock *MergeRequestStore) SaveComment(ctx context.Context, mr domain.MergeRequest, c domain.Comment) error {
788 ret := _mock.Called(ctx, mr, c)
789
790 if len(ret) == 0 {
791 panic("no return value specified for SaveComment")
792 }
793
794 var r0 error
795 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.MergeRequest, domain.Comment) error); ok {
796 r0 = returnFunc(ctx, mr, c)
797 } else {
798 r0 = ret.Error(0)
799 }
800 return r0
801}
802
803// MergeRequestStore_SaveComment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveComment'
804type MergeRequestStore_SaveComment_Call struct {
805 *mock.Call
806}
807
808// SaveComment is a helper method to define mock.On call
809// - ctx context.Context
810// - mr domain.MergeRequest
811// - c domain.Comment
812func (_e *MergeRequestStore_Expecter) SaveComment(ctx any, mr any, c any) *MergeRequestStore_SaveComment_Call {
813 return &MergeRequestStore_SaveComment_Call{Call: _e.mock.On("SaveComment", ctx, mr, c)}
814}
815
816func (_c *MergeRequestStore_SaveComment_Call) Run(run func(ctx context.Context, mr domain.MergeRequest, c domain.Comment)) *MergeRequestStore_SaveComment_Call {
817 _c.Call.Run(func(args mock.Arguments) {
818 var arg0 context.Context
819 if args[0] != nil {
820 arg0 = args[0].(context.Context)
821 }
822 var arg1 domain.MergeRequest
823 if args[1] != nil {
824 arg1 = args[1].(domain.MergeRequest)
825 }
826 var arg2 domain.Comment
827 if args[2] != nil {
828 arg2 = args[2].(domain.Comment)
829 }
830 run(
831 arg0,
832 arg1,
833 arg2,
834 )
835 })
836 return _c
837}
838
839func (_c *MergeRequestStore_SaveComment_Call) Return(err error) *MergeRequestStore_SaveComment_Call {
840 _c.Call.Return(err)
841 return _c
842}
843
844func (_c *MergeRequestStore_SaveComment_Call) RunAndReturn(run func(ctx context.Context, mr domain.MergeRequest, c domain.Comment) error) *MergeRequestStore_SaveComment_Call {
845 _c.Call.Return(run)
846 return _c
847}
848
849// SetRead provides a mock function for the type MergeRequestStore
850func (_mock *MergeRequestStore) SetRead(ctx context.Context, repo domain.RepoName, number int64, head domain.ObjectID) error {
851 ret := _mock.Called(ctx, repo, number, head)
852
853 if len(ret) == 0 {
854 panic("no return value specified for SetRead")
855 }
856
857 var r0 error
858 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, int64, domain.ObjectID) error); ok {
859 r0 = returnFunc(ctx, repo, number, head)
860 } else {
861 r0 = ret.Error(0)
862 }
863 return r0
864}
865
866// MergeRequestStore_SetRead_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetRead'
867type MergeRequestStore_SetRead_Call struct {
868 *mock.Call
869}
870
871// SetRead is a helper method to define mock.On call
872// - ctx context.Context
873// - repo domain.RepoName
874// - number int64
875// - head domain.ObjectID
876func (_e *MergeRequestStore_Expecter) SetRead(ctx any, repo any, number any, head any) *MergeRequestStore_SetRead_Call {
877 return &MergeRequestStore_SetRead_Call{Call: _e.mock.On("SetRead", ctx, repo, number, head)}
878}
879
880func (_c *MergeRequestStore_SetRead_Call) Run(run func(ctx context.Context, repo domain.RepoName, number int64, head domain.ObjectID)) *MergeRequestStore_SetRead_Call {
881 _c.Call.Run(func(args mock.Arguments) {
882 var arg0 context.Context
883 if args[0] != nil {
884 arg0 = args[0].(context.Context)
885 }
886 var arg1 domain.RepoName
887 if args[1] != nil {
888 arg1 = args[1].(domain.RepoName)
889 }
890 var arg2 int64
891 if args[2] != nil {
892 arg2 = args[2].(int64)
893 }
894 var arg3 domain.ObjectID
895 if args[3] != nil {
896 arg3 = args[3].(domain.ObjectID)
897 }
898 run(
899 arg0,
900 arg1,
901 arg2,
902 arg3,
903 )
904 })
905 return _c
906}
907
908func (_c *MergeRequestStore_SetRead_Call) Return(err error) *MergeRequestStore_SetRead_Call {
909 _c.Call.Return(err)
910 return _c
911}
912
913func (_c *MergeRequestStore_SetRead_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, number int64, head domain.ObjectID) error) *MergeRequestStore_SetRead_Call {
914 _c.Call.Return(run)
915 return _c
916}
917
918// Update provides a mock function for the type MergeRequestStore
919func (_mock *MergeRequestStore) Update(ctx context.Context, mr domain.MergeRequest) error {
920 ret := _mock.Called(ctx, mr)
921
922 if len(ret) == 0 {
923 panic("no return value specified for Update")
924 }
925
926 var r0 error
927 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.MergeRequest) error); ok {
928 r0 = returnFunc(ctx, mr)
929 } else {
930 r0 = ret.Error(0)
931 }
932 return r0
933}
934
935// MergeRequestStore_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update'
936type MergeRequestStore_Update_Call struct {
937 *mock.Call
938}
939
940// Update is a helper method to define mock.On call
941// - ctx context.Context
942// - mr domain.MergeRequest
943func (_e *MergeRequestStore_Expecter) Update(ctx any, mr any) *MergeRequestStore_Update_Call {
944 return &MergeRequestStore_Update_Call{Call: _e.mock.On("Update", ctx, mr)}
945}
946
947func (_c *MergeRequestStore_Update_Call) Run(run func(ctx context.Context, mr domain.MergeRequest)) *MergeRequestStore_Update_Call {
948 _c.Call.Run(func(args mock.Arguments) {
949 var arg0 context.Context
950 if args[0] != nil {
951 arg0 = args[0].(context.Context)
952 }
953 var arg1 domain.MergeRequest
954 if args[1] != nil {
955 arg1 = args[1].(domain.MergeRequest)
956 }
957 run(
958 arg0,
959 arg1,
960 )
961 })
962 return _c
963}
964
965func (_c *MergeRequestStore_Update_Call) Return(err error) *MergeRequestStore_Update_Call {
966 _c.Call.Return(err)
967 return _c
968}
969
970func (_c *MergeRequestStore_Update_Call) RunAndReturn(run func(ctx context.Context, mr domain.MergeRequest) error) *MergeRequestStore_Update_Call {
971 _c.Call.Return(run)
972 return _c
973}