mock_oservice_service_test.go 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. // Code generated by mockery; DO NOT EDIT.
  2. // github.com/vektra/mockery
  3. // template: testify
  4. package toc
  5. import (
  6. "context"
  7. "github.com/mk6i/open-oscar-server/config"
  8. "github.com/mk6i/open-oscar-server/state"
  9. "github.com/mk6i/open-oscar-server/wire"
  10. mock "github.com/stretchr/testify/mock"
  11. )
  12. // newMockOServiceService creates a new instance of mockOServiceService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
  13. // The first argument is typically a *testing.T value.
  14. func newMockOServiceService(t interface {
  15. mock.TestingT
  16. Cleanup(func())
  17. }) *mockOServiceService {
  18. if helper, ok := t.(interface{ Helper() }); ok {
  19. helper.Helper()
  20. }
  21. mock := &mockOServiceService{}
  22. mock.Mock.Test(t)
  23. t.Cleanup(func() {
  24. if helper, ok := t.(interface{ Helper() }); ok {
  25. helper.Helper()
  26. }
  27. mock.AssertExpectations(t)
  28. })
  29. return mock
  30. }
  31. // mockOServiceService is an autogenerated mock type for the OServiceService type
  32. type mockOServiceService struct {
  33. mock.Mock
  34. }
  35. type mockOServiceService_Expecter struct {
  36. mock *mock.Mock
  37. }
  38. func (_m *mockOServiceService) EXPECT() *mockOServiceService_Expecter {
  39. return &mockOServiceService_Expecter{mock: &_m.Mock}
  40. }
  41. // ClientOnline provides a mock function for the type mockOServiceService
  42. func (_mock *mockOServiceService) ClientOnline(ctx context.Context, service uint16, inBody wire.SNAC_0x01_0x02_OServiceClientOnline, instance *state.SessionInstance) error {
  43. ret := _mock.Called(ctx, service, inBody, instance)
  44. if len(ret) == 0 {
  45. panic("no return value specified for ClientOnline")
  46. }
  47. var r0 error
  48. if returnFunc, ok := ret.Get(0).(func(context.Context, uint16, wire.SNAC_0x01_0x02_OServiceClientOnline, *state.SessionInstance) error); ok {
  49. r0 = returnFunc(ctx, service, inBody, instance)
  50. } else {
  51. r0 = ret.Error(0)
  52. }
  53. return r0
  54. }
  55. // mockOServiceService_ClientOnline_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ClientOnline'
  56. type mockOServiceService_ClientOnline_Call struct {
  57. *mock.Call
  58. }
  59. // ClientOnline is a helper method to define mock.On call
  60. // - ctx context.Context
  61. // - service uint16
  62. // - inBody wire.SNAC_0x01_0x02_OServiceClientOnline
  63. // - instance *state.SessionInstance
  64. func (_e *mockOServiceService_Expecter) ClientOnline(ctx any, service any, inBody any, instance any) *mockOServiceService_ClientOnline_Call {
  65. return &mockOServiceService_ClientOnline_Call{Call: _e.mock.On("ClientOnline", ctx, service, inBody, instance)}
  66. }
  67. func (_c *mockOServiceService_ClientOnline_Call) Run(run func(ctx context.Context, service uint16, inBody wire.SNAC_0x01_0x02_OServiceClientOnline, instance *state.SessionInstance)) *mockOServiceService_ClientOnline_Call {
  68. _c.Call.Run(func(args mock.Arguments) {
  69. var arg0 context.Context
  70. if args[0] != nil {
  71. arg0 = args[0].(context.Context)
  72. }
  73. var arg1 uint16
  74. if args[1] != nil {
  75. arg1 = args[1].(uint16)
  76. }
  77. var arg2 wire.SNAC_0x01_0x02_OServiceClientOnline
  78. if args[2] != nil {
  79. arg2 = args[2].(wire.SNAC_0x01_0x02_OServiceClientOnline)
  80. }
  81. var arg3 *state.SessionInstance
  82. if args[3] != nil {
  83. arg3 = args[3].(*state.SessionInstance)
  84. }
  85. run(
  86. arg0,
  87. arg1,
  88. arg2,
  89. arg3,
  90. )
  91. })
  92. return _c
  93. }
  94. func (_c *mockOServiceService_ClientOnline_Call) Return(err error) *mockOServiceService_ClientOnline_Call {
  95. _c.Call.Return(err)
  96. return _c
  97. }
  98. func (_c *mockOServiceService_ClientOnline_Call) RunAndReturn(run func(ctx context.Context, service uint16, inBody wire.SNAC_0x01_0x02_OServiceClientOnline, instance *state.SessionInstance) error) *mockOServiceService_ClientOnline_Call {
  99. _c.Call.Return(run)
  100. return _c
  101. }
  102. // IdleNotification provides a mock function for the type mockOServiceService
  103. func (_mock *mockOServiceService) IdleNotification(ctx context.Context, instance *state.SessionInstance, inBody wire.SNAC_0x01_0x11_OServiceIdleNotification) error {
  104. ret := _mock.Called(ctx, instance, inBody)
  105. if len(ret) == 0 {
  106. panic("no return value specified for IdleNotification")
  107. }
  108. var r0 error
  109. if returnFunc, ok := ret.Get(0).(func(context.Context, *state.SessionInstance, wire.SNAC_0x01_0x11_OServiceIdleNotification) error); ok {
  110. r0 = returnFunc(ctx, instance, inBody)
  111. } else {
  112. r0 = ret.Error(0)
  113. }
  114. return r0
  115. }
  116. // mockOServiceService_IdleNotification_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IdleNotification'
  117. type mockOServiceService_IdleNotification_Call struct {
  118. *mock.Call
  119. }
  120. // IdleNotification is a helper method to define mock.On call
  121. // - ctx context.Context
  122. // - instance *state.SessionInstance
  123. // - inBody wire.SNAC_0x01_0x11_OServiceIdleNotification
  124. func (_e *mockOServiceService_Expecter) IdleNotification(ctx any, instance any, inBody any) *mockOServiceService_IdleNotification_Call {
  125. return &mockOServiceService_IdleNotification_Call{Call: _e.mock.On("IdleNotification", ctx, instance, inBody)}
  126. }
  127. func (_c *mockOServiceService_IdleNotification_Call) Run(run func(ctx context.Context, instance *state.SessionInstance, inBody wire.SNAC_0x01_0x11_OServiceIdleNotification)) *mockOServiceService_IdleNotification_Call {
  128. _c.Call.Run(func(args mock.Arguments) {
  129. var arg0 context.Context
  130. if args[0] != nil {
  131. arg0 = args[0].(context.Context)
  132. }
  133. var arg1 *state.SessionInstance
  134. if args[1] != nil {
  135. arg1 = args[1].(*state.SessionInstance)
  136. }
  137. var arg2 wire.SNAC_0x01_0x11_OServiceIdleNotification
  138. if args[2] != nil {
  139. arg2 = args[2].(wire.SNAC_0x01_0x11_OServiceIdleNotification)
  140. }
  141. run(
  142. arg0,
  143. arg1,
  144. arg2,
  145. )
  146. })
  147. return _c
  148. }
  149. func (_c *mockOServiceService_IdleNotification_Call) Return(err error) *mockOServiceService_IdleNotification_Call {
  150. _c.Call.Return(err)
  151. return _c
  152. }
  153. func (_c *mockOServiceService_IdleNotification_Call) RunAndReturn(run func(ctx context.Context, instance *state.SessionInstance, inBody wire.SNAC_0x01_0x11_OServiceIdleNotification) error) *mockOServiceService_IdleNotification_Call {
  154. _c.Call.Return(run)
  155. return _c
  156. }
  157. // MonitorRateLimits provides a mock function for the type mockOServiceService
  158. func (_mock *mockOServiceService) MonitorRateLimits(ctx context.Context, session *state.Session) {
  159. _mock.Called(ctx, session)
  160. return
  161. }
  162. // mockOServiceService_MonitorRateLimits_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MonitorRateLimits'
  163. type mockOServiceService_MonitorRateLimits_Call struct {
  164. *mock.Call
  165. }
  166. // MonitorRateLimits is a helper method to define mock.On call
  167. // - ctx context.Context
  168. // - session *state.Session
  169. func (_e *mockOServiceService_Expecter) MonitorRateLimits(ctx any, session any) *mockOServiceService_MonitorRateLimits_Call {
  170. return &mockOServiceService_MonitorRateLimits_Call{Call: _e.mock.On("MonitorRateLimits", ctx, session)}
  171. }
  172. func (_c *mockOServiceService_MonitorRateLimits_Call) Run(run func(ctx context.Context, session *state.Session)) *mockOServiceService_MonitorRateLimits_Call {
  173. _c.Call.Run(func(args mock.Arguments) {
  174. var arg0 context.Context
  175. if args[0] != nil {
  176. arg0 = args[0].(context.Context)
  177. }
  178. var arg1 *state.Session
  179. if args[1] != nil {
  180. arg1 = args[1].(*state.Session)
  181. }
  182. run(
  183. arg0,
  184. arg1,
  185. )
  186. })
  187. return _c
  188. }
  189. func (_c *mockOServiceService_MonitorRateLimits_Call) Return() *mockOServiceService_MonitorRateLimits_Call {
  190. _c.Call.Return()
  191. return _c
  192. }
  193. func (_c *mockOServiceService_MonitorRateLimits_Call) RunAndReturn(run func(ctx context.Context, session *state.Session)) *mockOServiceService_MonitorRateLimits_Call {
  194. _c.Run(run)
  195. return _c
  196. }
  197. // ServiceRequest provides a mock function for the type mockOServiceService
  198. func (_mock *mockOServiceService) ServiceRequest(ctx context.Context, service uint16, instance *state.SessionInstance, inFrame wire.SNACFrame, inBody wire.SNAC_0x01_0x04_OServiceServiceRequest, listenerGroup config.ListenerGroup) (wire.SNACMessage, error) {
  199. ret := _mock.Called(ctx, service, instance, inFrame, inBody, listenerGroup)
  200. if len(ret) == 0 {
  201. panic("no return value specified for ServiceRequest")
  202. }
  203. var r0 wire.SNACMessage
  204. var r1 error
  205. if returnFunc, ok := ret.Get(0).(func(context.Context, uint16, *state.SessionInstance, wire.SNACFrame, wire.SNAC_0x01_0x04_OServiceServiceRequest, config.ListenerGroup) (wire.SNACMessage, error)); ok {
  206. return returnFunc(ctx, service, instance, inFrame, inBody, listenerGroup)
  207. }
  208. if returnFunc, ok := ret.Get(0).(func(context.Context, uint16, *state.SessionInstance, wire.SNACFrame, wire.SNAC_0x01_0x04_OServiceServiceRequest, config.ListenerGroup) wire.SNACMessage); ok {
  209. r0 = returnFunc(ctx, service, instance, inFrame, inBody, listenerGroup)
  210. } else {
  211. r0 = ret.Get(0).(wire.SNACMessage)
  212. }
  213. if returnFunc, ok := ret.Get(1).(func(context.Context, uint16, *state.SessionInstance, wire.SNACFrame, wire.SNAC_0x01_0x04_OServiceServiceRequest, config.ListenerGroup) error); ok {
  214. r1 = returnFunc(ctx, service, instance, inFrame, inBody, listenerGroup)
  215. } else {
  216. r1 = ret.Error(1)
  217. }
  218. return r0, r1
  219. }
  220. // mockOServiceService_ServiceRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ServiceRequest'
  221. type mockOServiceService_ServiceRequest_Call struct {
  222. *mock.Call
  223. }
  224. // ServiceRequest is a helper method to define mock.On call
  225. // - ctx context.Context
  226. // - service uint16
  227. // - instance *state.SessionInstance
  228. // - inFrame wire.SNACFrame
  229. // - inBody wire.SNAC_0x01_0x04_OServiceServiceRequest
  230. // - listenerGroup config.ListenerGroup
  231. func (_e *mockOServiceService_Expecter) ServiceRequest(ctx any, service any, instance any, inFrame any, inBody any, listenerGroup any) *mockOServiceService_ServiceRequest_Call {
  232. return &mockOServiceService_ServiceRequest_Call{Call: _e.mock.On("ServiceRequest", ctx, service, instance, inFrame, inBody, listenerGroup)}
  233. }
  234. func (_c *mockOServiceService_ServiceRequest_Call) Run(run func(ctx context.Context, service uint16, instance *state.SessionInstance, inFrame wire.SNACFrame, inBody wire.SNAC_0x01_0x04_OServiceServiceRequest, listenerGroup config.ListenerGroup)) *mockOServiceService_ServiceRequest_Call {
  235. _c.Call.Run(func(args mock.Arguments) {
  236. var arg0 context.Context
  237. if args[0] != nil {
  238. arg0 = args[0].(context.Context)
  239. }
  240. var arg1 uint16
  241. if args[1] != nil {
  242. arg1 = args[1].(uint16)
  243. }
  244. var arg2 *state.SessionInstance
  245. if args[2] != nil {
  246. arg2 = args[2].(*state.SessionInstance)
  247. }
  248. var arg3 wire.SNACFrame
  249. if args[3] != nil {
  250. arg3 = args[3].(wire.SNACFrame)
  251. }
  252. var arg4 wire.SNAC_0x01_0x04_OServiceServiceRequest
  253. if args[4] != nil {
  254. arg4 = args[4].(wire.SNAC_0x01_0x04_OServiceServiceRequest)
  255. }
  256. var arg5 config.ListenerGroup
  257. if args[5] != nil {
  258. arg5 = args[5].(config.ListenerGroup)
  259. }
  260. run(
  261. arg0,
  262. arg1,
  263. arg2,
  264. arg3,
  265. arg4,
  266. arg5,
  267. )
  268. })
  269. return _c
  270. }
  271. func (_c *mockOServiceService_ServiceRequest_Call) Return(sNACMessage wire.SNACMessage, err error) *mockOServiceService_ServiceRequest_Call {
  272. _c.Call.Return(sNACMessage, err)
  273. return _c
  274. }
  275. func (_c *mockOServiceService_ServiceRequest_Call) RunAndReturn(run func(ctx context.Context, service uint16, instance *state.SessionInstance, inFrame wire.SNACFrame, inBody wire.SNAC_0x01_0x04_OServiceServiceRequest, listenerGroup config.ListenerGroup) (wire.SNACMessage, error)) *mockOServiceService_ServiceRequest_Call {
  276. _c.Call.Return(run)
  277. return _c
  278. }