mock_auth_test.go 24 KB

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