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 "bnema.dev/ermite/internal/ports"
12 mock "github.com/stretchr/testify/mock"
13)
14
15// NewRunService creates a new instance of RunService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
16// The first argument is typically a *testing.T value.
17func NewRunService(t interface {
18 mock.TestingT
19 Cleanup(func())
20}) *RunService {
21 if helper, ok := t.(interface{ Helper() }); ok {
22 helper.Helper()
23 }
24
25 mock := &RunService{}
26 mock.Mock.Test(t)
27
28 t.Cleanup(func() {
29 if helper, ok := t.(interface{ Helper() }); ok {
30 helper.Helper()
31 }
32 mock.AssertExpectations(t)
33 })
34
35 return mock
36}
37
38// RunService is an autogenerated mock type for the RunService type
39type RunService struct {
40 mock.Mock
41}
42
43type RunService_Expecter struct {
44 mock *mock.Mock
45}
46
47func (_m *RunService) EXPECT() *RunService_Expecter {
48 return &RunService_Expecter{mock: &_m.Mock}
49}
50
51// CancelRun provides a mock function for the type RunService
52func (_mock *RunService) CancelRun(ctx context.Context, p domain.Principal, repo domain.RepoName, runID int64) (domain.CIRun, error) {
53 ret := _mock.Called(ctx, p, repo, runID)
54
55 if len(ret) == 0 {
56 panic("no return value specified for CancelRun")
57 }
58
59 var r0 domain.CIRun
60 var r1 error
61 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, int64) (domain.CIRun, error)); ok {
62 return returnFunc(ctx, p, repo, runID)
63 }
64 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, int64) domain.CIRun); ok {
65 r0 = returnFunc(ctx, p, repo, runID)
66 } else {
67 r0 = ret.Get(0).(domain.CIRun)
68 }
69 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, int64) error); ok {
70 r1 = returnFunc(ctx, p, repo, runID)
71 } else {
72 r1 = ret.Error(1)
73 }
74 return r0, r1
75}
76
77// RunService_CancelRun_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CancelRun'
78type RunService_CancelRun_Call struct {
79 *mock.Call
80}
81
82// CancelRun is a helper method to define mock.On call
83// - ctx context.Context
84// - p domain.Principal
85// - repo domain.RepoName
86// - runID int64
87func (_e *RunService_Expecter) CancelRun(ctx any, p any, repo any, runID any) *RunService_CancelRun_Call {
88 return &RunService_CancelRun_Call{Call: _e.mock.On("CancelRun", ctx, p, repo, runID)}
89}
90
91func (_c *RunService_CancelRun_Call) Run(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, runID int64)) *RunService_CancelRun_Call {
92 _c.Call.Run(func(args mock.Arguments) {
93 var arg0 context.Context
94 if args[0] != nil {
95 arg0 = args[0].(context.Context)
96 }
97 var arg1 domain.Principal
98 if args[1] != nil {
99 arg1 = args[1].(domain.Principal)
100 }
101 var arg2 domain.RepoName
102 if args[2] != nil {
103 arg2 = args[2].(domain.RepoName)
104 }
105 var arg3 int64
106 if args[3] != nil {
107 arg3 = args[3].(int64)
108 }
109 run(
110 arg0,
111 arg1,
112 arg2,
113 arg3,
114 )
115 })
116 return _c
117}
118
119func (_c *RunService_CancelRun_Call) Return(cIRun domain.CIRun, err error) *RunService_CancelRun_Call {
120 _c.Call.Return(cIRun, err)
121 return _c
122}
123
124func (_c *RunService_CancelRun_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, runID int64) (domain.CIRun, error)) *RunService_CancelRun_Call {
125 _c.Call.Return(run)
126 return _c
127}
128
129// GetJob provides a mock function for the type RunService
130func (_mock *RunService) GetJob(ctx context.Context, p domain.Principal, repo domain.RepoName, jobID string, attempt int32) (ports.JobView, error) {
131 ret := _mock.Called(ctx, p, repo, jobID, attempt)
132
133 if len(ret) == 0 {
134 panic("no return value specified for GetJob")
135 }
136
137 var r0 ports.JobView
138 var r1 error
139 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, string, int32) (ports.JobView, error)); ok {
140 return returnFunc(ctx, p, repo, jobID, attempt)
141 }
142 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, string, int32) ports.JobView); ok {
143 r0 = returnFunc(ctx, p, repo, jobID, attempt)
144 } else {
145 r0 = ret.Get(0).(ports.JobView)
146 }
147 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, string, int32) error); ok {
148 r1 = returnFunc(ctx, p, repo, jobID, attempt)
149 } else {
150 r1 = ret.Error(1)
151 }
152 return r0, r1
153}
154
155// RunService_GetJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetJob'
156type RunService_GetJob_Call struct {
157 *mock.Call
158}
159
160// GetJob is a helper method to define mock.On call
161// - ctx context.Context
162// - p domain.Principal
163// - repo domain.RepoName
164// - jobID string
165// - attempt int32
166func (_e *RunService_Expecter) GetJob(ctx any, p any, repo any, jobID any, attempt any) *RunService_GetJob_Call {
167 return &RunService_GetJob_Call{Call: _e.mock.On("GetJob", ctx, p, repo, jobID, attempt)}
168}
169
170func (_c *RunService_GetJob_Call) Run(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, jobID string, attempt int32)) *RunService_GetJob_Call {
171 _c.Call.Run(func(args mock.Arguments) {
172 var arg0 context.Context
173 if args[0] != nil {
174 arg0 = args[0].(context.Context)
175 }
176 var arg1 domain.Principal
177 if args[1] != nil {
178 arg1 = args[1].(domain.Principal)
179 }
180 var arg2 domain.RepoName
181 if args[2] != nil {
182 arg2 = args[2].(domain.RepoName)
183 }
184 var arg3 string
185 if args[3] != nil {
186 arg3 = args[3].(string)
187 }
188 var arg4 int32
189 if args[4] != nil {
190 arg4 = args[4].(int32)
191 }
192 run(
193 arg0,
194 arg1,
195 arg2,
196 arg3,
197 arg4,
198 )
199 })
200 return _c
201}
202
203func (_c *RunService_GetJob_Call) Return(jobView ports.JobView, err error) *RunService_GetJob_Call {
204 _c.Call.Return(jobView, err)
205 return _c
206}
207
208func (_c *RunService_GetJob_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, jobID string, attempt int32) (ports.JobView, error)) *RunService_GetJob_Call {
209 _c.Call.Return(run)
210 return _c
211}
212
213// GetJobLog provides a mock function for the type RunService
214func (_mock *RunService) GetJobLog(ctx context.Context, p domain.Principal, repo domain.RepoName, params ports.GetJobLogParams, send func(ports.LogBatch) error) error {
215 ret := _mock.Called(ctx, p, repo, params, send)
216
217 if len(ret) == 0 {
218 panic("no return value specified for GetJobLog")
219 }
220
221 var r0 error
222 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, ports.GetJobLogParams, func(ports.LogBatch) error) error); ok {
223 r0 = returnFunc(ctx, p, repo, params, send)
224 } else {
225 r0 = ret.Error(0)
226 }
227 return r0
228}
229
230// RunService_GetJobLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetJobLog'
231type RunService_GetJobLog_Call struct {
232 *mock.Call
233}
234
235// GetJobLog is a helper method to define mock.On call
236// - ctx context.Context
237// - p domain.Principal
238// - repo domain.RepoName
239// - params ports.GetJobLogParams
240// - send func(ports.LogBatch) error
241func (_e *RunService_Expecter) GetJobLog(ctx any, p any, repo any, params any, send any) *RunService_GetJobLog_Call {
242 return &RunService_GetJobLog_Call{Call: _e.mock.On("GetJobLog", ctx, p, repo, params, send)}
243}
244
245func (_c *RunService_GetJobLog_Call) Run(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, params ports.GetJobLogParams, send func(ports.LogBatch) error)) *RunService_GetJobLog_Call {
246 _c.Call.Run(func(args mock.Arguments) {
247 var arg0 context.Context
248 if args[0] != nil {
249 arg0 = args[0].(context.Context)
250 }
251 var arg1 domain.Principal
252 if args[1] != nil {
253 arg1 = args[1].(domain.Principal)
254 }
255 var arg2 domain.RepoName
256 if args[2] != nil {
257 arg2 = args[2].(domain.RepoName)
258 }
259 var arg3 ports.GetJobLogParams
260 if args[3] != nil {
261 arg3 = args[3].(ports.GetJobLogParams)
262 }
263 var arg4 func(ports.LogBatch) error
264 if args[4] != nil {
265 arg4 = args[4].(func(ports.LogBatch) error)
266 }
267 run(
268 arg0,
269 arg1,
270 arg2,
271 arg3,
272 arg4,
273 )
274 })
275 return _c
276}
277
278func (_c *RunService_GetJobLog_Call) Return(err error) *RunService_GetJobLog_Call {
279 _c.Call.Return(err)
280 return _c
281}
282
283func (_c *RunService_GetJobLog_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, params ports.GetJobLogParams, send func(ports.LogBatch) error) error) *RunService_GetJobLog_Call {
284 _c.Call.Return(run)
285 return _c
286}
287
288// GetRun provides a mock function for the type RunService
289func (_mock *RunService) GetRun(ctx context.Context, p domain.Principal, repo domain.RepoName, runID int64, attempt int32) (ports.RunDetail, error) {
290 ret := _mock.Called(ctx, p, repo, runID, attempt)
291
292 if len(ret) == 0 {
293 panic("no return value specified for GetRun")
294 }
295
296 var r0 ports.RunDetail
297 var r1 error
298 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, int64, int32) (ports.RunDetail, error)); ok {
299 return returnFunc(ctx, p, repo, runID, attempt)
300 }
301 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, int64, int32) ports.RunDetail); ok {
302 r0 = returnFunc(ctx, p, repo, runID, attempt)
303 } else {
304 r0 = ret.Get(0).(ports.RunDetail)
305 }
306 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, int64, int32) error); ok {
307 r1 = returnFunc(ctx, p, repo, runID, attempt)
308 } else {
309 r1 = ret.Error(1)
310 }
311 return r0, r1
312}
313
314// RunService_GetRun_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRun'
315type RunService_GetRun_Call struct {
316 *mock.Call
317}
318
319// GetRun is a helper method to define mock.On call
320// - ctx context.Context
321// - p domain.Principal
322// - repo domain.RepoName
323// - runID int64
324// - attempt int32
325func (_e *RunService_Expecter) GetRun(ctx any, p any, repo any, runID any, attempt any) *RunService_GetRun_Call {
326 return &RunService_GetRun_Call{Call: _e.mock.On("GetRun", ctx, p, repo, runID, attempt)}
327}
328
329func (_c *RunService_GetRun_Call) Run(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, runID int64, attempt int32)) *RunService_GetRun_Call {
330 _c.Call.Run(func(args mock.Arguments) {
331 var arg0 context.Context
332 if args[0] != nil {
333 arg0 = args[0].(context.Context)
334 }
335 var arg1 domain.Principal
336 if args[1] != nil {
337 arg1 = args[1].(domain.Principal)
338 }
339 var arg2 domain.RepoName
340 if args[2] != nil {
341 arg2 = args[2].(domain.RepoName)
342 }
343 var arg3 int64
344 if args[3] != nil {
345 arg3 = args[3].(int64)
346 }
347 var arg4 int32
348 if args[4] != nil {
349 arg4 = args[4].(int32)
350 }
351 run(
352 arg0,
353 arg1,
354 arg2,
355 arg3,
356 arg4,
357 )
358 })
359 return _c
360}
361
362func (_c *RunService_GetRun_Call) Return(runDetail ports.RunDetail, err error) *RunService_GetRun_Call {
363 _c.Call.Return(runDetail, err)
364 return _c
365}
366
367func (_c *RunService_GetRun_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, runID int64, attempt int32) (ports.RunDetail, error)) *RunService_GetRun_Call {
368 _c.Call.Return(run)
369 return _c
370}
371
372// ListChecks provides a mock function for the type RunService
373func (_mock *RunService) ListChecks(ctx context.Context, p domain.Principal, repo domain.RepoName, sha string) (ports.ChecksResult, error) {
374 ret := _mock.Called(ctx, p, repo, sha)
375
376 if len(ret) == 0 {
377 panic("no return value specified for ListChecks")
378 }
379
380 var r0 ports.ChecksResult
381 var r1 error
382 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, string) (ports.ChecksResult, error)); ok {
383 return returnFunc(ctx, p, repo, sha)
384 }
385 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, string) ports.ChecksResult); ok {
386 r0 = returnFunc(ctx, p, repo, sha)
387 } else {
388 r0 = ret.Get(0).(ports.ChecksResult)
389 }
390 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, string) error); ok {
391 r1 = returnFunc(ctx, p, repo, sha)
392 } else {
393 r1 = ret.Error(1)
394 }
395 return r0, r1
396}
397
398// RunService_ListChecks_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListChecks'
399type RunService_ListChecks_Call struct {
400 *mock.Call
401}
402
403// ListChecks is a helper method to define mock.On call
404// - ctx context.Context
405// - p domain.Principal
406// - repo domain.RepoName
407// - sha string
408func (_e *RunService_Expecter) ListChecks(ctx any, p any, repo any, sha any) *RunService_ListChecks_Call {
409 return &RunService_ListChecks_Call{Call: _e.mock.On("ListChecks", ctx, p, repo, sha)}
410}
411
412func (_c *RunService_ListChecks_Call) Run(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, sha string)) *RunService_ListChecks_Call {
413 _c.Call.Run(func(args mock.Arguments) {
414 var arg0 context.Context
415 if args[0] != nil {
416 arg0 = args[0].(context.Context)
417 }
418 var arg1 domain.Principal
419 if args[1] != nil {
420 arg1 = args[1].(domain.Principal)
421 }
422 var arg2 domain.RepoName
423 if args[2] != nil {
424 arg2 = args[2].(domain.RepoName)
425 }
426 var arg3 string
427 if args[3] != nil {
428 arg3 = args[3].(string)
429 }
430 run(
431 arg0,
432 arg1,
433 arg2,
434 arg3,
435 )
436 })
437 return _c
438}
439
440func (_c *RunService_ListChecks_Call) Return(checksResult ports.ChecksResult, err error) *RunService_ListChecks_Call {
441 _c.Call.Return(checksResult, err)
442 return _c
443}
444
445func (_c *RunService_ListChecks_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, sha string) (ports.ChecksResult, error)) *RunService_ListChecks_Call {
446 _c.Call.Return(run)
447 return _c
448}
449
450// ListRunners provides a mock function for the type RunService
451func (_mock *RunService) ListRunners(ctx context.Context, p domain.Principal, size int, token string) (ports.RunnerPage, error) {
452 ret := _mock.Called(ctx, p, size, token)
453
454 if len(ret) == 0 {
455 panic("no return value specified for ListRunners")
456 }
457
458 var r0 ports.RunnerPage
459 var r1 error
460 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, int, string) (ports.RunnerPage, error)); ok {
461 return returnFunc(ctx, p, size, token)
462 }
463 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, int, string) ports.RunnerPage); ok {
464 r0 = returnFunc(ctx, p, size, token)
465 } else {
466 r0 = ret.Get(0).(ports.RunnerPage)
467 }
468 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, int, string) error); ok {
469 r1 = returnFunc(ctx, p, size, token)
470 } else {
471 r1 = ret.Error(1)
472 }
473 return r0, r1
474}
475
476// RunService_ListRunners_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListRunners'
477type RunService_ListRunners_Call struct {
478 *mock.Call
479}
480
481// ListRunners is a helper method to define mock.On call
482// - ctx context.Context
483// - p domain.Principal
484// - size int
485// - token string
486func (_e *RunService_Expecter) ListRunners(ctx any, p any, size any, token any) *RunService_ListRunners_Call {
487 return &RunService_ListRunners_Call{Call: _e.mock.On("ListRunners", ctx, p, size, token)}
488}
489
490func (_c *RunService_ListRunners_Call) Run(run func(ctx context.Context, p domain.Principal, size int, token string)) *RunService_ListRunners_Call {
491 _c.Call.Run(func(args mock.Arguments) {
492 var arg0 context.Context
493 if args[0] != nil {
494 arg0 = args[0].(context.Context)
495 }
496 var arg1 domain.Principal
497 if args[1] != nil {
498 arg1 = args[1].(domain.Principal)
499 }
500 var arg2 int
501 if args[2] != nil {
502 arg2 = args[2].(int)
503 }
504 var arg3 string
505 if args[3] != nil {
506 arg3 = args[3].(string)
507 }
508 run(
509 arg0,
510 arg1,
511 arg2,
512 arg3,
513 )
514 })
515 return _c
516}
517
518func (_c *RunService_ListRunners_Call) Return(runnerPage ports.RunnerPage, err error) *RunService_ListRunners_Call {
519 _c.Call.Return(runnerPage, err)
520 return _c
521}
522
523func (_c *RunService_ListRunners_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, size int, token string) (ports.RunnerPage, error)) *RunService_ListRunners_Call {
524 _c.Call.Return(run)
525 return _c
526}
527
528// ListRuns provides a mock function for the type RunService
529func (_mock *RunService) ListRuns(ctx context.Context, p domain.Principal, repo domain.RepoName, params ports.ListRunsParams) (ports.RunPage, error) {
530 ret := _mock.Called(ctx, p, repo, params)
531
532 if len(ret) == 0 {
533 panic("no return value specified for ListRuns")
534 }
535
536 var r0 ports.RunPage
537 var r1 error
538 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, ports.ListRunsParams) (ports.RunPage, error)); ok {
539 return returnFunc(ctx, p, repo, params)
540 }
541 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, ports.ListRunsParams) ports.RunPage); ok {
542 r0 = returnFunc(ctx, p, repo, params)
543 } else {
544 r0 = ret.Get(0).(ports.RunPage)
545 }
546 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, ports.ListRunsParams) error); ok {
547 r1 = returnFunc(ctx, p, repo, params)
548 } else {
549 r1 = ret.Error(1)
550 }
551 return r0, r1
552}
553
554// RunService_ListRuns_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListRuns'
555type RunService_ListRuns_Call struct {
556 *mock.Call
557}
558
559// ListRuns is a helper method to define mock.On call
560// - ctx context.Context
561// - p domain.Principal
562// - repo domain.RepoName
563// - params ports.ListRunsParams
564func (_e *RunService_Expecter) ListRuns(ctx any, p any, repo any, params any) *RunService_ListRuns_Call {
565 return &RunService_ListRuns_Call{Call: _e.mock.On("ListRuns", ctx, p, repo, params)}
566}
567
568func (_c *RunService_ListRuns_Call) Run(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, params ports.ListRunsParams)) *RunService_ListRuns_Call {
569 _c.Call.Run(func(args mock.Arguments) {
570 var arg0 context.Context
571 if args[0] != nil {
572 arg0 = args[0].(context.Context)
573 }
574 var arg1 domain.Principal
575 if args[1] != nil {
576 arg1 = args[1].(domain.Principal)
577 }
578 var arg2 domain.RepoName
579 if args[2] != nil {
580 arg2 = args[2].(domain.RepoName)
581 }
582 var arg3 ports.ListRunsParams
583 if args[3] != nil {
584 arg3 = args[3].(ports.ListRunsParams)
585 }
586 run(
587 arg0,
588 arg1,
589 arg2,
590 arg3,
591 )
592 })
593 return _c
594}
595
596func (_c *RunService_ListRuns_Call) Return(runPage ports.RunPage, err error) *RunService_ListRuns_Call {
597 _c.Call.Return(runPage, err)
598 return _c
599}
600
601func (_c *RunService_ListRuns_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, params ports.ListRunsParams) (ports.RunPage, error)) *RunService_ListRuns_Call {
602 _c.Call.Return(run)
603 return _c
604}
605
606// RemoveRunner provides a mock function for the type RunService
607func (_mock *RunService) RemoveRunner(ctx context.Context, p domain.Principal, id string) error {
608 ret := _mock.Called(ctx, p, id)
609
610 if len(ret) == 0 {
611 panic("no return value specified for RemoveRunner")
612 }
613
614 var r0 error
615 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, string) error); ok {
616 r0 = returnFunc(ctx, p, id)
617 } else {
618 r0 = ret.Error(0)
619 }
620 return r0
621}
622
623// RunService_RemoveRunner_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveRunner'
624type RunService_RemoveRunner_Call struct {
625 *mock.Call
626}
627
628// RemoveRunner is a helper method to define mock.On call
629// - ctx context.Context
630// - p domain.Principal
631// - id string
632func (_e *RunService_Expecter) RemoveRunner(ctx any, p any, id any) *RunService_RemoveRunner_Call {
633 return &RunService_RemoveRunner_Call{Call: _e.mock.On("RemoveRunner", ctx, p, id)}
634}
635
636func (_c *RunService_RemoveRunner_Call) Run(run func(ctx context.Context, p domain.Principal, id string)) *RunService_RemoveRunner_Call {
637 _c.Call.Run(func(args mock.Arguments) {
638 var arg0 context.Context
639 if args[0] != nil {
640 arg0 = args[0].(context.Context)
641 }
642 var arg1 domain.Principal
643 if args[1] != nil {
644 arg1 = args[1].(domain.Principal)
645 }
646 var arg2 string
647 if args[2] != nil {
648 arg2 = args[2].(string)
649 }
650 run(
651 arg0,
652 arg1,
653 arg2,
654 )
655 })
656 return _c
657}
658
659func (_c *RunService_RemoveRunner_Call) Return(err error) *RunService_RemoveRunner_Call {
660 _c.Call.Return(err)
661 return _c
662}
663
664func (_c *RunService_RemoveRunner_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, id string) error) *RunService_RemoveRunner_Call {
665 _c.Call.Return(run)
666 return _c
667}
668
669// RerunRun provides a mock function for the type RunService
670func (_mock *RunService) RerunRun(ctx context.Context, p domain.Principal, repo domain.RepoName, runID int64, failedOnly bool) (domain.CIRun, error) {
671 ret := _mock.Called(ctx, p, repo, runID, failedOnly)
672
673 if len(ret) == 0 {
674 panic("no return value specified for RerunRun")
675 }
676
677 var r0 domain.CIRun
678 var r1 error
679 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, int64, bool) (domain.CIRun, error)); ok {
680 return returnFunc(ctx, p, repo, runID, failedOnly)
681 }
682 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, int64, bool) domain.CIRun); ok {
683 r0 = returnFunc(ctx, p, repo, runID, failedOnly)
684 } else {
685 r0 = ret.Get(0).(domain.CIRun)
686 }
687 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, int64, bool) error); ok {
688 r1 = returnFunc(ctx, p, repo, runID, failedOnly)
689 } else {
690 r1 = ret.Error(1)
691 }
692 return r0, r1
693}
694
695// RunService_RerunRun_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RerunRun'
696type RunService_RerunRun_Call struct {
697 *mock.Call
698}
699
700// RerunRun is a helper method to define mock.On call
701// - ctx context.Context
702// - p domain.Principal
703// - repo domain.RepoName
704// - runID int64
705// - failedOnly bool
706func (_e *RunService_Expecter) RerunRun(ctx any, p any, repo any, runID any, failedOnly any) *RunService_RerunRun_Call {
707 return &RunService_RerunRun_Call{Call: _e.mock.On("RerunRun", ctx, p, repo, runID, failedOnly)}
708}
709
710func (_c *RunService_RerunRun_Call) Run(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, runID int64, failedOnly bool)) *RunService_RerunRun_Call {
711 _c.Call.Run(func(args mock.Arguments) {
712 var arg0 context.Context
713 if args[0] != nil {
714 arg0 = args[0].(context.Context)
715 }
716 var arg1 domain.Principal
717 if args[1] != nil {
718 arg1 = args[1].(domain.Principal)
719 }
720 var arg2 domain.RepoName
721 if args[2] != nil {
722 arg2 = args[2].(domain.RepoName)
723 }
724 var arg3 int64
725 if args[3] != nil {
726 arg3 = args[3].(int64)
727 }
728 var arg4 bool
729 if args[4] != nil {
730 arg4 = args[4].(bool)
731 }
732 run(
733 arg0,
734 arg1,
735 arg2,
736 arg3,
737 arg4,
738 )
739 })
740 return _c
741}
742
743func (_c *RunService_RerunRun_Call) Return(cIRun domain.CIRun, err error) *RunService_RerunRun_Call {
744 _c.Call.Return(cIRun, err)
745 return _c
746}
747
748func (_c *RunService_RerunRun_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, runID int64, failedOnly bool) (domain.CIRun, error)) *RunService_RerunRun_Call {
749 _c.Call.Return(run)
750 return _c
751}