mock_auth_test.go 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. // Code generated by mockery v2.40.1. DO NOT EDIT.
  2. package oscar
  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, newUUID, fn
  68. func (_m *mockAuthService) BUCPLogin(bodyIn wire.SNAC_0x17_0x02_BUCPLoginRequest, newUUID func() uuid.UUID, fn func(string) (state.User, error)) (wire.SNACMessage, error) {
  69. ret := _m.Called(bodyIn, newUUID, fn)
  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() uuid.UUID, func(string) (state.User, error)) (wire.SNACMessage, error)); ok {
  76. return rf(bodyIn, newUUID, fn)
  77. }
  78. if rf, ok := ret.Get(0).(func(wire.SNAC_0x17_0x02_BUCPLoginRequest, func() uuid.UUID, func(string) (state.User, error)) wire.SNACMessage); ok {
  79. r0 = rf(bodyIn, newUUID, fn)
  80. } else {
  81. r0 = ret.Get(0).(wire.SNACMessage)
  82. }
  83. if rf, ok := ret.Get(1).(func(wire.SNAC_0x17_0x02_BUCPLoginRequest, func() uuid.UUID, func(string) (state.User, error)) error); ok {
  84. r1 = rf(bodyIn, newUUID, fn)
  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. // - newUUID func() uuid.UUID
  97. // - fn func(string)(state.User , error)
  98. func (_e *mockAuthService_Expecter) BUCPLogin(bodyIn interface{}, newUUID interface{}, fn interface{}) *mockAuthService_BUCPLogin_Call {
  99. return &mockAuthService_BUCPLogin_Call{Call: _e.mock.On("BUCPLogin", bodyIn, newUUID, fn)}
  100. }
  101. func (_c *mockAuthService_BUCPLogin_Call) Run(run func(bodyIn wire.SNAC_0x17_0x02_BUCPLoginRequest, newUUID func() uuid.UUID, fn func(string) (state.User, error))) *mockAuthService_BUCPLogin_Call {
  102. _c.Call.Run(func(args mock.Arguments) {
  103. run(args[0].(wire.SNAC_0x17_0x02_BUCPLoginRequest), args[1].(func() uuid.UUID), args[2].(func(string) (state.User, error)))
  104. })
  105. return _c
  106. }
  107. func (_c *mockAuthService_BUCPLogin_Call) Return(_a0 wire.SNACMessage, _a1 error) *mockAuthService_BUCPLogin_Call {
  108. _c.Call.Return(_a0, _a1)
  109. return _c
  110. }
  111. func (_c *mockAuthService_BUCPLogin_Call) RunAndReturn(run func(wire.SNAC_0x17_0x02_BUCPLoginRequest, func() uuid.UUID, func(string) (state.User, error)) (wire.SNACMessage, error)) *mockAuthService_BUCPLogin_Call {
  112. _c.Call.Return(run)
  113. return _c
  114. }
  115. // FLAPLogin provides a mock function with given fields: frame, newUUIDFn, newUserFn
  116. func (_m *mockAuthService) FLAPLogin(frame wire.FLAPSignonFrame, newUUIDFn func() uuid.UUID, newUserFn func(string) (state.User, error)) (wire.TLVRestBlock, error) {
  117. ret := _m.Called(frame, newUUIDFn, newUserFn)
  118. if len(ret) == 0 {
  119. panic("no return value specified for FLAPLogin")
  120. }
  121. var r0 wire.TLVRestBlock
  122. var r1 error
  123. if rf, ok := ret.Get(0).(func(wire.FLAPSignonFrame, func() uuid.UUID, func(string) (state.User, error)) (wire.TLVRestBlock, error)); ok {
  124. return rf(frame, newUUIDFn, newUserFn)
  125. }
  126. if rf, ok := ret.Get(0).(func(wire.FLAPSignonFrame, func() uuid.UUID, func(string) (state.User, error)) wire.TLVRestBlock); ok {
  127. r0 = rf(frame, newUUIDFn, newUserFn)
  128. } else {
  129. r0 = ret.Get(0).(wire.TLVRestBlock)
  130. }
  131. if rf, ok := ret.Get(1).(func(wire.FLAPSignonFrame, func() uuid.UUID, func(string) (state.User, error)) error); ok {
  132. r1 = rf(frame, newUUIDFn, newUserFn)
  133. } else {
  134. r1 = ret.Error(1)
  135. }
  136. return r0, r1
  137. }
  138. // mockAuthService_FLAPLogin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FLAPLogin'
  139. type mockAuthService_FLAPLogin_Call struct {
  140. *mock.Call
  141. }
  142. // FLAPLogin is a helper method to define mock.On call
  143. // - frame wire.FLAPSignonFrame
  144. // - newUUIDFn func() uuid.UUID
  145. // - newUserFn func(string)(state.User , error)
  146. func (_e *mockAuthService_Expecter) FLAPLogin(frame interface{}, newUUIDFn interface{}, newUserFn interface{}) *mockAuthService_FLAPLogin_Call {
  147. return &mockAuthService_FLAPLogin_Call{Call: _e.mock.On("FLAPLogin", frame, newUUIDFn, newUserFn)}
  148. }
  149. func (_c *mockAuthService_FLAPLogin_Call) Run(run func(frame wire.FLAPSignonFrame, newUUIDFn func() uuid.UUID, newUserFn func(string) (state.User, error))) *mockAuthService_FLAPLogin_Call {
  150. _c.Call.Run(func(args mock.Arguments) {
  151. run(args[0].(wire.FLAPSignonFrame), args[1].(func() uuid.UUID), args[2].(func(string) (state.User, error)))
  152. })
  153. return _c
  154. }
  155. func (_c *mockAuthService_FLAPLogin_Call) Return(_a0 wire.TLVRestBlock, _a1 error) *mockAuthService_FLAPLogin_Call {
  156. _c.Call.Return(_a0, _a1)
  157. return _c
  158. }
  159. func (_c *mockAuthService_FLAPLogin_Call) RunAndReturn(run func(wire.FLAPSignonFrame, func() uuid.UUID, func(string) (state.User, error)) (wire.TLVRestBlock, error)) *mockAuthService_FLAPLogin_Call {
  160. _c.Call.Return(run)
  161. return _c
  162. }
  163. // RetrieveBOSSession provides a mock function with given fields: sessionID
  164. func (_m *mockAuthService) RetrieveBOSSession(sessionID string) (*state.Session, error) {
  165. ret := _m.Called(sessionID)
  166. if len(ret) == 0 {
  167. panic("no return value specified for RetrieveBOSSession")
  168. }
  169. var r0 *state.Session
  170. var r1 error
  171. if rf, ok := ret.Get(0).(func(string) (*state.Session, error)); ok {
  172. return rf(sessionID)
  173. }
  174. if rf, ok := ret.Get(0).(func(string) *state.Session); ok {
  175. r0 = rf(sessionID)
  176. } else {
  177. if ret.Get(0) != nil {
  178. r0 = ret.Get(0).(*state.Session)
  179. }
  180. }
  181. if rf, ok := ret.Get(1).(func(string) error); ok {
  182. r1 = rf(sessionID)
  183. } else {
  184. r1 = ret.Error(1)
  185. }
  186. return r0, r1
  187. }
  188. // mockAuthService_RetrieveBOSSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RetrieveBOSSession'
  189. type mockAuthService_RetrieveBOSSession_Call struct {
  190. *mock.Call
  191. }
  192. // RetrieveBOSSession is a helper method to define mock.On call
  193. // - sessionID string
  194. func (_e *mockAuthService_Expecter) RetrieveBOSSession(sessionID interface{}) *mockAuthService_RetrieveBOSSession_Call {
  195. return &mockAuthService_RetrieveBOSSession_Call{Call: _e.mock.On("RetrieveBOSSession", sessionID)}
  196. }
  197. func (_c *mockAuthService_RetrieveBOSSession_Call) Run(run func(sessionID string)) *mockAuthService_RetrieveBOSSession_Call {
  198. _c.Call.Run(func(args mock.Arguments) {
  199. run(args[0].(string))
  200. })
  201. return _c
  202. }
  203. func (_c *mockAuthService_RetrieveBOSSession_Call) Return(_a0 *state.Session, _a1 error) *mockAuthService_RetrieveBOSSession_Call {
  204. _c.Call.Return(_a0, _a1)
  205. return _c
  206. }
  207. func (_c *mockAuthService_RetrieveBOSSession_Call) RunAndReturn(run func(string) (*state.Session, error)) *mockAuthService_RetrieveBOSSession_Call {
  208. _c.Call.Return(run)
  209. return _c
  210. }
  211. // RetrieveChatSession provides a mock function with given fields: loginCookie
  212. func (_m *mockAuthService) RetrieveChatSession(loginCookie []byte) (*state.Session, error) {
  213. ret := _m.Called(loginCookie)
  214. if len(ret) == 0 {
  215. panic("no return value specified for RetrieveChatSession")
  216. }
  217. var r0 *state.Session
  218. var r1 error
  219. if rf, ok := ret.Get(0).(func([]byte) (*state.Session, error)); ok {
  220. return rf(loginCookie)
  221. }
  222. if rf, ok := ret.Get(0).(func([]byte) *state.Session); ok {
  223. r0 = rf(loginCookie)
  224. } else {
  225. if ret.Get(0) != nil {
  226. r0 = ret.Get(0).(*state.Session)
  227. }
  228. }
  229. if rf, ok := ret.Get(1).(func([]byte) error); ok {
  230. r1 = rf(loginCookie)
  231. } else {
  232. r1 = ret.Error(1)
  233. }
  234. return r0, r1
  235. }
  236. // mockAuthService_RetrieveChatSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RetrieveChatSession'
  237. type mockAuthService_RetrieveChatSession_Call struct {
  238. *mock.Call
  239. }
  240. // RetrieveChatSession is a helper method to define mock.On call
  241. // - loginCookie []byte
  242. func (_e *mockAuthService_Expecter) RetrieveChatSession(loginCookie interface{}) *mockAuthService_RetrieveChatSession_Call {
  243. return &mockAuthService_RetrieveChatSession_Call{Call: _e.mock.On("RetrieveChatSession", loginCookie)}
  244. }
  245. func (_c *mockAuthService_RetrieveChatSession_Call) Run(run func(loginCookie []byte)) *mockAuthService_RetrieveChatSession_Call {
  246. _c.Call.Run(func(args mock.Arguments) {
  247. run(args[0].([]byte))
  248. })
  249. return _c
  250. }
  251. func (_c *mockAuthService_RetrieveChatSession_Call) Return(_a0 *state.Session, _a1 error) *mockAuthService_RetrieveChatSession_Call {
  252. _c.Call.Return(_a0, _a1)
  253. return _c
  254. }
  255. func (_c *mockAuthService_RetrieveChatSession_Call) RunAndReturn(run func([]byte) (*state.Session, error)) *mockAuthService_RetrieveChatSession_Call {
  256. _c.Call.Return(run)
  257. return _c
  258. }
  259. // Signout provides a mock function with given fields: ctx, sess
  260. func (_m *mockAuthService) Signout(ctx context.Context, sess *state.Session) error {
  261. ret := _m.Called(ctx, sess)
  262. if len(ret) == 0 {
  263. panic("no return value specified for Signout")
  264. }
  265. var r0 error
  266. if rf, ok := ret.Get(0).(func(context.Context, *state.Session) error); ok {
  267. r0 = rf(ctx, sess)
  268. } else {
  269. r0 = ret.Error(0)
  270. }
  271. return r0
  272. }
  273. // mockAuthService_Signout_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Signout'
  274. type mockAuthService_Signout_Call struct {
  275. *mock.Call
  276. }
  277. // Signout is a helper method to define mock.On call
  278. // - ctx context.Context
  279. // - sess *state.Session
  280. func (_e *mockAuthService_Expecter) Signout(ctx interface{}, sess interface{}) *mockAuthService_Signout_Call {
  281. return &mockAuthService_Signout_Call{Call: _e.mock.On("Signout", ctx, sess)}
  282. }
  283. func (_c *mockAuthService_Signout_Call) Run(run func(ctx context.Context, sess *state.Session)) *mockAuthService_Signout_Call {
  284. _c.Call.Run(func(args mock.Arguments) {
  285. run(args[0].(context.Context), args[1].(*state.Session))
  286. })
  287. return _c
  288. }
  289. func (_c *mockAuthService_Signout_Call) Return(_a0 error) *mockAuthService_Signout_Call {
  290. _c.Call.Return(_a0)
  291. return _c
  292. }
  293. func (_c *mockAuthService_Signout_Call) RunAndReturn(run func(context.Context, *state.Session) error) *mockAuthService_Signout_Call {
  294. _c.Call.Return(run)
  295. return _c
  296. }
  297. // SignoutChat provides a mock function with given fields: ctx, sess
  298. func (_m *mockAuthService) SignoutChat(ctx context.Context, sess *state.Session) error {
  299. ret := _m.Called(ctx, sess)
  300. if len(ret) == 0 {
  301. panic("no return value specified for SignoutChat")
  302. }
  303. var r0 error
  304. if rf, ok := ret.Get(0).(func(context.Context, *state.Session) error); ok {
  305. r0 = rf(ctx, sess)
  306. } else {
  307. r0 = ret.Error(0)
  308. }
  309. return r0
  310. }
  311. // mockAuthService_SignoutChat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SignoutChat'
  312. type mockAuthService_SignoutChat_Call struct {
  313. *mock.Call
  314. }
  315. // SignoutChat is a helper method to define mock.On call
  316. // - ctx context.Context
  317. // - sess *state.Session
  318. func (_e *mockAuthService_Expecter) SignoutChat(ctx interface{}, sess interface{}) *mockAuthService_SignoutChat_Call {
  319. return &mockAuthService_SignoutChat_Call{Call: _e.mock.On("SignoutChat", ctx, sess)}
  320. }
  321. func (_c *mockAuthService_SignoutChat_Call) Run(run func(ctx context.Context, sess *state.Session)) *mockAuthService_SignoutChat_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_SignoutChat_Call) Return(_a0 error) *mockAuthService_SignoutChat_Call {
  328. _c.Call.Return(_a0)
  329. return _c
  330. }
  331. func (_c *mockAuthService_SignoutChat_Call) RunAndReturn(run func(context.Context, *state.Session) error) *mockAuthService_SignoutChat_Call {
  332. _c.Call.Return(run)
  333. return _c
  334. }
  335. // 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.
  336. // The first argument is typically a *testing.T value.
  337. func newMockAuthService(t interface {
  338. mock.TestingT
  339. Cleanup(func())
  340. }) *mockAuthService {
  341. mock := &mockAuthService{}
  342. mock.Mock.Test(t)
  343. t.Cleanup(func() { mock.AssertExpectations(t) })
  344. return mock
  345. }