mock_auth_test.go 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  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, fn
  68. func (_m *mockAuthService) BUCPLogin(bodyIn wire.SNAC_0x17_0x02_BUCPLoginRequest, fn func(string) (state.User, error)) (wire.SNACMessage, error) {
  69. ret := _m.Called(bodyIn, 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(string) (state.User, error)) (wire.SNACMessage, error)); ok {
  76. return rf(bodyIn, fn)
  77. }
  78. if rf, ok := ret.Get(0).(func(wire.SNAC_0x17_0x02_BUCPLoginRequest, func(string) (state.User, error)) wire.SNACMessage); ok {
  79. r0 = rf(bodyIn, 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(string) (state.User, error)) error); ok {
  84. r1 = rf(bodyIn, 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. // - fn func(string)(state.User , error)
  97. func (_e *mockAuthService_Expecter) BUCPLogin(bodyIn interface{}, fn interface{}) *mockAuthService_BUCPLogin_Call {
  98. return &mockAuthService_BUCPLogin_Call{Call: _e.mock.On("BUCPLogin", bodyIn, fn)}
  99. }
  100. func (_c *mockAuthService_BUCPLogin_Call) Run(run func(bodyIn wire.SNAC_0x17_0x02_BUCPLoginRequest, fn func(string) (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(string) (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(string) (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(string) (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(string) (state.User, error)) (wire.TLVRestBlock, error)); ok {
  123. return rf(frame, newUserFn)
  124. }
  125. if rf, ok := ret.Get(0).(func(wire.FLAPSignonFrame, func(string) (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(string) (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(string)(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(string) (state.User, error))) *mockAuthService_FLAPLogin_Call {
  148. _c.Call.Run(func(args mock.Arguments) {
  149. run(args[0].(wire.FLAPSignonFrame), args[1].(func(string) (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(string) (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: sessionID
  162. func (_m *mockAuthService) RegisterBOSSession(sessionID string) (*state.Session, error) {
  163. ret := _m.Called(sessionID)
  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(string) (*state.Session, error)); ok {
  170. return rf(sessionID)
  171. }
  172. if rf, ok := ret.Get(0).(func(string) *state.Session); ok {
  173. r0 = rf(sessionID)
  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(string) error); ok {
  180. r1 = rf(sessionID)
  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. // - sessionID string
  192. func (_e *mockAuthService_Expecter) RegisterBOSSession(sessionID interface{}) *mockAuthService_RegisterBOSSession_Call {
  193. return &mockAuthService_RegisterBOSSession_Call{Call: _e.mock.On("RegisterBOSSession", sessionID)}
  194. }
  195. func (_c *mockAuthService_RegisterBOSSession_Call) Run(run func(sessionID string)) *mockAuthService_RegisterBOSSession_Call {
  196. _c.Call.Run(func(args mock.Arguments) {
  197. run(args[0].(string))
  198. })
  199. return _c
  200. }
  201. func (_c *mockAuthService_RegisterBOSSession_Call) Return(_a0 *state.Session, _a1 error) *mockAuthService_RegisterBOSSession_Call {
  202. _c.Call.Return(_a0, _a1)
  203. return _c
  204. }
  205. func (_c *mockAuthService_RegisterBOSSession_Call) RunAndReturn(run func(string) (*state.Session, error)) *mockAuthService_RegisterBOSSession_Call {
  206. _c.Call.Return(run)
  207. return _c
  208. }
  209. // RegisterChatSession provides a mock function with given fields: loginCookie
  210. func (_m *mockAuthService) RegisterChatSession(loginCookie []byte) (*state.Session, error) {
  211. ret := _m.Called(loginCookie)
  212. if len(ret) == 0 {
  213. panic("no return value specified for RegisterChatSession")
  214. }
  215. var r0 *state.Session
  216. var r1 error
  217. if rf, ok := ret.Get(0).(func([]byte) (*state.Session, error)); ok {
  218. return rf(loginCookie)
  219. }
  220. if rf, ok := ret.Get(0).(func([]byte) *state.Session); ok {
  221. r0 = rf(loginCookie)
  222. } else {
  223. if ret.Get(0) != nil {
  224. r0 = ret.Get(0).(*state.Session)
  225. }
  226. }
  227. if rf, ok := ret.Get(1).(func([]byte) error); ok {
  228. r1 = rf(loginCookie)
  229. } else {
  230. r1 = ret.Error(1)
  231. }
  232. return r0, r1
  233. }
  234. // mockAuthService_RegisterChatSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterChatSession'
  235. type mockAuthService_RegisterChatSession_Call struct {
  236. *mock.Call
  237. }
  238. // RegisterChatSession is a helper method to define mock.On call
  239. // - loginCookie []byte
  240. func (_e *mockAuthService_Expecter) RegisterChatSession(loginCookie interface{}) *mockAuthService_RegisterChatSession_Call {
  241. return &mockAuthService_RegisterChatSession_Call{Call: _e.mock.On("RegisterChatSession", loginCookie)}
  242. }
  243. func (_c *mockAuthService_RegisterChatSession_Call) Run(run func(loginCookie []byte)) *mockAuthService_RegisterChatSession_Call {
  244. _c.Call.Run(func(args mock.Arguments) {
  245. run(args[0].([]byte))
  246. })
  247. return _c
  248. }
  249. func (_c *mockAuthService_RegisterChatSession_Call) Return(_a0 *state.Session, _a1 error) *mockAuthService_RegisterChatSession_Call {
  250. _c.Call.Return(_a0, _a1)
  251. return _c
  252. }
  253. func (_c *mockAuthService_RegisterChatSession_Call) RunAndReturn(run func([]byte) (*state.Session, error)) *mockAuthService_RegisterChatSession_Call {
  254. _c.Call.Return(run)
  255. return _c
  256. }
  257. // Signout provides a mock function with given fields: ctx, sess
  258. func (_m *mockAuthService) Signout(ctx context.Context, sess *state.Session) error {
  259. ret := _m.Called(ctx, sess)
  260. if len(ret) == 0 {
  261. panic("no return value specified for Signout")
  262. }
  263. var r0 error
  264. if rf, ok := ret.Get(0).(func(context.Context, *state.Session) error); ok {
  265. r0 = rf(ctx, sess)
  266. } else {
  267. r0 = ret.Error(0)
  268. }
  269. return r0
  270. }
  271. // mockAuthService_Signout_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Signout'
  272. type mockAuthService_Signout_Call struct {
  273. *mock.Call
  274. }
  275. // Signout is a helper method to define mock.On call
  276. // - ctx context.Context
  277. // - sess *state.Session
  278. func (_e *mockAuthService_Expecter) Signout(ctx interface{}, sess interface{}) *mockAuthService_Signout_Call {
  279. return &mockAuthService_Signout_Call{Call: _e.mock.On("Signout", ctx, sess)}
  280. }
  281. func (_c *mockAuthService_Signout_Call) Run(run func(ctx context.Context, sess *state.Session)) *mockAuthService_Signout_Call {
  282. _c.Call.Run(func(args mock.Arguments) {
  283. run(args[0].(context.Context), args[1].(*state.Session))
  284. })
  285. return _c
  286. }
  287. func (_c *mockAuthService_Signout_Call) Return(_a0 error) *mockAuthService_Signout_Call {
  288. _c.Call.Return(_a0)
  289. return _c
  290. }
  291. func (_c *mockAuthService_Signout_Call) RunAndReturn(run func(context.Context, *state.Session) error) *mockAuthService_Signout_Call {
  292. _c.Call.Return(run)
  293. return _c
  294. }
  295. // SignoutChat provides a mock function with given fields: ctx, sess
  296. func (_m *mockAuthService) SignoutChat(ctx context.Context, sess *state.Session) error {
  297. ret := _m.Called(ctx, sess)
  298. if len(ret) == 0 {
  299. panic("no return value specified for SignoutChat")
  300. }
  301. var r0 error
  302. if rf, ok := ret.Get(0).(func(context.Context, *state.Session) error); ok {
  303. r0 = rf(ctx, sess)
  304. } else {
  305. r0 = ret.Error(0)
  306. }
  307. return r0
  308. }
  309. // mockAuthService_SignoutChat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SignoutChat'
  310. type mockAuthService_SignoutChat_Call struct {
  311. *mock.Call
  312. }
  313. // SignoutChat is a helper method to define mock.On call
  314. // - ctx context.Context
  315. // - sess *state.Session
  316. func (_e *mockAuthService_Expecter) SignoutChat(ctx interface{}, sess interface{}) *mockAuthService_SignoutChat_Call {
  317. return &mockAuthService_SignoutChat_Call{Call: _e.mock.On("SignoutChat", ctx, sess)}
  318. }
  319. func (_c *mockAuthService_SignoutChat_Call) Run(run func(ctx context.Context, sess *state.Session)) *mockAuthService_SignoutChat_Call {
  320. _c.Call.Run(func(args mock.Arguments) {
  321. run(args[0].(context.Context), args[1].(*state.Session))
  322. })
  323. return _c
  324. }
  325. func (_c *mockAuthService_SignoutChat_Call) Return(_a0 error) *mockAuthService_SignoutChat_Call {
  326. _c.Call.Return(_a0)
  327. return _c
  328. }
  329. func (_c *mockAuthService_SignoutChat_Call) RunAndReturn(run func(context.Context, *state.Session) error) *mockAuthService_SignoutChat_Call {
  330. _c.Call.Return(run)
  331. return _c
  332. }
  333. // 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.
  334. // The first argument is typically a *testing.T value.
  335. func newMockAuthService(t interface {
  336. mock.TestingT
  337. Cleanup(func())
  338. }) *mockAuthService {
  339. mock := &mockAuthService{}
  340. mock.Mock.Test(t)
  341. t.Cleanup(func() { mock.AssertExpectations(t) })
  342. return mock
  343. }