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// NewTokenService creates a new instance of TokenService. 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 NewTokenService(t interface {
18 mock.TestingT
19 Cleanup(func())
20}) *TokenService {
21 if helper, ok := t.(interface{ Helper() }); ok {
22 helper.Helper()
23 }
24
25 mock := &TokenService{}
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// TokenService is an autogenerated mock type for the TokenService type
39type TokenService struct {
40 mock.Mock
41}
42
43type TokenService_Expecter struct {
44 mock *mock.Mock
45}
46
47func (_m *TokenService) EXPECT() *TokenService_Expecter {
48 return &TokenService_Expecter{mock: &_m.Mock}
49}
50
51// Create provides a mock function for the type TokenService
52func (_mock *TokenService) Create(ctx context.Context, p domain.Principal, params ports.CreateTokenParams) (ports.CreatedToken, error) {
53 ret := _mock.Called(ctx, p, params)
54
55 if len(ret) == 0 {
56 panic("no return value specified for Create")
57 }
58
59 var r0 ports.CreatedToken
60 var r1 error
61 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, ports.CreateTokenParams) (ports.CreatedToken, error)); ok {
62 return returnFunc(ctx, p, params)
63 }
64 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, ports.CreateTokenParams) ports.CreatedToken); ok {
65 r0 = returnFunc(ctx, p, params)
66 } else {
67 r0 = ret.Get(0).(ports.CreatedToken)
68 }
69 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, ports.CreateTokenParams) error); ok {
70 r1 = returnFunc(ctx, p, params)
71 } else {
72 r1 = ret.Error(1)
73 }
74 return r0, r1
75}
76
77// TokenService_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create'
78type TokenService_Create_Call struct {
79 *mock.Call
80}
81
82// Create is a helper method to define mock.On call
83// - ctx context.Context
84// - p domain.Principal
85// - params ports.CreateTokenParams
86func (_e *TokenService_Expecter) Create(ctx any, p any, params any) *TokenService_Create_Call {
87 return &TokenService_Create_Call{Call: _e.mock.On("Create", ctx, p, params)}
88}
89
90func (_c *TokenService_Create_Call) Run(run func(ctx context.Context, p domain.Principal, params ports.CreateTokenParams)) *TokenService_Create_Call {
91 _c.Call.Run(func(args mock.Arguments) {
92 var arg0 context.Context
93 if args[0] != nil {
94 arg0 = args[0].(context.Context)
95 }
96 var arg1 domain.Principal
97 if args[1] != nil {
98 arg1 = args[1].(domain.Principal)
99 }
100 var arg2 ports.CreateTokenParams
101 if args[2] != nil {
102 arg2 = args[2].(ports.CreateTokenParams)
103 }
104 run(
105 arg0,
106 arg1,
107 arg2,
108 )
109 })
110 return _c
111}
112
113func (_c *TokenService_Create_Call) Return(createdToken ports.CreatedToken, err error) *TokenService_Create_Call {
114 _c.Call.Return(createdToken, err)
115 return _c
116}
117
118func (_c *TokenService_Create_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, params ports.CreateTokenParams) (ports.CreatedToken, error)) *TokenService_Create_Call {
119 _c.Call.Return(run)
120 return _c
121}
122
123// ListPage provides a mock function for the type TokenService
124func (_mock *TokenService) ListPage(ctx context.Context, p domain.Principal, size int, token string) (ports.TokenPage, error) {
125 ret := _mock.Called(ctx, p, size, token)
126
127 if len(ret) == 0 {
128 panic("no return value specified for ListPage")
129 }
130
131 var r0 ports.TokenPage
132 var r1 error
133 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, int, string) (ports.TokenPage, error)); ok {
134 return returnFunc(ctx, p, size, token)
135 }
136 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, int, string) ports.TokenPage); ok {
137 r0 = returnFunc(ctx, p, size, token)
138 } else {
139 r0 = ret.Get(0).(ports.TokenPage)
140 }
141 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, int, string) error); ok {
142 r1 = returnFunc(ctx, p, size, token)
143 } else {
144 r1 = ret.Error(1)
145 }
146 return r0, r1
147}
148
149// TokenService_ListPage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListPage'
150type TokenService_ListPage_Call struct {
151 *mock.Call
152}
153
154// ListPage is a helper method to define mock.On call
155// - ctx context.Context
156// - p domain.Principal
157// - size int
158// - token string
159func (_e *TokenService_Expecter) ListPage(ctx any, p any, size any, token any) *TokenService_ListPage_Call {
160 return &TokenService_ListPage_Call{Call: _e.mock.On("ListPage", ctx, p, size, token)}
161}
162
163func (_c *TokenService_ListPage_Call) Run(run func(ctx context.Context, p domain.Principal, size int, token string)) *TokenService_ListPage_Call {
164 _c.Call.Run(func(args mock.Arguments) {
165 var arg0 context.Context
166 if args[0] != nil {
167 arg0 = args[0].(context.Context)
168 }
169 var arg1 domain.Principal
170 if args[1] != nil {
171 arg1 = args[1].(domain.Principal)
172 }
173 var arg2 int
174 if args[2] != nil {
175 arg2 = args[2].(int)
176 }
177 var arg3 string
178 if args[3] != nil {
179 arg3 = args[3].(string)
180 }
181 run(
182 arg0,
183 arg1,
184 arg2,
185 arg3,
186 )
187 })
188 return _c
189}
190
191func (_c *TokenService_ListPage_Call) Return(tokenPage ports.TokenPage, err error) *TokenService_ListPage_Call {
192 _c.Call.Return(tokenPage, err)
193 return _c
194}
195
196func (_c *TokenService_ListPage_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, size int, token string) (ports.TokenPage, error)) *TokenService_ListPage_Call {
197 _c.Call.Return(run)
198 return _c
199}
200
201// Revoke provides a mock function for the type TokenService
202func (_mock *TokenService) Revoke(ctx context.Context, p domain.Principal, id string) error {
203 ret := _mock.Called(ctx, p, id)
204
205 if len(ret) == 0 {
206 panic("no return value specified for Revoke")
207 }
208
209 var r0 error
210 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, string) error); ok {
211 r0 = returnFunc(ctx, p, id)
212 } else {
213 r0 = ret.Error(0)
214 }
215 return r0
216}
217
218// TokenService_Revoke_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Revoke'
219type TokenService_Revoke_Call struct {
220 *mock.Call
221}
222
223// Revoke is a helper method to define mock.On call
224// - ctx context.Context
225// - p domain.Principal
226// - id string
227func (_e *TokenService_Expecter) Revoke(ctx any, p any, id any) *TokenService_Revoke_Call {
228 return &TokenService_Revoke_Call{Call: _e.mock.On("Revoke", ctx, p, id)}
229}
230
231func (_c *TokenService_Revoke_Call) Run(run func(ctx context.Context, p domain.Principal, id string)) *TokenService_Revoke_Call {
232 _c.Call.Run(func(args mock.Arguments) {
233 var arg0 context.Context
234 if args[0] != nil {
235 arg0 = args[0].(context.Context)
236 }
237 var arg1 domain.Principal
238 if args[1] != nil {
239 arg1 = args[1].(domain.Principal)
240 }
241 var arg2 string
242 if args[2] != nil {
243 arg2 = args[2].(string)
244 }
245 run(
246 arg0,
247 arg1,
248 arg2,
249 )
250 })
251 return _c
252}
253
254func (_c *TokenService_Revoke_Call) Return(err error) *TokenService_Revoke_Call {
255 _c.Call.Return(err)
256 return _c
257}
258
259func (_c *TokenService_Revoke_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, id string) error) *TokenService_Revoke_Call {
260 _c.Call.Return(run)
261 return _c
262}