forked from oapi-codegen/oapi-codegen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
echo_router_moq.gen.go
535 lines (504 loc) · 13.9 KB
/
echo_router_moq.gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
// Code generated by moq; DO NOT EDIT.
// github.com/matryer/moq
package server
import (
"github.com/labstack/echo/v4"
"sync"
)
// Ensure, that EchoRouterMock does implement EchoRouter.
// If this is not the case, regenerate this file with moq.
var _ EchoRouter = &EchoRouterMock{}
// EchoRouterMock is a mock implementation of EchoRouter.
//
// func TestSomethingThatUsesEchoRouter(t *testing.T) {
//
// // make and configure a mocked EchoRouter
// mockedEchoRouter := &EchoRouterMock{
// CONNECTFunc: func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route {
// panic("mock out the CONNECT method")
// },
// DELETEFunc: func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route {
// panic("mock out the DELETE method")
// },
// GETFunc: func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route {
// panic("mock out the GET method")
// },
// HEADFunc: func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route {
// panic("mock out the HEAD method")
// },
// OPTIONSFunc: func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route {
// panic("mock out the OPTIONS method")
// },
// PATCHFunc: func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route {
// panic("mock out the PATCH method")
// },
// POSTFunc: func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route {
// panic("mock out the POST method")
// },
// PUTFunc: func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route {
// panic("mock out the PUT method")
// },
// TRACEFunc: func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route {
// panic("mock out the TRACE method")
// },
// }
//
// // use mockedEchoRouter in code that requires EchoRouter
// // and then make assertions.
//
// }
type EchoRouterMock struct {
// CONNECTFunc mocks the CONNECT method.
CONNECTFunc func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
// DELETEFunc mocks the DELETE method.
DELETEFunc func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
// GETFunc mocks the GET method.
GETFunc func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
// HEADFunc mocks the HEAD method.
HEADFunc func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
// OPTIONSFunc mocks the OPTIONS method.
OPTIONSFunc func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
// PATCHFunc mocks the PATCH method.
PATCHFunc func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
// POSTFunc mocks the POST method.
POSTFunc func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
// PUTFunc mocks the PUT method.
PUTFunc func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
// TRACEFunc mocks the TRACE method.
TRACEFunc func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
// calls tracks calls to the methods.
calls struct {
// CONNECT holds details about calls to the CONNECT method.
CONNECT []struct {
// Path is the path argument value.
Path string
// H is the h argument value.
H echo.HandlerFunc
// M is the m argument value.
M []echo.MiddlewareFunc
}
// DELETE holds details about calls to the DELETE method.
DELETE []struct {
// Path is the path argument value.
Path string
// H is the h argument value.
H echo.HandlerFunc
// M is the m argument value.
M []echo.MiddlewareFunc
}
// GET holds details about calls to the GET method.
GET []struct {
// Path is the path argument value.
Path string
// H is the h argument value.
H echo.HandlerFunc
// M is the m argument value.
M []echo.MiddlewareFunc
}
// HEAD holds details about calls to the HEAD method.
HEAD []struct {
// Path is the path argument value.
Path string
// H is the h argument value.
H echo.HandlerFunc
// M is the m argument value.
M []echo.MiddlewareFunc
}
// OPTIONS holds details about calls to the OPTIONS method.
OPTIONS []struct {
// Path is the path argument value.
Path string
// H is the h argument value.
H echo.HandlerFunc
// M is the m argument value.
M []echo.MiddlewareFunc
}
// PATCH holds details about calls to the PATCH method.
PATCH []struct {
// Path is the path argument value.
Path string
// H is the h argument value.
H echo.HandlerFunc
// M is the m argument value.
M []echo.MiddlewareFunc
}
// POST holds details about calls to the POST method.
POST []struct {
// Path is the path argument value.
Path string
// H is the h argument value.
H echo.HandlerFunc
// M is the m argument value.
M []echo.MiddlewareFunc
}
// PUT holds details about calls to the PUT method.
PUT []struct {
// Path is the path argument value.
Path string
// H is the h argument value.
H echo.HandlerFunc
// M is the m argument value.
M []echo.MiddlewareFunc
}
// TRACE holds details about calls to the TRACE method.
TRACE []struct {
// Path is the path argument value.
Path string
// H is the h argument value.
H echo.HandlerFunc
// M is the m argument value.
M []echo.MiddlewareFunc
}
}
lockCONNECT sync.RWMutex
lockDELETE sync.RWMutex
lockGET sync.RWMutex
lockHEAD sync.RWMutex
lockOPTIONS sync.RWMutex
lockPATCH sync.RWMutex
lockPOST sync.RWMutex
lockPUT sync.RWMutex
lockTRACE sync.RWMutex
}
// CONNECT calls CONNECTFunc.
func (mock *EchoRouterMock) CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route {
if mock.CONNECTFunc == nil {
panic("EchoRouterMock.CONNECTFunc: method is nil but EchoRouter.CONNECT was just called")
}
callInfo := struct {
Path string
H echo.HandlerFunc
M []echo.MiddlewareFunc
}{
Path: path,
H: h,
M: m,
}
mock.lockCONNECT.Lock()
mock.calls.CONNECT = append(mock.calls.CONNECT, callInfo)
mock.lockCONNECT.Unlock()
return mock.CONNECTFunc(path, h, m...)
}
// CONNECTCalls gets all the calls that were made to CONNECT.
// Check the length with:
//
// len(mockedEchoRouter.CONNECTCalls())
func (mock *EchoRouterMock) CONNECTCalls() []struct {
Path string
H echo.HandlerFunc
M []echo.MiddlewareFunc
} {
var calls []struct {
Path string
H echo.HandlerFunc
M []echo.MiddlewareFunc
}
mock.lockCONNECT.RLock()
calls = mock.calls.CONNECT
mock.lockCONNECT.RUnlock()
return calls
}
// DELETE calls DELETEFunc.
func (mock *EchoRouterMock) DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route {
if mock.DELETEFunc == nil {
panic("EchoRouterMock.DELETEFunc: method is nil but EchoRouter.DELETE was just called")
}
callInfo := struct {
Path string
H echo.HandlerFunc
M []echo.MiddlewareFunc
}{
Path: path,
H: h,
M: m,
}
mock.lockDELETE.Lock()
mock.calls.DELETE = append(mock.calls.DELETE, callInfo)
mock.lockDELETE.Unlock()
return mock.DELETEFunc(path, h, m...)
}
// DELETECalls gets all the calls that were made to DELETE.
// Check the length with:
//
// len(mockedEchoRouter.DELETECalls())
func (mock *EchoRouterMock) DELETECalls() []struct {
Path string
H echo.HandlerFunc
M []echo.MiddlewareFunc
} {
var calls []struct {
Path string
H echo.HandlerFunc
M []echo.MiddlewareFunc
}
mock.lockDELETE.RLock()
calls = mock.calls.DELETE
mock.lockDELETE.RUnlock()
return calls
}
// GET calls GETFunc.
func (mock *EchoRouterMock) GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route {
if mock.GETFunc == nil {
panic("EchoRouterMock.GETFunc: method is nil but EchoRouter.GET was just called")
}
callInfo := struct {
Path string
H echo.HandlerFunc
M []echo.MiddlewareFunc
}{
Path: path,
H: h,
M: m,
}
mock.lockGET.Lock()
mock.calls.GET = append(mock.calls.GET, callInfo)
mock.lockGET.Unlock()
return mock.GETFunc(path, h, m...)
}
// GETCalls gets all the calls that were made to GET.
// Check the length with:
//
// len(mockedEchoRouter.GETCalls())
func (mock *EchoRouterMock) GETCalls() []struct {
Path string
H echo.HandlerFunc
M []echo.MiddlewareFunc
} {
var calls []struct {
Path string
H echo.HandlerFunc
M []echo.MiddlewareFunc
}
mock.lockGET.RLock()
calls = mock.calls.GET
mock.lockGET.RUnlock()
return calls
}
// HEAD calls HEADFunc.
func (mock *EchoRouterMock) HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route {
if mock.HEADFunc == nil {
panic("EchoRouterMock.HEADFunc: method is nil but EchoRouter.HEAD was just called")
}
callInfo := struct {
Path string
H echo.HandlerFunc
M []echo.MiddlewareFunc
}{
Path: path,
H: h,
M: m,
}
mock.lockHEAD.Lock()
mock.calls.HEAD = append(mock.calls.HEAD, callInfo)
mock.lockHEAD.Unlock()
return mock.HEADFunc(path, h, m...)
}
// HEADCalls gets all the calls that were made to HEAD.
// Check the length with:
//
// len(mockedEchoRouter.HEADCalls())
func (mock *EchoRouterMock) HEADCalls() []struct {
Path string
H echo.HandlerFunc
M []echo.MiddlewareFunc
} {
var calls []struct {
Path string
H echo.HandlerFunc
M []echo.MiddlewareFunc
}
mock.lockHEAD.RLock()
calls = mock.calls.HEAD
mock.lockHEAD.RUnlock()
return calls
}
// OPTIONS calls OPTIONSFunc.
func (mock *EchoRouterMock) OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route {
if mock.OPTIONSFunc == nil {
panic("EchoRouterMock.OPTIONSFunc: method is nil but EchoRouter.OPTIONS was just called")
}
callInfo := struct {
Path string
H echo.HandlerFunc
M []echo.MiddlewareFunc
}{
Path: path,
H: h,
M: m,
}
mock.lockOPTIONS.Lock()
mock.calls.OPTIONS = append(mock.calls.OPTIONS, callInfo)
mock.lockOPTIONS.Unlock()
return mock.OPTIONSFunc(path, h, m...)
}
// OPTIONSCalls gets all the calls that were made to OPTIONS.
// Check the length with:
//
// len(mockedEchoRouter.OPTIONSCalls())
func (mock *EchoRouterMock) OPTIONSCalls() []struct {
Path string
H echo.HandlerFunc
M []echo.MiddlewareFunc
} {
var calls []struct {
Path string
H echo.HandlerFunc
M []echo.MiddlewareFunc
}
mock.lockOPTIONS.RLock()
calls = mock.calls.OPTIONS
mock.lockOPTIONS.RUnlock()
return calls
}
// PATCH calls PATCHFunc.
func (mock *EchoRouterMock) PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route {
if mock.PATCHFunc == nil {
panic("EchoRouterMock.PATCHFunc: method is nil but EchoRouter.PATCH was just called")
}
callInfo := struct {
Path string
H echo.HandlerFunc
M []echo.MiddlewareFunc
}{
Path: path,
H: h,
M: m,
}
mock.lockPATCH.Lock()
mock.calls.PATCH = append(mock.calls.PATCH, callInfo)
mock.lockPATCH.Unlock()
return mock.PATCHFunc(path, h, m...)
}
// PATCHCalls gets all the calls that were made to PATCH.
// Check the length with:
//
// len(mockedEchoRouter.PATCHCalls())
func (mock *EchoRouterMock) PATCHCalls() []struct {
Path string
H echo.HandlerFunc
M []echo.MiddlewareFunc
} {
var calls []struct {
Path string
H echo.HandlerFunc
M []echo.MiddlewareFunc
}
mock.lockPATCH.RLock()
calls = mock.calls.PATCH
mock.lockPATCH.RUnlock()
return calls
}
// POST calls POSTFunc.
func (mock *EchoRouterMock) POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route {
if mock.POSTFunc == nil {
panic("EchoRouterMock.POSTFunc: method is nil but EchoRouter.POST was just called")
}
callInfo := struct {
Path string
H echo.HandlerFunc
M []echo.MiddlewareFunc
}{
Path: path,
H: h,
M: m,
}
mock.lockPOST.Lock()
mock.calls.POST = append(mock.calls.POST, callInfo)
mock.lockPOST.Unlock()
return mock.POSTFunc(path, h, m...)
}
// POSTCalls gets all the calls that were made to POST.
// Check the length with:
//
// len(mockedEchoRouter.POSTCalls())
func (mock *EchoRouterMock) POSTCalls() []struct {
Path string
H echo.HandlerFunc
M []echo.MiddlewareFunc
} {
var calls []struct {
Path string
H echo.HandlerFunc
M []echo.MiddlewareFunc
}
mock.lockPOST.RLock()
calls = mock.calls.POST
mock.lockPOST.RUnlock()
return calls
}
// PUT calls PUTFunc.
func (mock *EchoRouterMock) PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route {
if mock.PUTFunc == nil {
panic("EchoRouterMock.PUTFunc: method is nil but EchoRouter.PUT was just called")
}
callInfo := struct {
Path string
H echo.HandlerFunc
M []echo.MiddlewareFunc
}{
Path: path,
H: h,
M: m,
}
mock.lockPUT.Lock()
mock.calls.PUT = append(mock.calls.PUT, callInfo)
mock.lockPUT.Unlock()
return mock.PUTFunc(path, h, m...)
}
// PUTCalls gets all the calls that were made to PUT.
// Check the length with:
//
// len(mockedEchoRouter.PUTCalls())
func (mock *EchoRouterMock) PUTCalls() []struct {
Path string
H echo.HandlerFunc
M []echo.MiddlewareFunc
} {
var calls []struct {
Path string
H echo.HandlerFunc
M []echo.MiddlewareFunc
}
mock.lockPUT.RLock()
calls = mock.calls.PUT
mock.lockPUT.RUnlock()
return calls
}
// TRACE calls TRACEFunc.
func (mock *EchoRouterMock) TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route {
if mock.TRACEFunc == nil {
panic("EchoRouterMock.TRACEFunc: method is nil but EchoRouter.TRACE was just called")
}
callInfo := struct {
Path string
H echo.HandlerFunc
M []echo.MiddlewareFunc
}{
Path: path,
H: h,
M: m,
}
mock.lockTRACE.Lock()
mock.calls.TRACE = append(mock.calls.TRACE, callInfo)
mock.lockTRACE.Unlock()
return mock.TRACEFunc(path, h, m...)
}
// TRACECalls gets all the calls that were made to TRACE.
// Check the length with:
//
// len(mockedEchoRouter.TRACECalls())
func (mock *EchoRouterMock) TRACECalls() []struct {
Path string
H echo.HandlerFunc
M []echo.MiddlewareFunc
} {
var calls []struct {
Path string
H echo.HandlerFunc
M []echo.MiddlewareFunc
}
mock.lockTRACE.RLock()
calls = mock.calls.TRACE
mock.lockTRACE.RUnlock()
return calls
}