mock_auth_service_test.go 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  1. // Code generated by mockery v2.53.3. DO NOT EDIT.
  2. package toc
  3. import (
  4. context "context"
  5. state "github.com/mk6i/retro-aim-server/state"
  6. mock "github.com/stretchr/testify/mock"
  7. uuid "github.com/google/uuid"
  8. wire "github.com/mk6i/retro-aim-server/wire"
  9. )
  10. // mockAuthService is an autogenerated mock type for the AuthService type
  11. type mockAuthService struct {
  12. mock.Mock
  13. }
  14. type mockAuthService_Expecter struct {
  15. mock *mock.Mock
  16. }
  17. func (_m *mockAuthService) EXPECT() *mockAuthService_Expecter {
  18. return &mockAuthService_Expecter{mock: &_m.Mock}
  19. }
  20. // BUCPChallenge provides a mock function with given fields: ctx, bodyIn, newUUID
  21. func (_m *mockAuthService) BUCPChallenge(ctx context.Context, bodyIn wire.SNAC_0x17_0x06_BUCPChallengeRequest, newUUID func() uuid.UUID) (wire.SNACMessage, error) {
  22. ret := _m.Called(ctx, bodyIn, newUUID)
  23. if len(ret) == 0 {
  24. panic("no return value specified for BUCPChallenge")
  25. }
  26. var r0 wire.SNACMessage
  27. var r1 error
  28. if rf, ok := ret.Get(0).(func(context.Context, wire.SNAC_0x17_0x06_BUCPChallengeRequest, func() uuid.UUID) (wire.SNACMessage, error)); ok {
  29. return rf(ctx, bodyIn, newUUID)
  30. }
  31. if rf, ok := ret.Get(0).(func(context.Context, wire.SNAC_0x17_0x06_BUCPChallengeRequest, func() uuid.UUID) wire.SNACMessage); ok {
  32. r0 = rf(ctx, bodyIn, newUUID)
  33. } else {
  34. r0 = ret.Get(0).(wire.SNACMessage)
  35. }
  36. if rf, ok := ret.Get(1).(func(context.Context, wire.SNAC_0x17_0x06_BUCPChallengeRequest, func() uuid.UUID) error); ok {
  37. r1 = rf(ctx, bodyIn, newUUID)
  38. } else {
  39. r1 = ret.Error(1)
  40. }
  41. return r0, r1
  42. }
  43. // mockAuthService_BUCPChallenge_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BUCPChallenge'
  44. type mockAuthService_BUCPChallenge_Call struct {
  45. *mock.Call
  46. }
  47. // BUCPChallenge is a helper method to define mock.On call
  48. // - ctx context.Context
  49. // - bodyIn wire.SNAC_0x17_0x06_BUCPChallengeRequest
  50. // - newUUID func() uuid.UUID
  51. func (_e *mockAuthService_Expecter) BUCPChallenge(ctx interface{}, bodyIn interface{}, newUUID interface{}) *mockAuthService_BUCPChallenge_Call {
  52. return &mockAuthService_BUCPChallenge_Call{Call: _e.mock.On("BUCPChallenge", ctx, bodyIn, newUUID)}
  53. }
  54. func (_c *mockAuthService_BUCPChallenge_Call) Run(run func(ctx context.Context, bodyIn wire.SNAC_0x17_0x06_BUCPChallengeRequest, newUUID func() uuid.UUID)) *mockAuthService_BUCPChallenge_Call {
  55. _c.Call.Run(func(args mock.Arguments) {
  56. run(args[0].(context.Context), args[1].(wire.SNAC_0x17_0x06_BUCPChallengeRequest), args[2].(func() uuid.UUID))
  57. })
  58. return _c
  59. }
  60. func (_c *mockAuthService_BUCPChallenge_Call) Return(_a0 wire.SNACMessage, _a1 error) *mockAuthService_BUCPChallenge_Call {
  61. _c.Call.Return(_a0, _a1)
  62. return _c
  63. }
  64. func (_c *mockAuthService_BUCPChallenge_Call) RunAndReturn(run func(context.Context, wire.SNAC_0x17_0x06_BUCPChallengeRequest, func() uuid.UUID) (wire.SNACMessage, error)) *mockAuthService_BUCPChallenge_Call {
  65. _c.Call.Return(run)
  66. return _c
  67. }
  68. // BUCPLogin provides a mock function with given fields: ctx, bodyIn, newUserFn
  69. func (_m *mockAuthService) BUCPLogin(ctx context.Context, bodyIn wire.SNAC_0x17_0x02_BUCPLoginRequest, newUserFn func(state.DisplayScreenName) (state.User, error)) (wire.SNACMessage, error) {
  70. ret := _m.Called(ctx, bodyIn, newUserFn)
  71. if len(ret) == 0 {
  72. panic("no return value specified for BUCPLogin")
  73. }
  74. var r0 wire.SNACMessage
  75. var r1 error
  76. if rf, ok := ret.Get(0).(func(context.Context, wire.SNAC_0x17_0x02_BUCPLoginRequest, func(state.DisplayScreenName) (state.User, error)) (wire.SNACMessage, error)); ok {
  77. return rf(ctx, bodyIn, newUserFn)
  78. }
  79. if rf, ok := ret.Get(0).(func(context.Context, wire.SNAC_0x17_0x02_BUCPLoginRequest, func(state.DisplayScreenName) (state.User, error)) wire.SNACMessage); ok {
  80. r0 = rf(ctx, bodyIn, newUserFn)
  81. } else {
  82. r0 = ret.Get(0).(wire.SNACMessage)
  83. }
  84. if rf, ok := ret.Get(1).(func(context.Context, wire.SNAC_0x17_0x02_BUCPLoginRequest, func(state.DisplayScreenName) (state.User, error)) error); ok {
  85. r1 = rf(ctx, bodyIn, newUserFn)
  86. } else {
  87. r1 = ret.Error(1)
  88. }
  89. return r0, r1
  90. }
  91. // mockAuthService_BUCPLogin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BUCPLogin'
  92. type mockAuthService_BUCPLogin_Call struct {
  93. *mock.Call
  94. }
  95. // BUCPLogin is a helper method to define mock.On call
  96. // - ctx context.Context
  97. // - bodyIn wire.SNAC_0x17_0x02_BUCPLoginRequest
  98. // - newUserFn func(state.DisplayScreenName)(state.User , error)
  99. func (_e *mockAuthService_Expecter) BUCPLogin(ctx interface{}, bodyIn interface{}, newUserFn interface{}) *mockAuthService_BUCPLogin_Call {
  100. return &mockAuthService_BUCPLogin_Call{Call: _e.mock.On("BUCPLogin", ctx, bodyIn, newUserFn)}
  101. }
  102. func (_c *mockAuthService_BUCPLogin_Call) Run(run func(ctx context.Context, bodyIn wire.SNAC_0x17_0x02_BUCPLoginRequest, newUserFn func(state.DisplayScreenName) (state.User, error))) *mockAuthService_BUCPLogin_Call {
  103. _c.Call.Run(func(args mock.Arguments) {
  104. run(args[0].(context.Context), args[1].(wire.SNAC_0x17_0x02_BUCPLoginRequest), args[2].(func(state.DisplayScreenName) (state.User, error)))
  105. })
  106. return _c
  107. }
  108. func (_c *mockAuthService_BUCPLogin_Call) Return(_a0 wire.SNACMessage, _a1 error) *mockAuthService_BUCPLogin_Call {
  109. _c.Call.Return(_a0, _a1)
  110. return _c
  111. }
  112. func (_c *mockAuthService_BUCPLogin_Call) RunAndReturn(run func(context.Context, wire.SNAC_0x17_0x02_BUCPLoginRequest, func(state.DisplayScreenName) (state.User, error)) (wire.SNACMessage, error)) *mockAuthService_BUCPLogin_Call {
  113. _c.Call.Return(run)
  114. return _c
  115. }
  116. // FLAPLogin provides a mock function with given fields: ctx, frame, newUserFn
  117. func (_m *mockAuthService) FLAPLogin(ctx context.Context, frame wire.FLAPSignonFrame, newUserFn func(state.DisplayScreenName) (state.User, error)) (wire.TLVRestBlock, error) {
  118. ret := _m.Called(ctx, frame, newUserFn)
  119. if len(ret) == 0 {
  120. panic("no return value specified for FLAPLogin")
  121. }
  122. var r0 wire.TLVRestBlock
  123. var r1 error
  124. if rf, ok := ret.Get(0).(func(context.Context, wire.FLAPSignonFrame, func(state.DisplayScreenName) (state.User, error)) (wire.TLVRestBlock, error)); ok {
  125. return rf(ctx, frame, newUserFn)
  126. }
  127. if rf, ok := ret.Get(0).(func(context.Context, wire.FLAPSignonFrame, func(state.DisplayScreenName) (state.User, error)) wire.TLVRestBlock); ok {
  128. r0 = rf(ctx, frame, newUserFn)
  129. } else {
  130. r0 = ret.Get(0).(wire.TLVRestBlock)
  131. }
  132. if rf, ok := ret.Get(1).(func(context.Context, wire.FLAPSignonFrame, func(state.DisplayScreenName) (state.User, error)) error); ok {
  133. r1 = rf(ctx, frame, newUserFn)
  134. } else {
  135. r1 = ret.Error(1)
  136. }
  137. return r0, r1
  138. }
  139. // mockAuthService_FLAPLogin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FLAPLogin'
  140. type mockAuthService_FLAPLogin_Call struct {
  141. *mock.Call
  142. }
  143. // FLAPLogin is a helper method to define mock.On call
  144. // - ctx context.Context
  145. // - frame wire.FLAPSignonFrame
  146. // - newUserFn func(state.DisplayScreenName)(state.User , error)
  147. func (_e *mockAuthService_Expecter) FLAPLogin(ctx interface{}, frame interface{}, newUserFn interface{}) *mockAuthService_FLAPLogin_Call {
  148. return &mockAuthService_FLAPLogin_Call{Call: _e.mock.On("FLAPLogin", ctx, frame, newUserFn)}
  149. }
  150. func (_c *mockAuthService_FLAPLogin_Call) Run(run func(ctx context.Context, frame wire.FLAPSignonFrame, newUserFn func(state.DisplayScreenName) (state.User, error))) *mockAuthService_FLAPLogin_Call {
  151. _c.Call.Run(func(args mock.Arguments) {
  152. run(args[0].(context.Context), args[1].(wire.FLAPSignonFrame), args[2].(func(state.DisplayScreenName) (state.User, error)))
  153. })
  154. return _c
  155. }
  156. func (_c *mockAuthService_FLAPLogin_Call) Return(_a0 wire.TLVRestBlock, _a1 error) *mockAuthService_FLAPLogin_Call {
  157. _c.Call.Return(_a0, _a1)
  158. return _c
  159. }
  160. func (_c *mockAuthService_FLAPLogin_Call) RunAndReturn(run func(context.Context, wire.FLAPSignonFrame, func(state.DisplayScreenName) (state.User, error)) (wire.TLVRestBlock, error)) *mockAuthService_FLAPLogin_Call {
  161. _c.Call.Return(run)
  162. return _c
  163. }
  164. // RegisterBOSSession provides a mock function with given fields: ctx, authCookie
  165. func (_m *mockAuthService) RegisterBOSSession(ctx context.Context, authCookie []byte) (*state.Session, error) {
  166. ret := _m.Called(ctx, authCookie)
  167. if len(ret) == 0 {
  168. panic("no return value specified for RegisterBOSSession")
  169. }
  170. var r0 *state.Session
  171. var r1 error
  172. if rf, ok := ret.Get(0).(func(context.Context, []byte) (*state.Session, error)); ok {
  173. return rf(ctx, authCookie)
  174. }
  175. if rf, ok := ret.Get(0).(func(context.Context, []byte) *state.Session); ok {
  176. r0 = rf(ctx, authCookie)
  177. } else {
  178. if ret.Get(0) != nil {
  179. r0 = ret.Get(0).(*state.Session)
  180. }
  181. }
  182. if rf, ok := ret.Get(1).(func(context.Context, []byte) error); ok {
  183. r1 = rf(ctx, authCookie)
  184. } else {
  185. r1 = ret.Error(1)
  186. }
  187. return r0, r1
  188. }
  189. // mockAuthService_RegisterBOSSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterBOSSession'
  190. type mockAuthService_RegisterBOSSession_Call struct {
  191. *mock.Call
  192. }
  193. // RegisterBOSSession is a helper method to define mock.On call
  194. // - ctx context.Context
  195. // - authCookie []byte
  196. func (_e *mockAuthService_Expecter) RegisterBOSSession(ctx interface{}, authCookie interface{}) *mockAuthService_RegisterBOSSession_Call {
  197. return &mockAuthService_RegisterBOSSession_Call{Call: _e.mock.On("RegisterBOSSession", ctx, authCookie)}
  198. }
  199. func (_c *mockAuthService_RegisterBOSSession_Call) Run(run func(ctx context.Context, authCookie []byte)) *mockAuthService_RegisterBOSSession_Call {
  200. _c.Call.Run(func(args mock.Arguments) {
  201. run(args[0].(context.Context), args[1].([]byte))
  202. })
  203. return _c
  204. }
  205. func (_c *mockAuthService_RegisterBOSSession_Call) Return(_a0 *state.Session, _a1 error) *mockAuthService_RegisterBOSSession_Call {
  206. _c.Call.Return(_a0, _a1)
  207. return _c
  208. }
  209. func (_c *mockAuthService_RegisterBOSSession_Call) RunAndReturn(run func(context.Context, []byte) (*state.Session, error)) *mockAuthService_RegisterBOSSession_Call {
  210. _c.Call.Return(run)
  211. return _c
  212. }
  213. // RegisterChatSession provides a mock function with given fields: ctx, authCookie
  214. func (_m *mockAuthService) RegisterChatSession(ctx context.Context, authCookie []byte) (*state.Session, error) {
  215. ret := _m.Called(ctx, authCookie)
  216. if len(ret) == 0 {
  217. panic("no return value specified for RegisterChatSession")
  218. }
  219. var r0 *state.Session
  220. var r1 error
  221. if rf, ok := ret.Get(0).(func(context.Context, []byte) (*state.Session, error)); ok {
  222. return rf(ctx, authCookie)
  223. }
  224. if rf, ok := ret.Get(0).(func(context.Context, []byte) *state.Session); ok {
  225. r0 = rf(ctx, authCookie)
  226. } else {
  227. if ret.Get(0) != nil {
  228. r0 = ret.Get(0).(*state.Session)
  229. }
  230. }
  231. if rf, ok := ret.Get(1).(func(context.Context, []byte) error); ok {
  232. r1 = rf(ctx, authCookie)
  233. } else {
  234. r1 = ret.Error(1)
  235. }
  236. return r0, r1
  237. }
  238. // mockAuthService_RegisterChatSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterChatSession'
  239. type mockAuthService_RegisterChatSession_Call struct {
  240. *mock.Call
  241. }
  242. // RegisterChatSession is a helper method to define mock.On call
  243. // - ctx context.Context
  244. // - authCookie []byte
  245. func (_e *mockAuthService_Expecter) RegisterChatSession(ctx interface{}, authCookie interface{}) *mockAuthService_RegisterChatSession_Call {
  246. return &mockAuthService_RegisterChatSession_Call{Call: _e.mock.On("RegisterChatSession", ctx, authCookie)}
  247. }
  248. func (_c *mockAuthService_RegisterChatSession_Call) Run(run func(ctx context.Context, authCookie []byte)) *mockAuthService_RegisterChatSession_Call {
  249. _c.Call.Run(func(args mock.Arguments) {
  250. run(args[0].(context.Context), args[1].([]byte))
  251. })
  252. return _c
  253. }
  254. func (_c *mockAuthService_RegisterChatSession_Call) Return(_a0 *state.Session, _a1 error) *mockAuthService_RegisterChatSession_Call {
  255. _c.Call.Return(_a0, _a1)
  256. return _c
  257. }
  258. func (_c *mockAuthService_RegisterChatSession_Call) RunAndReturn(run func(context.Context, []byte) (*state.Session, error)) *mockAuthService_RegisterChatSession_Call {
  259. _c.Call.Return(run)
  260. return _c
  261. }
  262. // RetrieveBOSSession provides a mock function with given fields: ctx, authCookie
  263. func (_m *mockAuthService) RetrieveBOSSession(ctx context.Context, authCookie []byte) (*state.Session, error) {
  264. ret := _m.Called(ctx, authCookie)
  265. if len(ret) == 0 {
  266. panic("no return value specified for RetrieveBOSSession")
  267. }
  268. var r0 *state.Session
  269. var r1 error
  270. if rf, ok := ret.Get(0).(func(context.Context, []byte) (*state.Session, error)); ok {
  271. return rf(ctx, authCookie)
  272. }
  273. if rf, ok := ret.Get(0).(func(context.Context, []byte) *state.Session); ok {
  274. r0 = rf(ctx, authCookie)
  275. } else {
  276. if ret.Get(0) != nil {
  277. r0 = ret.Get(0).(*state.Session)
  278. }
  279. }
  280. if rf, ok := ret.Get(1).(func(context.Context, []byte) error); ok {
  281. r1 = rf(ctx, authCookie)
  282. } else {
  283. r1 = ret.Error(1)
  284. }
  285. return r0, r1
  286. }
  287. // mockAuthService_RetrieveBOSSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RetrieveBOSSession'
  288. type mockAuthService_RetrieveBOSSession_Call struct {
  289. *mock.Call
  290. }
  291. // RetrieveBOSSession is a helper method to define mock.On call
  292. // - ctx context.Context
  293. // - authCookie []byte
  294. func (_e *mockAuthService_Expecter) RetrieveBOSSession(ctx interface{}, authCookie interface{}) *mockAuthService_RetrieveBOSSession_Call {
  295. return &mockAuthService_RetrieveBOSSession_Call{Call: _e.mock.On("RetrieveBOSSession", ctx, authCookie)}
  296. }
  297. func (_c *mockAuthService_RetrieveBOSSession_Call) Run(run func(ctx context.Context, authCookie []byte)) *mockAuthService_RetrieveBOSSession_Call {
  298. _c.Call.Run(func(args mock.Arguments) {
  299. run(args[0].(context.Context), args[1].([]byte))
  300. })
  301. return _c
  302. }
  303. func (_c *mockAuthService_RetrieveBOSSession_Call) Return(_a0 *state.Session, _a1 error) *mockAuthService_RetrieveBOSSession_Call {
  304. _c.Call.Return(_a0, _a1)
  305. return _c
  306. }
  307. func (_c *mockAuthService_RetrieveBOSSession_Call) RunAndReturn(run func(context.Context, []byte) (*state.Session, error)) *mockAuthService_RetrieveBOSSession_Call {
  308. _c.Call.Return(run)
  309. return _c
  310. }
  311. // Signout provides a mock function with given fields: ctx, sess
  312. func (_m *mockAuthService) Signout(ctx context.Context, sess *state.Session) {
  313. _m.Called(ctx, sess)
  314. }
  315. // mockAuthService_Signout_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Signout'
  316. type mockAuthService_Signout_Call struct {
  317. *mock.Call
  318. }
  319. // Signout is a helper method to define mock.On call
  320. // - ctx context.Context
  321. // - sess *state.Session
  322. func (_e *mockAuthService_Expecter) Signout(ctx interface{}, sess interface{}) *mockAuthService_Signout_Call {
  323. return &mockAuthService_Signout_Call{Call: _e.mock.On("Signout", ctx, sess)}
  324. }
  325. func (_c *mockAuthService_Signout_Call) Run(run func(ctx context.Context, sess *state.Session)) *mockAuthService_Signout_Call {
  326. _c.Call.Run(func(args mock.Arguments) {
  327. run(args[0].(context.Context), args[1].(*state.Session))
  328. })
  329. return _c
  330. }
  331. func (_c *mockAuthService_Signout_Call) Return() *mockAuthService_Signout_Call {
  332. _c.Call.Return()
  333. return _c
  334. }
  335. func (_c *mockAuthService_Signout_Call) RunAndReturn(run func(context.Context, *state.Session)) *mockAuthService_Signout_Call {
  336. _c.Run(run)
  337. return _c
  338. }
  339. // SignoutChat provides a mock function with given fields: ctx, sess
  340. func (_m *mockAuthService) SignoutChat(ctx context.Context, sess *state.Session) {
  341. _m.Called(ctx, sess)
  342. }
  343. // mockAuthService_SignoutChat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SignoutChat'
  344. type mockAuthService_SignoutChat_Call struct {
  345. *mock.Call
  346. }
  347. // SignoutChat is a helper method to define mock.On call
  348. // - ctx context.Context
  349. // - sess *state.Session
  350. func (_e *mockAuthService_Expecter) SignoutChat(ctx interface{}, sess interface{}) *mockAuthService_SignoutChat_Call {
  351. return &mockAuthService_SignoutChat_Call{Call: _e.mock.On("SignoutChat", ctx, sess)}
  352. }
  353. func (_c *mockAuthService_SignoutChat_Call) Run(run func(ctx context.Context, sess *state.Session)) *mockAuthService_SignoutChat_Call {
  354. _c.Call.Run(func(args mock.Arguments) {
  355. run(args[0].(context.Context), args[1].(*state.Session))
  356. })
  357. return _c
  358. }
  359. func (_c *mockAuthService_SignoutChat_Call) Return() *mockAuthService_SignoutChat_Call {
  360. _c.Call.Return()
  361. return _c
  362. }
  363. func (_c *mockAuthService_SignoutChat_Call) RunAndReturn(run func(context.Context, *state.Session)) *mockAuthService_SignoutChat_Call {
  364. _c.Run(run)
  365. return _c
  366. }
  367. // newMockAuthService creates a new instance of mockAuthService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
  368. // The first argument is typically a *testing.T value.
  369. func newMockAuthService(t interface {
  370. mock.TestingT
  371. Cleanup(func())
  372. }) *mockAuthService {
  373. mock := &mockAuthService{}
  374. mock.Mock.Test(t)
  375. t.Cleanup(func() { mock.AssertExpectations(t) })
  376. return mock
  377. }