mock_admin_service_test.go 9.6 KB

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