forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_http_client_interface.go
56 lines (48 loc) · 1.27 KB
/
fake_http_client_interface.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// This file was generated by counterfeiter
package fakes
import (
"net/http"
"sync"
"github.com/cloudfoundry/cli/cf/net"
)
type FakeHttpClientInterface struct {
DoStub func(req *http.Request) (resp *http.Response, err error)
doMutex sync.RWMutex
doArgsForCall []struct {
req *http.Request
}
doReturns struct {
result1 *http.Response
result2 error
}
}
func (fake *FakeHttpClientInterface) Do(req *http.Request) (resp *http.Response, err error) {
fake.doMutex.Lock()
fake.doArgsForCall = append(fake.doArgsForCall, struct {
req *http.Request
}{req})
fake.doMutex.Unlock()
if fake.DoStub != nil {
return fake.DoStub(req)
} else {
return fake.doReturns.result1, fake.doReturns.result2
}
}
func (fake *FakeHttpClientInterface) DoCallCount() int {
fake.doMutex.RLock()
defer fake.doMutex.RUnlock()
return len(fake.doArgsForCall)
}
func (fake *FakeHttpClientInterface) DoArgsForCall(i int) *http.Request {
fake.doMutex.RLock()
defer fake.doMutex.RUnlock()
return fake.doArgsForCall[i].req
}
func (fake *FakeHttpClientInterface) DoReturns(result1 *http.Response, result2 error) {
fake.DoStub = nil
fake.doReturns = struct {
result1 *http.Response
result2 error
}{result1, result2}
}
var _ net.HttpClientInterface = new(FakeHttpClientInterface)