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