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