forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_config.go
191 lines (173 loc) · 5.55 KB
/
fake_config.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
// Code generated by counterfeiter. DO NOT EDIT.
package v3actionfakes
import (
"sync"
"time"
"code.cloudfoundry.org/cli/actor/v3action"
)
type FakeConfig struct {
PollingIntervalStub func() time.Duration
pollingIntervalMutex sync.RWMutex
pollingIntervalArgsForCall []struct{}
pollingIntervalReturns struct {
result1 time.Duration
}
pollingIntervalReturnsOnCall map[int]struct {
result1 time.Duration
}
StartupTimeoutStub func() time.Duration
startupTimeoutMutex sync.RWMutex
startupTimeoutArgsForCall []struct{}
startupTimeoutReturns struct {
result1 time.Duration
}
startupTimeoutReturnsOnCall map[int]struct {
result1 time.Duration
}
StagingTimeoutStub func() time.Duration
stagingTimeoutMutex sync.RWMutex
stagingTimeoutArgsForCall []struct{}
stagingTimeoutReturns struct {
result1 time.Duration
}
stagingTimeoutReturnsOnCall map[int]struct {
result1 time.Duration
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeConfig) PollingInterval() time.Duration {
fake.pollingIntervalMutex.Lock()
ret, specificReturn := fake.pollingIntervalReturnsOnCall[len(fake.pollingIntervalArgsForCall)]
fake.pollingIntervalArgsForCall = append(fake.pollingIntervalArgsForCall, struct{}{})
fake.recordInvocation("PollingInterval", []interface{}{})
fake.pollingIntervalMutex.Unlock()
if fake.PollingIntervalStub != nil {
return fake.PollingIntervalStub()
}
if specificReturn {
return ret.result1
}
return fake.pollingIntervalReturns.result1
}
func (fake *FakeConfig) PollingIntervalCallCount() int {
fake.pollingIntervalMutex.RLock()
defer fake.pollingIntervalMutex.RUnlock()
return len(fake.pollingIntervalArgsForCall)
}
func (fake *FakeConfig) PollingIntervalReturns(result1 time.Duration) {
fake.PollingIntervalStub = nil
fake.pollingIntervalReturns = struct {
result1 time.Duration
}{result1}
}
func (fake *FakeConfig) PollingIntervalReturnsOnCall(i int, result1 time.Duration) {
fake.PollingIntervalStub = nil
if fake.pollingIntervalReturnsOnCall == nil {
fake.pollingIntervalReturnsOnCall = make(map[int]struct {
result1 time.Duration
})
}
fake.pollingIntervalReturnsOnCall[i] = struct {
result1 time.Duration
}{result1}
}
func (fake *FakeConfig) StartupTimeout() time.Duration {
fake.startupTimeoutMutex.Lock()
ret, specificReturn := fake.startupTimeoutReturnsOnCall[len(fake.startupTimeoutArgsForCall)]
fake.startupTimeoutArgsForCall = append(fake.startupTimeoutArgsForCall, struct{}{})
fake.recordInvocation("StartupTimeout", []interface{}{})
fake.startupTimeoutMutex.Unlock()
if fake.StartupTimeoutStub != nil {
return fake.StartupTimeoutStub()
}
if specificReturn {
return ret.result1
}
return fake.startupTimeoutReturns.result1
}
func (fake *FakeConfig) StartupTimeoutCallCount() int {
fake.startupTimeoutMutex.RLock()
defer fake.startupTimeoutMutex.RUnlock()
return len(fake.startupTimeoutArgsForCall)
}
func (fake *FakeConfig) StartupTimeoutReturns(result1 time.Duration) {
fake.StartupTimeoutStub = nil
fake.startupTimeoutReturns = struct {
result1 time.Duration
}{result1}
}
func (fake *FakeConfig) StartupTimeoutReturnsOnCall(i int, result1 time.Duration) {
fake.StartupTimeoutStub = nil
if fake.startupTimeoutReturnsOnCall == nil {
fake.startupTimeoutReturnsOnCall = make(map[int]struct {
result1 time.Duration
})
}
fake.startupTimeoutReturnsOnCall[i] = struct {
result1 time.Duration
}{result1}
}
func (fake *FakeConfig) StagingTimeout() time.Duration {
fake.stagingTimeoutMutex.Lock()
ret, specificReturn := fake.stagingTimeoutReturnsOnCall[len(fake.stagingTimeoutArgsForCall)]
fake.stagingTimeoutArgsForCall = append(fake.stagingTimeoutArgsForCall, struct{}{})
fake.recordInvocation("StagingTimeout", []interface{}{})
fake.stagingTimeoutMutex.Unlock()
if fake.StagingTimeoutStub != nil {
return fake.StagingTimeoutStub()
}
if specificReturn {
return ret.result1
}
return fake.stagingTimeoutReturns.result1
}
func (fake *FakeConfig) StagingTimeoutCallCount() int {
fake.stagingTimeoutMutex.RLock()
defer fake.stagingTimeoutMutex.RUnlock()
return len(fake.stagingTimeoutArgsForCall)
}
func (fake *FakeConfig) StagingTimeoutReturns(result1 time.Duration) {
fake.StagingTimeoutStub = nil
fake.stagingTimeoutReturns = struct {
result1 time.Duration
}{result1}
}
func (fake *FakeConfig) StagingTimeoutReturnsOnCall(i int, result1 time.Duration) {
fake.StagingTimeoutStub = nil
if fake.stagingTimeoutReturnsOnCall == nil {
fake.stagingTimeoutReturnsOnCall = make(map[int]struct {
result1 time.Duration
})
}
fake.stagingTimeoutReturnsOnCall[i] = struct {
result1 time.Duration
}{result1}
}
func (fake *FakeConfig) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.pollingIntervalMutex.RLock()
defer fake.pollingIntervalMutex.RUnlock()
fake.startupTimeoutMutex.RLock()
defer fake.startupTimeoutMutex.RUnlock()
fake.stagingTimeoutMutex.RLock()
defer fake.stagingTimeoutMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeConfig) 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 _ v3action.Config = new(FakeConfig)