4
0

mock_locate_service_test.go 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. // Code generated by mockery; DO NOT EDIT.
  2. // github.com/vektra/mockery
  3. // template: testify
  4. package webapi
  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. // newMockLocateService creates a new instance of mockLocateService. 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 newMockLocateService(t interface {
  14. mock.TestingT
  15. Cleanup(func())
  16. }) *mockLocateService {
  17. if helper, ok := t.(interface{ Helper() }); ok {
  18. helper.Helper()
  19. }
  20. mock := &mockLocateService{}
  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. // mockLocateService is an autogenerated mock type for the LocateService type
  31. type mockLocateService struct {
  32. mock.Mock
  33. }
  34. type mockLocateService_Expecter struct {
  35. mock *mock.Mock
  36. }
  37. func (_m *mockLocateService) EXPECT() *mockLocateService_Expecter {
  38. return &mockLocateService_Expecter{mock: &_m.Mock}
  39. }
  40. // DirInfo provides a mock function for the type mockLocateService
  41. func (_mock *mockLocateService) DirInfo(ctx context.Context, inFrame wire.SNACFrame, inBody wire.SNAC_0x02_0x0B_LocateGetDirInfo) (wire.SNACMessage, error) {
  42. ret := _mock.Called(ctx, inFrame, inBody)
  43. if len(ret) == 0 {
  44. panic("no return value specified for DirInfo")
  45. }
  46. var r0 wire.SNACMessage
  47. var r1 error
  48. if returnFunc, ok := ret.Get(0).(func(context.Context, wire.SNACFrame, wire.SNAC_0x02_0x0B_LocateGetDirInfo) (wire.SNACMessage, error)); ok {
  49. return returnFunc(ctx, inFrame, inBody)
  50. }
  51. if returnFunc, ok := ret.Get(0).(func(context.Context, wire.SNACFrame, wire.SNAC_0x02_0x0B_LocateGetDirInfo) wire.SNACMessage); ok {
  52. r0 = returnFunc(ctx, inFrame, inBody)
  53. } else {
  54. r0 = ret.Get(0).(wire.SNACMessage)
  55. }
  56. if returnFunc, ok := ret.Get(1).(func(context.Context, wire.SNACFrame, wire.SNAC_0x02_0x0B_LocateGetDirInfo) error); ok {
  57. r1 = returnFunc(ctx, inFrame, inBody)
  58. } else {
  59. r1 = ret.Error(1)
  60. }
  61. return r0, r1
  62. }
  63. // mockLocateService_DirInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DirInfo'
  64. type mockLocateService_DirInfo_Call struct {
  65. *mock.Call
  66. }
  67. // DirInfo is a helper method to define mock.On call
  68. // - ctx context.Context
  69. // - inFrame wire.SNACFrame
  70. // - inBody wire.SNAC_0x02_0x0B_LocateGetDirInfo
  71. func (_e *mockLocateService_Expecter) DirInfo(ctx any, inFrame any, inBody any) *mockLocateService_DirInfo_Call {
  72. return &mockLocateService_DirInfo_Call{Call: _e.mock.On("DirInfo", ctx, inFrame, inBody)}
  73. }
  74. func (_c *mockLocateService_DirInfo_Call) Run(run func(ctx context.Context, inFrame wire.SNACFrame, inBody wire.SNAC_0x02_0x0B_LocateGetDirInfo)) *mockLocateService_DirInfo_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 wire.SNACFrame
  81. if args[1] != nil {
  82. arg1 = args[1].(wire.SNACFrame)
  83. }
  84. var arg2 wire.SNAC_0x02_0x0B_LocateGetDirInfo
  85. if args[2] != nil {
  86. arg2 = args[2].(wire.SNAC_0x02_0x0B_LocateGetDirInfo)
  87. }
  88. run(
  89. arg0,
  90. arg1,
  91. arg2,
  92. )
  93. })
  94. return _c
  95. }
  96. func (_c *mockLocateService_DirInfo_Call) Return(sNACMessage wire.SNACMessage, err error) *mockLocateService_DirInfo_Call {
  97. _c.Call.Return(sNACMessage, err)
  98. return _c
  99. }
  100. func (_c *mockLocateService_DirInfo_Call) RunAndReturn(run func(ctx context.Context, inFrame wire.SNACFrame, inBody wire.SNAC_0x02_0x0B_LocateGetDirInfo) (wire.SNACMessage, error)) *mockLocateService_DirInfo_Call {
  101. _c.Call.Return(run)
  102. return _c
  103. }
  104. // SetDirInfo provides a mock function for the type mockLocateService
  105. func (_mock *mockLocateService) SetDirInfo(ctx context.Context, instance *state.SessionInstance, inFrame wire.SNACFrame, inBody wire.SNAC_0x02_0x09_LocateSetDirInfo) (wire.SNACMessage, error) {
  106. ret := _mock.Called(ctx, instance, inFrame, inBody)
  107. if len(ret) == 0 {
  108. panic("no return value specified for SetDirInfo")
  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_0x02_0x09_LocateSetDirInfo) (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_0x02_0x09_LocateSetDirInfo) 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_0x02_0x09_LocateSetDirInfo) error); ok {
  121. r1 = returnFunc(ctx, instance, inFrame, inBody)
  122. } else {
  123. r1 = ret.Error(1)
  124. }
  125. return r0, r1
  126. }
  127. // mockLocateService_SetDirInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDirInfo'
  128. type mockLocateService_SetDirInfo_Call struct {
  129. *mock.Call
  130. }
  131. // SetDirInfo 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_0x02_0x09_LocateSetDirInfo
  136. func (_e *mockLocateService_Expecter) SetDirInfo(ctx any, instance any, inFrame any, inBody any) *mockLocateService_SetDirInfo_Call {
  137. return &mockLocateService_SetDirInfo_Call{Call: _e.mock.On("SetDirInfo", ctx, instance, inFrame, inBody)}
  138. }
  139. func (_c *mockLocateService_SetDirInfo_Call) Run(run func(ctx context.Context, instance *state.SessionInstance, inFrame wire.SNACFrame, inBody wire.SNAC_0x02_0x09_LocateSetDirInfo)) *mockLocateService_SetDirInfo_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_0x02_0x09_LocateSetDirInfo
  154. if args[3] != nil {
  155. arg3 = args[3].(wire.SNAC_0x02_0x09_LocateSetDirInfo)
  156. }
  157. run(
  158. arg0,
  159. arg1,
  160. arg2,
  161. arg3,
  162. )
  163. })
  164. return _c
  165. }
  166. func (_c *mockLocateService_SetDirInfo_Call) Return(sNACMessage wire.SNACMessage, err error) *mockLocateService_SetDirInfo_Call {
  167. _c.Call.Return(sNACMessage, err)
  168. return _c
  169. }
  170. func (_c *mockLocateService_SetDirInfo_Call) RunAndReturn(run func(ctx context.Context, instance *state.SessionInstance, inFrame wire.SNACFrame, inBody wire.SNAC_0x02_0x09_LocateSetDirInfo) (wire.SNACMessage, error)) *mockLocateService_SetDirInfo_Call {
  171. _c.Call.Return(run)
  172. return _c
  173. }
  174. // SetInfo provides a mock function for the type mockLocateService
  175. func (_mock *mockLocateService) SetInfo(ctx context.Context, instance *state.SessionInstance, inBody wire.SNAC_0x02_0x04_LocateSetInfo) error {
  176. ret := _mock.Called(ctx, instance, inBody)
  177. if len(ret) == 0 {
  178. panic("no return value specified for SetInfo")
  179. }
  180. var r0 error
  181. if returnFunc, ok := ret.Get(0).(func(context.Context, *state.SessionInstance, wire.SNAC_0x02_0x04_LocateSetInfo) error); ok {
  182. r0 = returnFunc(ctx, instance, inBody)
  183. } else {
  184. r0 = ret.Error(0)
  185. }
  186. return r0
  187. }
  188. // mockLocateService_SetInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetInfo'
  189. type mockLocateService_SetInfo_Call struct {
  190. *mock.Call
  191. }
  192. // SetInfo is a helper method to define mock.On call
  193. // - ctx context.Context
  194. // - instance *state.SessionInstance
  195. // - inBody wire.SNAC_0x02_0x04_LocateSetInfo
  196. func (_e *mockLocateService_Expecter) SetInfo(ctx any, instance any, inBody any) *mockLocateService_SetInfo_Call {
  197. return &mockLocateService_SetInfo_Call{Call: _e.mock.On("SetInfo", ctx, instance, inBody)}
  198. }
  199. func (_c *mockLocateService_SetInfo_Call) Run(run func(ctx context.Context, instance *state.SessionInstance, inBody wire.SNAC_0x02_0x04_LocateSetInfo)) *mockLocateService_SetInfo_Call {
  200. _c.Call.Run(func(args mock.Arguments) {
  201. var arg0 context.Context
  202. if args[0] != nil {
  203. arg0 = args[0].(context.Context)
  204. }
  205. var arg1 *state.SessionInstance
  206. if args[1] != nil {
  207. arg1 = args[1].(*state.SessionInstance)
  208. }
  209. var arg2 wire.SNAC_0x02_0x04_LocateSetInfo
  210. if args[2] != nil {
  211. arg2 = args[2].(wire.SNAC_0x02_0x04_LocateSetInfo)
  212. }
  213. run(
  214. arg0,
  215. arg1,
  216. arg2,
  217. )
  218. })
  219. return _c
  220. }
  221. func (_c *mockLocateService_SetInfo_Call) Return(err error) *mockLocateService_SetInfo_Call {
  222. _c.Call.Return(err)
  223. return _c
  224. }
  225. func (_c *mockLocateService_SetInfo_Call) RunAndReturn(run func(ctx context.Context, instance *state.SessionInstance, inBody wire.SNAC_0x02_0x04_LocateSetInfo) error) *mockLocateService_SetInfo_Call {
  226. _c.Call.Return(run)
  227. return _c
  228. }
  229. // UserInfoQuery provides a mock function for the type mockLocateService
  230. func (_mock *mockLocateService) UserInfoQuery(ctx context.Context, instance *state.SessionInstance, inFrame wire.SNACFrame, inBody wire.SNAC_0x02_0x05_LocateUserInfoQuery) (wire.SNACMessage, error) {
  231. ret := _mock.Called(ctx, instance, inFrame, inBody)
  232. if len(ret) == 0 {
  233. panic("no return value specified for UserInfoQuery")
  234. }
  235. var r0 wire.SNACMessage
  236. var r1 error
  237. if returnFunc, ok := ret.Get(0).(func(context.Context, *state.SessionInstance, wire.SNACFrame, wire.SNAC_0x02_0x05_LocateUserInfoQuery) (wire.SNACMessage, error)); ok {
  238. return returnFunc(ctx, instance, inFrame, inBody)
  239. }
  240. if returnFunc, ok := ret.Get(0).(func(context.Context, *state.SessionInstance, wire.SNACFrame, wire.SNAC_0x02_0x05_LocateUserInfoQuery) wire.SNACMessage); ok {
  241. r0 = returnFunc(ctx, instance, inFrame, inBody)
  242. } else {
  243. r0 = ret.Get(0).(wire.SNACMessage)
  244. }
  245. if returnFunc, ok := ret.Get(1).(func(context.Context, *state.SessionInstance, wire.SNACFrame, wire.SNAC_0x02_0x05_LocateUserInfoQuery) error); ok {
  246. r1 = returnFunc(ctx, instance, inFrame, inBody)
  247. } else {
  248. r1 = ret.Error(1)
  249. }
  250. return r0, r1
  251. }
  252. // mockLocateService_UserInfoQuery_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UserInfoQuery'
  253. type mockLocateService_UserInfoQuery_Call struct {
  254. *mock.Call
  255. }
  256. // UserInfoQuery is a helper method to define mock.On call
  257. // - ctx context.Context
  258. // - instance *state.SessionInstance
  259. // - inFrame wire.SNACFrame
  260. // - inBody wire.SNAC_0x02_0x05_LocateUserInfoQuery
  261. func (_e *mockLocateService_Expecter) UserInfoQuery(ctx any, instance any, inFrame any, inBody any) *mockLocateService_UserInfoQuery_Call {
  262. return &mockLocateService_UserInfoQuery_Call{Call: _e.mock.On("UserInfoQuery", ctx, instance, inFrame, inBody)}
  263. }
  264. func (_c *mockLocateService_UserInfoQuery_Call) Run(run func(ctx context.Context, instance *state.SessionInstance, inFrame wire.SNACFrame, inBody wire.SNAC_0x02_0x05_LocateUserInfoQuery)) *mockLocateService_UserInfoQuery_Call {
  265. _c.Call.Run(func(args mock.Arguments) {
  266. var arg0 context.Context
  267. if args[0] != nil {
  268. arg0 = args[0].(context.Context)
  269. }
  270. var arg1 *state.SessionInstance
  271. if args[1] != nil {
  272. arg1 = args[1].(*state.SessionInstance)
  273. }
  274. var arg2 wire.SNACFrame
  275. if args[2] != nil {
  276. arg2 = args[2].(wire.SNACFrame)
  277. }
  278. var arg3 wire.SNAC_0x02_0x05_LocateUserInfoQuery
  279. if args[3] != nil {
  280. arg3 = args[3].(wire.SNAC_0x02_0x05_LocateUserInfoQuery)
  281. }
  282. run(
  283. arg0,
  284. arg1,
  285. arg2,
  286. arg3,
  287. )
  288. })
  289. return _c
  290. }
  291. func (_c *mockLocateService_UserInfoQuery_Call) Return(sNACMessage wire.SNACMessage, err error) *mockLocateService_UserInfoQuery_Call {
  292. _c.Call.Return(sNACMessage, err)
  293. return _c
  294. }
  295. func (_c *mockLocateService_UserInfoQuery_Call) RunAndReturn(run func(ctx context.Context, instance *state.SessionInstance, inFrame wire.SNACFrame, inBody wire.SNAC_0x02_0x05_LocateUserInfoQuery) (wire.SNACMessage, error)) *mockLocateService_UserInfoQuery_Call {
  296. _c.Call.Return(run)
  297. return _c
  298. }