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