broker_pool_mock.go RawHistoryFolder
1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package portsmocks
6
7import (
8 "github.com/bnema/vev/internal/ports"
9 "github.com/bnema/vev/internal/protocol"
10 mock "github.com/stretchr/testify/mock"
11)
12
13// NewMockBrokerLogicalConnection creates a new instance of MockBrokerLogicalConnection. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
14// The first argument is typically a *testing.T value.
15func NewMockBrokerLogicalConnection(t interface {
16 mock.TestingT
17 Cleanup(func())
18}) *MockBrokerLogicalConnection {
19 if helper, ok := t.(interface{ Helper() }); ok {
20 helper.Helper()
21 }
22
23 mock := &MockBrokerLogicalConnection{}
24 mock.Mock.Test(t)
25
26 t.Cleanup(func() {
27 if helper, ok := t.(interface{ Helper() }); ok {
28 helper.Helper()
29 }
30 mock.AssertExpectations(t)
31 })
32
33 return mock
34}
35
36// MockBrokerLogicalConnection is an autogenerated mock type for the BrokerLogicalConnection type
37type MockBrokerLogicalConnection struct {
38 mock.Mock
39}
40
41type MockBrokerLogicalConnection_Expecter struct {
42 mock *mock.Mock
43}
44
45func (_m *MockBrokerLogicalConnection) EXPECT() *MockBrokerLogicalConnection_Expecter {
46 return &MockBrokerLogicalConnection_Expecter{mock: &_m.Mock}
47}
48
49// Capabilities provides a mock function for the type MockBrokerLogicalConnection
50func (_mock *MockBrokerLogicalConnection) Capabilities() protocol.ConnectionCapabilities {
51 ret := _mock.Called()
52
53 if len(ret) == 0 {
54 panic("no return value specified for Capabilities")
55 }
56
57 var r0 protocol.ConnectionCapabilities
58 if returnFunc, ok := ret.Get(0).(func() protocol.ConnectionCapabilities); ok {
59 r0 = returnFunc()
60 } else {
61 r0 = ret.Get(0).(protocol.ConnectionCapabilities)
62 }
63 return r0
64}
65
66// MockBrokerLogicalConnection_Capabilities_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Capabilities'
67type MockBrokerLogicalConnection_Capabilities_Call struct {
68 *mock.Call
69}
70
71// Capabilities is a helper method to define mock.On call
72func (_e *MockBrokerLogicalConnection_Expecter) Capabilities() *MockBrokerLogicalConnection_Capabilities_Call {
73 return &MockBrokerLogicalConnection_Capabilities_Call{Call: _e.mock.On("Capabilities")}
74}
75
76func (_c *MockBrokerLogicalConnection_Capabilities_Call) Run(run func()) *MockBrokerLogicalConnection_Capabilities_Call {
77 _c.Call.Run(func(args mock.Arguments) {
78 run()
79 })
80 return _c
81}
82
83func (_c *MockBrokerLogicalConnection_Capabilities_Call) Return(connectionCapabilities protocol.ConnectionCapabilities) *MockBrokerLogicalConnection_Capabilities_Call {
84 _c.Call.Return(connectionCapabilities)
85 return _c
86}
87
88func (_c *MockBrokerLogicalConnection_Capabilities_Call) RunAndReturn(run func() protocol.ConnectionCapabilities) *MockBrokerLogicalConnection_Capabilities_Call {
89 _c.Call.Return(run)
90 return _c
91}
92
93// Close provides a mock function for the type MockBrokerLogicalConnection
94func (_mock *MockBrokerLogicalConnection) Close() error {
95 ret := _mock.Called()
96
97 if len(ret) == 0 {
98 panic("no return value specified for Close")
99 }
100
101 var r0 error
102 if returnFunc, ok := ret.Get(0).(func() error); ok {
103 r0 = returnFunc()
104 } else {
105 r0 = ret.Error(0)
106 }
107 return r0
108}
109
110// MockBrokerLogicalConnection_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
111type MockBrokerLogicalConnection_Close_Call struct {
112 *mock.Call
113}
114
115// Close is a helper method to define mock.On call
116func (_e *MockBrokerLogicalConnection_Expecter) Close() *MockBrokerLogicalConnection_Close_Call {
117 return &MockBrokerLogicalConnection_Close_Call{Call: _e.mock.On("Close")}
118}
119
120func (_c *MockBrokerLogicalConnection_Close_Call) Run(run func()) *MockBrokerLogicalConnection_Close_Call {
121 _c.Call.Run(func(args mock.Arguments) {
122 run()
123 })
124 return _c
125}
126
127func (_c *MockBrokerLogicalConnection_Close_Call) Return(err error) *MockBrokerLogicalConnection_Close_Call {
128 _c.Call.Return(err)
129 return _c
130}
131
132func (_c *MockBrokerLogicalConnection_Close_Call) RunAndReturn(run func() error) *MockBrokerLogicalConnection_Close_Call {
133 _c.Call.Return(run)
134 return _c
135}
136
137// Done provides a mock function for the type MockBrokerLogicalConnection
138func (_mock *MockBrokerLogicalConnection) Done() <-chan struct{} {
139 ret := _mock.Called()
140
141 if len(ret) == 0 {
142 panic("no return value specified for Done")
143 }
144
145 var r0 <-chan struct{}
146 if returnFunc, ok := ret.Get(0).(func() <-chan struct{}); ok {
147 r0 = returnFunc()
148 } else {
149 if ret.Get(0) != nil {
150 r0 = ret.Get(0).(<-chan struct{})
151 }
152 }
153 return r0
154}
155
156// MockBrokerLogicalConnection_Done_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Done'
157type MockBrokerLogicalConnection_Done_Call struct {
158 *mock.Call
159}
160
161// Done is a helper method to define mock.On call
162func (_e *MockBrokerLogicalConnection_Expecter) Done() *MockBrokerLogicalConnection_Done_Call {
163 return &MockBrokerLogicalConnection_Done_Call{Call: _e.mock.On("Done")}
164}
165
166func (_c *MockBrokerLogicalConnection_Done_Call) Run(run func()) *MockBrokerLogicalConnection_Done_Call {
167 _c.Call.Run(func(args mock.Arguments) {
168 run()
169 })
170 return _c
171}
172
173func (_c *MockBrokerLogicalConnection_Done_Call) Return(valCh <-chan struct{}) *MockBrokerLogicalConnection_Done_Call {
174 _c.Call.Return(valCh)
175 return _c
176}
177
178func (_c *MockBrokerLogicalConnection_Done_Call) RunAndReturn(run func() <-chan struct{}) *MockBrokerLogicalConnection_Done_Call {
179 _c.Call.Return(run)
180 return _c
181}
182
183// Err provides a mock function for the type MockBrokerLogicalConnection
184func (_mock *MockBrokerLogicalConnection) Err() error {
185 ret := _mock.Called()
186
187 if len(ret) == 0 {
188 panic("no return value specified for Err")
189 }
190
191 var r0 error
192 if returnFunc, ok := ret.Get(0).(func() error); ok {
193 r0 = returnFunc()
194 } else {
195 r0 = ret.Error(0)
196 }
197 return r0
198}
199
200// MockBrokerLogicalConnection_Err_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Err'
201type MockBrokerLogicalConnection_Err_Call struct {
202 *mock.Call
203}
204
205// Err is a helper method to define mock.On call
206func (_e *MockBrokerLogicalConnection_Expecter) Err() *MockBrokerLogicalConnection_Err_Call {
207 return &MockBrokerLogicalConnection_Err_Call{Call: _e.mock.On("Err")}
208}
209
210func (_c *MockBrokerLogicalConnection_Err_Call) Run(run func()) *MockBrokerLogicalConnection_Err_Call {
211 _c.Call.Run(func(args mock.Arguments) {
212 run()
213 })
214 return _c
215}
216
217func (_c *MockBrokerLogicalConnection_Err_Call) Return(err error) *MockBrokerLogicalConnection_Err_Call {
218 _c.Call.Return(err)
219 return _c
220}
221
222func (_c *MockBrokerLogicalConnection_Err_Call) RunAndReturn(run func() error) *MockBrokerLogicalConnection_Err_Call {
223 _c.Call.Return(run)
224 return _c
225}
226
227// LinkEvents provides a mock function for the type MockBrokerLogicalConnection
228func (_mock *MockBrokerLogicalConnection) LinkEvents() <-chan ports.LinkEvent {
229 ret := _mock.Called()
230
231 if len(ret) == 0 {
232 panic("no return value specified for LinkEvents")
233 }
234
235 var r0 <-chan ports.LinkEvent
236 if returnFunc, ok := ret.Get(0).(func() <-chan ports.LinkEvent); ok {
237 r0 = returnFunc()
238 } else {
239 if ret.Get(0) != nil {
240 r0 = ret.Get(0).(<-chan ports.LinkEvent)
241 }
242 }
243 return r0
244}
245
246// MockBrokerLogicalConnection_LinkEvents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LinkEvents'
247type MockBrokerLogicalConnection_LinkEvents_Call struct {
248 *mock.Call
249}
250
251// LinkEvents is a helper method to define mock.On call
252func (_e *MockBrokerLogicalConnection_Expecter) LinkEvents() *MockBrokerLogicalConnection_LinkEvents_Call {
253 return &MockBrokerLogicalConnection_LinkEvents_Call{Call: _e.mock.On("LinkEvents")}
254}
255
256func (_c *MockBrokerLogicalConnection_LinkEvents_Call) Run(run func()) *MockBrokerLogicalConnection_LinkEvents_Call {
257 _c.Call.Run(func(args mock.Arguments) {
258 run()
259 })
260 return _c
261}
262
263func (_c *MockBrokerLogicalConnection_LinkEvents_Call) Return(linkEventCh <-chan ports.LinkEvent) *MockBrokerLogicalConnection_LinkEvents_Call {
264 _c.Call.Return(linkEventCh)
265 return _c
266}
267
268func (_c *MockBrokerLogicalConnection_LinkEvents_Call) RunAndReturn(run func() <-chan ports.LinkEvent) *MockBrokerLogicalConnection_LinkEvents_Call {
269 _c.Call.Return(run)
270 return _c
271}
272
273// LinkState provides a mock function for the type MockBrokerLogicalConnection
274func (_mock *MockBrokerLogicalConnection) LinkState() ports.LinkState {
275 ret := _mock.Called()
276
277 if len(ret) == 0 {
278 panic("no return value specified for LinkState")
279 }
280
281 var r0 ports.LinkState
282 if returnFunc, ok := ret.Get(0).(func() ports.LinkState); ok {
283 r0 = returnFunc()
284 } else {
285 r0 = ret.Get(0).(ports.LinkState)
286 }
287 return r0
288}
289
290// MockBrokerLogicalConnection_LinkState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LinkState'
291type MockBrokerLogicalConnection_LinkState_Call struct {
292 *mock.Call
293}
294
295// LinkState is a helper method to define mock.On call
296func (_e *MockBrokerLogicalConnection_Expecter) LinkState() *MockBrokerLogicalConnection_LinkState_Call {
297 return &MockBrokerLogicalConnection_LinkState_Call{Call: _e.mock.On("LinkState")}
298}
299
300func (_c *MockBrokerLogicalConnection_LinkState_Call) Run(run func()) *MockBrokerLogicalConnection_LinkState_Call {
301 _c.Call.Run(func(args mock.Arguments) {
302 run()
303 })
304 return _c
305}
306
307func (_c *MockBrokerLogicalConnection_LinkState_Call) Return(linkState ports.LinkState) *MockBrokerLogicalConnection_LinkState_Call {
308 _c.Call.Return(linkState)
309 return _c
310}
311
312func (_c *MockBrokerLogicalConnection_LinkState_Call) RunAndReturn(run func() ports.LinkState) *MockBrokerLogicalConnection_LinkState_Call {
313 _c.Call.Return(run)
314 return _c
315}
316
317// ReceiveServer provides a mock function for the type MockBrokerLogicalConnection
318func (_mock *MockBrokerLogicalConnection) ReceiveServer() (protocol.ServerMessage, error) {
319 ret := _mock.Called()
320
321 if len(ret) == 0 {
322 panic("no return value specified for ReceiveServer")
323 }
324
325 var r0 protocol.ServerMessage
326 var r1 error
327 if returnFunc, ok := ret.Get(0).(func() (protocol.ServerMessage, error)); ok {
328 return returnFunc()
329 }
330 if returnFunc, ok := ret.Get(0).(func() protocol.ServerMessage); ok {
331 r0 = returnFunc()
332 } else {
333 if ret.Get(0) != nil {
334 r0 = ret.Get(0).(protocol.ServerMessage)
335 }
336 }
337 if returnFunc, ok := ret.Get(1).(func() error); ok {
338 r1 = returnFunc()
339 } else {
340 r1 = ret.Error(1)
341 }
342 return r0, r1
343}
344
345// MockBrokerLogicalConnection_ReceiveServer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReceiveServer'
346type MockBrokerLogicalConnection_ReceiveServer_Call struct {
347 *mock.Call
348}
349
350// ReceiveServer is a helper method to define mock.On call
351func (_e *MockBrokerLogicalConnection_Expecter) ReceiveServer() *MockBrokerLogicalConnection_ReceiveServer_Call {
352 return &MockBrokerLogicalConnection_ReceiveServer_Call{Call: _e.mock.On("ReceiveServer")}
353}
354
355func (_c *MockBrokerLogicalConnection_ReceiveServer_Call) Run(run func()) *MockBrokerLogicalConnection_ReceiveServer_Call {
356 _c.Call.Run(func(args mock.Arguments) {
357 run()
358 })
359 return _c
360}
361
362func (_c *MockBrokerLogicalConnection_ReceiveServer_Call) Return(serverMessage protocol.ServerMessage, err error) *MockBrokerLogicalConnection_ReceiveServer_Call {
363 _c.Call.Return(serverMessage, err)
364 return _c
365}
366
367func (_c *MockBrokerLogicalConnection_ReceiveServer_Call) RunAndReturn(run func() (protocol.ServerMessage, error)) *MockBrokerLogicalConnection_ReceiveServer_Call {
368 _c.Call.Return(run)
369 return _c
370}
371
372// SendClient provides a mock function for the type MockBrokerLogicalConnection
373func (_mock *MockBrokerLogicalConnection) SendClient(clientMessage protocol.ClientMessage) error {
374 ret := _mock.Called(clientMessage)
375
376 if len(ret) == 0 {
377 panic("no return value specified for SendClient")
378 }
379
380 var r0 error
381 if returnFunc, ok := ret.Get(0).(func(protocol.ClientMessage) error); ok {
382 r0 = returnFunc(clientMessage)
383 } else {
384 r0 = ret.Error(0)
385 }
386 return r0
387}
388
389// MockBrokerLogicalConnection_SendClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendClient'
390type MockBrokerLogicalConnection_SendClient_Call struct {
391 *mock.Call
392}
393
394// SendClient is a helper method to define mock.On call
395// - clientMessage protocol.ClientMessage
396func (_e *MockBrokerLogicalConnection_Expecter) SendClient(clientMessage any) *MockBrokerLogicalConnection_SendClient_Call {
397 return &MockBrokerLogicalConnection_SendClient_Call{Call: _e.mock.On("SendClient", clientMessage)}
398}
399
400func (_c *MockBrokerLogicalConnection_SendClient_Call) Run(run func(clientMessage protocol.ClientMessage)) *MockBrokerLogicalConnection_SendClient_Call {
401 _c.Call.Run(func(args mock.Arguments) {
402 var arg0 protocol.ClientMessage
403 if args[0] != nil {
404 arg0 = args[0].(protocol.ClientMessage)
405 }
406 run(
407 arg0,
408 )
409 })
410 return _c
411}
412
413func (_c *MockBrokerLogicalConnection_SendClient_Call) Return(err error) *MockBrokerLogicalConnection_SendClient_Call {
414 _c.Call.Return(err)
415 return _c
416}
417
418func (_c *MockBrokerLogicalConnection_SendClient_Call) RunAndReturn(run func(clientMessage protocol.ClientMessage) error) *MockBrokerLogicalConnection_SendClient_Call {
419 _c.Call.Return(run)
420 return _c
421}