1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package mocks
6
7import (
8 "context"
9 "time"
10
11 "bnema.dev/ermite/internal/domain"
12 mock "github.com/stretchr/testify/mock"
13)
14
15// NewWebPasskeyService creates a new instance of WebPasskeyService. 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 NewWebPasskeyService(t interface {
18 mock.TestingT
19 Cleanup(func())
20}) *WebPasskeyService {
21 if helper, ok := t.(interface{ Helper() }); ok {
22 helper.Helper()
23 }
24
25 mock := &WebPasskeyService{}
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// WebPasskeyService is an autogenerated mock type for the WebPasskeyService type
39type WebPasskeyService struct {
40 mock.Mock
41}
42
43type WebPasskeyService_Expecter struct {
44 mock *mock.Mock
45}
46
47func (_m *WebPasskeyService) EXPECT() *WebPasskeyService_Expecter {
48 return &WebPasskeyService_Expecter{mock: &_m.Mock}
49}
50
51// BeginLogin provides a mock function for the type WebPasskeyService
52func (_mock *WebPasskeyService) BeginLogin(ctx context.Context, client string) (string, []byte, error) {
53 ret := _mock.Called(ctx, client)
54
55 if len(ret) == 0 {
56 panic("no return value specified for BeginLogin")
57 }
58
59 var r0 string
60 var r1 []byte
61 var r2 error
62 if returnFunc, ok := ret.Get(0).(func(context.Context, string) (string, []byte, error)); ok {
63 return returnFunc(ctx, client)
64 }
65 if returnFunc, ok := ret.Get(0).(func(context.Context, string) string); ok {
66 r0 = returnFunc(ctx, client)
67 } else {
68 r0 = ret.Get(0).(string)
69 }
70 if returnFunc, ok := ret.Get(1).(func(context.Context, string) []byte); ok {
71 r1 = returnFunc(ctx, client)
72 } else {
73 if ret.Get(1) != nil {
74 r1 = ret.Get(1).([]byte)
75 }
76 }
77 if returnFunc, ok := ret.Get(2).(func(context.Context, string) error); ok {
78 r2 = returnFunc(ctx, client)
79 } else {
80 r2 = ret.Error(2)
81 }
82 return r0, r1, r2
83}
84
85// WebPasskeyService_BeginLogin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BeginLogin'
86type WebPasskeyService_BeginLogin_Call struct {
87 *mock.Call
88}
89
90// BeginLogin is a helper method to define mock.On call
91// - ctx context.Context
92// - client string
93func (_e *WebPasskeyService_Expecter) BeginLogin(ctx any, client any) *WebPasskeyService_BeginLogin_Call {
94 return &WebPasskeyService_BeginLogin_Call{Call: _e.mock.On("BeginLogin", ctx, client)}
95}
96
97func (_c *WebPasskeyService_BeginLogin_Call) Run(run func(ctx context.Context, client string)) *WebPasskeyService_BeginLogin_Call {
98 _c.Call.Run(func(args mock.Arguments) {
99 var arg0 context.Context
100 if args[0] != nil {
101 arg0 = args[0].(context.Context)
102 }
103 var arg1 string
104 if args[1] != nil {
105 arg1 = args[1].(string)
106 }
107 run(
108 arg0,
109 arg1,
110 )
111 })
112 return _c
113}
114
115func (_c *WebPasskeyService_BeginLogin_Call) Return(ceremony string, options []byte, err error) *WebPasskeyService_BeginLogin_Call {
116 _c.Call.Return(ceremony, options, err)
117 return _c
118}
119
120func (_c *WebPasskeyService_BeginLogin_Call) RunAndReturn(run func(ctx context.Context, client string) (string, []byte, error)) *WebPasskeyService_BeginLogin_Call {
121 _c.Call.Return(run)
122 return _c
123}
124
125// BeginRegistration provides a mock function for the type WebPasskeyService
126func (_mock *WebPasskeyService) BeginRegistration(ctx context.Context, p domain.Principal, name string) (string, []byte, error) {
127 ret := _mock.Called(ctx, p, name)
128
129 if len(ret) == 0 {
130 panic("no return value specified for BeginRegistration")
131 }
132
133 var r0 string
134 var r1 []byte
135 var r2 error
136 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, string) (string, []byte, error)); ok {
137 return returnFunc(ctx, p, name)
138 }
139 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, string) string); ok {
140 r0 = returnFunc(ctx, p, name)
141 } else {
142 r0 = ret.Get(0).(string)
143 }
144 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, string) []byte); ok {
145 r1 = returnFunc(ctx, p, name)
146 } else {
147 if ret.Get(1) != nil {
148 r1 = ret.Get(1).([]byte)
149 }
150 }
151 if returnFunc, ok := ret.Get(2).(func(context.Context, domain.Principal, string) error); ok {
152 r2 = returnFunc(ctx, p, name)
153 } else {
154 r2 = ret.Error(2)
155 }
156 return r0, r1, r2
157}
158
159// WebPasskeyService_BeginRegistration_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BeginRegistration'
160type WebPasskeyService_BeginRegistration_Call struct {
161 *mock.Call
162}
163
164// BeginRegistration is a helper method to define mock.On call
165// - ctx context.Context
166// - p domain.Principal
167// - name string
168func (_e *WebPasskeyService_Expecter) BeginRegistration(ctx any, p any, name any) *WebPasskeyService_BeginRegistration_Call {
169 return &WebPasskeyService_BeginRegistration_Call{Call: _e.mock.On("BeginRegistration", ctx, p, name)}
170}
171
172func (_c *WebPasskeyService_BeginRegistration_Call) Run(run func(ctx context.Context, p domain.Principal, name string)) *WebPasskeyService_BeginRegistration_Call {
173 _c.Call.Run(func(args mock.Arguments) {
174 var arg0 context.Context
175 if args[0] != nil {
176 arg0 = args[0].(context.Context)
177 }
178 var arg1 domain.Principal
179 if args[1] != nil {
180 arg1 = args[1].(domain.Principal)
181 }
182 var arg2 string
183 if args[2] != nil {
184 arg2 = args[2].(string)
185 }
186 run(
187 arg0,
188 arg1,
189 arg2,
190 )
191 })
192 return _c
193}
194
195func (_c *WebPasskeyService_BeginRegistration_Call) Return(ceremony string, options []byte, err error) *WebPasskeyService_BeginRegistration_Call {
196 _c.Call.Return(ceremony, options, err)
197 return _c
198}
199
200func (_c *WebPasskeyService_BeginRegistration_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, name string) (string, []byte, error)) *WebPasskeyService_BeginRegistration_Call {
201 _c.Call.Return(run)
202 return _c
203}
204
205// FinishLogin provides a mock function for the type WebPasskeyService
206func (_mock *WebPasskeyService) FinishLogin(ctx context.Context, ceremony string, response []byte) (string, time.Duration, error) {
207 ret := _mock.Called(ctx, ceremony, response)
208
209 if len(ret) == 0 {
210 panic("no return value specified for FinishLogin")
211 }
212
213 var r0 string
214 var r1 time.Duration
215 var r2 error
216 if returnFunc, ok := ret.Get(0).(func(context.Context, string, []byte) (string, time.Duration, error)); ok {
217 return returnFunc(ctx, ceremony, response)
218 }
219 if returnFunc, ok := ret.Get(0).(func(context.Context, string, []byte) string); ok {
220 r0 = returnFunc(ctx, ceremony, response)
221 } else {
222 r0 = ret.Get(0).(string)
223 }
224 if returnFunc, ok := ret.Get(1).(func(context.Context, string, []byte) time.Duration); ok {
225 r1 = returnFunc(ctx, ceremony, response)
226 } else {
227 r1 = ret.Get(1).(time.Duration)
228 }
229 if returnFunc, ok := ret.Get(2).(func(context.Context, string, []byte) error); ok {
230 r2 = returnFunc(ctx, ceremony, response)
231 } else {
232 r2 = ret.Error(2)
233 }
234 return r0, r1, r2
235}
236
237// WebPasskeyService_FinishLogin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FinishLogin'
238type WebPasskeyService_FinishLogin_Call struct {
239 *mock.Call
240}
241
242// FinishLogin is a helper method to define mock.On call
243// - ctx context.Context
244// - ceremony string
245// - response []byte
246func (_e *WebPasskeyService_Expecter) FinishLogin(ctx any, ceremony any, response any) *WebPasskeyService_FinishLogin_Call {
247 return &WebPasskeyService_FinishLogin_Call{Call: _e.mock.On("FinishLogin", ctx, ceremony, response)}
248}
249
250func (_c *WebPasskeyService_FinishLogin_Call) Run(run func(ctx context.Context, ceremony string, response []byte)) *WebPasskeyService_FinishLogin_Call {
251 _c.Call.Run(func(args mock.Arguments) {
252 var arg0 context.Context
253 if args[0] != nil {
254 arg0 = args[0].(context.Context)
255 }
256 var arg1 string
257 if args[1] != nil {
258 arg1 = args[1].(string)
259 }
260 var arg2 []byte
261 if args[2] != nil {
262 arg2 = args[2].([]byte)
263 }
264 run(
265 arg0,
266 arg1,
267 arg2,
268 )
269 })
270 return _c
271}
272
273func (_c *WebPasskeyService_FinishLogin_Call) Return(token string, lifetime time.Duration, err error) *WebPasskeyService_FinishLogin_Call {
274 _c.Call.Return(token, lifetime, err)
275 return _c
276}
277
278func (_c *WebPasskeyService_FinishLogin_Call) RunAndReturn(run func(ctx context.Context, ceremony string, response []byte) (string, time.Duration, error)) *WebPasskeyService_FinishLogin_Call {
279 _c.Call.Return(run)
280 return _c
281}
282
283// FinishRegistration provides a mock function for the type WebPasskeyService
284func (_mock *WebPasskeyService) FinishRegistration(ctx context.Context, p domain.Principal, ceremony string, response []byte) error {
285 ret := _mock.Called(ctx, p, ceremony, response)
286
287 if len(ret) == 0 {
288 panic("no return value specified for FinishRegistration")
289 }
290
291 var r0 error
292 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, string, []byte) error); ok {
293 r0 = returnFunc(ctx, p, ceremony, response)
294 } else {
295 r0 = ret.Error(0)
296 }
297 return r0
298}
299
300// WebPasskeyService_FinishRegistration_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FinishRegistration'
301type WebPasskeyService_FinishRegistration_Call struct {
302 *mock.Call
303}
304
305// FinishRegistration is a helper method to define mock.On call
306// - ctx context.Context
307// - p domain.Principal
308// - ceremony string
309// - response []byte
310func (_e *WebPasskeyService_Expecter) FinishRegistration(ctx any, p any, ceremony any, response any) *WebPasskeyService_FinishRegistration_Call {
311 return &WebPasskeyService_FinishRegistration_Call{Call: _e.mock.On("FinishRegistration", ctx, p, ceremony, response)}
312}
313
314func (_c *WebPasskeyService_FinishRegistration_Call) Run(run func(ctx context.Context, p domain.Principal, ceremony string, response []byte)) *WebPasskeyService_FinishRegistration_Call {
315 _c.Call.Run(func(args mock.Arguments) {
316 var arg0 context.Context
317 if args[0] != nil {
318 arg0 = args[0].(context.Context)
319 }
320 var arg1 domain.Principal
321 if args[1] != nil {
322 arg1 = args[1].(domain.Principal)
323 }
324 var arg2 string
325 if args[2] != nil {
326 arg2 = args[2].(string)
327 }
328 var arg3 []byte
329 if args[3] != nil {
330 arg3 = args[3].([]byte)
331 }
332 run(
333 arg0,
334 arg1,
335 arg2,
336 arg3,
337 )
338 })
339 return _c
340}
341
342func (_c *WebPasskeyService_FinishRegistration_Call) Return(err error) *WebPasskeyService_FinishRegistration_Call {
343 _c.Call.Return(err)
344 return _c
345}
346
347func (_c *WebPasskeyService_FinishRegistration_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, ceremony string, response []byte) error) *WebPasskeyService_FinishRegistration_Call {
348 _c.Call.Return(run)
349 return _c
350}
351
352// List provides a mock function for the type WebPasskeyService
353func (_mock *WebPasskeyService) List(ctx context.Context, p domain.Principal) ([]domain.Passkey, error) {
354 ret := _mock.Called(ctx, p)
355
356 if len(ret) == 0 {
357 panic("no return value specified for List")
358 }
359
360 var r0 []domain.Passkey
361 var r1 error
362 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal) ([]domain.Passkey, error)); ok {
363 return returnFunc(ctx, p)
364 }
365 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal) []domain.Passkey); ok {
366 r0 = returnFunc(ctx, p)
367 } else {
368 if ret.Get(0) != nil {
369 r0 = ret.Get(0).([]domain.Passkey)
370 }
371 }
372 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal) error); ok {
373 r1 = returnFunc(ctx, p)
374 } else {
375 r1 = ret.Error(1)
376 }
377 return r0, r1
378}
379
380// WebPasskeyService_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List'
381type WebPasskeyService_List_Call struct {
382 *mock.Call
383}
384
385// List is a helper method to define mock.On call
386// - ctx context.Context
387// - p domain.Principal
388func (_e *WebPasskeyService_Expecter) List(ctx any, p any) *WebPasskeyService_List_Call {
389 return &WebPasskeyService_List_Call{Call: _e.mock.On("List", ctx, p)}
390}
391
392func (_c *WebPasskeyService_List_Call) Run(run func(ctx context.Context, p domain.Principal)) *WebPasskeyService_List_Call {
393 _c.Call.Run(func(args mock.Arguments) {
394 var arg0 context.Context
395 if args[0] != nil {
396 arg0 = args[0].(context.Context)
397 }
398 var arg1 domain.Principal
399 if args[1] != nil {
400 arg1 = args[1].(domain.Principal)
401 }
402 run(
403 arg0,
404 arg1,
405 )
406 })
407 return _c
408}
409
410func (_c *WebPasskeyService_List_Call) Return(passkeys []domain.Passkey, err error) *WebPasskeyService_List_Call {
411 _c.Call.Return(passkeys, err)
412 return _c
413}
414
415func (_c *WebPasskeyService_List_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal) ([]domain.Passkey, error)) *WebPasskeyService_List_Call {
416 _c.Call.Return(run)
417 return _c
418}
419
420// Remove provides a mock function for the type WebPasskeyService
421func (_mock *WebPasskeyService) Remove(ctx context.Context, p domain.Principal, id []byte) error {
422 ret := _mock.Called(ctx, p, id)
423
424 if len(ret) == 0 {
425 panic("no return value specified for Remove")
426 }
427
428 var r0 error
429 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, []byte) error); ok {
430 r0 = returnFunc(ctx, p, id)
431 } else {
432 r0 = ret.Error(0)
433 }
434 return r0
435}
436
437// WebPasskeyService_Remove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Remove'
438type WebPasskeyService_Remove_Call struct {
439 *mock.Call
440}
441
442// Remove is a helper method to define mock.On call
443// - ctx context.Context
444// - p domain.Principal
445// - id []byte
446func (_e *WebPasskeyService_Expecter) Remove(ctx any, p any, id any) *WebPasskeyService_Remove_Call {
447 return &WebPasskeyService_Remove_Call{Call: _e.mock.On("Remove", ctx, p, id)}
448}
449
450func (_c *WebPasskeyService_Remove_Call) Run(run func(ctx context.Context, p domain.Principal, id []byte)) *WebPasskeyService_Remove_Call {
451 _c.Call.Run(func(args mock.Arguments) {
452 var arg0 context.Context
453 if args[0] != nil {
454 arg0 = args[0].(context.Context)
455 }
456 var arg1 domain.Principal
457 if args[1] != nil {
458 arg1 = args[1].(domain.Principal)
459 }
460 var arg2 []byte
461 if args[2] != nil {
462 arg2 = args[2].([]byte)
463 }
464 run(
465 arg0,
466 arg1,
467 arg2,
468 )
469 })
470 return _c
471}
472
473func (_c *WebPasskeyService_Remove_Call) Return(err error) *WebPasskeyService_Remove_Call {
474 _c.Call.Return(err)
475 return _c
476}
477
478func (_c *WebPasskeyService_Remove_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, id []byte) error) *WebPasskeyService_Remove_Call {
479 _c.Call.Return(run)
480 return _c
481}