mock_auth_service_test.go 16 KB

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