1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package portsmocks
6
7import (
8 "context"
9 "time"
10
11 "github.com/bnema/vev/internal/ports"
12 "github.com/bnema/vev/internal/protocol"
13 mock "github.com/stretchr/testify/mock"
14)
15
16// NewMockClientConnection creates a new instance of MockClientConnection. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
17// The first argument is typically a *testing.T value.
18func NewMockClientConnection(t interface {
19 mock.TestingT
20 Cleanup(func())
21}) *MockClientConnection {
22 if helper, ok := t.(interface{ Helper() }); ok {
23 helper.Helper()
24 }
25
26 mock := &MockClientConnection{}
27 mock.Mock.Test(t)
28
29 t.Cleanup(func() {
30 if helper, ok := t.(interface{ Helper() }); ok {
31 helper.Helper()
32 }
33 mock.AssertExpectations(t)
34 })
35
36 return mock
37}
38
39// MockClientConnection is an autogenerated mock type for the ClientConnection type
40type MockClientConnection struct {
41 mock.Mock
42}
43
44type MockClientConnection_Expecter struct {
45 mock *mock.Mock
46}
47
48func (_m *MockClientConnection) EXPECT() *MockClientConnection_Expecter {
49 return &MockClientConnection_Expecter{mock: &_m.Mock}
50}
51
52// Capabilities provides a mock function for the type MockClientConnection
53func (_mock *MockClientConnection) Capabilities() protocol.ConnectionCapabilities {
54 ret := _mock.Called()
55
56 if len(ret) == 0 {
57 panic("no return value specified for Capabilities")
58 }
59
60 var r0 protocol.ConnectionCapabilities
61 if returnFunc, ok := ret.Get(0).(func() protocol.ConnectionCapabilities); ok {
62 r0 = returnFunc()
63 } else {
64 r0 = ret.Get(0).(protocol.ConnectionCapabilities)
65 }
66 return r0
67}
68
69// MockClientConnection_Capabilities_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Capabilities'
70type MockClientConnection_Capabilities_Call struct {
71 *mock.Call
72}
73
74// Capabilities is a helper method to define mock.On call
75func (_e *MockClientConnection_Expecter) Capabilities() *MockClientConnection_Capabilities_Call {
76 return &MockClientConnection_Capabilities_Call{Call: _e.mock.On("Capabilities")}
77}
78
79func (_c *MockClientConnection_Capabilities_Call) Run(run func()) *MockClientConnection_Capabilities_Call {
80 _c.Call.Run(func(args mock.Arguments) {
81 run()
82 })
83 return _c
84}
85
86func (_c *MockClientConnection_Capabilities_Call) Return(connectionCapabilities protocol.ConnectionCapabilities) *MockClientConnection_Capabilities_Call {
87 _c.Call.Return(connectionCapabilities)
88 return _c
89}
90
91func (_c *MockClientConnection_Capabilities_Call) RunAndReturn(run func() protocol.ConnectionCapabilities) *MockClientConnection_Capabilities_Call {
92 _c.Call.Return(run)
93 return _c
94}
95
96// Close provides a mock function for the type MockClientConnection
97func (_mock *MockClientConnection) Close() error {
98 ret := _mock.Called()
99
100 if len(ret) == 0 {
101 panic("no return value specified for Close")
102 }
103
104 var r0 error
105 if returnFunc, ok := ret.Get(0).(func() error); ok {
106 r0 = returnFunc()
107 } else {
108 r0 = ret.Error(0)
109 }
110 return r0
111}
112
113// MockClientConnection_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
114type MockClientConnection_Close_Call struct {
115 *mock.Call
116}
117
118// Close is a helper method to define mock.On call
119func (_e *MockClientConnection_Expecter) Close() *MockClientConnection_Close_Call {
120 return &MockClientConnection_Close_Call{Call: _e.mock.On("Close")}
121}
122
123func (_c *MockClientConnection_Close_Call) Run(run func()) *MockClientConnection_Close_Call {
124 _c.Call.Run(func(args mock.Arguments) {
125 run()
126 })
127 return _c
128}
129
130func (_c *MockClientConnection_Close_Call) Return(err error) *MockClientConnection_Close_Call {
131 _c.Call.Return(err)
132 return _c
133}
134
135func (_c *MockClientConnection_Close_Call) RunAndReturn(run func() error) *MockClientConnection_Close_Call {
136 _c.Call.Return(run)
137 return _c
138}
139
140// LinkEvents provides a mock function for the type MockClientConnection
141func (_mock *MockClientConnection) LinkEvents() <-chan ports.LinkEvent {
142 ret := _mock.Called()
143
144 if len(ret) == 0 {
145 panic("no return value specified for LinkEvents")
146 }
147
148 var r0 <-chan ports.LinkEvent
149 if returnFunc, ok := ret.Get(0).(func() <-chan ports.LinkEvent); ok {
150 r0 = returnFunc()
151 } else {
152 if ret.Get(0) != nil {
153 r0 = ret.Get(0).(<-chan ports.LinkEvent)
154 }
155 }
156 return r0
157}
158
159// MockClientConnection_LinkEvents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LinkEvents'
160type MockClientConnection_LinkEvents_Call struct {
161 *mock.Call
162}
163
164// LinkEvents is a helper method to define mock.On call
165func (_e *MockClientConnection_Expecter) LinkEvents() *MockClientConnection_LinkEvents_Call {
166 return &MockClientConnection_LinkEvents_Call{Call: _e.mock.On("LinkEvents")}
167}
168
169func (_c *MockClientConnection_LinkEvents_Call) Run(run func()) *MockClientConnection_LinkEvents_Call {
170 _c.Call.Run(func(args mock.Arguments) {
171 run()
172 })
173 return _c
174}
175
176func (_c *MockClientConnection_LinkEvents_Call) Return(linkEventCh <-chan ports.LinkEvent) *MockClientConnection_LinkEvents_Call {
177 _c.Call.Return(linkEventCh)
178 return _c
179}
180
181func (_c *MockClientConnection_LinkEvents_Call) RunAndReturn(run func() <-chan ports.LinkEvent) *MockClientConnection_LinkEvents_Call {
182 _c.Call.Return(run)
183 return _c
184}
185
186// LinkState provides a mock function for the type MockClientConnection
187func (_mock *MockClientConnection) LinkState() ports.LinkState {
188 ret := _mock.Called()
189
190 if len(ret) == 0 {
191 panic("no return value specified for LinkState")
192 }
193
194 var r0 ports.LinkState
195 if returnFunc, ok := ret.Get(0).(func() ports.LinkState); ok {
196 r0 = returnFunc()
197 } else {
198 r0 = ret.Get(0).(ports.LinkState)
199 }
200 return r0
201}
202
203// MockClientConnection_LinkState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LinkState'
204type MockClientConnection_LinkState_Call struct {
205 *mock.Call
206}
207
208// LinkState is a helper method to define mock.On call
209func (_e *MockClientConnection_Expecter) LinkState() *MockClientConnection_LinkState_Call {
210 return &MockClientConnection_LinkState_Call{Call: _e.mock.On("LinkState")}
211}
212
213func (_c *MockClientConnection_LinkState_Call) Run(run func()) *MockClientConnection_LinkState_Call {
214 _c.Call.Run(func(args mock.Arguments) {
215 run()
216 })
217 return _c
218}
219
220func (_c *MockClientConnection_LinkState_Call) Return(linkState ports.LinkState) *MockClientConnection_LinkState_Call {
221 _c.Call.Return(linkState)
222 return _c
223}
224
225func (_c *MockClientConnection_LinkState_Call) RunAndReturn(run func() ports.LinkState) *MockClientConnection_LinkState_Call {
226 _c.Call.Return(run)
227 return _c
228}
229
230// ReceiveServer provides a mock function for the type MockClientConnection
231func (_mock *MockClientConnection) ReceiveServer() (protocol.ServerMessage, error) {
232 ret := _mock.Called()
233
234 if len(ret) == 0 {
235 panic("no return value specified for ReceiveServer")
236 }
237
238 var r0 protocol.ServerMessage
239 var r1 error
240 if returnFunc, ok := ret.Get(0).(func() (protocol.ServerMessage, error)); ok {
241 return returnFunc()
242 }
243 if returnFunc, ok := ret.Get(0).(func() protocol.ServerMessage); ok {
244 r0 = returnFunc()
245 } else {
246 if ret.Get(0) != nil {
247 r0 = ret.Get(0).(protocol.ServerMessage)
248 }
249 }
250 if returnFunc, ok := ret.Get(1).(func() error); ok {
251 r1 = returnFunc()
252 } else {
253 r1 = ret.Error(1)
254 }
255 return r0, r1
256}
257
258// MockClientConnection_ReceiveServer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReceiveServer'
259type MockClientConnection_ReceiveServer_Call struct {
260 *mock.Call
261}
262
263// ReceiveServer is a helper method to define mock.On call
264func (_e *MockClientConnection_Expecter) ReceiveServer() *MockClientConnection_ReceiveServer_Call {
265 return &MockClientConnection_ReceiveServer_Call{Call: _e.mock.On("ReceiveServer")}
266}
267
268func (_c *MockClientConnection_ReceiveServer_Call) Run(run func()) *MockClientConnection_ReceiveServer_Call {
269 _c.Call.Run(func(args mock.Arguments) {
270 run()
271 })
272 return _c
273}
274
275func (_c *MockClientConnection_ReceiveServer_Call) Return(serverMessage protocol.ServerMessage, err error) *MockClientConnection_ReceiveServer_Call {
276 _c.Call.Return(serverMessage, err)
277 return _c
278}
279
280func (_c *MockClientConnection_ReceiveServer_Call) RunAndReturn(run func() (protocol.ServerMessage, error)) *MockClientConnection_ReceiveServer_Call {
281 _c.Call.Return(run)
282 return _c
283}
284
285// SendClient provides a mock function for the type MockClientConnection
286func (_mock *MockClientConnection) SendClient(clientMessage protocol.ClientMessage) error {
287 ret := _mock.Called(clientMessage)
288
289 if len(ret) == 0 {
290 panic("no return value specified for SendClient")
291 }
292
293 var r0 error
294 if returnFunc, ok := ret.Get(0).(func(protocol.ClientMessage) error); ok {
295 r0 = returnFunc(clientMessage)
296 } else {
297 r0 = ret.Error(0)
298 }
299 return r0
300}
301
302// MockClientConnection_SendClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendClient'
303type MockClientConnection_SendClient_Call struct {
304 *mock.Call
305}
306
307// SendClient is a helper method to define mock.On call
308// - clientMessage protocol.ClientMessage
309func (_e *MockClientConnection_Expecter) SendClient(clientMessage any) *MockClientConnection_SendClient_Call {
310 return &MockClientConnection_SendClient_Call{Call: _e.mock.On("SendClient", clientMessage)}
311}
312
313func (_c *MockClientConnection_SendClient_Call) Run(run func(clientMessage protocol.ClientMessage)) *MockClientConnection_SendClient_Call {
314 _c.Call.Run(func(args mock.Arguments) {
315 var arg0 protocol.ClientMessage
316 if args[0] != nil {
317 arg0 = args[0].(protocol.ClientMessage)
318 }
319 run(
320 arg0,
321 )
322 })
323 return _c
324}
325
326func (_c *MockClientConnection_SendClient_Call) Return(err error) *MockClientConnection_SendClient_Call {
327 _c.Call.Return(err)
328 return _c
329}
330
331func (_c *MockClientConnection_SendClient_Call) RunAndReturn(run func(clientMessage protocol.ClientMessage) error) *MockClientConnection_SendClient_Call {
332 _c.Call.Return(run)
333 return _c
334}
335
336// NewMockClientDialer creates a new instance of MockClientDialer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
337// The first argument is typically a *testing.T value.
338func NewMockClientDialer(t interface {
339 mock.TestingT
340 Cleanup(func())
341}) *MockClientDialer {
342 if helper, ok := t.(interface{ Helper() }); ok {
343 helper.Helper()
344 }
345
346 mock := &MockClientDialer{}
347 mock.Mock.Test(t)
348
349 t.Cleanup(func() {
350 if helper, ok := t.(interface{ Helper() }); ok {
351 helper.Helper()
352 }
353 mock.AssertExpectations(t)
354 })
355
356 return mock
357}
358
359// MockClientDialer is an autogenerated mock type for the ClientDialer type
360type MockClientDialer struct {
361 mock.Mock
362}
363
364type MockClientDialer_Expecter struct {
365 mock *mock.Mock
366}
367
368func (_m *MockClientDialer) EXPECT() *MockClientDialer_Expecter {
369 return &MockClientDialer_Expecter{mock: &_m.Mock}
370}
371
372// Dial provides a mock function for the type MockClientDialer
373func (_mock *MockClientDialer) Dial(context1 context.Context) (ports.ClientConnection, error) {
374 ret := _mock.Called(context1)
375
376 if len(ret) == 0 {
377 panic("no return value specified for Dial")
378 }
379
380 var r0 ports.ClientConnection
381 var r1 error
382 if returnFunc, ok := ret.Get(0).(func(context.Context) (ports.ClientConnection, error)); ok {
383 return returnFunc(context1)
384 }
385 if returnFunc, ok := ret.Get(0).(func(context.Context) ports.ClientConnection); ok {
386 r0 = returnFunc(context1)
387 } else {
388 if ret.Get(0) != nil {
389 r0 = ret.Get(0).(ports.ClientConnection)
390 }
391 }
392 if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
393 r1 = returnFunc(context1)
394 } else {
395 r1 = ret.Error(1)
396 }
397 return r0, r1
398}
399
400// MockClientDialer_Dial_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Dial'
401type MockClientDialer_Dial_Call struct {
402 *mock.Call
403}
404
405// Dial is a helper method to define mock.On call
406// - context1 context.Context
407func (_e *MockClientDialer_Expecter) Dial(context1 any) *MockClientDialer_Dial_Call {
408 return &MockClientDialer_Dial_Call{Call: _e.mock.On("Dial", context1)}
409}
410
411func (_c *MockClientDialer_Dial_Call) Run(run func(context1 context.Context)) *MockClientDialer_Dial_Call {
412 _c.Call.Run(func(args mock.Arguments) {
413 var arg0 context.Context
414 if args[0] != nil {
415 arg0 = args[0].(context.Context)
416 }
417 run(
418 arg0,
419 )
420 })
421 return _c
422}
423
424func (_c *MockClientDialer_Dial_Call) Return(clientConnection ports.ClientConnection, err error) *MockClientDialer_Dial_Call {
425 _c.Call.Return(clientConnection, err)
426 return _c
427}
428
429func (_c *MockClientDialer_Dial_Call) RunAndReturn(run func(context1 context.Context) (ports.ClientConnection, error)) *MockClientDialer_Dial_Call {
430 _c.Call.Return(run)
431 return _c
432}
433
434// NewMockServerConnection creates a new instance of MockServerConnection. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
435// The first argument is typically a *testing.T value.
436func NewMockServerConnection(t interface {
437 mock.TestingT
438 Cleanup(func())
439}) *MockServerConnection {
440 if helper, ok := t.(interface{ Helper() }); ok {
441 helper.Helper()
442 }
443
444 mock := &MockServerConnection{}
445 mock.Mock.Test(t)
446
447 t.Cleanup(func() {
448 if helper, ok := t.(interface{ Helper() }); ok {
449 helper.Helper()
450 }
451 mock.AssertExpectations(t)
452 })
453
454 return mock
455}
456
457// MockServerConnection is an autogenerated mock type for the ServerConnection type
458type MockServerConnection struct {
459 mock.Mock
460}
461
462type MockServerConnection_Expecter struct {
463 mock *mock.Mock
464}
465
466func (_m *MockServerConnection) EXPECT() *MockServerConnection_Expecter {
467 return &MockServerConnection_Expecter{mock: &_m.Mock}
468}
469
470// Capabilities provides a mock function for the type MockServerConnection
471func (_mock *MockServerConnection) Capabilities() protocol.ConnectionCapabilities {
472 ret := _mock.Called()
473
474 if len(ret) == 0 {
475 panic("no return value specified for Capabilities")
476 }
477
478 var r0 protocol.ConnectionCapabilities
479 if returnFunc, ok := ret.Get(0).(func() protocol.ConnectionCapabilities); ok {
480 r0 = returnFunc()
481 } else {
482 r0 = ret.Get(0).(protocol.ConnectionCapabilities)
483 }
484 return r0
485}
486
487// MockServerConnection_Capabilities_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Capabilities'
488type MockServerConnection_Capabilities_Call struct {
489 *mock.Call
490}
491
492// Capabilities is a helper method to define mock.On call
493func (_e *MockServerConnection_Expecter) Capabilities() *MockServerConnection_Capabilities_Call {
494 return &MockServerConnection_Capabilities_Call{Call: _e.mock.On("Capabilities")}
495}
496
497func (_c *MockServerConnection_Capabilities_Call) Run(run func()) *MockServerConnection_Capabilities_Call {
498 _c.Call.Run(func(args mock.Arguments) {
499 run()
500 })
501 return _c
502}
503
504func (_c *MockServerConnection_Capabilities_Call) Return(connectionCapabilities protocol.ConnectionCapabilities) *MockServerConnection_Capabilities_Call {
505 _c.Call.Return(connectionCapabilities)
506 return _c
507}
508
509func (_c *MockServerConnection_Capabilities_Call) RunAndReturn(run func() protocol.ConnectionCapabilities) *MockServerConnection_Capabilities_Call {
510 _c.Call.Return(run)
511 return _c
512}
513
514// Close provides a mock function for the type MockServerConnection
515func (_mock *MockServerConnection) Close() error {
516 ret := _mock.Called()
517
518 if len(ret) == 0 {
519 panic("no return value specified for Close")
520 }
521
522 var r0 error
523 if returnFunc, ok := ret.Get(0).(func() error); ok {
524 r0 = returnFunc()
525 } else {
526 r0 = ret.Error(0)
527 }
528 return r0
529}
530
531// MockServerConnection_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
532type MockServerConnection_Close_Call struct {
533 *mock.Call
534}
535
536// Close is a helper method to define mock.On call
537func (_e *MockServerConnection_Expecter) Close() *MockServerConnection_Close_Call {
538 return &MockServerConnection_Close_Call{Call: _e.mock.On("Close")}
539}
540
541func (_c *MockServerConnection_Close_Call) Run(run func()) *MockServerConnection_Close_Call {
542 _c.Call.Run(func(args mock.Arguments) {
543 run()
544 })
545 return _c
546}
547
548func (_c *MockServerConnection_Close_Call) Return(err error) *MockServerConnection_Close_Call {
549 _c.Call.Return(err)
550 return _c
551}
552
553func (_c *MockServerConnection_Close_Call) RunAndReturn(run func() error) *MockServerConnection_Close_Call {
554 _c.Call.Return(run)
555 return _c
556}
557
558// LinkEvents provides a mock function for the type MockServerConnection
559func (_mock *MockServerConnection) LinkEvents() <-chan ports.LinkEvent {
560 ret := _mock.Called()
561
562 if len(ret) == 0 {
563 panic("no return value specified for LinkEvents")
564 }
565
566 var r0 <-chan ports.LinkEvent
567 if returnFunc, ok := ret.Get(0).(func() <-chan ports.LinkEvent); ok {
568 r0 = returnFunc()
569 } else {
570 if ret.Get(0) != nil {
571 r0 = ret.Get(0).(<-chan ports.LinkEvent)
572 }
573 }
574 return r0
575}
576
577// MockServerConnection_LinkEvents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LinkEvents'
578type MockServerConnection_LinkEvents_Call struct {
579 *mock.Call
580}
581
582// LinkEvents is a helper method to define mock.On call
583func (_e *MockServerConnection_Expecter) LinkEvents() *MockServerConnection_LinkEvents_Call {
584 return &MockServerConnection_LinkEvents_Call{Call: _e.mock.On("LinkEvents")}
585}
586
587func (_c *MockServerConnection_LinkEvents_Call) Run(run func()) *MockServerConnection_LinkEvents_Call {
588 _c.Call.Run(func(args mock.Arguments) {
589 run()
590 })
591 return _c
592}
593
594func (_c *MockServerConnection_LinkEvents_Call) Return(linkEventCh <-chan ports.LinkEvent) *MockServerConnection_LinkEvents_Call {
595 _c.Call.Return(linkEventCh)
596 return _c
597}
598
599func (_c *MockServerConnection_LinkEvents_Call) RunAndReturn(run func() <-chan ports.LinkEvent) *MockServerConnection_LinkEvents_Call {
600 _c.Call.Return(run)
601 return _c
602}
603
604// LinkState provides a mock function for the type MockServerConnection
605func (_mock *MockServerConnection) LinkState() ports.LinkState {
606 ret := _mock.Called()
607
608 if len(ret) == 0 {
609 panic("no return value specified for LinkState")
610 }
611
612 var r0 ports.LinkState
613 if returnFunc, ok := ret.Get(0).(func() ports.LinkState); ok {
614 r0 = returnFunc()
615 } else {
616 r0 = ret.Get(0).(ports.LinkState)
617 }
618 return r0
619}
620
621// MockServerConnection_LinkState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LinkState'
622type MockServerConnection_LinkState_Call struct {
623 *mock.Call
624}
625
626// LinkState is a helper method to define mock.On call
627func (_e *MockServerConnection_Expecter) LinkState() *MockServerConnection_LinkState_Call {
628 return &MockServerConnection_LinkState_Call{Call: _e.mock.On("LinkState")}
629}
630
631func (_c *MockServerConnection_LinkState_Call) Run(run func()) *MockServerConnection_LinkState_Call {
632 _c.Call.Run(func(args mock.Arguments) {
633 run()
634 })
635 return _c
636}
637
638func (_c *MockServerConnection_LinkState_Call) Return(linkState ports.LinkState) *MockServerConnection_LinkState_Call {
639 _c.Call.Return(linkState)
640 return _c
641}
642
643func (_c *MockServerConnection_LinkState_Call) RunAndReturn(run func() ports.LinkState) *MockServerConnection_LinkState_Call {
644 _c.Call.Return(run)
645 return _c
646}
647
648// ReceiveClient provides a mock function for the type MockServerConnection
649func (_mock *MockServerConnection) ReceiveClient() (protocol.ClientMessage, error) {
650 ret := _mock.Called()
651
652 if len(ret) == 0 {
653 panic("no return value specified for ReceiveClient")
654 }
655
656 var r0 protocol.ClientMessage
657 var r1 error
658 if returnFunc, ok := ret.Get(0).(func() (protocol.ClientMessage, error)); ok {
659 return returnFunc()
660 }
661 if returnFunc, ok := ret.Get(0).(func() protocol.ClientMessage); ok {
662 r0 = returnFunc()
663 } else {
664 if ret.Get(0) != nil {
665 r0 = ret.Get(0).(protocol.ClientMessage)
666 }
667 }
668 if returnFunc, ok := ret.Get(1).(func() error); ok {
669 r1 = returnFunc()
670 } else {
671 r1 = ret.Error(1)
672 }
673 return r0, r1
674}
675
676// MockServerConnection_ReceiveClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReceiveClient'
677type MockServerConnection_ReceiveClient_Call struct {
678 *mock.Call
679}
680
681// ReceiveClient is a helper method to define mock.On call
682func (_e *MockServerConnection_Expecter) ReceiveClient() *MockServerConnection_ReceiveClient_Call {
683 return &MockServerConnection_ReceiveClient_Call{Call: _e.mock.On("ReceiveClient")}
684}
685
686func (_c *MockServerConnection_ReceiveClient_Call) Run(run func()) *MockServerConnection_ReceiveClient_Call {
687 _c.Call.Run(func(args mock.Arguments) {
688 run()
689 })
690 return _c
691}
692
693func (_c *MockServerConnection_ReceiveClient_Call) Return(clientMessage protocol.ClientMessage, err error) *MockServerConnection_ReceiveClient_Call {
694 _c.Call.Return(clientMessage, err)
695 return _c
696}
697
698func (_c *MockServerConnection_ReceiveClient_Call) RunAndReturn(run func() (protocol.ClientMessage, error)) *MockServerConnection_ReceiveClient_Call {
699 _c.Call.Return(run)
700 return _c
701}
702
703// SendOutput provides a mock function for the type MockServerConnection
704func (_mock *MockServerConnection) SendOutput(output protocol.Output) error {
705 ret := _mock.Called(output)
706
707 if len(ret) == 0 {
708 panic("no return value specified for SendOutput")
709 }
710
711 var r0 error
712 if returnFunc, ok := ret.Get(0).(func(protocol.Output) error); ok {
713 r0 = returnFunc(output)
714 } else {
715 r0 = ret.Error(0)
716 }
717 return r0
718}
719
720// MockServerConnection_SendOutput_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendOutput'
721type MockServerConnection_SendOutput_Call struct {
722 *mock.Call
723}
724
725// SendOutput is a helper method to define mock.On call
726// - output protocol.Output
727func (_e *MockServerConnection_Expecter) SendOutput(output any) *MockServerConnection_SendOutput_Call {
728 return &MockServerConnection_SendOutput_Call{Call: _e.mock.On("SendOutput", output)}
729}
730
731func (_c *MockServerConnection_SendOutput_Call) Run(run func(output protocol.Output)) *MockServerConnection_SendOutput_Call {
732 _c.Call.Run(func(args mock.Arguments) {
733 var arg0 protocol.Output
734 if args[0] != nil {
735 arg0 = args[0].(protocol.Output)
736 }
737 run(
738 arg0,
739 )
740 })
741 return _c
742}
743
744func (_c *MockServerConnection_SendOutput_Call) Return(err error) *MockServerConnection_SendOutput_Call {
745 _c.Call.Return(err)
746 return _c
747}
748
749func (_c *MockServerConnection_SendOutput_Call) RunAndReturn(run func(output protocol.Output) error) *MockServerConnection_SendOutput_Call {
750 _c.Call.Return(run)
751 return _c
752}
753
754// SendOutputAsync provides a mock function for the type MockServerConnection
755func (_mock *MockServerConnection) SendOutputAsync(output protocol.Output) error {
756 ret := _mock.Called(output)
757
758 if len(ret) == 0 {
759 panic("no return value specified for SendOutputAsync")
760 }
761
762 var r0 error
763 if returnFunc, ok := ret.Get(0).(func(protocol.Output) error); ok {
764 r0 = returnFunc(output)
765 } else {
766 r0 = ret.Error(0)
767 }
768 return r0
769}
770
771// MockServerConnection_SendOutputAsync_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendOutputAsync'
772type MockServerConnection_SendOutputAsync_Call struct {
773 *mock.Call
774}
775
776// SendOutputAsync is a helper method to define mock.On call
777// - output protocol.Output
778func (_e *MockServerConnection_Expecter) SendOutputAsync(output any) *MockServerConnection_SendOutputAsync_Call {
779 return &MockServerConnection_SendOutputAsync_Call{Call: _e.mock.On("SendOutputAsync", output)}
780}
781
782func (_c *MockServerConnection_SendOutputAsync_Call) Run(run func(output protocol.Output)) *MockServerConnection_SendOutputAsync_Call {
783 _c.Call.Run(func(args mock.Arguments) {
784 var arg0 protocol.Output
785 if args[0] != nil {
786 arg0 = args[0].(protocol.Output)
787 }
788 run(
789 arg0,
790 )
791 })
792 return _c
793}
794
795func (_c *MockServerConnection_SendOutputAsync_Call) Return(err error) *MockServerConnection_SendOutputAsync_Call {
796 _c.Call.Return(err)
797 return _c
798}
799
800func (_c *MockServerConnection_SendOutputAsync_Call) RunAndReturn(run func(output protocol.Output) error) *MockServerConnection_SendOutputAsync_Call {
801 _c.Call.Return(run)
802 return _c
803}
804
805// SendOutputSynchronous provides a mock function for the type MockServerConnection
806func (_mock *MockServerConnection) SendOutputSynchronous(output protocol.Output) error {
807 ret := _mock.Called(output)
808
809 if len(ret) == 0 {
810 panic("no return value specified for SendOutputSynchronous")
811 }
812
813 var r0 error
814 if returnFunc, ok := ret.Get(0).(func(protocol.Output) error); ok {
815 r0 = returnFunc(output)
816 } else {
817 r0 = ret.Error(0)
818 }
819 return r0
820}
821
822// MockServerConnection_SendOutputSynchronous_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendOutputSynchronous'
823type MockServerConnection_SendOutputSynchronous_Call struct {
824 *mock.Call
825}
826
827// SendOutputSynchronous is a helper method to define mock.On call
828// - output protocol.Output
829func (_e *MockServerConnection_Expecter) SendOutputSynchronous(output any) *MockServerConnection_SendOutputSynchronous_Call {
830 return &MockServerConnection_SendOutputSynchronous_Call{Call: _e.mock.On("SendOutputSynchronous", output)}
831}
832
833func (_c *MockServerConnection_SendOutputSynchronous_Call) Run(run func(output protocol.Output)) *MockServerConnection_SendOutputSynchronous_Call {
834 _c.Call.Run(func(args mock.Arguments) {
835 var arg0 protocol.Output
836 if args[0] != nil {
837 arg0 = args[0].(protocol.Output)
838 }
839 run(
840 arg0,
841 )
842 })
843 return _c
844}
845
846func (_c *MockServerConnection_SendOutputSynchronous_Call) Return(err error) *MockServerConnection_SendOutputSynchronous_Call {
847 _c.Call.Return(err)
848 return _c
849}
850
851func (_c *MockServerConnection_SendOutputSynchronous_Call) RunAndReturn(run func(output protocol.Output) error) *MockServerConnection_SendOutputSynchronous_Call {
852 _c.Call.Return(run)
853 return _c
854}
855
856// SendServer provides a mock function for the type MockServerConnection
857func (_mock *MockServerConnection) SendServer(serverMessage protocol.ServerMessage) error {
858 ret := _mock.Called(serverMessage)
859
860 if len(ret) == 0 {
861 panic("no return value specified for SendServer")
862 }
863
864 var r0 error
865 if returnFunc, ok := ret.Get(0).(func(protocol.ServerMessage) error); ok {
866 r0 = returnFunc(serverMessage)
867 } else {
868 r0 = ret.Error(0)
869 }
870 return r0
871}
872
873// MockServerConnection_SendServer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendServer'
874type MockServerConnection_SendServer_Call struct {
875 *mock.Call
876}
877
878// SendServer is a helper method to define mock.On call
879// - serverMessage protocol.ServerMessage
880func (_e *MockServerConnection_Expecter) SendServer(serverMessage any) *MockServerConnection_SendServer_Call {
881 return &MockServerConnection_SendServer_Call{Call: _e.mock.On("SendServer", serverMessage)}
882}
883
884func (_c *MockServerConnection_SendServer_Call) Run(run func(serverMessage protocol.ServerMessage)) *MockServerConnection_SendServer_Call {
885 _c.Call.Run(func(args mock.Arguments) {
886 var arg0 protocol.ServerMessage
887 if args[0] != nil {
888 arg0 = args[0].(protocol.ServerMessage)
889 }
890 run(
891 arg0,
892 )
893 })
894 return _c
895}
896
897func (_c *MockServerConnection_SendServer_Call) Return(err error) *MockServerConnection_SendServer_Call {
898 _c.Call.Return(err)
899 return _c
900}
901
902func (_c *MockServerConnection_SendServer_Call) RunAndReturn(run func(serverMessage protocol.ServerMessage) error) *MockServerConnection_SendServer_Call {
903 _c.Call.Return(run)
904 return _c
905}
906
907// SendServerAsync provides a mock function for the type MockServerConnection
908func (_mock *MockServerConnection) SendServerAsync(serverMessage protocol.ServerMessage) error {
909 ret := _mock.Called(serverMessage)
910
911 if len(ret) == 0 {
912 panic("no return value specified for SendServerAsync")
913 }
914
915 var r0 error
916 if returnFunc, ok := ret.Get(0).(func(protocol.ServerMessage) error); ok {
917 r0 = returnFunc(serverMessage)
918 } else {
919 r0 = ret.Error(0)
920 }
921 return r0
922}
923
924// MockServerConnection_SendServerAsync_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendServerAsync'
925type MockServerConnection_SendServerAsync_Call struct {
926 *mock.Call
927}
928
929// SendServerAsync is a helper method to define mock.On call
930// - serverMessage protocol.ServerMessage
931func (_e *MockServerConnection_Expecter) SendServerAsync(serverMessage any) *MockServerConnection_SendServerAsync_Call {
932 return &MockServerConnection_SendServerAsync_Call{Call: _e.mock.On("SendServerAsync", serverMessage)}
933}
934
935func (_c *MockServerConnection_SendServerAsync_Call) Run(run func(serverMessage protocol.ServerMessage)) *MockServerConnection_SendServerAsync_Call {
936 _c.Call.Run(func(args mock.Arguments) {
937 var arg0 protocol.ServerMessage
938 if args[0] != nil {
939 arg0 = args[0].(protocol.ServerMessage)
940 }
941 run(
942 arg0,
943 )
944 })
945 return _c
946}
947
948func (_c *MockServerConnection_SendServerAsync_Call) Return(err error) *MockServerConnection_SendServerAsync_Call {
949 _c.Call.Return(err)
950 return _c
951}
952
953func (_c *MockServerConnection_SendServerAsync_Call) RunAndReturn(run func(serverMessage protocol.ServerMessage) error) *MockServerConnection_SendServerAsync_Call {
954 _c.Call.Return(run)
955 return _c
956}
957
958// SendServerSynchronous provides a mock function for the type MockServerConnection
959func (_mock *MockServerConnection) SendServerSynchronous(serverMessage protocol.ServerMessage) error {
960 ret := _mock.Called(serverMessage)
961
962 if len(ret) == 0 {
963 panic("no return value specified for SendServerSynchronous")
964 }
965
966 var r0 error
967 if returnFunc, ok := ret.Get(0).(func(protocol.ServerMessage) error); ok {
968 r0 = returnFunc(serverMessage)
969 } else {
970 r0 = ret.Error(0)
971 }
972 return r0
973}
974
975// MockServerConnection_SendServerSynchronous_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendServerSynchronous'
976type MockServerConnection_SendServerSynchronous_Call struct {
977 *mock.Call
978}
979
980// SendServerSynchronous is a helper method to define mock.On call
981// - serverMessage protocol.ServerMessage
982func (_e *MockServerConnection_Expecter) SendServerSynchronous(serverMessage any) *MockServerConnection_SendServerSynchronous_Call {
983 return &MockServerConnection_SendServerSynchronous_Call{Call: _e.mock.On("SendServerSynchronous", serverMessage)}
984}
985
986func (_c *MockServerConnection_SendServerSynchronous_Call) Run(run func(serverMessage protocol.ServerMessage)) *MockServerConnection_SendServerSynchronous_Call {
987 _c.Call.Run(func(args mock.Arguments) {
988 var arg0 protocol.ServerMessage
989 if args[0] != nil {
990 arg0 = args[0].(protocol.ServerMessage)
991 }
992 run(
993 arg0,
994 )
995 })
996 return _c
997}
998
999func (_c *MockServerConnection_SendServerSynchronous_Call) Return(err error) *MockServerConnection_SendServerSynchronous_Call {
1000 _c.Call.Return(err)
1001 return _c
1002}
1003
1004func (_c *MockServerConnection_SendServerSynchronous_Call) RunAndReturn(run func(serverMessage protocol.ServerMessage) error) *MockServerConnection_SendServerSynchronous_Call {
1005 _c.Call.Return(run)
1006 return _c
1007}
1008
1009// NewMockHandshakeDeadlineProvider creates a new instance of MockHandshakeDeadlineProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
1010// The first argument is typically a *testing.T value.
1011func NewMockHandshakeDeadlineProvider(t interface {
1012 mock.TestingT
1013 Cleanup(func())
1014}) *MockHandshakeDeadlineProvider {
1015 if helper, ok := t.(interface{ Helper() }); ok {
1016 helper.Helper()
1017 }
1018
1019 mock := &MockHandshakeDeadlineProvider{}
1020 mock.Mock.Test(t)
1021
1022 t.Cleanup(func() {
1023 if helper, ok := t.(interface{ Helper() }); ok {
1024 helper.Helper()
1025 }
1026 mock.AssertExpectations(t)
1027 })
1028
1029 return mock
1030}
1031
1032// MockHandshakeDeadlineProvider is an autogenerated mock type for the HandshakeDeadlineProvider type
1033type MockHandshakeDeadlineProvider struct {
1034 mock.Mock
1035}
1036
1037type MockHandshakeDeadlineProvider_Expecter struct {
1038 mock *mock.Mock
1039}
1040
1041func (_m *MockHandshakeDeadlineProvider) EXPECT() *MockHandshakeDeadlineProvider_Expecter {
1042 return &MockHandshakeDeadlineProvider_Expecter{mock: &_m.Mock}
1043}
1044
1045// HandshakeDeadline provides a mock function for the type MockHandshakeDeadlineProvider
1046func (_mock *MockHandshakeDeadlineProvider) HandshakeDeadline() time.Time {
1047 ret := _mock.Called()
1048
1049 if len(ret) == 0 {
1050 panic("no return value specified for HandshakeDeadline")
1051 }
1052
1053 var r0 time.Time
1054 if returnFunc, ok := ret.Get(0).(func() time.Time); ok {
1055 r0 = returnFunc()
1056 } else {
1057 r0 = ret.Get(0).(time.Time)
1058 }
1059 return r0
1060}
1061
1062// MockHandshakeDeadlineProvider_HandshakeDeadline_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HandshakeDeadline'
1063type MockHandshakeDeadlineProvider_HandshakeDeadline_Call struct {
1064 *mock.Call
1065}
1066
1067// HandshakeDeadline is a helper method to define mock.On call
1068func (_e *MockHandshakeDeadlineProvider_Expecter) HandshakeDeadline() *MockHandshakeDeadlineProvider_HandshakeDeadline_Call {
1069 return &MockHandshakeDeadlineProvider_HandshakeDeadline_Call{Call: _e.mock.On("HandshakeDeadline")}
1070}
1071
1072func (_c *MockHandshakeDeadlineProvider_HandshakeDeadline_Call) Run(run func()) *MockHandshakeDeadlineProvider_HandshakeDeadline_Call {
1073 _c.Call.Run(func(args mock.Arguments) {
1074 run()
1075 })
1076 return _c
1077}
1078
1079func (_c *MockHandshakeDeadlineProvider_HandshakeDeadline_Call) Return(time1 time.Time) *MockHandshakeDeadlineProvider_HandshakeDeadline_Call {
1080 _c.Call.Return(time1)
1081 return _c
1082}
1083
1084func (_c *MockHandshakeDeadlineProvider_HandshakeDeadline_Call) RunAndReturn(run func() time.Time) *MockHandshakeDeadlineProvider_HandshakeDeadline_Call {
1085 _c.Call.Return(run)
1086 return _c
1087}
1088
1089// NewMockServerListener creates a new instance of MockServerListener. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
1090// The first argument is typically a *testing.T value.
1091func NewMockServerListener(t interface {
1092 mock.TestingT
1093 Cleanup(func())
1094}) *MockServerListener {
1095 if helper, ok := t.(interface{ Helper() }); ok {
1096 helper.Helper()
1097 }
1098
1099 mock := &MockServerListener{}
1100 mock.Mock.Test(t)
1101
1102 t.Cleanup(func() {
1103 if helper, ok := t.(interface{ Helper() }); ok {
1104 helper.Helper()
1105 }
1106 mock.AssertExpectations(t)
1107 })
1108
1109 return mock
1110}
1111
1112// MockServerListener is an autogenerated mock type for the ServerListener type
1113type MockServerListener struct {
1114 mock.Mock
1115}
1116
1117type MockServerListener_Expecter struct {
1118 mock *mock.Mock
1119}
1120
1121func (_m *MockServerListener) EXPECT() *MockServerListener_Expecter {
1122 return &MockServerListener_Expecter{mock: &_m.Mock}
1123}
1124
1125// Accept provides a mock function for the type MockServerListener
1126func (_mock *MockServerListener) Accept() (ports.ServerConnection, error) {
1127 ret := _mock.Called()
1128
1129 if len(ret) == 0 {
1130 panic("no return value specified for Accept")
1131 }
1132
1133 var r0 ports.ServerConnection
1134 var r1 error
1135 if returnFunc, ok := ret.Get(0).(func() (ports.ServerConnection, error)); ok {
1136 return returnFunc()
1137 }
1138 if returnFunc, ok := ret.Get(0).(func() ports.ServerConnection); ok {
1139 r0 = returnFunc()
1140 } else {
1141 if ret.Get(0) != nil {
1142 r0 = ret.Get(0).(ports.ServerConnection)
1143 }
1144 }
1145 if returnFunc, ok := ret.Get(1).(func() error); ok {
1146 r1 = returnFunc()
1147 } else {
1148 r1 = ret.Error(1)
1149 }
1150 return r0, r1
1151}
1152
1153// MockServerListener_Accept_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Accept'
1154type MockServerListener_Accept_Call struct {
1155 *mock.Call
1156}
1157
1158// Accept is a helper method to define mock.On call
1159func (_e *MockServerListener_Expecter) Accept() *MockServerListener_Accept_Call {
1160 return &MockServerListener_Accept_Call{Call: _e.mock.On("Accept")}
1161}
1162
1163func (_c *MockServerListener_Accept_Call) Run(run func()) *MockServerListener_Accept_Call {
1164 _c.Call.Run(func(args mock.Arguments) {
1165 run()
1166 })
1167 return _c
1168}
1169
1170func (_c *MockServerListener_Accept_Call) Return(serverConnection ports.ServerConnection, err error) *MockServerListener_Accept_Call {
1171 _c.Call.Return(serverConnection, err)
1172 return _c
1173}
1174
1175func (_c *MockServerListener_Accept_Call) RunAndReturn(run func() (ports.ServerConnection, error)) *MockServerListener_Accept_Call {
1176 _c.Call.Return(run)
1177 return _c
1178}
1179
1180// Addr provides a mock function for the type MockServerListener
1181func (_mock *MockServerListener) Addr() string {
1182 ret := _mock.Called()
1183
1184 if len(ret) == 0 {
1185 panic("no return value specified for Addr")
1186 }
1187
1188 var r0 string
1189 if returnFunc, ok := ret.Get(0).(func() string); ok {
1190 r0 = returnFunc()
1191 } else {
1192 r0 = ret.Get(0).(string)
1193 }
1194 return r0
1195}
1196
1197// MockServerListener_Addr_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Addr'
1198type MockServerListener_Addr_Call struct {
1199 *mock.Call
1200}
1201
1202// Addr is a helper method to define mock.On call
1203func (_e *MockServerListener_Expecter) Addr() *MockServerListener_Addr_Call {
1204 return &MockServerListener_Addr_Call{Call: _e.mock.On("Addr")}
1205}
1206
1207func (_c *MockServerListener_Addr_Call) Run(run func()) *MockServerListener_Addr_Call {
1208 _c.Call.Run(func(args mock.Arguments) {
1209 run()
1210 })
1211 return _c
1212}
1213
1214func (_c *MockServerListener_Addr_Call) Return(s string) *MockServerListener_Addr_Call {
1215 _c.Call.Return(s)
1216 return _c
1217}
1218
1219func (_c *MockServerListener_Addr_Call) RunAndReturn(run func() string) *MockServerListener_Addr_Call {
1220 _c.Call.Return(run)
1221 return _c
1222}
1223
1224// Close provides a mock function for the type MockServerListener
1225func (_mock *MockServerListener) Close() error {
1226 ret := _mock.Called()
1227
1228 if len(ret) == 0 {
1229 panic("no return value specified for Close")
1230 }
1231
1232 var r0 error
1233 if returnFunc, ok := ret.Get(0).(func() error); ok {
1234 r0 = returnFunc()
1235 } else {
1236 r0 = ret.Error(0)
1237 }
1238 return r0
1239}
1240
1241// MockServerListener_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
1242type MockServerListener_Close_Call struct {
1243 *mock.Call
1244}
1245
1246// Close is a helper method to define mock.On call
1247func (_e *MockServerListener_Expecter) Close() *MockServerListener_Close_Call {
1248 return &MockServerListener_Close_Call{Call: _e.mock.On("Close")}
1249}
1250
1251func (_c *MockServerListener_Close_Call) Run(run func()) *MockServerListener_Close_Call {
1252 _c.Call.Run(func(args mock.Arguments) {
1253 run()
1254 })
1255 return _c
1256}
1257
1258func (_c *MockServerListener_Close_Call) Return(err error) *MockServerListener_Close_Call {
1259 _c.Call.Return(err)
1260 return _c
1261}
1262
1263func (_c *MockServerListener_Close_Call) RunAndReturn(run func() error) *MockServerListener_Close_Call {
1264 _c.Call.Return(run)
1265 return _c
1266}