/
HandlerDef.go
166 lines (133 loc) · 4.51 KB
/
HandlerDef.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
// Code generated by mockery v2.42.0. DO NOT EDIT.
package mocks
import (
gin "github.com/gin-gonic/gin"
mock "github.com/stretchr/testify/mock"
types "github.com/gwkline/full-stack-skeleton/backend/types"
)
// HandlerDef is an autogenerated mock type for the HandlerDef type
type HandlerDef struct {
mock.Mock
}
type HandlerDef_Expecter struct {
mock *mock.Mock
}
func (_m *HandlerDef) EXPECT() *HandlerDef_Expecter {
return &HandlerDef_Expecter{mock: &_m.Mock}
}
// Graphql provides a mock function with given fields: repo
func (_m *HandlerDef) Graphql(repo interface{}) gin.HandlerFunc {
ret := _m.Called(repo)
if len(ret) == 0 {
panic("no return value specified for Graphql")
}
var r0 gin.HandlerFunc
if rf, ok := ret.Get(0).(func(interface{}) gin.HandlerFunc); ok {
r0 = rf(repo)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(gin.HandlerFunc)
}
}
return r0
}
// HandlerDef_Graphql_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Graphql'
type HandlerDef_Graphql_Call struct {
*mock.Call
}
// Graphql is a helper method to define mock.On call
// - repo interface{}
func (_e *HandlerDef_Expecter) Graphql(repo interface{}) *HandlerDef_Graphql_Call {
return &HandlerDef_Graphql_Call{Call: _e.mock.On("Graphql", repo)}
}
func (_c *HandlerDef_Graphql_Call) Run(run func(repo interface{})) *HandlerDef_Graphql_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(interface{}))
})
return _c
}
func (_c *HandlerDef_Graphql_Call) Return(_a0 gin.HandlerFunc) *HandlerDef_Graphql_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *HandlerDef_Graphql_Call) RunAndReturn(run func(interface{}) gin.HandlerFunc) *HandlerDef_Graphql_Call {
_c.Call.Return(run)
return _c
}
// Playground provides a mock function with given fields:
func (_m *HandlerDef) Playground() gin.HandlerFunc {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Playground")
}
var r0 gin.HandlerFunc
if rf, ok := ret.Get(0).(func() gin.HandlerFunc); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(gin.HandlerFunc)
}
}
return r0
}
// HandlerDef_Playground_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Playground'
type HandlerDef_Playground_Call struct {
*mock.Call
}
// Playground is a helper method to define mock.On call
func (_e *HandlerDef_Expecter) Playground() *HandlerDef_Playground_Call {
return &HandlerDef_Playground_Call{Call: _e.mock.On("Playground")}
}
func (_c *HandlerDef_Playground_Call) Run(run func()) *HandlerDef_Playground_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *HandlerDef_Playground_Call) Return(_a0 gin.HandlerFunc) *HandlerDef_Playground_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *HandlerDef_Playground_Call) RunAndReturn(run func() gin.HandlerFunc) *HandlerDef_Playground_Call {
_c.Call.Return(run)
return _c
}
// SomeWebhookHandler provides a mock function with given fields: c, e
func (_m *HandlerDef) SomeWebhookHandler(c *gin.Context, e types.IWorker) {
_m.Called(c, e)
}
// HandlerDef_SomeWebhookHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SomeWebhookHandler'
type HandlerDef_SomeWebhookHandler_Call struct {
*mock.Call
}
// SomeWebhookHandler is a helper method to define mock.On call
// - c *gin.Context
// - e types.IWorker
func (_e *HandlerDef_Expecter) SomeWebhookHandler(c interface{}, e interface{}) *HandlerDef_SomeWebhookHandler_Call {
return &HandlerDef_SomeWebhookHandler_Call{Call: _e.mock.On("SomeWebhookHandler", c, e)}
}
func (_c *HandlerDef_SomeWebhookHandler_Call) Run(run func(c *gin.Context, e types.IWorker)) *HandlerDef_SomeWebhookHandler_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*gin.Context), args[1].(types.IWorker))
})
return _c
}
func (_c *HandlerDef_SomeWebhookHandler_Call) Return() *HandlerDef_SomeWebhookHandler_Call {
_c.Call.Return()
return _c
}
func (_c *HandlerDef_SomeWebhookHandler_Call) RunAndReturn(run func(*gin.Context, types.IWorker)) *HandlerDef_SomeWebhookHandler_Call {
_c.Call.Return(run)
return _c
}
// NewHandlerDef creates a new instance of HandlerDef. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewHandlerDef(t interface {
mock.TestingT
Cleanup(func())
}) *HandlerDef {
mock := &HandlerDef{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}