mock_auth_service_test.go 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. // Code generated by mockery; DO NOT EDIT.
  2. // github.com/vektra/mockery
  3. // template: testify
  4. package toc
  5. import (
  6. "context"
  7. "time"
  8. "github.com/google/uuid"
  9. "github.com/mk6i/open-oscar-server/config"
  10. "github.com/mk6i/open-oscar-server/state"
  11. "github.com/mk6i/open-oscar-server/wire"
  12. mock "github.com/stretchr/testify/mock"
  13. )
  14. // 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.
  15. // The first argument is typically a *testing.T value.
  16. func newMockAuthService(t interface {
  17. mock.TestingT
  18. Cleanup(func())
  19. }) *mockAuthService {
  20. if helper, ok := t.(interface{ Helper() }); ok {
  21. helper.Helper()
  22. }
  23. mock := &mockAuthService{}
  24. mock.Mock.Test(t)
  25. t.Cleanup(func() {
  26. if helper, ok := t.(interface{ Helper() }); ok {
  27. helper.Helper()
  28. }
  29. mock.AssertExpectations(t)
  30. })
  31. return mock
  32. }
  33. // mockAuthService is an autogenerated mock type for the AuthService type
  34. type mockAuthService struct {
  35. mock.Mock
  36. }
  37. type mockAuthService_Expecter struct {
  38. mock *mock.Mock
  39. }
  40. func (_m *mockAuthService) EXPECT() *mockAuthService_Expecter {
  41. return &mockAuthService_Expecter{mock: &_m.Mock}
  42. }
  43. // BUCPChallenge provides a mock function for the type mockAuthService
  44. func (_mock *mockAuthService) BUCPChallenge(ctx context.Context, inBody wire.SNAC_0x17_0x06_BUCPChallengeRequest, newUUID func() uuid.UUID) (wire.SNACMessage, error) {
  45. ret := _mock.Called(ctx, inBody, newUUID)
  46. if len(ret) == 0 {
  47. panic("no return value specified for BUCPChallenge")
  48. }
  49. var r0 wire.SNACMessage
  50. var r1 error
  51. if returnFunc, ok := ret.Get(0).(func(context.Context, wire.SNAC_0x17_0x06_BUCPChallengeRequest, func() uuid.UUID) (wire.SNACMessage, error)); ok {
  52. return returnFunc(ctx, inBody, newUUID)
  53. }
  54. if returnFunc, ok := ret.Get(0).(func(context.Context, wire.SNAC_0x17_0x06_BUCPChallengeRequest, func() uuid.UUID) wire.SNACMessage); ok {
  55. r0 = returnFunc(ctx, inBody, newUUID)
  56. } else {
  57. r0 = ret.Get(0).(wire.SNACMessage)
  58. }
  59. if returnFunc, ok := ret.Get(1).(func(context.Context, wire.SNAC_0x17_0x06_BUCPChallengeRequest, func() uuid.UUID) error); ok {
  60. r1 = returnFunc(ctx, inBody, newUUID)
  61. } else {
  62. r1 = ret.Error(1)
  63. }
  64. return r0, r1
  65. }
  66. // mockAuthService_BUCPChallenge_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BUCPChallenge'
  67. type mockAuthService_BUCPChallenge_Call struct {
  68. *mock.Call
  69. }
  70. // BUCPChallenge is a helper method to define mock.On call
  71. // - ctx context.Context
  72. // - inBody wire.SNAC_0x17_0x06_BUCPChallengeRequest
  73. // - newUUID func() uuid.UUID
  74. func (_e *mockAuthService_Expecter) BUCPChallenge(ctx any, inBody any, newUUID any) *mockAuthService_BUCPChallenge_Call {
  75. return &mockAuthService_BUCPChallenge_Call{Call: _e.mock.On("BUCPChallenge", ctx, inBody, newUUID)}
  76. }
  77. func (_c *mockAuthService_BUCPChallenge_Call) Run(run func(ctx context.Context, inBody wire.SNAC_0x17_0x06_BUCPChallengeRequest, newUUID func() uuid.UUID)) *mockAuthService_BUCPChallenge_Call {
  78. _c.Call.Run(func(args mock.Arguments) {
  79. var arg0 context.Context
  80. if args[0] != nil {
  81. arg0 = args[0].(context.Context)
  82. }
  83. var arg1 wire.SNAC_0x17_0x06_BUCPChallengeRequest
  84. if args[1] != nil {
  85. arg1 = args[1].(wire.SNAC_0x17_0x06_BUCPChallengeRequest)
  86. }
  87. var arg2 func() uuid.UUID
  88. if args[2] != nil {
  89. arg2 = args[2].(func() uuid.UUID)
  90. }
  91. run(
  92. arg0,
  93. arg1,
  94. arg2,
  95. )
  96. })
  97. return _c
  98. }
  99. func (_c *mockAuthService_BUCPChallenge_Call) Return(sNACMessage wire.SNACMessage, err error) *mockAuthService_BUCPChallenge_Call {
  100. _c.Call.Return(sNACMessage, err)
  101. return _c
  102. }
  103. func (_c *mockAuthService_BUCPChallenge_Call) RunAndReturn(run func(ctx context.Context, inBody wire.SNAC_0x17_0x06_BUCPChallengeRequest, newUUID func() uuid.UUID) (wire.SNACMessage, error)) *mockAuthService_BUCPChallenge_Call {
  104. _c.Call.Return(run)
  105. return _c
  106. }
  107. // BUCPLogin provides a mock function for the type mockAuthService
  108. func (_mock *mockAuthService) BUCPLogin(ctx context.Context, inBody wire.SNAC_0x17_0x02_BUCPLoginRequest, endpointCfg config.Endpoint) (wire.SNACMessage, error) {
  109. ret := _mock.Called(ctx, inBody, endpointCfg)
  110. if len(ret) == 0 {
  111. panic("no return value specified for BUCPLogin")
  112. }
  113. var r0 wire.SNACMessage
  114. var r1 error
  115. if returnFunc, ok := ret.Get(0).(func(context.Context, wire.SNAC_0x17_0x02_BUCPLoginRequest, config.Endpoint) (wire.SNACMessage, error)); ok {
  116. return returnFunc(ctx, inBody, endpointCfg)
  117. }
  118. if returnFunc, ok := ret.Get(0).(func(context.Context, wire.SNAC_0x17_0x02_BUCPLoginRequest, config.Endpoint) wire.SNACMessage); ok {
  119. r0 = returnFunc(ctx, inBody, endpointCfg)
  120. } else {
  121. r0 = ret.Get(0).(wire.SNACMessage)
  122. }
  123. if returnFunc, ok := ret.Get(1).(func(context.Context, wire.SNAC_0x17_0x02_BUCPLoginRequest, config.Endpoint) error); ok {
  124. r1 = returnFunc(ctx, inBody, endpointCfg)
  125. } else {
  126. r1 = ret.Error(1)
  127. }
  128. return r0, r1
  129. }
  130. // mockAuthService_BUCPLogin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BUCPLogin'
  131. type mockAuthService_BUCPLogin_Call struct {
  132. *mock.Call
  133. }
  134. // BUCPLogin is a helper method to define mock.On call
  135. // - ctx context.Context
  136. // - inBody wire.SNAC_0x17_0x02_BUCPLoginRequest
  137. // - endpointCfg config.Endpoint
  138. func (_e *mockAuthService_Expecter) BUCPLogin(ctx any, inBody any, endpointCfg any) *mockAuthService_BUCPLogin_Call {
  139. return &mockAuthService_BUCPLogin_Call{Call: _e.mock.On("BUCPLogin", ctx, inBody, endpointCfg)}
  140. }
  141. func (_c *mockAuthService_BUCPLogin_Call) Run(run func(ctx context.Context, inBody wire.SNAC_0x17_0x02_BUCPLoginRequest, endpointCfg config.Endpoint)) *mockAuthService_BUCPLogin_Call {
  142. _c.Call.Run(func(args mock.Arguments) {
  143. var arg0 context.Context
  144. if args[0] != nil {
  145. arg0 = args[0].(context.Context)
  146. }
  147. var arg1 wire.SNAC_0x17_0x02_BUCPLoginRequest
  148. if args[1] != nil {
  149. arg1 = args[1].(wire.SNAC_0x17_0x02_BUCPLoginRequest)
  150. }
  151. var arg2 config.Endpoint
  152. if args[2] != nil {
  153. arg2 = args[2].(config.Endpoint)
  154. }
  155. run(
  156. arg0,
  157. arg1,
  158. arg2,
  159. )
  160. })
  161. return _c
  162. }
  163. func (_c *mockAuthService_BUCPLogin_Call) Return(sNACMessage wire.SNACMessage, err error) *mockAuthService_BUCPLogin_Call {
  164. _c.Call.Return(sNACMessage, err)
  165. return _c
  166. }
  167. func (_c *mockAuthService_BUCPLogin_Call) RunAndReturn(run func(ctx context.Context, inBody wire.SNAC_0x17_0x02_BUCPLoginRequest, endpointCfg config.Endpoint) (wire.SNACMessage, error)) *mockAuthService_BUCPLogin_Call {
  168. _c.Call.Return(run)
  169. return _c
  170. }
  171. // CrackCookie provides a mock function for the type mockAuthService
  172. func (_mock *mockAuthService) CrackCookie(authCookie []byte) (state.ServerCookie, time.Time, error) {
  173. ret := _mock.Called(authCookie)
  174. if len(ret) == 0 {
  175. panic("no return value specified for CrackCookie")
  176. }
  177. var r0 state.ServerCookie
  178. var r1 time.Time
  179. var r2 error
  180. if returnFunc, ok := ret.Get(0).(func([]byte) (state.ServerCookie, time.Time, error)); ok {
  181. return returnFunc(authCookie)
  182. }
  183. if returnFunc, ok := ret.Get(0).(func([]byte) state.ServerCookie); ok {
  184. r0 = returnFunc(authCookie)
  185. } else {
  186. r0 = ret.Get(0).(state.ServerCookie)
  187. }
  188. if returnFunc, ok := ret.Get(1).(func([]byte) time.Time); ok {
  189. r1 = returnFunc(authCookie)
  190. } else {
  191. r1 = ret.Get(1).(time.Time)
  192. }
  193. if returnFunc, ok := ret.Get(2).(func([]byte) error); ok {
  194. r2 = returnFunc(authCookie)
  195. } else {
  196. r2 = ret.Error(2)
  197. }
  198. return r0, r1, r2
  199. }
  200. // mockAuthService_CrackCookie_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CrackCookie'
  201. type mockAuthService_CrackCookie_Call struct {
  202. *mock.Call
  203. }
  204. // CrackCookie is a helper method to define mock.On call
  205. // - authCookie []byte
  206. func (_e *mockAuthService_Expecter) CrackCookie(authCookie any) *mockAuthService_CrackCookie_Call {
  207. return &mockAuthService_CrackCookie_Call{Call: _e.mock.On("CrackCookie", authCookie)}
  208. }
  209. func (_c *mockAuthService_CrackCookie_Call) Run(run func(authCookie []byte)) *mockAuthService_CrackCookie_Call {
  210. _c.Call.Run(func(args mock.Arguments) {
  211. var arg0 []byte
  212. if args[0] != nil {
  213. arg0 = args[0].([]byte)
  214. }
  215. run(
  216. arg0,
  217. )
  218. })
  219. return _c
  220. }
  221. func (_c *mockAuthService_CrackCookie_Call) Return(serverCookie state.ServerCookie, time1 time.Time, err error) *mockAuthService_CrackCookie_Call {
  222. _c.Call.Return(serverCookie, time1, err)
  223. return _c
  224. }
  225. func (_c *mockAuthService_CrackCookie_Call) RunAndReturn(run func(authCookie []byte) (state.ServerCookie, time.Time, error)) *mockAuthService_CrackCookie_Call {
  226. _c.Call.Return(run)
  227. return _c
  228. }
  229. // FLAPLogin provides a mock function for the type mockAuthService
  230. func (_mock *mockAuthService) FLAPLogin(ctx context.Context, inFrame wire.FLAPSignonFrame, endpointCfg config.Endpoint) (wire.TLVRestBlock, error) {
  231. ret := _mock.Called(ctx, inFrame, endpointCfg)
  232. if len(ret) == 0 {
  233. panic("no return value specified for FLAPLogin")
  234. }
  235. var r0 wire.TLVRestBlock
  236. var r1 error
  237. if returnFunc, ok := ret.Get(0).(func(context.Context, wire.FLAPSignonFrame, config.Endpoint) (wire.TLVRestBlock, error)); ok {
  238. return returnFunc(ctx, inFrame, endpointCfg)
  239. }
  240. if returnFunc, ok := ret.Get(0).(func(context.Context, wire.FLAPSignonFrame, config.Endpoint) wire.TLVRestBlock); ok {
  241. r0 = returnFunc(ctx, inFrame, endpointCfg)
  242. } else {
  243. r0 = ret.Get(0).(wire.TLVRestBlock)
  244. }
  245. if returnFunc, ok := ret.Get(1).(func(context.Context, wire.FLAPSignonFrame, config.Endpoint) error); ok {
  246. r1 = returnFunc(ctx, inFrame, endpointCfg)
  247. } else {
  248. r1 = ret.Error(1)
  249. }
  250. return r0, r1
  251. }
  252. // mockAuthService_FLAPLogin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FLAPLogin'
  253. type mockAuthService_FLAPLogin_Call struct {
  254. *mock.Call
  255. }
  256. // FLAPLogin is a helper method to define mock.On call
  257. // - ctx context.Context
  258. // - inFrame wire.FLAPSignonFrame
  259. // - endpointCfg config.Endpoint
  260. func (_e *mockAuthService_Expecter) FLAPLogin(ctx any, inFrame any, endpointCfg any) *mockAuthService_FLAPLogin_Call {
  261. return &mockAuthService_FLAPLogin_Call{Call: _e.mock.On("FLAPLogin", ctx, inFrame, endpointCfg)}
  262. }
  263. func (_c *mockAuthService_FLAPLogin_Call) Run(run func(ctx context.Context, inFrame wire.FLAPSignonFrame, endpointCfg config.Endpoint)) *mockAuthService_FLAPLogin_Call {
  264. _c.Call.Run(func(args mock.Arguments) {
  265. var arg0 context.Context
  266. if args[0] != nil {
  267. arg0 = args[0].(context.Context)
  268. }
  269. var arg1 wire.FLAPSignonFrame
  270. if args[1] != nil {
  271. arg1 = args[1].(wire.FLAPSignonFrame)
  272. }
  273. var arg2 config.Endpoint
  274. if args[2] != nil {
  275. arg2 = args[2].(config.Endpoint)
  276. }
  277. run(
  278. arg0,
  279. arg1,
  280. arg2,
  281. )
  282. })
  283. return _c
  284. }
  285. func (_c *mockAuthService_FLAPLogin_Call) Return(tLVRestBlock wire.TLVRestBlock, err error) *mockAuthService_FLAPLogin_Call {
  286. _c.Call.Return(tLVRestBlock, err)
  287. return _c
  288. }
  289. func (_c *mockAuthService_FLAPLogin_Call) RunAndReturn(run func(ctx context.Context, inFrame wire.FLAPSignonFrame, endpointCfg config.Endpoint) (wire.TLVRestBlock, error)) *mockAuthService_FLAPLogin_Call {
  290. _c.Call.Return(run)
  291. return _c
  292. }
  293. // RegisterBOSSession provides a mock function for the type mockAuthService
  294. func (_mock *mockAuthService) RegisterBOSSession(ctx context.Context, authCookie state.ServerCookie, cfg func(*state.Session)) (*state.SessionInstance, error) {
  295. ret := _mock.Called(ctx, authCookie, cfg)
  296. if len(ret) == 0 {
  297. panic("no return value specified for RegisterBOSSession")
  298. }
  299. var r0 *state.SessionInstance
  300. var r1 error
  301. if returnFunc, ok := ret.Get(0).(func(context.Context, state.ServerCookie, func(*state.Session)) (*state.SessionInstance, error)); ok {
  302. return returnFunc(ctx, authCookie, cfg)
  303. }
  304. if returnFunc, ok := ret.Get(0).(func(context.Context, state.ServerCookie, func(*state.Session)) *state.SessionInstance); ok {
  305. r0 = returnFunc(ctx, authCookie, cfg)
  306. } else {
  307. if ret.Get(0) != nil {
  308. r0 = ret.Get(0).(*state.SessionInstance)
  309. }
  310. }
  311. if returnFunc, ok := ret.Get(1).(func(context.Context, state.ServerCookie, func(*state.Session)) error); ok {
  312. r1 = returnFunc(ctx, authCookie, cfg)
  313. } else {
  314. r1 = ret.Error(1)
  315. }
  316. return r0, r1
  317. }
  318. // mockAuthService_RegisterBOSSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterBOSSession'
  319. type mockAuthService_RegisterBOSSession_Call struct {
  320. *mock.Call
  321. }
  322. // RegisterBOSSession is a helper method to define mock.On call
  323. // - ctx context.Context
  324. // - authCookie state.ServerCookie
  325. // - cfg func(*state.Session)
  326. func (_e *mockAuthService_Expecter) RegisterBOSSession(ctx any, authCookie any, cfg any) *mockAuthService_RegisterBOSSession_Call {
  327. return &mockAuthService_RegisterBOSSession_Call{Call: _e.mock.On("RegisterBOSSession", ctx, authCookie, cfg)}
  328. }
  329. func (_c *mockAuthService_RegisterBOSSession_Call) Run(run func(ctx context.Context, authCookie state.ServerCookie, cfg func(*state.Session))) *mockAuthService_RegisterBOSSession_Call {
  330. _c.Call.Run(func(args mock.Arguments) {
  331. var arg0 context.Context
  332. if args[0] != nil {
  333. arg0 = args[0].(context.Context)
  334. }
  335. var arg1 state.ServerCookie
  336. if args[1] != nil {
  337. arg1 = args[1].(state.ServerCookie)
  338. }
  339. var arg2 func(*state.Session)
  340. if args[2] != nil {
  341. arg2 = args[2].(func(*state.Session))
  342. }
  343. run(
  344. arg0,
  345. arg1,
  346. arg2,
  347. )
  348. })
  349. return _c
  350. }
  351. func (_c *mockAuthService_RegisterBOSSession_Call) Return(sessionInstance *state.SessionInstance, err error) *mockAuthService_RegisterBOSSession_Call {
  352. _c.Call.Return(sessionInstance, err)
  353. return _c
  354. }
  355. func (_c *mockAuthService_RegisterBOSSession_Call) RunAndReturn(run func(ctx context.Context, authCookie state.ServerCookie, cfg func(*state.Session)) (*state.SessionInstance, error)) *mockAuthService_RegisterBOSSession_Call {
  356. _c.Call.Return(run)
  357. return _c
  358. }
  359. // RegisterChatSession provides a mock function for the type mockAuthService
  360. func (_mock *mockAuthService) RegisterChatSession(ctx context.Context, authCookie state.ServerCookie, cfg func(sess *state.Session)) (*state.SessionInstance, error) {
  361. ret := _mock.Called(ctx, authCookie, cfg)
  362. if len(ret) == 0 {
  363. panic("no return value specified for RegisterChatSession")
  364. }
  365. var r0 *state.SessionInstance
  366. var r1 error
  367. if returnFunc, ok := ret.Get(0).(func(context.Context, state.ServerCookie, func(sess *state.Session)) (*state.SessionInstance, error)); ok {
  368. return returnFunc(ctx, authCookie, cfg)
  369. }
  370. if returnFunc, ok := ret.Get(0).(func(context.Context, state.ServerCookie, func(sess *state.Session)) *state.SessionInstance); ok {
  371. r0 = returnFunc(ctx, authCookie, cfg)
  372. } else {
  373. if ret.Get(0) != nil {
  374. r0 = ret.Get(0).(*state.SessionInstance)
  375. }
  376. }
  377. if returnFunc, ok := ret.Get(1).(func(context.Context, state.ServerCookie, func(sess *state.Session)) error); ok {
  378. r1 = returnFunc(ctx, authCookie, cfg)
  379. } else {
  380. r1 = ret.Error(1)
  381. }
  382. return r0, r1
  383. }
  384. // mockAuthService_RegisterChatSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterChatSession'
  385. type mockAuthService_RegisterChatSession_Call struct {
  386. *mock.Call
  387. }
  388. // RegisterChatSession is a helper method to define mock.On call
  389. // - ctx context.Context
  390. // - authCookie state.ServerCookie
  391. // - cfg func(sess *state.Session)
  392. func (_e *mockAuthService_Expecter) RegisterChatSession(ctx any, authCookie any, cfg any) *mockAuthService_RegisterChatSession_Call {
  393. return &mockAuthService_RegisterChatSession_Call{Call: _e.mock.On("RegisterChatSession", ctx, authCookie, cfg)}
  394. }
  395. func (_c *mockAuthService_RegisterChatSession_Call) Run(run func(ctx context.Context, authCookie state.ServerCookie, cfg func(sess *state.Session))) *mockAuthService_RegisterChatSession_Call {
  396. _c.Call.Run(func(args mock.Arguments) {
  397. var arg0 context.Context
  398. if args[0] != nil {
  399. arg0 = args[0].(context.Context)
  400. }
  401. var arg1 state.ServerCookie
  402. if args[1] != nil {
  403. arg1 = args[1].(state.ServerCookie)
  404. }
  405. var arg2 func(sess *state.Session)
  406. if args[2] != nil {
  407. arg2 = args[2].(func(sess *state.Session))
  408. }
  409. run(
  410. arg0,
  411. arg1,
  412. arg2,
  413. )
  414. })
  415. return _c
  416. }
  417. func (_c *mockAuthService_RegisterChatSession_Call) Return(sessionInstance *state.SessionInstance, err error) *mockAuthService_RegisterChatSession_Call {
  418. _c.Call.Return(sessionInstance, err)
  419. return _c
  420. }
  421. func (_c *mockAuthService_RegisterChatSession_Call) RunAndReturn(run func(ctx context.Context, authCookie state.ServerCookie, cfg func(sess *state.Session)) (*state.SessionInstance, error)) *mockAuthService_RegisterChatSession_Call {
  422. _c.Call.Return(run)
  423. return _c
  424. }
  425. // RetrieveBOSSession provides a mock function for the type mockAuthService
  426. func (_mock *mockAuthService) RetrieveBOSSession(ctx context.Context, authCookie state.ServerCookie) (*state.SessionInstance, error) {
  427. ret := _mock.Called(ctx, authCookie)
  428. if len(ret) == 0 {
  429. panic("no return value specified for RetrieveBOSSession")
  430. }
  431. var r0 *state.SessionInstance
  432. var r1 error
  433. if returnFunc, ok := ret.Get(0).(func(context.Context, state.ServerCookie) (*state.SessionInstance, error)); ok {
  434. return returnFunc(ctx, authCookie)
  435. }
  436. if returnFunc, ok := ret.Get(0).(func(context.Context, state.ServerCookie) *state.SessionInstance); ok {
  437. r0 = returnFunc(ctx, authCookie)
  438. } else {
  439. if ret.Get(0) != nil {
  440. r0 = ret.Get(0).(*state.SessionInstance)
  441. }
  442. }
  443. if returnFunc, ok := ret.Get(1).(func(context.Context, state.ServerCookie) error); ok {
  444. r1 = returnFunc(ctx, authCookie)
  445. } else {
  446. r1 = ret.Error(1)
  447. }
  448. return r0, r1
  449. }
  450. // mockAuthService_RetrieveBOSSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RetrieveBOSSession'
  451. type mockAuthService_RetrieveBOSSession_Call struct {
  452. *mock.Call
  453. }
  454. // RetrieveBOSSession is a helper method to define mock.On call
  455. // - ctx context.Context
  456. // - authCookie state.ServerCookie
  457. func (_e *mockAuthService_Expecter) RetrieveBOSSession(ctx any, authCookie any) *mockAuthService_RetrieveBOSSession_Call {
  458. return &mockAuthService_RetrieveBOSSession_Call{Call: _e.mock.On("RetrieveBOSSession", ctx, authCookie)}
  459. }
  460. func (_c *mockAuthService_RetrieveBOSSession_Call) Run(run func(ctx context.Context, authCookie state.ServerCookie)) *mockAuthService_RetrieveBOSSession_Call {
  461. _c.Call.Run(func(args mock.Arguments) {
  462. var arg0 context.Context
  463. if args[0] != nil {
  464. arg0 = args[0].(context.Context)
  465. }
  466. var arg1 state.ServerCookie
  467. if args[1] != nil {
  468. arg1 = args[1].(state.ServerCookie)
  469. }
  470. run(
  471. arg0,
  472. arg1,
  473. )
  474. })
  475. return _c
  476. }
  477. func (_c *mockAuthService_RetrieveBOSSession_Call) Return(sessionInstance *state.SessionInstance, err error) *mockAuthService_RetrieveBOSSession_Call {
  478. _c.Call.Return(sessionInstance, err)
  479. return _c
  480. }
  481. func (_c *mockAuthService_RetrieveBOSSession_Call) RunAndReturn(run func(ctx context.Context, authCookie state.ServerCookie) (*state.SessionInstance, error)) *mockAuthService_RetrieveBOSSession_Call {
  482. _c.Call.Return(run)
  483. return _c
  484. }
  485. // Signout provides a mock function for the type mockAuthService
  486. func (_mock *mockAuthService) Signout(ctx context.Context, session *state.Session) {
  487. _mock.Called(ctx, session)
  488. return
  489. }
  490. // mockAuthService_Signout_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Signout'
  491. type mockAuthService_Signout_Call struct {
  492. *mock.Call
  493. }
  494. // Signout is a helper method to define mock.On call
  495. // - ctx context.Context
  496. // - session *state.Session
  497. func (_e *mockAuthService_Expecter) Signout(ctx any, session any) *mockAuthService_Signout_Call {
  498. return &mockAuthService_Signout_Call{Call: _e.mock.On("Signout", ctx, session)}
  499. }
  500. func (_c *mockAuthService_Signout_Call) Run(run func(ctx context.Context, session *state.Session)) *mockAuthService_Signout_Call {
  501. _c.Call.Run(func(args mock.Arguments) {
  502. var arg0 context.Context
  503. if args[0] != nil {
  504. arg0 = args[0].(context.Context)
  505. }
  506. var arg1 *state.Session
  507. if args[1] != nil {
  508. arg1 = args[1].(*state.Session)
  509. }
  510. run(
  511. arg0,
  512. arg1,
  513. )
  514. })
  515. return _c
  516. }
  517. func (_c *mockAuthService_Signout_Call) Return() *mockAuthService_Signout_Call {
  518. _c.Call.Return()
  519. return _c
  520. }
  521. func (_c *mockAuthService_Signout_Call) RunAndReturn(run func(ctx context.Context, session *state.Session)) *mockAuthService_Signout_Call {
  522. _c.Run(run)
  523. return _c
  524. }
  525. // SignoutChat provides a mock function for the type mockAuthService
  526. func (_mock *mockAuthService) SignoutChat(ctx context.Context, sess *state.Session) {
  527. _mock.Called(ctx, sess)
  528. return
  529. }
  530. // mockAuthService_SignoutChat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SignoutChat'
  531. type mockAuthService_SignoutChat_Call struct {
  532. *mock.Call
  533. }
  534. // SignoutChat is a helper method to define mock.On call
  535. // - ctx context.Context
  536. // - sess *state.Session
  537. func (_e *mockAuthService_Expecter) SignoutChat(ctx any, sess any) *mockAuthService_SignoutChat_Call {
  538. return &mockAuthService_SignoutChat_Call{Call: _e.mock.On("SignoutChat", ctx, sess)}
  539. }
  540. func (_c *mockAuthService_SignoutChat_Call) Run(run func(ctx context.Context, sess *state.Session)) *mockAuthService_SignoutChat_Call {
  541. _c.Call.Run(func(args mock.Arguments) {
  542. var arg0 context.Context
  543. if args[0] != nil {
  544. arg0 = args[0].(context.Context)
  545. }
  546. var arg1 *state.Session
  547. if args[1] != nil {
  548. arg1 = args[1].(*state.Session)
  549. }
  550. run(
  551. arg0,
  552. arg1,
  553. )
  554. })
  555. return _c
  556. }
  557. func (_c *mockAuthService_SignoutChat_Call) Return() *mockAuthService_SignoutChat_Call {
  558. _c.Call.Return()
  559. return _c
  560. }
  561. func (_c *mockAuthService_SignoutChat_Call) RunAndReturn(run func(ctx context.Context, sess *state.Session)) *mockAuthService_SignoutChat_Call {
  562. _c.Run(run)
  563. return _c
  564. }