| 1 | // Code generated by mockery; DO NOT EDIT. |
| 2 | // github.com/vektra/mockery |
| 3 | // template: testify |
| 4 | |
| 5 | package mocks |
| 6 | |
| 7 | import ( |
| 8 | "context" |
| 9 | |
| 10 | "github.com/eclipse/paho.golang/paho" |
| 11 | mock "github.com/stretchr/testify/mock" |
| 12 | ) |
| 13 | |
| 14 | // NewMockConnectionManager creates a new instance of MockConnectionManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. |
| 15 | // The first argument is typically a *testing.T value. |
| 16 | func NewMockConnectionManager(t interface { |
| 17 | mock.TestingT |
| 18 | Cleanup(func()) |
| 19 | }) *MockConnectionManager { |
| 20 | mock := &MockConnectionManager{} |
| 21 | mock.Mock.Test(t) |
| 22 | |
| 23 | t.Cleanup(func() { mock.AssertExpectations(t) }) |
| 24 | |
| 25 | return mock |
| 26 | } |
| 27 | |
| 28 | // MockConnectionManager is an autogenerated mock type for the ConnectionManager type |
| 29 | type MockConnectionManager struct { |
| 30 | mock.Mock |
| 31 | } |
| 32 | |
| 33 | type MockConnectionManager_Expecter struct { |
| 34 | mock *mock.Mock |
| 35 | } |
| 36 | |
| 37 | func (_m *MockConnectionManager) EXPECT() *MockConnectionManager_Expecter { |
| 38 | return &MockConnectionManager_Expecter{mock: &_m.Mock} |
| 39 | } |
| 40 | |
| 41 | // AwaitConnection provides a mock function for the type MockConnectionManager |
| 42 | func (_mock *MockConnectionManager) AwaitConnection(ctx context.Context) error { |
| 43 | ret := _mock.Called(ctx) |
| 44 | |
| 45 | if len(ret) == 0 { |
| 46 | panic("no return value specified for AwaitConnection") |
| 47 | } |
| 48 | |
| 49 | var r0 error |
| 50 | if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok { |
| 51 | r0 = returnFunc(ctx) |
| 52 | } else { |
| 53 | r0 = ret.Error(0) |
| 54 | } |
| 55 | return r0 |
| 56 | } |
| 57 | |
| 58 | // MockConnectionManager_AwaitConnection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AwaitConnection' |
| 59 | type MockConnectionManager_AwaitConnection_Call struct { |
| 60 | *mock.Call |
| 61 | } |
| 62 | |
| 63 | // AwaitConnection is a helper method to define mock.On call |
| 64 | // - ctx context.Context |
| 65 | func (_e *MockConnectionManager_Expecter) AwaitConnection(ctx any) *MockConnectionManager_AwaitConnection_Call { |
| 66 | return &MockConnectionManager_AwaitConnection_Call{Call: _e.mock.On("AwaitConnection", ctx)} |
| 67 | } |
| 68 | |
| 69 | func (_c *MockConnectionManager_AwaitConnection_Call) Run(run func(ctx context.Context)) *MockConnectionManager_AwaitConnection_Call { |
| 70 | _c.Call.Run(func(args mock.Arguments) { |
| 71 | var arg0 context.Context |
| 72 | if args[0] != nil { |
| 73 | arg0 = args[0].(context.Context) |
| 74 | } |
| 75 | run( |
| 76 | arg0, |
| 77 | ) |
| 78 | }) |
| 79 | return _c |
| 80 | } |
| 81 | |
| 82 | func (_c *MockConnectionManager_AwaitConnection_Call) Return(err error) *MockConnectionManager_AwaitConnection_Call { |
| 83 | _c.Call.Return(err) |
| 84 | return _c |
| 85 | } |
| 86 | |
| 87 | func (_c *MockConnectionManager_AwaitConnection_Call) RunAndReturn(run func(ctx context.Context) error) *MockConnectionManager_AwaitConnection_Call { |
| 88 | _c.Call.Return(run) |
| 89 | return _c |
| 90 | } |
| 91 | |
| 92 | // Disconnect provides a mock function for the type MockConnectionManager |
| 93 | func (_mock *MockConnectionManager) Disconnect(ctx context.Context) error { |
| 94 | ret := _mock.Called(ctx) |
| 95 | |
| 96 | if len(ret) == 0 { |
| 97 | panic("no return value specified for Disconnect") |
| 98 | } |
| 99 | |
| 100 | var r0 error |
| 101 | if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok { |
| 102 | r0 = returnFunc(ctx) |
| 103 | } else { |
| 104 | r0 = ret.Error(0) |
| 105 | } |
| 106 | return r0 |
| 107 | } |
| 108 | |
| 109 | // MockConnectionManager_Disconnect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Disconnect' |
| 110 | type MockConnectionManager_Disconnect_Call struct { |
| 111 | *mock.Call |
| 112 | } |
| 113 | |
| 114 | // Disconnect is a helper method to define mock.On call |
| 115 | // - ctx context.Context |
| 116 | func (_e *MockConnectionManager_Expecter) Disconnect(ctx any) *MockConnectionManager_Disconnect_Call { |
| 117 | return &MockConnectionManager_Disconnect_Call{Call: _e.mock.On("Disconnect", ctx)} |
| 118 | } |
| 119 | |
| 120 | func (_c *MockConnectionManager_Disconnect_Call) Run(run func(ctx context.Context)) *MockConnectionManager_Disconnect_Call { |
| 121 | _c.Call.Run(func(args mock.Arguments) { |
| 122 | var arg0 context.Context |
| 123 | if args[0] != nil { |
| 124 | arg0 = args[0].(context.Context) |
| 125 | } |
| 126 | run( |
| 127 | arg0, |
| 128 | ) |
| 129 | }) |
| 130 | return _c |
| 131 | } |
| 132 | |
| 133 | func (_c *MockConnectionManager_Disconnect_Call) Return(err error) *MockConnectionManager_Disconnect_Call { |
| 134 | _c.Call.Return(err) |
| 135 | return _c |
| 136 | } |
| 137 | |
| 138 | func (_c *MockConnectionManager_Disconnect_Call) RunAndReturn(run func(ctx context.Context) error) *MockConnectionManager_Disconnect_Call { |
| 139 | _c.Call.Return(run) |
| 140 | return _c |
| 141 | } |
| 142 | |
| 143 | // Publish provides a mock function for the type MockConnectionManager |
| 144 | func (_mock *MockConnectionManager) Publish(ctx context.Context, publish *paho.Publish) (*paho.PublishResponse, error) { |
| 145 | ret := _mock.Called(ctx, publish) |
| 146 | |
| 147 | if len(ret) == 0 { |
| 148 | panic("no return value specified for Publish") |
| 149 | } |
| 150 | |
| 151 | var r0 *paho.PublishResponse |
| 152 | var r1 error |
| 153 | if returnFunc, ok := ret.Get(0).(func(context.Context, *paho.Publish) (*paho.PublishResponse, error)); ok { |
| 154 | return returnFunc(ctx, publish) |
| 155 | } |
| 156 | if returnFunc, ok := ret.Get(0).(func(context.Context, *paho.Publish) *paho.PublishResponse); ok { |
| 157 | r0 = returnFunc(ctx, publish) |
| 158 | } else { |
| 159 | if ret.Get(0) != nil { |
| 160 | r0 = ret.Get(0).(*paho.PublishResponse) |
| 161 | } |
| 162 | } |
| 163 | if returnFunc, ok := ret.Get(1).(func(context.Context, *paho.Publish) error); ok { |
| 164 | r1 = returnFunc(ctx, publish) |
| 165 | } else { |
| 166 | r1 = ret.Error(1) |
| 167 | } |
| 168 | return r0, r1 |
| 169 | } |
| 170 | |
| 171 | // MockConnectionManager_Publish_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Publish' |
| 172 | type MockConnectionManager_Publish_Call struct { |
| 173 | *mock.Call |
| 174 | } |
| 175 | |
| 176 | // Publish is a helper method to define mock.On call |
| 177 | // - ctx context.Context |
| 178 | // - publish *paho.Publish |
| 179 | func (_e *MockConnectionManager_Expecter) Publish(ctx any, publish any) *MockConnectionManager_Publish_Call { |
| 180 | return &MockConnectionManager_Publish_Call{Call: _e.mock.On("Publish", ctx, publish)} |
| 181 | } |
| 182 | |
| 183 | func (_c *MockConnectionManager_Publish_Call) Run(run func(ctx context.Context, publish *paho.Publish)) *MockConnectionManager_Publish_Call { |
| 184 | _c.Call.Run(func(args mock.Arguments) { |
| 185 | var arg0 context.Context |
| 186 | if args[0] != nil { |
| 187 | arg0 = args[0].(context.Context) |
| 188 | } |
| 189 | var arg1 *paho.Publish |
| 190 | if args[1] != nil { |
| 191 | arg1 = args[1].(*paho.Publish) |
| 192 | } |
| 193 | run( |
| 194 | arg0, |
| 195 | arg1, |
| 196 | ) |
| 197 | }) |
| 198 | return _c |
| 199 | } |
| 200 | |
| 201 | func (_c *MockConnectionManager_Publish_Call) Return(publishResponse *paho.PublishResponse, err error) *MockConnectionManager_Publish_Call { |
| 202 | _c.Call.Return(publishResponse, err) |
| 203 | return _c |
| 204 | } |
| 205 | |
| 206 | func (_c *MockConnectionManager_Publish_Call) RunAndReturn(run func(ctx context.Context, publish *paho.Publish) (*paho.PublishResponse, error)) *MockConnectionManager_Publish_Call { |
| 207 | _c.Call.Return(run) |
| 208 | return _c |
| 209 | } |