mock_webapi_session_resolver_test.go 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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. mock := &mockSessionResolver{}
  16. mock.Mock.Test(t)
  17. t.Cleanup(func() { mock.AssertExpectations(t) })
  18. return mock
  19. }
  20. // mockSessionResolver is an autogenerated mock type for the SessionResolver type
  21. type mockSessionResolver struct {
  22. mock.Mock
  23. }
  24. type mockSessionResolver_Expecter struct {
  25. mock *mock.Mock
  26. }
  27. func (_m *mockSessionResolver) EXPECT() *mockSessionResolver_Expecter {
  28. return &mockSessionResolver_Expecter{mock: &_m.Mock}
  29. }
  30. // GetSession provides a mock function for the type mockSessionResolver
  31. func (_mock *mockSessionResolver) GetSession(ctx context.Context, aimsid string) (*Session, error) {
  32. ret := _mock.Called(ctx, aimsid)
  33. if len(ret) == 0 {
  34. panic("no return value specified for GetSession")
  35. }
  36. var r0 *Session
  37. var r1 error
  38. if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*Session, error)); ok {
  39. return returnFunc(ctx, aimsid)
  40. }
  41. if returnFunc, ok := ret.Get(0).(func(context.Context, string) *Session); ok {
  42. r0 = returnFunc(ctx, aimsid)
  43. } else {
  44. if ret.Get(0) != nil {
  45. r0 = ret.Get(0).(*Session)
  46. }
  47. }
  48. if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
  49. r1 = returnFunc(ctx, aimsid)
  50. } else {
  51. r1 = ret.Error(1)
  52. }
  53. return r0, r1
  54. }
  55. // mockSessionResolver_GetSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSession'
  56. type mockSessionResolver_GetSession_Call struct {
  57. *mock.Call
  58. }
  59. // GetSession is a helper method to define mock.On call
  60. // - ctx context.Context
  61. // - aimsid string
  62. func (_e *mockSessionResolver_Expecter) GetSession(ctx interface{}, aimsid interface{}) *mockSessionResolver_GetSession_Call {
  63. return &mockSessionResolver_GetSession_Call{Call: _e.mock.On("GetSession", ctx, aimsid)}
  64. }
  65. func (_c *mockSessionResolver_GetSession_Call) Run(run func(ctx context.Context, aimsid string)) *mockSessionResolver_GetSession_Call {
  66. _c.Call.Run(func(args mock.Arguments) {
  67. var arg0 context.Context
  68. if args[0] != nil {
  69. arg0 = args[0].(context.Context)
  70. }
  71. var arg1 string
  72. if args[1] != nil {
  73. arg1 = args[1].(string)
  74. }
  75. run(
  76. arg0,
  77. arg1,
  78. )
  79. })
  80. return _c
  81. }
  82. func (_c *mockSessionResolver_GetSession_Call) Return(session *Session, err error) *mockSessionResolver_GetSession_Call {
  83. _c.Call.Return(session, err)
  84. return _c
  85. }
  86. func (_c *mockSessionResolver_GetSession_Call) RunAndReturn(run func(ctx context.Context, aimsid string) (*Session, error)) *mockSessionResolver_GetSession_Call {
  87. _c.Call.Return(run)
  88. return _c
  89. }
  90. // TouchSession provides a mock function for the type mockSessionResolver
  91. func (_mock *mockSessionResolver) TouchSession(ctx context.Context, aimsid string) error {
  92. ret := _mock.Called(ctx, aimsid)
  93. if len(ret) == 0 {
  94. panic("no return value specified for TouchSession")
  95. }
  96. var r0 error
  97. if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
  98. r0 = returnFunc(ctx, aimsid)
  99. } else {
  100. r0 = ret.Error(0)
  101. }
  102. return r0
  103. }
  104. // mockSessionResolver_TouchSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TouchSession'
  105. type mockSessionResolver_TouchSession_Call struct {
  106. *mock.Call
  107. }
  108. // TouchSession is a helper method to define mock.On call
  109. // - ctx context.Context
  110. // - aimsid string
  111. func (_e *mockSessionResolver_Expecter) TouchSession(ctx interface{}, aimsid interface{}) *mockSessionResolver_TouchSession_Call {
  112. return &mockSessionResolver_TouchSession_Call{Call: _e.mock.On("TouchSession", ctx, aimsid)}
  113. }
  114. func (_c *mockSessionResolver_TouchSession_Call) Run(run func(ctx context.Context, aimsid string)) *mockSessionResolver_TouchSession_Call {
  115. _c.Call.Run(func(args mock.Arguments) {
  116. var arg0 context.Context
  117. if args[0] != nil {
  118. arg0 = args[0].(context.Context)
  119. }
  120. var arg1 string
  121. if args[1] != nil {
  122. arg1 = args[1].(string)
  123. }
  124. run(
  125. arg0,
  126. arg1,
  127. )
  128. })
  129. return _c
  130. }
  131. func (_c *mockSessionResolver_TouchSession_Call) Return(err error) *mockSessionResolver_TouchSession_Call {
  132. _c.Call.Return(err)
  133. return _c
  134. }
  135. func (_c *mockSessionResolver_TouchSession_Call) RunAndReturn(run func(ctx context.Context, aimsid string) error) *mockSessionResolver_TouchSession_Call {
  136. _c.Call.Return(run)
  137. return _c
  138. }