mock_auth_service_test.go 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. // Code generated by mockery; DO NOT EDIT.
  2. // github.com/vektra/mockery
  3. // template: testify
  4. package icq_legacy
  5. import (
  6. "context"
  7. "github.com/mk6i/open-oscar-server/config"
  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. // CrackCookie provides a mock function for the type mockAuthService
  34. func (_mock *mockAuthService) CrackCookie(authCookie []byte) (state.ServerCookie, error) {
  35. ret := _mock.Called(authCookie)
  36. if len(ret) == 0 {
  37. panic("no return value specified for CrackCookie")
  38. }
  39. var r0 state.ServerCookie
  40. var r1 error
  41. if returnFunc, ok := ret.Get(0).(func([]byte) (state.ServerCookie, error)); ok {
  42. return returnFunc(authCookie)
  43. }
  44. if returnFunc, ok := ret.Get(0).(func([]byte) state.ServerCookie); ok {
  45. r0 = returnFunc(authCookie)
  46. } else {
  47. r0 = ret.Get(0).(state.ServerCookie)
  48. }
  49. if returnFunc, ok := ret.Get(1).(func([]byte) error); ok {
  50. r1 = returnFunc(authCookie)
  51. } else {
  52. r1 = ret.Error(1)
  53. }
  54. return r0, r1
  55. }
  56. // mockAuthService_CrackCookie_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CrackCookie'
  57. type mockAuthService_CrackCookie_Call struct {
  58. *mock.Call
  59. }
  60. // CrackCookie is a helper method to define mock.On call
  61. // - authCookie []byte
  62. func (_e *mockAuthService_Expecter) CrackCookie(authCookie interface{}) *mockAuthService_CrackCookie_Call {
  63. return &mockAuthService_CrackCookie_Call{Call: _e.mock.On("CrackCookie", authCookie)}
  64. }
  65. func (_c *mockAuthService_CrackCookie_Call) Run(run func(authCookie []byte)) *mockAuthService_CrackCookie_Call {
  66. _c.Call.Run(func(args mock.Arguments) {
  67. var arg0 []byte
  68. if args[0] != nil {
  69. arg0 = args[0].([]byte)
  70. }
  71. run(
  72. arg0,
  73. )
  74. })
  75. return _c
  76. }
  77. func (_c *mockAuthService_CrackCookie_Call) Return(serverCookie state.ServerCookie, err error) *mockAuthService_CrackCookie_Call {
  78. _c.Call.Return(serverCookie, err)
  79. return _c
  80. }
  81. func (_c *mockAuthService_CrackCookie_Call) RunAndReturn(run func(authCookie []byte) (state.ServerCookie, error)) *mockAuthService_CrackCookie_Call {
  82. _c.Call.Return(run)
  83. return _c
  84. }
  85. // FLAPLogin provides a mock function for the type mockAuthService
  86. func (_mock *mockAuthService) FLAPLogin(ctx context.Context, inFrame wire.FLAPSignonFrame, endpointCfg config.Endpoint) (wire.TLVRestBlock, error) {
  87. ret := _mock.Called(ctx, inFrame, endpointCfg)
  88. if len(ret) == 0 {
  89. panic("no return value specified for FLAPLogin")
  90. }
  91. var r0 wire.TLVRestBlock
  92. var r1 error
  93. if returnFunc, ok := ret.Get(0).(func(context.Context, wire.FLAPSignonFrame, config.Endpoint) (wire.TLVRestBlock, error)); ok {
  94. return returnFunc(ctx, inFrame, endpointCfg)
  95. }
  96. if returnFunc, ok := ret.Get(0).(func(context.Context, wire.FLAPSignonFrame, config.Endpoint) wire.TLVRestBlock); ok {
  97. r0 = returnFunc(ctx, inFrame, endpointCfg)
  98. } else {
  99. r0 = ret.Get(0).(wire.TLVRestBlock)
  100. }
  101. if returnFunc, ok := ret.Get(1).(func(context.Context, wire.FLAPSignonFrame, config.Endpoint) error); ok {
  102. r1 = returnFunc(ctx, inFrame, endpointCfg)
  103. } else {
  104. r1 = ret.Error(1)
  105. }
  106. return r0, r1
  107. }
  108. // mockAuthService_FLAPLogin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FLAPLogin'
  109. type mockAuthService_FLAPLogin_Call struct {
  110. *mock.Call
  111. }
  112. // FLAPLogin is a helper method to define mock.On call
  113. // - ctx context.Context
  114. // - inFrame wire.FLAPSignonFrame
  115. // - endpointCfg config.Endpoint
  116. func (_e *mockAuthService_Expecter) FLAPLogin(ctx interface{}, inFrame interface{}, endpointCfg interface{}) *mockAuthService_FLAPLogin_Call {
  117. return &mockAuthService_FLAPLogin_Call{Call: _e.mock.On("FLAPLogin", ctx, inFrame, endpointCfg)}
  118. }
  119. func (_c *mockAuthService_FLAPLogin_Call) Run(run func(ctx context.Context, inFrame wire.FLAPSignonFrame, endpointCfg config.Endpoint)) *mockAuthService_FLAPLogin_Call {
  120. _c.Call.Run(func(args mock.Arguments) {
  121. var arg0 context.Context
  122. if args[0] != nil {
  123. arg0 = args[0].(context.Context)
  124. }
  125. var arg1 wire.FLAPSignonFrame
  126. if args[1] != nil {
  127. arg1 = args[1].(wire.FLAPSignonFrame)
  128. }
  129. var arg2 config.Endpoint
  130. if args[2] != nil {
  131. arg2 = args[2].(config.Endpoint)
  132. }
  133. run(
  134. arg0,
  135. arg1,
  136. arg2,
  137. )
  138. })
  139. return _c
  140. }
  141. func (_c *mockAuthService_FLAPLogin_Call) Return(tLVRestBlock wire.TLVRestBlock, err error) *mockAuthService_FLAPLogin_Call {
  142. _c.Call.Return(tLVRestBlock, err)
  143. return _c
  144. }
  145. func (_c *mockAuthService_FLAPLogin_Call) RunAndReturn(run func(ctx context.Context, inFrame wire.FLAPSignonFrame, endpointCfg config.Endpoint) (wire.TLVRestBlock, error)) *mockAuthService_FLAPLogin_Call {
  146. _c.Call.Return(run)
  147. return _c
  148. }
  149. // RegisterBOSSession provides a mock function for the type mockAuthService
  150. func (_mock *mockAuthService) RegisterBOSSession(ctx context.Context, authCookie state.ServerCookie, cfg func(*state.Session)) (*state.SessionInstance, error) {
  151. ret := _mock.Called(ctx, authCookie, cfg)
  152. if len(ret) == 0 {
  153. panic("no return value specified for RegisterBOSSession")
  154. }
  155. var r0 *state.SessionInstance
  156. var r1 error
  157. if returnFunc, ok := ret.Get(0).(func(context.Context, state.ServerCookie, func(*state.Session)) (*state.SessionInstance, error)); ok {
  158. return returnFunc(ctx, authCookie, cfg)
  159. }
  160. if returnFunc, ok := ret.Get(0).(func(context.Context, state.ServerCookie, func(*state.Session)) *state.SessionInstance); ok {
  161. r0 = returnFunc(ctx, authCookie, cfg)
  162. } else {
  163. if ret.Get(0) != nil {
  164. r0 = ret.Get(0).(*state.SessionInstance)
  165. }
  166. }
  167. if returnFunc, ok := ret.Get(1).(func(context.Context, state.ServerCookie, func(*state.Session)) error); ok {
  168. r1 = returnFunc(ctx, authCookie, cfg)
  169. } else {
  170. r1 = ret.Error(1)
  171. }
  172. return r0, r1
  173. }
  174. // mockAuthService_RegisterBOSSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterBOSSession'
  175. type mockAuthService_RegisterBOSSession_Call struct {
  176. *mock.Call
  177. }
  178. // RegisterBOSSession is a helper method to define mock.On call
  179. // - ctx context.Context
  180. // - authCookie state.ServerCookie
  181. // - cfg func(*state.Session)
  182. func (_e *mockAuthService_Expecter) RegisterBOSSession(ctx interface{}, authCookie interface{}, cfg interface{}) *mockAuthService_RegisterBOSSession_Call {
  183. return &mockAuthService_RegisterBOSSession_Call{Call: _e.mock.On("RegisterBOSSession", ctx, authCookie, cfg)}
  184. }
  185. func (_c *mockAuthService_RegisterBOSSession_Call) Run(run func(ctx context.Context, authCookie state.ServerCookie, cfg func(*state.Session))) *mockAuthService_RegisterBOSSession_Call {
  186. _c.Call.Run(func(args mock.Arguments) {
  187. var arg0 context.Context
  188. if args[0] != nil {
  189. arg0 = args[0].(context.Context)
  190. }
  191. var arg1 state.ServerCookie
  192. if args[1] != nil {
  193. arg1 = args[1].(state.ServerCookie)
  194. }
  195. var arg2 func(*state.Session)
  196. if args[2] != nil {
  197. arg2 = args[2].(func(*state.Session))
  198. }
  199. run(
  200. arg0,
  201. arg1,
  202. arg2,
  203. )
  204. })
  205. return _c
  206. }
  207. func (_c *mockAuthService_RegisterBOSSession_Call) Return(sessionInstance *state.SessionInstance, err error) *mockAuthService_RegisterBOSSession_Call {
  208. _c.Call.Return(sessionInstance, err)
  209. return _c
  210. }
  211. func (_c *mockAuthService_RegisterBOSSession_Call) RunAndReturn(run func(ctx context.Context, authCookie state.ServerCookie, cfg func(*state.Session)) (*state.SessionInstance, error)) *mockAuthService_RegisterBOSSession_Call {
  212. _c.Call.Return(run)
  213. return _c
  214. }