-
Notifications
You must be signed in to change notification settings - Fork 2
/
mock_quic_conn_test.go
359 lines (306 loc) · 12 KB
/
mock_quic_conn_test.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
// Code generated by MockGen. DO NOT EDIT.
// Source: server.go
// Package quic is a generated GoMock package.
package quic
import (
context "context"
net "net"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
congestion "github.com/lucas-clemente/quic-go/internal/congestion"
protocol "github.com/lucas-clemente/quic-go/internal/protocol"
)
// MockQuicConn is a mock of QuicConn interface.
type MockQuicConn struct {
ctrl *gomock.Controller
recorder *MockQuicConnMockRecorder
}
// MockQuicConnMockRecorder is the mock recorder for MockQuicConn.
type MockQuicConnMockRecorder struct {
mock *MockQuicConn
}
// NewMockQuicConn creates a new mock instance.
func NewMockQuicConn(ctrl *gomock.Controller) *MockQuicConn {
mock := &MockQuicConn{ctrl: ctrl}
mock.recorder = &MockQuicConnMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockQuicConn) EXPECT() *MockQuicConnMockRecorder {
return m.recorder
}
// AcceptStream mocks base method.
func (m *MockQuicConn) AcceptStream(arg0 context.Context) (Stream, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AcceptStream", arg0)
ret0, _ := ret[0].(Stream)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// AcceptStream indicates an expected call of AcceptStream.
func (mr *MockQuicConnMockRecorder) AcceptStream(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AcceptStream", reflect.TypeOf((*MockQuicConn)(nil).AcceptStream), arg0)
}
// AcceptUniStream mocks base method.
func (m *MockQuicConn) AcceptUniStream(arg0 context.Context) (ReceiveStream, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AcceptUniStream", arg0)
ret0, _ := ret[0].(ReceiveStream)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// AcceptUniStream indicates an expected call of AcceptUniStream.
func (mr *MockQuicConnMockRecorder) AcceptUniStream(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AcceptUniStream", reflect.TypeOf((*MockQuicConn)(nil).AcceptUniStream), arg0)
}
// BandwidthEstimate mocks base method.
func (m *MockQuicConn) BandwidthEstimate() congestion.Bandwidth {
ret := m.ctrl.Call(m, "BandwidthEstimate")
ret0, _ := ret[0].(congestion.Bandwidth)
return ret0
}
// BandwidthEstimate indicates an expected call of BandwidthEstimate.
func (mr *MockQuicConnMockRecorder) BandwidthEstimate() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BandwidthEstimate", reflect.TypeOf((*MockQuicConn)(nil).BandwidthEstimate))
}
// CloseWithError mocks base method.
func (m *MockQuicConn) CloseWithError(arg0 ApplicationErrorCode, arg1 string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CloseWithError", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// CloseWithError indicates an expected call of CloseWithError.
func (mr *MockQuicConnMockRecorder) CloseWithError(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseWithError", reflect.TypeOf((*MockQuicConn)(nil).CloseWithError), arg0, arg1)
}
// ConnectionState mocks base method.
func (m *MockQuicConn) ConnectionState() ConnectionState {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ConnectionState")
ret0, _ := ret[0].(ConnectionState)
return ret0
}
// ConnectionState indicates an expected call of ConnectionState.
func (mr *MockQuicConnMockRecorder) ConnectionState() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConnectionState", reflect.TypeOf((*MockQuicConn)(nil).ConnectionState))
}
// Context mocks base method.
func (m *MockQuicConn) Context() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context)
return ret0
}
// Context indicates an expected call of Context.
func (mr *MockQuicConnMockRecorder) Context() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockQuicConn)(nil).Context))
}
// GetVersion mocks base method.
func (m *MockQuicConn) GetVersion() protocol.VersionNumber {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetVersion")
ret0, _ := ret[0].(protocol.VersionNumber)
return ret0
}
// GetVersion indicates an expected call of GetVersion.
func (mr *MockQuicConnMockRecorder) GetVersion() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVersion", reflect.TypeOf((*MockQuicConn)(nil).GetVersion))
}
// HandshakeComplete mocks base method.
func (m *MockQuicConn) HandshakeComplete() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "HandshakeComplete")
ret0, _ := ret[0].(context.Context)
return ret0
}
// HandshakeComplete indicates an expected call of HandshakeComplete.
func (mr *MockQuicConnMockRecorder) HandshakeComplete() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandshakeComplete", reflect.TypeOf((*MockQuicConn)(nil).HandshakeComplete))
}
// LocalAddr mocks base method.
func (m *MockQuicConn) LocalAddr() net.Addr {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "LocalAddr")
ret0, _ := ret[0].(net.Addr)
return ret0
}
// LocalAddr indicates an expected call of LocalAddr.
func (mr *MockQuicConnMockRecorder) LocalAddr() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LocalAddr", reflect.TypeOf((*MockQuicConn)(nil).LocalAddr))
}
// NextConnection mocks base method.
func (m *MockQuicConn) NextConnection() Connection {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NextConnection")
ret0, _ := ret[0].(Connection)
return ret0
}
// NextConnection indicates an expected call of NextConnection.
func (mr *MockQuicConnMockRecorder) NextConnection() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NextConnection", reflect.TypeOf((*MockQuicConn)(nil).NextConnection))
}
// OpenStream mocks base method.
func (m *MockQuicConn) OpenStream() (Stream, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "OpenStream")
ret0, _ := ret[0].(Stream)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// OpenStream indicates an expected call of OpenStream.
func (mr *MockQuicConnMockRecorder) OpenStream() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OpenStream", reflect.TypeOf((*MockQuicConn)(nil).OpenStream))
}
// OpenStreamSync mocks base method.
func (m *MockQuicConn) OpenStreamSync(arg0 context.Context) (Stream, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "OpenStreamSync", arg0)
ret0, _ := ret[0].(Stream)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// OpenStreamSync indicates an expected call of OpenStreamSync.
func (mr *MockQuicConnMockRecorder) OpenStreamSync(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OpenStreamSync", reflect.TypeOf((*MockQuicConn)(nil).OpenStreamSync), arg0)
}
// OpenUniStream mocks base method.
func (m *MockQuicConn) OpenUniStream() (SendStream, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "OpenUniStream")
ret0, _ := ret[0].(SendStream)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// OpenUniStream indicates an expected call of OpenUniStream.
func (mr *MockQuicConnMockRecorder) OpenUniStream() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OpenUniStream", reflect.TypeOf((*MockQuicConn)(nil).OpenUniStream))
}
// OpenUniStreamSync mocks base method.
func (m *MockQuicConn) OpenUniStreamSync(arg0 context.Context) (SendStream, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "OpenUniStreamSync", arg0)
ret0, _ := ret[0].(SendStream)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// OpenUniStreamSync indicates an expected call of OpenUniStreamSync.
func (mr *MockQuicConnMockRecorder) OpenUniStreamSync(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OpenUniStreamSync", reflect.TypeOf((*MockQuicConn)(nil).OpenUniStreamSync), arg0)
}
// ReceiveMessage mocks base method.
func (m *MockQuicConn) ReceiveMessage() ([]byte, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ReceiveMessage")
ret0, _ := ret[0].([]byte)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ReceiveMessage indicates an expected call of ReceiveMessage.
func (mr *MockQuicConnMockRecorder) ReceiveMessage() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReceiveMessage", reflect.TypeOf((*MockQuicConn)(nil).ReceiveMessage))
}
// RemoteAddr mocks base method.
func (m *MockQuicConn) RemoteAddr() net.Addr {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "RemoteAddr")
ret0, _ := ret[0].(net.Addr)
return ret0
}
// RemoteAddr indicates an expected call of RemoteAddr.
func (mr *MockQuicConnMockRecorder) RemoteAddr() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoteAddr", reflect.TypeOf((*MockQuicConn)(nil).RemoteAddr))
}
// SendMessage mocks base method.
func (m *MockQuicConn) SendMessage(arg0 []byte) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendMessage", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendMessage indicates an expected call of SendMessage.
func (mr *MockQuicConnMockRecorder) SendMessage(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMessage", reflect.TypeOf((*MockQuicConn)(nil).SendMessage), arg0)
}
// destroy mocks base method.
func (m *MockQuicConn) destroy(arg0 error) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "destroy", arg0)
}
// destroy indicates an expected call of destroy.
func (mr *MockQuicConnMockRecorder) destroy(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "destroy", reflect.TypeOf((*MockQuicConn)(nil).destroy), arg0)
}
// earlyConnReady mocks base method.
func (m *MockQuicConn) earlyConnReady() <-chan struct{} {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "earlyConnReady")
ret0, _ := ret[0].(<-chan struct{})
return ret0
}
// earlyConnReady indicates an expected call of earlyConnReady.
func (mr *MockQuicConnMockRecorder) earlyConnReady() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "earlyConnReady", reflect.TypeOf((*MockQuicConn)(nil).earlyConnReady))
}
// getPerspective mocks base method.
func (m *MockQuicConn) getPerspective() protocol.Perspective {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "getPerspective")
ret0, _ := ret[0].(protocol.Perspective)
return ret0
}
// getPerspective indicates an expected call of getPerspective.
func (mr *MockQuicConnMockRecorder) getPerspective() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "getPerspective", reflect.TypeOf((*MockQuicConn)(nil).getPerspective))
}
// handlePacket mocks base method.
func (m *MockQuicConn) handlePacket(arg0 *receivedPacket) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "handlePacket", arg0)
}
// handlePacket indicates an expected call of handlePacket.
func (mr *MockQuicConnMockRecorder) handlePacket(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "handlePacket", reflect.TypeOf((*MockQuicConn)(nil).handlePacket), arg0)
}
// run mocks base method.
func (m *MockQuicConn) run() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "run")
ret0, _ := ret[0].(error)
return ret0
}
// run indicates an expected call of run.
func (mr *MockQuicConnMockRecorder) run() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "run", reflect.TypeOf((*MockQuicConn)(nil).run))
}
// shutdown mocks base method.
func (m *MockQuicConn) shutdown() {
m.ctrl.T.Helper()
m.ctrl.Call(m, "shutdown")
}
// shutdown indicates an expected call of shutdown.
func (mr *MockQuicConnMockRecorder) shutdown() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "shutdown", reflect.TypeOf((*MockQuicConn)(nil).shutdown))
}