mock_auth_test.go 24 KB

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