mock_auth_test.go 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714
  1. // Code generated by mockery; DO NOT EDIT.
  2. // github.com/vektra/mockery
  3. // template: testify
  4. package oscar
  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. // KerberosLogin provides a mock function for the type mockAuthService
  294. func (_mock *mockAuthService) KerberosLogin(ctx context.Context, inBody wire.SNAC_0x050C_0x0002_KerberosLoginRequest, endpointCfg config.Endpoint) (wire.SNACMessage, error) {
  295. ret := _mock.Called(ctx, inBody, endpointCfg)
  296. if len(ret) == 0 {
  297. panic("no return value specified for KerberosLogin")
  298. }
  299. var r0 wire.SNACMessage
  300. var r1 error
  301. if returnFunc, ok := ret.Get(0).(func(context.Context, wire.SNAC_0x050C_0x0002_KerberosLoginRequest, config.Endpoint) (wire.SNACMessage, error)); ok {
  302. return returnFunc(ctx, inBody, endpointCfg)
  303. }
  304. if returnFunc, ok := ret.Get(0).(func(context.Context, wire.SNAC_0x050C_0x0002_KerberosLoginRequest, config.Endpoint) wire.SNACMessage); ok {
  305. r0 = returnFunc(ctx, inBody, endpointCfg)
  306. } else {
  307. r0 = ret.Get(0).(wire.SNACMessage)
  308. }
  309. if returnFunc, ok := ret.Get(1).(func(context.Context, wire.SNAC_0x050C_0x0002_KerberosLoginRequest, config.Endpoint) error); ok {
  310. r1 = returnFunc(ctx, inBody, endpointCfg)
  311. } else {
  312. r1 = ret.Error(1)
  313. }
  314. return r0, r1
  315. }
  316. // mockAuthService_KerberosLogin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'KerberosLogin'
  317. type mockAuthService_KerberosLogin_Call struct {
  318. *mock.Call
  319. }
  320. // KerberosLogin is a helper method to define mock.On call
  321. // - ctx context.Context
  322. // - inBody wire.SNAC_0x050C_0x0002_KerberosLoginRequest
  323. // - endpointCfg config.Endpoint
  324. func (_e *mockAuthService_Expecter) KerberosLogin(ctx any, inBody any, endpointCfg any) *mockAuthService_KerberosLogin_Call {
  325. return &mockAuthService_KerberosLogin_Call{Call: _e.mock.On("KerberosLogin", ctx, inBody, endpointCfg)}
  326. }
  327. func (_c *mockAuthService_KerberosLogin_Call) Run(run func(ctx context.Context, inBody wire.SNAC_0x050C_0x0002_KerberosLoginRequest, endpointCfg config.Endpoint)) *mockAuthService_KerberosLogin_Call {
  328. _c.Call.Run(func(args mock.Arguments) {
  329. var arg0 context.Context
  330. if args[0] != nil {
  331. arg0 = args[0].(context.Context)
  332. }
  333. var arg1 wire.SNAC_0x050C_0x0002_KerberosLoginRequest
  334. if args[1] != nil {
  335. arg1 = args[1].(wire.SNAC_0x050C_0x0002_KerberosLoginRequest)
  336. }
  337. var arg2 config.Endpoint
  338. if args[2] != nil {
  339. arg2 = args[2].(config.Endpoint)
  340. }
  341. run(
  342. arg0,
  343. arg1,
  344. arg2,
  345. )
  346. })
  347. return _c
  348. }
  349. func (_c *mockAuthService_KerberosLogin_Call) Return(sNACMessage wire.SNACMessage, err error) *mockAuthService_KerberosLogin_Call {
  350. _c.Call.Return(sNACMessage, err)
  351. return _c
  352. }
  353. func (_c *mockAuthService_KerberosLogin_Call) RunAndReturn(run func(ctx context.Context, inBody wire.SNAC_0x050C_0x0002_KerberosLoginRequest, endpointCfg config.Endpoint) (wire.SNACMessage, error)) *mockAuthService_KerberosLogin_Call {
  354. _c.Call.Return(run)
  355. return _c
  356. }
  357. // RegisterBOSSession provides a mock function for the type mockAuthService
  358. func (_mock *mockAuthService) RegisterBOSSession(ctx context.Context, authCookie state.ServerCookie, sessCfg func(sess *state.Session)) (*state.SessionInstance, error) {
  359. ret := _mock.Called(ctx, authCookie, sessCfg)
  360. if len(ret) == 0 {
  361. panic("no return value specified for RegisterBOSSession")
  362. }
  363. var r0 *state.SessionInstance
  364. var r1 error
  365. if returnFunc, ok := ret.Get(0).(func(context.Context, state.ServerCookie, func(sess *state.Session)) (*state.SessionInstance, error)); ok {
  366. return returnFunc(ctx, authCookie, sessCfg)
  367. }
  368. if returnFunc, ok := ret.Get(0).(func(context.Context, state.ServerCookie, func(sess *state.Session)) *state.SessionInstance); ok {
  369. r0 = returnFunc(ctx, authCookie, sessCfg)
  370. } else {
  371. if ret.Get(0) != nil {
  372. r0 = ret.Get(0).(*state.SessionInstance)
  373. }
  374. }
  375. if returnFunc, ok := ret.Get(1).(func(context.Context, state.ServerCookie, func(sess *state.Session)) error); ok {
  376. r1 = returnFunc(ctx, authCookie, sessCfg)
  377. } else {
  378. r1 = ret.Error(1)
  379. }
  380. return r0, r1
  381. }
  382. // mockAuthService_RegisterBOSSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterBOSSession'
  383. type mockAuthService_RegisterBOSSession_Call struct {
  384. *mock.Call
  385. }
  386. // RegisterBOSSession is a helper method to define mock.On call
  387. // - ctx context.Context
  388. // - authCookie state.ServerCookie
  389. // - sessCfg func(sess *state.Session)
  390. func (_e *mockAuthService_Expecter) RegisterBOSSession(ctx any, authCookie any, sessCfg any) *mockAuthService_RegisterBOSSession_Call {
  391. return &mockAuthService_RegisterBOSSession_Call{Call: _e.mock.On("RegisterBOSSession", ctx, authCookie, sessCfg)}
  392. }
  393. func (_c *mockAuthService_RegisterBOSSession_Call) Run(run func(ctx context.Context, authCookie state.ServerCookie, sessCfg func(sess *state.Session))) *mockAuthService_RegisterBOSSession_Call {
  394. _c.Call.Run(func(args mock.Arguments) {
  395. var arg0 context.Context
  396. if args[0] != nil {
  397. arg0 = args[0].(context.Context)
  398. }
  399. var arg1 state.ServerCookie
  400. if args[1] != nil {
  401. arg1 = args[1].(state.ServerCookie)
  402. }
  403. var arg2 func(sess *state.Session)
  404. if args[2] != nil {
  405. arg2 = args[2].(func(sess *state.Session))
  406. }
  407. run(
  408. arg0,
  409. arg1,
  410. arg2,
  411. )
  412. })
  413. return _c
  414. }
  415. func (_c *mockAuthService_RegisterBOSSession_Call) Return(sessionInstance *state.SessionInstance, err error) *mockAuthService_RegisterBOSSession_Call {
  416. _c.Call.Return(sessionInstance, err)
  417. return _c
  418. }
  419. func (_c *mockAuthService_RegisterBOSSession_Call) RunAndReturn(run func(ctx context.Context, authCookie state.ServerCookie, sessCfg func(sess *state.Session)) (*state.SessionInstance, error)) *mockAuthService_RegisterBOSSession_Call {
  420. _c.Call.Return(run)
  421. return _c
  422. }
  423. // RegisterChatSession provides a mock function for the type mockAuthService
  424. func (_mock *mockAuthService) RegisterChatSession(ctx context.Context, authCookie state.ServerCookie, sessCfg func(sess *state.Session)) (*state.SessionInstance, error) {
  425. ret := _mock.Called(ctx, authCookie, sessCfg)
  426. if len(ret) == 0 {
  427. panic("no return value specified for RegisterChatSession")
  428. }
  429. var r0 *state.SessionInstance
  430. var r1 error
  431. if returnFunc, ok := ret.Get(0).(func(context.Context, state.ServerCookie, func(sess *state.Session)) (*state.SessionInstance, error)); ok {
  432. return returnFunc(ctx, authCookie, sessCfg)
  433. }
  434. if returnFunc, ok := ret.Get(0).(func(context.Context, state.ServerCookie, func(sess *state.Session)) *state.SessionInstance); ok {
  435. r0 = returnFunc(ctx, authCookie, sessCfg)
  436. } else {
  437. if ret.Get(0) != nil {
  438. r0 = ret.Get(0).(*state.SessionInstance)
  439. }
  440. }
  441. if returnFunc, ok := ret.Get(1).(func(context.Context, state.ServerCookie, func(sess *state.Session)) error); ok {
  442. r1 = returnFunc(ctx, authCookie, sessCfg)
  443. } else {
  444. r1 = ret.Error(1)
  445. }
  446. return r0, r1
  447. }
  448. // mockAuthService_RegisterChatSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterChatSession'
  449. type mockAuthService_RegisterChatSession_Call struct {
  450. *mock.Call
  451. }
  452. // RegisterChatSession is a helper method to define mock.On call
  453. // - ctx context.Context
  454. // - authCookie state.ServerCookie
  455. // - sessCfg func(sess *state.Session)
  456. func (_e *mockAuthService_Expecter) RegisterChatSession(ctx any, authCookie any, sessCfg any) *mockAuthService_RegisterChatSession_Call {
  457. return &mockAuthService_RegisterChatSession_Call{Call: _e.mock.On("RegisterChatSession", ctx, authCookie, sessCfg)}
  458. }
  459. func (_c *mockAuthService_RegisterChatSession_Call) Run(run func(ctx context.Context, authCookie state.ServerCookie, sessCfg func(sess *state.Session))) *mockAuthService_RegisterChatSession_Call {
  460. _c.Call.Run(func(args mock.Arguments) {
  461. var arg0 context.Context
  462. if args[0] != nil {
  463. arg0 = args[0].(context.Context)
  464. }
  465. var arg1 state.ServerCookie
  466. if args[1] != nil {
  467. arg1 = args[1].(state.ServerCookie)
  468. }
  469. var arg2 func(sess *state.Session)
  470. if args[2] != nil {
  471. arg2 = args[2].(func(sess *state.Session))
  472. }
  473. run(
  474. arg0,
  475. arg1,
  476. arg2,
  477. )
  478. })
  479. return _c
  480. }
  481. func (_c *mockAuthService_RegisterChatSession_Call) Return(sessionInstance *state.SessionInstance, err error) *mockAuthService_RegisterChatSession_Call {
  482. _c.Call.Return(sessionInstance, err)
  483. return _c
  484. }
  485. func (_c *mockAuthService_RegisterChatSession_Call) RunAndReturn(run func(ctx context.Context, authCookie state.ServerCookie, sessCfg func(sess *state.Session)) (*state.SessionInstance, error)) *mockAuthService_RegisterChatSession_Call {
  486. _c.Call.Return(run)
  487. return _c
  488. }
  489. // RetrieveBOSSession provides a mock function for the type mockAuthService
  490. func (_mock *mockAuthService) RetrieveBOSSession(ctx context.Context, authCookie state.ServerCookie) (*state.SessionInstance, error) {
  491. ret := _mock.Called(ctx, authCookie)
  492. if len(ret) == 0 {
  493. panic("no return value specified for RetrieveBOSSession")
  494. }
  495. var r0 *state.SessionInstance
  496. var r1 error
  497. if returnFunc, ok := ret.Get(0).(func(context.Context, state.ServerCookie) (*state.SessionInstance, error)); ok {
  498. return returnFunc(ctx, authCookie)
  499. }
  500. if returnFunc, ok := ret.Get(0).(func(context.Context, state.ServerCookie) *state.SessionInstance); ok {
  501. r0 = returnFunc(ctx, authCookie)
  502. } else {
  503. if ret.Get(0) != nil {
  504. r0 = ret.Get(0).(*state.SessionInstance)
  505. }
  506. }
  507. if returnFunc, ok := ret.Get(1).(func(context.Context, state.ServerCookie) error); ok {
  508. r1 = returnFunc(ctx, authCookie)
  509. } else {
  510. r1 = ret.Error(1)
  511. }
  512. return r0, r1
  513. }
  514. // mockAuthService_RetrieveBOSSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RetrieveBOSSession'
  515. type mockAuthService_RetrieveBOSSession_Call struct {
  516. *mock.Call
  517. }
  518. // RetrieveBOSSession is a helper method to define mock.On call
  519. // - ctx context.Context
  520. // - authCookie state.ServerCookie
  521. func (_e *mockAuthService_Expecter) RetrieveBOSSession(ctx any, authCookie any) *mockAuthService_RetrieveBOSSession_Call {
  522. return &mockAuthService_RetrieveBOSSession_Call{Call: _e.mock.On("RetrieveBOSSession", ctx, authCookie)}
  523. }
  524. func (_c *mockAuthService_RetrieveBOSSession_Call) Run(run func(ctx context.Context, authCookie state.ServerCookie)) *mockAuthService_RetrieveBOSSession_Call {
  525. _c.Call.Run(func(args mock.Arguments) {
  526. var arg0 context.Context
  527. if args[0] != nil {
  528. arg0 = args[0].(context.Context)
  529. }
  530. var arg1 state.ServerCookie
  531. if args[1] != nil {
  532. arg1 = args[1].(state.ServerCookie)
  533. }
  534. run(
  535. arg0,
  536. arg1,
  537. )
  538. })
  539. return _c
  540. }
  541. func (_c *mockAuthService_RetrieveBOSSession_Call) Return(sessionInstance *state.SessionInstance, err error) *mockAuthService_RetrieveBOSSession_Call {
  542. _c.Call.Return(sessionInstance, err)
  543. return _c
  544. }
  545. func (_c *mockAuthService_RetrieveBOSSession_Call) RunAndReturn(run func(ctx context.Context, authCookie state.ServerCookie) (*state.SessionInstance, error)) *mockAuthService_RetrieveBOSSession_Call {
  546. _c.Call.Return(run)
  547. return _c
  548. }
  549. // Signout provides a mock function for the type mockAuthService
  550. func (_mock *mockAuthService) Signout(ctx context.Context, session *state.Session) {
  551. _mock.Called(ctx, session)
  552. return
  553. }
  554. // mockAuthService_Signout_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Signout'
  555. type mockAuthService_Signout_Call struct {
  556. *mock.Call
  557. }
  558. // Signout is a helper method to define mock.On call
  559. // - ctx context.Context
  560. // - session *state.Session
  561. func (_e *mockAuthService_Expecter) Signout(ctx any, session any) *mockAuthService_Signout_Call {
  562. return &mockAuthService_Signout_Call{Call: _e.mock.On("Signout", ctx, session)}
  563. }
  564. func (_c *mockAuthService_Signout_Call) Run(run func(ctx context.Context, session *state.Session)) *mockAuthService_Signout_Call {
  565. _c.Call.Run(func(args mock.Arguments) {
  566. var arg0 context.Context
  567. if args[0] != nil {
  568. arg0 = args[0].(context.Context)
  569. }
  570. var arg1 *state.Session
  571. if args[1] != nil {
  572. arg1 = args[1].(*state.Session)
  573. }
  574. run(
  575. arg0,
  576. arg1,
  577. )
  578. })
  579. return _c
  580. }
  581. func (_c *mockAuthService_Signout_Call) Return() *mockAuthService_Signout_Call {
  582. _c.Call.Return()
  583. return _c
  584. }
  585. func (_c *mockAuthService_Signout_Call) RunAndReturn(run func(ctx context.Context, session *state.Session)) *mockAuthService_Signout_Call {
  586. _c.Run(run)
  587. return _c
  588. }
  589. // SignoutChat provides a mock function for the type mockAuthService
  590. func (_mock *mockAuthService) SignoutChat(ctx context.Context, instance *state.Session) {
  591. _mock.Called(ctx, instance)
  592. return
  593. }
  594. // mockAuthService_SignoutChat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SignoutChat'
  595. type mockAuthService_SignoutChat_Call struct {
  596. *mock.Call
  597. }
  598. // SignoutChat is a helper method to define mock.On call
  599. // - ctx context.Context
  600. // - instance *state.Session
  601. func (_e *mockAuthService_Expecter) SignoutChat(ctx any, instance any) *mockAuthService_SignoutChat_Call {
  602. return &mockAuthService_SignoutChat_Call{Call: _e.mock.On("SignoutChat", ctx, instance)}
  603. }
  604. func (_c *mockAuthService_SignoutChat_Call) Run(run func(ctx context.Context, instance *state.Session)) *mockAuthService_SignoutChat_Call {
  605. _c.Call.Run(func(args mock.Arguments) {
  606. var arg0 context.Context
  607. if args[0] != nil {
  608. arg0 = args[0].(context.Context)
  609. }
  610. var arg1 *state.Session
  611. if args[1] != nil {
  612. arg1 = args[1].(*state.Session)
  613. }
  614. run(
  615. arg0,
  616. arg1,
  617. )
  618. })
  619. return _c
  620. }
  621. func (_c *mockAuthService_SignoutChat_Call) Return() *mockAuthService_SignoutChat_Call {
  622. _c.Call.Return()
  623. return _c
  624. }
  625. func (_c *mockAuthService_SignoutChat_Call) RunAndReturn(run func(ctx context.Context, instance *state.Session)) *mockAuthService_SignoutChat_Call {
  626. _c.Run(run)
  627. return _c
  628. }