| 1 |
// Code generated by mockery; DO NOT EDIT. |
| 2 |
// github.com/vektra/mockery |
| 3 |
// template: testify |
| 4 |
|
| 5 |
package mocks |
| 6 |
|
| 7 |
import ( |
| 8 |
"net/http" |
| 9 |
|
| 10 |
mock "github.com/stretchr/testify/mock" |
| 11 |
) |
| 12 |
|
| 13 |
// NewMockHTTPClient creates a new instance of MockHTTPClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. |
| 14 |
// The first argument is typically a *testing.T value. |
| 15 |
func NewMockHTTPClient(t interface { |
| 16 |
mock.TestingT |
| 17 |
Cleanup(func()) |
| 18 |
}) *MockHTTPClient { |
| 19 |
mock := &MockHTTPClient{} |
| 20 |
mock.Mock.Test(t) |
| 21 |
|
| 22 |
t.Cleanup(func() { mock.AssertExpectations(t) }) |
| 23 |
|
| 24 |
return mock |
| 25 |
} |
| 26 |
|
| 27 |
// MockHTTPClient is an autogenerated mock type for the HTTPClient type |
| 28 |
type MockHTTPClient struct { |
| 29 |
mock.Mock |
| 30 |
} |
| 31 |
|
| 32 |
type MockHTTPClient_Expecter struct { |
| 33 |
mock *mock.Mock |
| 34 |
} |
| 35 |
|
| 36 |
func (_m *MockHTTPClient) EXPECT() *MockHTTPClient_Expecter { |
| 37 |
return &MockHTTPClient_Expecter{mock: &_m.Mock} |
| 38 |
} |
| 39 |
|
| 40 |
// Do provides a mock function for the type MockHTTPClient |
| 41 |
func (_mock *MockHTTPClient) Do(req *http.Request) (*http.Response, error) { |
| 42 |
ret := _mock.Called(req) |
| 43 |
|
| 44 |
if len(ret) == 0 { |
| 45 |
panic("no return value specified for Do") |
| 46 |
} |
| 47 |
|
| 48 |
var r0 *http.Response |
| 49 |
var r1 error |
| 50 |
if returnFunc, ok := ret.Get(0).(func(*http.Request) (*http.Response, error)); ok { |
| 51 |
return returnFunc(req) |
| 52 |
} |
| 53 |
if returnFunc, ok := ret.Get(0).(func(*http.Request) *http.Response); ok { |
| 54 |
r0 = returnFunc(req) |
| 55 |
} else { |
| 56 |
if ret.Get(0) != nil { |
| 57 |
r0 = ret.Get(0).(*http.Response) |
| 58 |
} |
| 59 |
} |
| 60 |
if returnFunc, ok := ret.Get(1).(func(*http.Request) error); ok { |
| 61 |
r1 = returnFunc(req) |
| 62 |
} else { |
| 63 |
r1 = ret.Error(1) |
| 64 |
} |
| 65 |
return r0, r1 |
| 66 |
} |
| 67 |
|
| 68 |
// MockHTTPClient_Do_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Do' |
| 69 |
type MockHTTPClient_Do_Call struct { |
| 70 |
*mock.Call |
| 71 |
} |
| 72 |
|
| 73 |
// Do is a helper method to define mock.On call |
| 74 |
// - req *http.Request |
| 75 |
func (_e *MockHTTPClient_Expecter) Do(req interface{}) *MockHTTPClient_Do_Call { |
| 76 |
return &MockHTTPClient_Do_Call{Call: _e.mock.On("Do", req)} |
| 77 |
} |
| 78 |
|
| 79 |
func (_c *MockHTTPClient_Do_Call) Run(run func(req *http.Request)) *MockHTTPClient_Do_Call { |
| 80 |
_c.Call.Run(func(args mock.Arguments) { |
| 81 |
var arg0 *http.Request |
| 82 |
if args[0] != nil { |
| 83 |
arg0 = args[0].(*http.Request) |
| 84 |
} |
| 85 |
run( |
| 86 |
arg0, |
| 87 |
) |
| 88 |
}) |
| 89 |
return _c |
| 90 |
} |
| 91 |
|
| 92 |
func (_c *MockHTTPClient_Do_Call) Return(response *http.Response, err error) *MockHTTPClient_Do_Call { |
| 93 |
_c.Call.Return(response, err) |
| 94 |
return _c |
| 95 |
} |
| 96 |
|
| 97 |
func (_c *MockHTTPClient_Do_Call) RunAndReturn(run func(req *http.Request) (*http.Response, error)) *MockHTTPClient_Do_Call { |
| 98 |
_c.Call.Return(run) |
| 99 |
return _c |
| 100 |
} |