mock_auth_service_test.go 7.8 KB

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