-
Notifications
You must be signed in to change notification settings - Fork 671
/
mock_server.go
304 lines (261 loc) · 11.5 KB
/
mock_server.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
// Code generated by MockGen. DO NOT EDIT.
// Source: api/server/server.go
// Package server is a generated GoMock package.
package server
import (
io "io"
reflect "reflect"
sync "sync"
time "time"
ids "github.com/ava-labs/avalanchego/ids"
snow "github.com/ava-labs/avalanchego/snow"
common "github.com/ava-labs/avalanchego/snow/engine/common"
logging "github.com/ava-labs/avalanchego/utils/logging"
gomock "github.com/golang/mock/gomock"
)
// MockPathAdder is a mock of PathAdder interface.
type MockPathAdder struct {
ctrl *gomock.Controller
recorder *MockPathAdderMockRecorder
}
// MockPathAdderMockRecorder is the mock recorder for MockPathAdder.
type MockPathAdderMockRecorder struct {
mock *MockPathAdder
}
// NewMockPathAdder creates a new mock instance.
func NewMockPathAdder(ctrl *gomock.Controller) *MockPathAdder {
mock := &MockPathAdder{ctrl: ctrl}
mock.recorder = &MockPathAdderMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockPathAdder) EXPECT() *MockPathAdderMockRecorder {
return m.recorder
}
// AddAliases mocks base method.
func (m *MockPathAdder) AddAliases(endpoint string, aliases ...string) error {
m.ctrl.T.Helper()
varargs := []interface{}{endpoint}
for _, a := range aliases {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "AddAliases", varargs...)
ret0, _ := ret[0].(error)
return ret0
}
// AddAliases indicates an expected call of AddAliases.
func (mr *MockPathAdderMockRecorder) AddAliases(endpoint interface{}, aliases ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{endpoint}, aliases...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddAliases", reflect.TypeOf((*MockPathAdder)(nil).AddAliases), varargs...)
}
// AddRoute mocks base method.
func (m *MockPathAdder) AddRoute(handler *common.HTTPHandler, lock *sync.RWMutex, base, endpoint string, loggingWriter io.Writer) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AddRoute", handler, lock, base, endpoint, loggingWriter)
ret0, _ := ret[0].(error)
return ret0
}
// AddRoute indicates an expected call of AddRoute.
func (mr *MockPathAdderMockRecorder) AddRoute(handler, lock, base, endpoint, loggingWriter interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddRoute", reflect.TypeOf((*MockPathAdder)(nil).AddRoute), handler, lock, base, endpoint, loggingWriter)
}
// MockPathAdderWithReadLock is a mock of PathAdderWithReadLock interface.
type MockPathAdderWithReadLock struct {
ctrl *gomock.Controller
recorder *MockPathAdderWithReadLockMockRecorder
}
// MockPathAdderWithReadLockMockRecorder is the mock recorder for MockPathAdderWithReadLock.
type MockPathAdderWithReadLockMockRecorder struct {
mock *MockPathAdderWithReadLock
}
// NewMockPathAdderWithReadLock creates a new mock instance.
func NewMockPathAdderWithReadLock(ctrl *gomock.Controller) *MockPathAdderWithReadLock {
mock := &MockPathAdderWithReadLock{ctrl: ctrl}
mock.recorder = &MockPathAdderWithReadLockMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockPathAdderWithReadLock) EXPECT() *MockPathAdderWithReadLockMockRecorder {
return m.recorder
}
// AddAliasesWithReadLock mocks base method.
func (m *MockPathAdderWithReadLock) AddAliasesWithReadLock(endpoint string, aliases ...string) error {
m.ctrl.T.Helper()
varargs := []interface{}{endpoint}
for _, a := range aliases {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "AddAliasesWithReadLock", varargs...)
ret0, _ := ret[0].(error)
return ret0
}
// AddAliasesWithReadLock indicates an expected call of AddAliasesWithReadLock.
func (mr *MockPathAdderWithReadLockMockRecorder) AddAliasesWithReadLock(endpoint interface{}, aliases ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{endpoint}, aliases...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddAliasesWithReadLock", reflect.TypeOf((*MockPathAdderWithReadLock)(nil).AddAliasesWithReadLock), varargs...)
}
// AddRouteWithReadLock mocks base method.
func (m *MockPathAdderWithReadLock) AddRouteWithReadLock(handler *common.HTTPHandler, lock *sync.RWMutex, base, endpoint string, loggingWriter io.Writer) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AddRouteWithReadLock", handler, lock, base, endpoint, loggingWriter)
ret0, _ := ret[0].(error)
return ret0
}
// AddRouteWithReadLock indicates an expected call of AddRouteWithReadLock.
func (mr *MockPathAdderWithReadLockMockRecorder) AddRouteWithReadLock(handler, lock, base, endpoint, loggingWriter interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddRouteWithReadLock", reflect.TypeOf((*MockPathAdderWithReadLock)(nil).AddRouteWithReadLock), handler, lock, base, endpoint, loggingWriter)
}
// MockServer is a mock of Server interface.
type MockServer struct {
ctrl *gomock.Controller
recorder *MockServerMockRecorder
}
// MockServerMockRecorder is the mock recorder for MockServer.
type MockServerMockRecorder struct {
mock *MockServer
}
// NewMockServer creates a new mock instance.
func NewMockServer(ctrl *gomock.Controller) *MockServer {
mock := &MockServer{ctrl: ctrl}
mock.recorder = &MockServerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockServer) EXPECT() *MockServerMockRecorder {
return m.recorder
}
// AddAliases mocks base method.
func (m *MockServer) AddAliases(endpoint string, aliases ...string) error {
m.ctrl.T.Helper()
varargs := []interface{}{endpoint}
for _, a := range aliases {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "AddAliases", varargs...)
ret0, _ := ret[0].(error)
return ret0
}
// AddAliases indicates an expected call of AddAliases.
func (mr *MockServerMockRecorder) AddAliases(endpoint interface{}, aliases ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{endpoint}, aliases...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddAliases", reflect.TypeOf((*MockServer)(nil).AddAliases), varargs...)
}
// AddAliasesWithReadLock mocks base method.
func (m *MockServer) AddAliasesWithReadLock(endpoint string, aliases ...string) error {
m.ctrl.T.Helper()
varargs := []interface{}{endpoint}
for _, a := range aliases {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "AddAliasesWithReadLock", varargs...)
ret0, _ := ret[0].(error)
return ret0
}
// AddAliasesWithReadLock indicates an expected call of AddAliasesWithReadLock.
func (mr *MockServerMockRecorder) AddAliasesWithReadLock(endpoint interface{}, aliases ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{endpoint}, aliases...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddAliasesWithReadLock", reflect.TypeOf((*MockServer)(nil).AddAliasesWithReadLock), varargs...)
}
// AddChainRoute mocks base method.
func (m *MockServer) AddChainRoute(handler *common.HTTPHandler, ctx *snow.ConsensusContext, base, endpoint string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AddChainRoute", handler, ctx, base, endpoint)
ret0, _ := ret[0].(error)
return ret0
}
// AddChainRoute indicates an expected call of AddChainRoute.
func (mr *MockServerMockRecorder) AddChainRoute(handler, ctx, base, endpoint interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddChainRoute", reflect.TypeOf((*MockServer)(nil).AddChainRoute), handler, ctx, base, endpoint)
}
// AddRoute mocks base method.
func (m *MockServer) AddRoute(handler *common.HTTPHandler, lock *sync.RWMutex, base, endpoint string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AddRoute", handler, lock, base, endpoint)
ret0, _ := ret[0].(error)
return ret0
}
// AddRoute indicates an expected call of AddRoute.
func (mr *MockServerMockRecorder) AddRoute(handler, lock, base, endpoint interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddRoute", reflect.TypeOf((*MockServer)(nil).AddRoute), handler, lock, base, endpoint)
}
// AddRouteWithReadLock mocks base method.
func (m *MockServer) AddRouteWithReadLock(handler *common.HTTPHandler, lock *sync.RWMutex, base, endpoint string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AddRouteWithReadLock", handler, lock, base, endpoint)
ret0, _ := ret[0].(error)
return ret0
}
// AddRouteWithReadLock indicates an expected call of AddRouteWithReadLock.
func (mr *MockServerMockRecorder) AddRouteWithReadLock(handler, lock, base, endpoint interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddRouteWithReadLock", reflect.TypeOf((*MockServer)(nil).AddRouteWithReadLock), handler, lock, base, endpoint)
}
// Dispatch mocks base method.
func (m *MockServer) Dispatch() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Dispatch")
ret0, _ := ret[0].(error)
return ret0
}
// Dispatch indicates an expected call of Dispatch.
func (mr *MockServerMockRecorder) Dispatch() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Dispatch", reflect.TypeOf((*MockServer)(nil).Dispatch))
}
// DispatchTLS mocks base method.
func (m *MockServer) DispatchTLS(certBytes, keyBytes []byte) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DispatchTLS", certBytes, keyBytes)
ret0, _ := ret[0].(error)
return ret0
}
// DispatchTLS indicates an expected call of DispatchTLS.
func (mr *MockServerMockRecorder) DispatchTLS(certBytes, keyBytes interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DispatchTLS", reflect.TypeOf((*MockServer)(nil).DispatchTLS), certBytes, keyBytes)
}
// Initialize mocks base method.
func (m *MockServer) Initialize(log logging.Logger, factory logging.Factory, host string, port uint16, allowedOrigins []string, shutdownTimeout time.Duration, nodeID ids.NodeID, wrappers ...Wrapper) {
m.ctrl.T.Helper()
varargs := []interface{}{log, factory, host, port, allowedOrigins, shutdownTimeout, nodeID}
for _, a := range wrappers {
varargs = append(varargs, a)
}
m.ctrl.Call(m, "Initialize", varargs...)
}
// Initialize indicates an expected call of Initialize.
func (mr *MockServerMockRecorder) Initialize(log, factory, host, port, allowedOrigins, shutdownTimeout, nodeID interface{}, wrappers ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{log, factory, host, port, allowedOrigins, shutdownTimeout, nodeID}, wrappers...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Initialize", reflect.TypeOf((*MockServer)(nil).Initialize), varargs...)
}
// RegisterChain mocks base method.
func (m *MockServer) RegisterChain(chainName string, engine common.Engine) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "RegisterChain", chainName, engine)
}
// RegisterChain indicates an expected call of RegisterChain.
func (mr *MockServerMockRecorder) RegisterChain(chainName, engine interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterChain", reflect.TypeOf((*MockServer)(nil).RegisterChain), chainName, engine)
}
// Shutdown mocks base method.
func (m *MockServer) Shutdown() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Shutdown")
ret0, _ := ret[0].(error)
return ret0
}
// Shutdown indicates an expected call of Shutdown.
func (mr *MockServerMockRecorder) Shutdown() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Shutdown", reflect.TypeOf((*MockServer)(nil).Shutdown))
}