github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/cf/net/netfakes/fake_http_client_interface.go (about) 1 // This file was generated by counterfeiter 2 package netfakes 3 4 import ( 5 _ "crypto/sha512" 6 "net/http" 7 "sync" 8 9 "code.cloudfoundry.org/cli/cf/net" 10 ) 11 12 type FakeHTTPClientInterface struct { 13 DumpRequestStub func(*http.Request) 14 dumpRequestMutex sync.RWMutex 15 dumpRequestArgsForCall []struct { 16 arg1 *http.Request 17 } 18 DumpResponseStub func(*http.Response) 19 dumpResponseMutex sync.RWMutex 20 dumpResponseArgsForCall []struct { 21 arg1 *http.Response 22 } 23 DoStub func(*http.Request) (*http.Response, error) 24 doMutex sync.RWMutex 25 doArgsForCall []struct { 26 arg1 *http.Request 27 } 28 doReturns struct { 29 result1 *http.Response 30 result2 error 31 } 32 ExecuteCheckRedirectStub func(req *http.Request, via []*http.Request) error 33 executeCheckRedirectMutex sync.RWMutex 34 executeCheckRedirectArgsForCall []struct { 35 req *http.Request 36 via []*http.Request 37 } 38 executeCheckRedirectReturns struct { 39 result1 error 40 } 41 } 42 43 func (fake *FakeHTTPClientInterface) DumpRequest(arg1 *http.Request) { 44 fake.dumpRequestMutex.Lock() 45 fake.dumpRequestArgsForCall = append(fake.dumpRequestArgsForCall, struct { 46 arg1 *http.Request 47 }{arg1}) 48 fake.dumpRequestMutex.Unlock() 49 if fake.DumpRequestStub != nil { 50 fake.DumpRequestStub(arg1) 51 } 52 } 53 54 func (fake *FakeHTTPClientInterface) DumpRequestCallCount() int { 55 fake.dumpRequestMutex.RLock() 56 defer fake.dumpRequestMutex.RUnlock() 57 return len(fake.dumpRequestArgsForCall) 58 } 59 60 func (fake *FakeHTTPClientInterface) DumpRequestArgsForCall(i int) *http.Request { 61 fake.dumpRequestMutex.RLock() 62 defer fake.dumpRequestMutex.RUnlock() 63 return fake.dumpRequestArgsForCall[i].arg1 64 } 65 66 func (fake *FakeHTTPClientInterface) DumpResponse(arg1 *http.Response) { 67 fake.dumpResponseMutex.Lock() 68 fake.dumpResponseArgsForCall = append(fake.dumpResponseArgsForCall, struct { 69 arg1 *http.Response 70 }{arg1}) 71 fake.dumpResponseMutex.Unlock() 72 if fake.DumpResponseStub != nil { 73 fake.DumpResponseStub(arg1) 74 } 75 } 76 77 func (fake *FakeHTTPClientInterface) DumpResponseCallCount() int { 78 fake.dumpResponseMutex.RLock() 79 defer fake.dumpResponseMutex.RUnlock() 80 return len(fake.dumpResponseArgsForCall) 81 } 82 83 func (fake *FakeHTTPClientInterface) DumpResponseArgsForCall(i int) *http.Response { 84 fake.dumpResponseMutex.RLock() 85 defer fake.dumpResponseMutex.RUnlock() 86 return fake.dumpResponseArgsForCall[i].arg1 87 } 88 89 func (fake *FakeHTTPClientInterface) Do(arg1 *http.Request) (*http.Response, error) { 90 fake.doMutex.Lock() 91 fake.doArgsForCall = append(fake.doArgsForCall, struct { 92 arg1 *http.Request 93 }{arg1}) 94 fake.doMutex.Unlock() 95 if fake.DoStub != nil { 96 return fake.DoStub(arg1) 97 } else { 98 return fake.doReturns.result1, fake.doReturns.result2 99 } 100 } 101 102 func (fake *FakeHTTPClientInterface) DoCallCount() int { 103 fake.doMutex.RLock() 104 defer fake.doMutex.RUnlock() 105 return len(fake.doArgsForCall) 106 } 107 108 func (fake *FakeHTTPClientInterface) DoArgsForCall(i int) *http.Request { 109 fake.doMutex.RLock() 110 defer fake.doMutex.RUnlock() 111 return fake.doArgsForCall[i].arg1 112 } 113 114 func (fake *FakeHTTPClientInterface) DoReturns(result1 *http.Response, result2 error) { 115 fake.DoStub = nil 116 fake.doReturns = struct { 117 result1 *http.Response 118 result2 error 119 }{result1, result2} 120 } 121 122 func (fake *FakeHTTPClientInterface) ExecuteCheckRedirect(req *http.Request, via []*http.Request) error { 123 fake.executeCheckRedirectMutex.Lock() 124 fake.executeCheckRedirectArgsForCall = append(fake.executeCheckRedirectArgsForCall, struct { 125 req *http.Request 126 via []*http.Request 127 }{req, via}) 128 fake.executeCheckRedirectMutex.Unlock() 129 if fake.ExecuteCheckRedirectStub != nil { 130 return fake.ExecuteCheckRedirectStub(req, via) 131 } else { 132 return fake.executeCheckRedirectReturns.result1 133 } 134 } 135 136 func (fake *FakeHTTPClientInterface) ExecuteCheckRedirectCallCount() int { 137 fake.executeCheckRedirectMutex.RLock() 138 defer fake.executeCheckRedirectMutex.RUnlock() 139 return len(fake.executeCheckRedirectArgsForCall) 140 } 141 142 func (fake *FakeHTTPClientInterface) ExecuteCheckRedirectArgsForCall(i int) (*http.Request, []*http.Request) { 143 fake.executeCheckRedirectMutex.RLock() 144 defer fake.executeCheckRedirectMutex.RUnlock() 145 return fake.executeCheckRedirectArgsForCall[i].req, fake.executeCheckRedirectArgsForCall[i].via 146 } 147 148 func (fake *FakeHTTPClientInterface) ExecuteCheckRedirectReturns(result1 error) { 149 fake.ExecuteCheckRedirectStub = nil 150 fake.executeCheckRedirectReturns = struct { 151 result1 error 152 }{result1} 153 } 154 155 var _ net.HTTPClientInterface = new(FakeHTTPClientInterface)