mock_admin_service_test.go 9.6 KB

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