github.com/0chain/gosdk@v1.17.11/zboxcore/mocks/HttpClient.go (about) 1 // Code generated by mockery v2.28.1. DO NOT EDIT. 2 3 package mocks 4 5 import ( 6 http "net/http" 7 8 mock "github.com/stretchr/testify/mock" 9 ) 10 11 // HttpClient is an autogenerated mock type for the HttpClient type 12 type HttpClient struct { 13 mock.Mock 14 } 15 16 // Do provides a mock function with given fields: req 17 func (_m *HttpClient) Do(req *http.Request) (*http.Response, error) { 18 ret := _m.Called(req) 19 20 var r0 *http.Response 21 var r1 error 22 if rf, ok := ret.Get(0).(func(*http.Request) (*http.Response, error)); ok { 23 return rf(req) 24 } 25 if rf, ok := ret.Get(0).(func(*http.Request) *http.Response); ok { 26 r0 = rf(req) 27 } else { 28 if ret.Get(0) != nil { 29 r0 = ret.Get(0).(*http.Response) 30 } 31 } 32 33 if rf, ok := ret.Get(1).(func(*http.Request) error); ok { 34 r1 = rf(req) 35 } else { 36 r1 = ret.Error(1) 37 } 38 39 return r0, r1 40 } 41 42 type mockConstructorTestingTNewHttpClient interface { 43 mock.TestingT 44 Cleanup(func()) 45 } 46 47 // NewHttpClient creates a new instance of HttpClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 48 func NewHttpClient(t mockConstructorTestingTNewHttpClient) *HttpClient { 49 mock := &HttpClient{} 50 mock.Mock.Test(t) 51 52 t.Cleanup(func() { mock.AssertExpectations(t) }) 53 54 return mock 55 }