mock_webapi_session_resolver_test.go 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. // Code generated by mockery; DO NOT EDIT.
  2. // github.com/vektra/mockery
  3. // template: testify
  4. package webapi
  5. import (
  6. "context"
  7. mock "github.com/stretchr/testify/mock"
  8. )
  9. // newMockSessionResolver creates a new instance of mockSessionResolver. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
  10. // The first argument is typically a *testing.T value.
  11. func newMockSessionResolver(t interface {
  12. mock.TestingT
  13. Cleanup(func())
  14. }) *mockSessionResolver {
  15. if helper, ok := t.(interface{ Helper() }); ok {
  16. helper.Helper()
  17. }
  18. mock := &mockSessionResolver{}
  19. mock.Mock.Test(t)
  20. t.Cleanup(func() {
  21. if helper, ok := t.(interface{ Helper() }); ok {
  22. helper.Helper()
  23. }
  24. mock.AssertExpectations(t)
  25. })
  26. return mock
  27. }
  28. // mockSessionResolver is an autogenerated mock type for the SessionResolver type
  29. type mockSessionResolver struct {
  30. mock.Mock
  31. }
  32. type mockSessionResolver_Expecter struct {
  33. mock *mock.Mock
  34. }
  35. func (_m *mockSessionResolver) EXPECT() *mockSessionResolver_Expecter {
  36. return &mockSessionResolver_Expecter{mock: &_m.Mock}
  37. }
  38. // GetSession provides a mock function for the type mockSessionResolver
  39. func (_mock *mockSessionResolver) GetSession(ctx context.Context, aimsid string) (*Session, error) {
  40. ret := _mock.Called(ctx, aimsid)
  41. if len(ret) == 0 {
  42. panic("no return value specified for GetSession")
  43. }
  44. var r0 *Session
  45. var r1 error
  46. if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*Session, error)); ok {
  47. return returnFunc(ctx, aimsid)
  48. }
  49. if returnFunc, ok := ret.Get(0).(func(context.Context, string) *Session); ok {
  50. r0 = returnFunc(ctx, aimsid)
  51. } else {
  52. if ret.Get(0) != nil {
  53. r0 = ret.Get(0).(*Session)
  54. }
  55. }
  56. if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
  57. r1 = returnFunc(ctx, aimsid)
  58. } else {
  59. r1 = ret.Error(1)
  60. }
  61. return r0, r1
  62. }
  63. // mockSessionResolver_GetSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSession'
  64. type mockSessionResolver_GetSession_Call struct {
  65. *mock.Call
  66. }
  67. // GetSession is a helper method to define mock.On call
  68. // - ctx context.Context
  69. // - aimsid string
  70. func (_e *mockSessionResolver_Expecter) GetSession(ctx any, aimsid any) *mockSessionResolver_GetSession_Call {
  71. return &mockSessionResolver_GetSession_Call{Call: _e.mock.On("GetSession", ctx, aimsid)}
  72. }
  73. func (_c *mockSessionResolver_GetSession_Call) Run(run func(ctx context.Context, aimsid string)) *mockSessionResolver_GetSession_Call {
  74. _c.Call.Run(func(args mock.Arguments) {
  75. var arg0 context.Context
  76. if args[0] != nil {
  77. arg0 = args[0].(context.Context)
  78. }
  79. var arg1 string
  80. if args[1] != nil {
  81. arg1 = args[1].(string)
  82. }
  83. run(
  84. arg0,
  85. arg1,
  86. )
  87. })
  88. return _c
  89. }
  90. func (_c *mockSessionResolver_GetSession_Call) Return(session *Session, err error) *mockSessionResolver_GetSession_Call {
  91. _c.Call.Return(session, err)
  92. return _c
  93. }
  94. func (_c *mockSessionResolver_GetSession_Call) RunAndReturn(run func(ctx context.Context, aimsid string) (*Session, error)) *mockSessionResolver_GetSession_Call {
  95. _c.Call.Return(run)
  96. return _c
  97. }
  98. // TouchSession provides a mock function for the type mockSessionResolver
  99. func (_mock *mockSessionResolver) TouchSession(ctx context.Context, aimsid string) error {
  100. ret := _mock.Called(ctx, aimsid)
  101. if len(ret) == 0 {
  102. panic("no return value specified for TouchSession")
  103. }
  104. var r0 error
  105. if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
  106. r0 = returnFunc(ctx, aimsid)
  107. } else {
  108. r0 = ret.Error(0)
  109. }
  110. return r0
  111. }
  112. // mockSessionResolver_TouchSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TouchSession'
  113. type mockSessionResolver_TouchSession_Call struct {
  114. *mock.Call
  115. }
  116. // TouchSession is a helper method to define mock.On call
  117. // - ctx context.Context
  118. // - aimsid string
  119. func (_e *mockSessionResolver_Expecter) TouchSession(ctx any, aimsid any) *mockSessionResolver_TouchSession_Call {
  120. return &mockSessionResolver_TouchSession_Call{Call: _e.mock.On("TouchSession", ctx, aimsid)}
  121. }
  122. func (_c *mockSessionResolver_TouchSession_Call) Run(run func(ctx context.Context, aimsid string)) *mockSessionResolver_TouchSession_Call {
  123. _c.Call.Run(func(args mock.Arguments) {
  124. var arg0 context.Context
  125. if args[0] != nil {
  126. arg0 = args[0].(context.Context)
  127. }
  128. var arg1 string
  129. if args[1] != nil {
  130. arg1 = args[1].(string)
  131. }
  132. run(
  133. arg0,
  134. arg1,
  135. )
  136. })
  137. return _c
  138. }
  139. func (_c *mockSessionResolver_TouchSession_Call) Return(err error) *mockSessionResolver_TouchSession_Call {
  140. _c.Call.Return(err)
  141. return _c
  142. }
  143. func (_c *mockSessionResolver_TouchSession_Call) RunAndReturn(run func(ctx context.Context, aimsid string) error) *mockSessionResolver_TouchSession_Call {
  144. _c.Call.Return(run)
  145. return _c
  146. }