mock_auth_test.go 24 KB

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