v2.10.1 43db1bb

mock_token_store.go RawHistoryFolder

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	"github.com/bnema/gordon/internal/domain"
11	mock "github.com/stretchr/testify/mock"
12)
13
14// NewMockTokenStore creates a new instance of MockTokenStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
15// The first argument is typically a *testing.T value.
16func NewMockTokenStore(t interface {
17	mock.TestingT
18	Cleanup(func())
19}) *MockTokenStore {
20	mock := &MockTokenStore{}
21	mock.Mock.Test(t)
22
23	t.Cleanup(func() { mock.AssertExpectations(t) })
24
25	return mock
26}
27
28// MockTokenStore is an autogenerated mock type for the TokenStore type
29type MockTokenStore struct {
30	mock.Mock
31}
32
33type MockTokenStore_Expecter struct {
34	mock *mock.Mock
35}
36
37func (_m *MockTokenStore) EXPECT() *MockTokenStore_Expecter {
38	return &MockTokenStore_Expecter{mock: &_m.Mock}
39}
40
41// DeleteToken provides a mock function for the type MockTokenStore
42func (_mock *MockTokenStore) DeleteToken(ctx context.Context, subject string) error {
43	ret := _mock.Called(ctx, subject)
44
45	if len(ret) == 0 {
46		panic("no return value specified for DeleteToken")
47	}
48
49	var r0 error
50	if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
51		r0 = returnFunc(ctx, subject)
52	} else {
53		r0 = ret.Error(0)
54	}
55	return r0
56}
57
58// MockTokenStore_DeleteToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteToken'
59type MockTokenStore_DeleteToken_Call struct {
60	*mock.Call
61}
62
63// DeleteToken is a helper method to define mock.On call
64//   - ctx context.Context
65//   - subject string
66func (_e *MockTokenStore_Expecter) DeleteToken(ctx interface{}, subject interface{}) *MockTokenStore_DeleteToken_Call {
67	return &MockTokenStore_DeleteToken_Call{Call: _e.mock.On("DeleteToken", ctx, subject)}
68}
69
70func (_c *MockTokenStore_DeleteToken_Call) Run(run func(ctx context.Context, subject string)) *MockTokenStore_DeleteToken_Call {
71	_c.Call.Run(func(args mock.Arguments) {
72		var arg0 context.Context
73		if args[0] != nil {
74			arg0 = args[0].(context.Context)
75		}
76		var arg1 string
77		if args[1] != nil {
78			arg1 = args[1].(string)
79		}
80		run(
81			arg0,
82			arg1,
83		)
84	})
85	return _c
86}
87
88func (_c *MockTokenStore_DeleteToken_Call) Return(err error) *MockTokenStore_DeleteToken_Call {
89	_c.Call.Return(err)
90	return _c
91}
92
93func (_c *MockTokenStore_DeleteToken_Call) RunAndReturn(run func(ctx context.Context, subject string) error) *MockTokenStore_DeleteToken_Call {
94	_c.Call.Return(run)
95	return _c
96}
97
98// GetToken provides a mock function for the type MockTokenStore
99func (_mock *MockTokenStore) GetToken(ctx context.Context, subject string) (string, *domain.Token, error) {
100	ret := _mock.Called(ctx, subject)
101
102	if len(ret) == 0 {
103		panic("no return value specified for GetToken")
104	}
105
106	var r0 string
107	var r1 *domain.Token
108	var r2 error
109	if returnFunc, ok := ret.Get(0).(func(context.Context, string) (string, *domain.Token, error)); ok {
110		return returnFunc(ctx, subject)
111	}
112	if returnFunc, ok := ret.Get(0).(func(context.Context, string) string); ok {
113		r0 = returnFunc(ctx, subject)
114	} else {
115		r0 = ret.Get(0).(string)
116	}
117	if returnFunc, ok := ret.Get(1).(func(context.Context, string) *domain.Token); ok {
118		r1 = returnFunc(ctx, subject)
119	} else {
120		if ret.Get(1) != nil {
121			r1 = ret.Get(1).(*domain.Token)
122		}
123	}
124	if returnFunc, ok := ret.Get(2).(func(context.Context, string) error); ok {
125		r2 = returnFunc(ctx, subject)
126	} else {
127		r2 = ret.Error(2)
128	}
129	return r0, r1, r2
130}
131
132// MockTokenStore_GetToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetToken'
133type MockTokenStore_GetToken_Call struct {
134	*mock.Call
135}
136
137// GetToken is a helper method to define mock.On call
138//   - ctx context.Context
139//   - subject string
140func (_e *MockTokenStore_Expecter) GetToken(ctx interface{}, subject interface{}) *MockTokenStore_GetToken_Call {
141	return &MockTokenStore_GetToken_Call{Call: _e.mock.On("GetToken", ctx, subject)}
142}
143
144func (_c *MockTokenStore_GetToken_Call) Run(run func(ctx context.Context, subject string)) *MockTokenStore_GetToken_Call {
145	_c.Call.Run(func(args mock.Arguments) {
146		var arg0 context.Context
147		if args[0] != nil {
148			arg0 = args[0].(context.Context)
149		}
150		var arg1 string
151		if args[1] != nil {
152			arg1 = args[1].(string)
153		}
154		run(
155			arg0,
156			arg1,
157		)
158	})
159	return _c
160}
161
162func (_c *MockTokenStore_GetToken_Call) Return(s string, token *domain.Token, err error) *MockTokenStore_GetToken_Call {
163	_c.Call.Return(s, token, err)
164	return _c
165}
166
167func (_c *MockTokenStore_GetToken_Call) RunAndReturn(run func(ctx context.Context, subject string) (string, *domain.Token, error)) *MockTokenStore_GetToken_Call {
168	_c.Call.Return(run)
169	return _c
170}
171
172// IsRevoked provides a mock function for the type MockTokenStore
173func (_mock *MockTokenStore) IsRevoked(ctx context.Context, tokenID string) (bool, error) {
174	ret := _mock.Called(ctx, tokenID)
175
176	if len(ret) == 0 {
177		panic("no return value specified for IsRevoked")
178	}
179
180	var r0 bool
181	var r1 error
182	if returnFunc, ok := ret.Get(0).(func(context.Context, string) (bool, error)); ok {
183		return returnFunc(ctx, tokenID)
184	}
185	if returnFunc, ok := ret.Get(0).(func(context.Context, string) bool); ok {
186		r0 = returnFunc(ctx, tokenID)
187	} else {
188		r0 = ret.Get(0).(bool)
189	}
190	if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
191		r1 = returnFunc(ctx, tokenID)
192	} else {
193		r1 = ret.Error(1)
194	}
195	return r0, r1
196}
197
198// MockTokenStore_IsRevoked_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsRevoked'
199type MockTokenStore_IsRevoked_Call struct {
200	*mock.Call
201}
202
203// IsRevoked is a helper method to define mock.On call
204//   - ctx context.Context
205//   - tokenID string
206func (_e *MockTokenStore_Expecter) IsRevoked(ctx interface{}, tokenID interface{}) *MockTokenStore_IsRevoked_Call {
207	return &MockTokenStore_IsRevoked_Call{Call: _e.mock.On("IsRevoked", ctx, tokenID)}
208}
209
210func (_c *MockTokenStore_IsRevoked_Call) Run(run func(ctx context.Context, tokenID string)) *MockTokenStore_IsRevoked_Call {
211	_c.Call.Run(func(args mock.Arguments) {
212		var arg0 context.Context
213		if args[0] != nil {
214			arg0 = args[0].(context.Context)
215		}
216		var arg1 string
217		if args[1] != nil {
218			arg1 = args[1].(string)
219		}
220		run(
221			arg0,
222			arg1,
223		)
224	})
225	return _c
226}
227
228func (_c *MockTokenStore_IsRevoked_Call) Return(b bool, err error) *MockTokenStore_IsRevoked_Call {
229	_c.Call.Return(b, err)
230	return _c
231}
232
233func (_c *MockTokenStore_IsRevoked_Call) RunAndReturn(run func(ctx context.Context, tokenID string) (bool, error)) *MockTokenStore_IsRevoked_Call {
234	_c.Call.Return(run)
235	return _c
236}
237
238// ListTokens provides a mock function for the type MockTokenStore
239func (_mock *MockTokenStore) ListTokens(ctx context.Context) ([]domain.Token, error) {
240	ret := _mock.Called(ctx)
241
242	if len(ret) == 0 {
243		panic("no return value specified for ListTokens")
244	}
245
246	var r0 []domain.Token
247	var r1 error
248	if returnFunc, ok := ret.Get(0).(func(context.Context) ([]domain.Token, error)); ok {
249		return returnFunc(ctx)
250	}
251	if returnFunc, ok := ret.Get(0).(func(context.Context) []domain.Token); ok {
252		r0 = returnFunc(ctx)
253	} else {
254		if ret.Get(0) != nil {
255			r0 = ret.Get(0).([]domain.Token)
256		}
257	}
258	if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
259		r1 = returnFunc(ctx)
260	} else {
261		r1 = ret.Error(1)
262	}
263	return r0, r1
264}
265
266// MockTokenStore_ListTokens_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListTokens'
267type MockTokenStore_ListTokens_Call struct {
268	*mock.Call
269}
270
271// ListTokens is a helper method to define mock.On call
272//   - ctx context.Context
273func (_e *MockTokenStore_Expecter) ListTokens(ctx interface{}) *MockTokenStore_ListTokens_Call {
274	return &MockTokenStore_ListTokens_Call{Call: _e.mock.On("ListTokens", ctx)}
275}
276
277func (_c *MockTokenStore_ListTokens_Call) Run(run func(ctx context.Context)) *MockTokenStore_ListTokens_Call {
278	_c.Call.Run(func(args mock.Arguments) {
279		var arg0 context.Context
280		if args[0] != nil {
281			arg0 = args[0].(context.Context)
282		}
283		run(
284			arg0,
285		)
286	})
287	return _c
288}
289
290func (_c *MockTokenStore_ListTokens_Call) Return(tokens []domain.Token, err error) *MockTokenStore_ListTokens_Call {
291	_c.Call.Return(tokens, err)
292	return _c
293}
294
295func (_c *MockTokenStore_ListTokens_Call) RunAndReturn(run func(ctx context.Context) ([]domain.Token, error)) *MockTokenStore_ListTokens_Call {
296	_c.Call.Return(run)
297	return _c
298}
299
300// Revoke provides a mock function for the type MockTokenStore
301func (_mock *MockTokenStore) Revoke(ctx context.Context, tokenID string) error {
302	ret := _mock.Called(ctx, tokenID)
303
304	if len(ret) == 0 {
305		panic("no return value specified for Revoke")
306	}
307
308	var r0 error
309	if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
310		r0 = returnFunc(ctx, tokenID)
311	} else {
312		r0 = ret.Error(0)
313	}
314	return r0
315}
316
317// MockTokenStore_Revoke_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Revoke'
318type MockTokenStore_Revoke_Call struct {
319	*mock.Call
320}
321
322// Revoke is a helper method to define mock.On call
323//   - ctx context.Context
324//   - tokenID string
325func (_e *MockTokenStore_Expecter) Revoke(ctx interface{}, tokenID interface{}) *MockTokenStore_Revoke_Call {
326	return &MockTokenStore_Revoke_Call{Call: _e.mock.On("Revoke", ctx, tokenID)}
327}
328
329func (_c *MockTokenStore_Revoke_Call) Run(run func(ctx context.Context, tokenID string)) *MockTokenStore_Revoke_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 string
336		if args[1] != nil {
337			arg1 = args[1].(string)
338		}
339		run(
340			arg0,
341			arg1,
342		)
343	})
344	return _c
345}
346
347func (_c *MockTokenStore_Revoke_Call) Return(err error) *MockTokenStore_Revoke_Call {
348	_c.Call.Return(err)
349	return _c
350}
351
352func (_c *MockTokenStore_Revoke_Call) RunAndReturn(run func(ctx context.Context, tokenID string) error) *MockTokenStore_Revoke_Call {
353	_c.Call.Return(run)
354	return _c
355}
356
357// SaveToken provides a mock function for the type MockTokenStore
358func (_mock *MockTokenStore) SaveToken(ctx context.Context, token *domain.Token, jwt string) error {
359	ret := _mock.Called(ctx, token, jwt)
360
361	if len(ret) == 0 {
362		panic("no return value specified for SaveToken")
363	}
364
365	var r0 error
366	if returnFunc, ok := ret.Get(0).(func(context.Context, *domain.Token, string) error); ok {
367		r0 = returnFunc(ctx, token, jwt)
368	} else {
369		r0 = ret.Error(0)
370	}
371	return r0
372}
373
374// MockTokenStore_SaveToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveToken'
375type MockTokenStore_SaveToken_Call struct {
376	*mock.Call
377}
378
379// SaveToken is a helper method to define mock.On call
380//   - ctx context.Context
381//   - token *domain.Token
382//   - jwt string
383func (_e *MockTokenStore_Expecter) SaveToken(ctx interface{}, token interface{}, jwt interface{}) *MockTokenStore_SaveToken_Call {
384	return &MockTokenStore_SaveToken_Call{Call: _e.mock.On("SaveToken", ctx, token, jwt)}
385}
386
387func (_c *MockTokenStore_SaveToken_Call) Run(run func(ctx context.Context, token *domain.Token, jwt string)) *MockTokenStore_SaveToken_Call {
388	_c.Call.Run(func(args mock.Arguments) {
389		var arg0 context.Context
390		if args[0] != nil {
391			arg0 = args[0].(context.Context)
392		}
393		var arg1 *domain.Token
394		if args[1] != nil {
395			arg1 = args[1].(*domain.Token)
396		}
397		var arg2 string
398		if args[2] != nil {
399			arg2 = args[2].(string)
400		}
401		run(
402			arg0,
403			arg1,
404			arg2,
405		)
406	})
407	return _c
408}
409
410func (_c *MockTokenStore_SaveToken_Call) Return(err error) *MockTokenStore_SaveToken_Call {
411	_c.Call.Return(err)
412	return _c
413}
414
415func (_c *MockTokenStore_SaveToken_Call) RunAndReturn(run func(ctx context.Context, token *domain.Token, jwt string) error) *MockTokenStore_SaveToken_Call {
416	_c.Call.Return(run)
417	return _c
418}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 7

Tags 106

↑↓ moveenter openesc close