forked from cloudfoundry/bosh-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_adjustment.go
120 lines (106 loc) · 3.32 KB
/
fake_adjustment.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
// This file was generated by counterfeiter
package directorfakes
import (
"net/http"
"sync"
"github.com/cloudfoundry/bosh-cli/director"
)
type FakeAdjustment struct {
AdjustStub func(req *http.Request, retried bool) error
adjustMutex sync.RWMutex
adjustArgsForCall []struct {
req *http.Request
retried bool
}
adjustReturns struct {
result1 error
}
NeedsReadjustmentStub func(*http.Response) bool
needsReadjustmentMutex sync.RWMutex
needsReadjustmentArgsForCall []struct {
arg1 *http.Response
}
needsReadjustmentReturns struct {
result1 bool
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeAdjustment) Adjust(req *http.Request, retried bool) error {
fake.adjustMutex.Lock()
fake.adjustArgsForCall = append(fake.adjustArgsForCall, struct {
req *http.Request
retried bool
}{req, retried})
fake.recordInvocation("Adjust", []interface{}{req, retried})
fake.adjustMutex.Unlock()
if fake.AdjustStub != nil {
return fake.AdjustStub(req, retried)
}
return fake.adjustReturns.result1
}
func (fake *FakeAdjustment) AdjustCallCount() int {
fake.adjustMutex.RLock()
defer fake.adjustMutex.RUnlock()
return len(fake.adjustArgsForCall)
}
func (fake *FakeAdjustment) AdjustArgsForCall(i int) (*http.Request, bool) {
fake.adjustMutex.RLock()
defer fake.adjustMutex.RUnlock()
return fake.adjustArgsForCall[i].req, fake.adjustArgsForCall[i].retried
}
func (fake *FakeAdjustment) AdjustReturns(result1 error) {
fake.AdjustStub = nil
fake.adjustReturns = struct {
result1 error
}{result1}
}
func (fake *FakeAdjustment) NeedsReadjustment(arg1 *http.Response) bool {
fake.needsReadjustmentMutex.Lock()
fake.needsReadjustmentArgsForCall = append(fake.needsReadjustmentArgsForCall, struct {
arg1 *http.Response
}{arg1})
fake.recordInvocation("NeedsReadjustment", []interface{}{arg1})
fake.needsReadjustmentMutex.Unlock()
if fake.NeedsReadjustmentStub != nil {
return fake.NeedsReadjustmentStub(arg1)
}
return fake.needsReadjustmentReturns.result1
}
func (fake *FakeAdjustment) NeedsReadjustmentCallCount() int {
fake.needsReadjustmentMutex.RLock()
defer fake.needsReadjustmentMutex.RUnlock()
return len(fake.needsReadjustmentArgsForCall)
}
func (fake *FakeAdjustment) NeedsReadjustmentArgsForCall(i int) *http.Response {
fake.needsReadjustmentMutex.RLock()
defer fake.needsReadjustmentMutex.RUnlock()
return fake.needsReadjustmentArgsForCall[i].arg1
}
func (fake *FakeAdjustment) NeedsReadjustmentReturns(result1 bool) {
fake.NeedsReadjustmentStub = nil
fake.needsReadjustmentReturns = struct {
result1 bool
}{result1}
}
func (fake *FakeAdjustment) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.adjustMutex.RLock()
defer fake.adjustMutex.RUnlock()
fake.needsReadjustmentMutex.RLock()
defer fake.needsReadjustmentMutex.RUnlock()
return fake.invocations
}
func (fake *FakeAdjustment) recordInvocation(key string, args []interface{}) {
fake.invocationsMutex.Lock()
defer fake.invocationsMutex.Unlock()
if fake.invocations == nil {
fake.invocations = map[string][][]interface{}{}
}
if fake.invocations[key] == nil {
fake.invocations[key] = [][]interface{}{}
}
fake.invocations[key] = append(fake.invocations[key], args)
}
var _ director.Adjustment = new(FakeAdjustment)