github.com/dcarley/cf-cli@v6.24.1-0.20170220111324-4225ff346898+incompatible/actor/v2action/v2actionfakes/fake_config.go (about) 1 // This file was generated by counterfeiter 2 package v2actionfakes 3 4 import ( 5 "sync" 6 "time" 7 8 "code.cloudfoundry.org/cli/actor/v2action" 9 ) 10 11 type FakeConfig struct { 12 PollingIntervalStub func() time.Duration 13 pollingIntervalMutex sync.RWMutex 14 pollingIntervalArgsForCall []struct{} 15 pollingIntervalReturns struct { 16 result1 time.Duration 17 } 18 SetTargetInformationStub func(api string, apiVersion string, auth string, minCLIVersion string, doppler string, uaa string, routing string, skipSSLValidation bool) 19 setTargetInformationMutex sync.RWMutex 20 setTargetInformationArgsForCall []struct { 21 api string 22 apiVersion string 23 auth string 24 minCLIVersion string 25 doppler string 26 uaa string 27 routing string 28 skipSSLValidation bool 29 } 30 SetTokenInformationStub func(accessToken string, refreshToken string, sshOAuthClient string) 31 setTokenInformationMutex sync.RWMutex 32 setTokenInformationArgsForCall []struct { 33 accessToken string 34 refreshToken string 35 sshOAuthClient string 36 } 37 SkipSSLValidationStub func() bool 38 skipSSLValidationMutex sync.RWMutex 39 skipSSLValidationArgsForCall []struct{} 40 skipSSLValidationReturns struct { 41 result1 bool 42 } 43 StagingTimeoutStub func() time.Duration 44 stagingTimeoutMutex sync.RWMutex 45 stagingTimeoutArgsForCall []struct{} 46 stagingTimeoutReturns struct { 47 result1 time.Duration 48 } 49 StartupTimeoutStub func() time.Duration 50 startupTimeoutMutex sync.RWMutex 51 startupTimeoutArgsForCall []struct{} 52 startupTimeoutReturns struct { 53 result1 time.Duration 54 } 55 TargetStub func() string 56 targetMutex sync.RWMutex 57 targetArgsForCall []struct{} 58 targetReturns struct { 59 result1 string 60 } 61 UnsetOrganizationInformationStub func() 62 unsetOrganizationInformationMutex sync.RWMutex 63 unsetOrganizationInformationArgsForCall []struct{} 64 UnsetSpaceInformationStub func() 65 unsetSpaceInformationMutex sync.RWMutex 66 unsetSpaceInformationArgsForCall []struct{} 67 invocations map[string][][]interface{} 68 invocationsMutex sync.RWMutex 69 } 70 71 func (fake *FakeConfig) PollingInterval() time.Duration { 72 fake.pollingIntervalMutex.Lock() 73 fake.pollingIntervalArgsForCall = append(fake.pollingIntervalArgsForCall, struct{}{}) 74 fake.recordInvocation("PollingInterval", []interface{}{}) 75 fake.pollingIntervalMutex.Unlock() 76 if fake.PollingIntervalStub != nil { 77 return fake.PollingIntervalStub() 78 } else { 79 return fake.pollingIntervalReturns.result1 80 } 81 } 82 83 func (fake *FakeConfig) PollingIntervalCallCount() int { 84 fake.pollingIntervalMutex.RLock() 85 defer fake.pollingIntervalMutex.RUnlock() 86 return len(fake.pollingIntervalArgsForCall) 87 } 88 89 func (fake *FakeConfig) PollingIntervalReturns(result1 time.Duration) { 90 fake.PollingIntervalStub = nil 91 fake.pollingIntervalReturns = struct { 92 result1 time.Duration 93 }{result1} 94 } 95 96 func (fake *FakeConfig) SetTargetInformation(api string, apiVersion string, auth string, minCLIVersion string, doppler string, uaa string, routing string, skipSSLValidation bool) { 97 fake.setTargetInformationMutex.Lock() 98 fake.setTargetInformationArgsForCall = append(fake.setTargetInformationArgsForCall, struct { 99 api string 100 apiVersion string 101 auth string 102 minCLIVersion string 103 doppler string 104 uaa string 105 routing string 106 skipSSLValidation bool 107 }{api, apiVersion, auth, minCLIVersion, doppler, uaa, routing, skipSSLValidation}) 108 fake.recordInvocation("SetTargetInformation", []interface{}{api, apiVersion, auth, minCLIVersion, doppler, uaa, routing, skipSSLValidation}) 109 fake.setTargetInformationMutex.Unlock() 110 if fake.SetTargetInformationStub != nil { 111 fake.SetTargetInformationStub(api, apiVersion, auth, minCLIVersion, doppler, uaa, routing, skipSSLValidation) 112 } 113 } 114 115 func (fake *FakeConfig) SetTargetInformationCallCount() int { 116 fake.setTargetInformationMutex.RLock() 117 defer fake.setTargetInformationMutex.RUnlock() 118 return len(fake.setTargetInformationArgsForCall) 119 } 120 121 func (fake *FakeConfig) SetTargetInformationArgsForCall(i int) (string, string, string, string, string, string, string, bool) { 122 fake.setTargetInformationMutex.RLock() 123 defer fake.setTargetInformationMutex.RUnlock() 124 return fake.setTargetInformationArgsForCall[i].api, fake.setTargetInformationArgsForCall[i].apiVersion, fake.setTargetInformationArgsForCall[i].auth, fake.setTargetInformationArgsForCall[i].minCLIVersion, fake.setTargetInformationArgsForCall[i].doppler, fake.setTargetInformationArgsForCall[i].uaa, fake.setTargetInformationArgsForCall[i].routing, fake.setTargetInformationArgsForCall[i].skipSSLValidation 125 } 126 127 func (fake *FakeConfig) SetTokenInformation(accessToken string, refreshToken string, sshOAuthClient string) { 128 fake.setTokenInformationMutex.Lock() 129 fake.setTokenInformationArgsForCall = append(fake.setTokenInformationArgsForCall, struct { 130 accessToken string 131 refreshToken string 132 sshOAuthClient string 133 }{accessToken, refreshToken, sshOAuthClient}) 134 fake.recordInvocation("SetTokenInformation", []interface{}{accessToken, refreshToken, sshOAuthClient}) 135 fake.setTokenInformationMutex.Unlock() 136 if fake.SetTokenInformationStub != nil { 137 fake.SetTokenInformationStub(accessToken, refreshToken, sshOAuthClient) 138 } 139 } 140 141 func (fake *FakeConfig) SetTokenInformationCallCount() int { 142 fake.setTokenInformationMutex.RLock() 143 defer fake.setTokenInformationMutex.RUnlock() 144 return len(fake.setTokenInformationArgsForCall) 145 } 146 147 func (fake *FakeConfig) SetTokenInformationArgsForCall(i int) (string, string, string) { 148 fake.setTokenInformationMutex.RLock() 149 defer fake.setTokenInformationMutex.RUnlock() 150 return fake.setTokenInformationArgsForCall[i].accessToken, fake.setTokenInformationArgsForCall[i].refreshToken, fake.setTokenInformationArgsForCall[i].sshOAuthClient 151 } 152 153 func (fake *FakeConfig) SkipSSLValidation() bool { 154 fake.skipSSLValidationMutex.Lock() 155 fake.skipSSLValidationArgsForCall = append(fake.skipSSLValidationArgsForCall, struct{}{}) 156 fake.recordInvocation("SkipSSLValidation", []interface{}{}) 157 fake.skipSSLValidationMutex.Unlock() 158 if fake.SkipSSLValidationStub != nil { 159 return fake.SkipSSLValidationStub() 160 } else { 161 return fake.skipSSLValidationReturns.result1 162 } 163 } 164 165 func (fake *FakeConfig) SkipSSLValidationCallCount() int { 166 fake.skipSSLValidationMutex.RLock() 167 defer fake.skipSSLValidationMutex.RUnlock() 168 return len(fake.skipSSLValidationArgsForCall) 169 } 170 171 func (fake *FakeConfig) SkipSSLValidationReturns(result1 bool) { 172 fake.SkipSSLValidationStub = nil 173 fake.skipSSLValidationReturns = struct { 174 result1 bool 175 }{result1} 176 } 177 178 func (fake *FakeConfig) StagingTimeout() time.Duration { 179 fake.stagingTimeoutMutex.Lock() 180 fake.stagingTimeoutArgsForCall = append(fake.stagingTimeoutArgsForCall, struct{}{}) 181 fake.recordInvocation("StagingTimeout", []interface{}{}) 182 fake.stagingTimeoutMutex.Unlock() 183 if fake.StagingTimeoutStub != nil { 184 return fake.StagingTimeoutStub() 185 } else { 186 return fake.stagingTimeoutReturns.result1 187 } 188 } 189 190 func (fake *FakeConfig) StagingTimeoutCallCount() int { 191 fake.stagingTimeoutMutex.RLock() 192 defer fake.stagingTimeoutMutex.RUnlock() 193 return len(fake.stagingTimeoutArgsForCall) 194 } 195 196 func (fake *FakeConfig) StagingTimeoutReturns(result1 time.Duration) { 197 fake.StagingTimeoutStub = nil 198 fake.stagingTimeoutReturns = struct { 199 result1 time.Duration 200 }{result1} 201 } 202 203 func (fake *FakeConfig) StartupTimeout() time.Duration { 204 fake.startupTimeoutMutex.Lock() 205 fake.startupTimeoutArgsForCall = append(fake.startupTimeoutArgsForCall, struct{}{}) 206 fake.recordInvocation("StartupTimeout", []interface{}{}) 207 fake.startupTimeoutMutex.Unlock() 208 if fake.StartupTimeoutStub != nil { 209 return fake.StartupTimeoutStub() 210 } else { 211 return fake.startupTimeoutReturns.result1 212 } 213 } 214 215 func (fake *FakeConfig) StartupTimeoutCallCount() int { 216 fake.startupTimeoutMutex.RLock() 217 defer fake.startupTimeoutMutex.RUnlock() 218 return len(fake.startupTimeoutArgsForCall) 219 } 220 221 func (fake *FakeConfig) StartupTimeoutReturns(result1 time.Duration) { 222 fake.StartupTimeoutStub = nil 223 fake.startupTimeoutReturns = struct { 224 result1 time.Duration 225 }{result1} 226 } 227 228 func (fake *FakeConfig) Target() string { 229 fake.targetMutex.Lock() 230 fake.targetArgsForCall = append(fake.targetArgsForCall, struct{}{}) 231 fake.recordInvocation("Target", []interface{}{}) 232 fake.targetMutex.Unlock() 233 if fake.TargetStub != nil { 234 return fake.TargetStub() 235 } else { 236 return fake.targetReturns.result1 237 } 238 } 239 240 func (fake *FakeConfig) TargetCallCount() int { 241 fake.targetMutex.RLock() 242 defer fake.targetMutex.RUnlock() 243 return len(fake.targetArgsForCall) 244 } 245 246 func (fake *FakeConfig) TargetReturns(result1 string) { 247 fake.TargetStub = nil 248 fake.targetReturns = struct { 249 result1 string 250 }{result1} 251 } 252 253 func (fake *FakeConfig) UnsetOrganizationInformation() { 254 fake.unsetOrganizationInformationMutex.Lock() 255 fake.unsetOrganizationInformationArgsForCall = append(fake.unsetOrganizationInformationArgsForCall, struct{}{}) 256 fake.recordInvocation("UnsetOrganizationInformation", []interface{}{}) 257 fake.unsetOrganizationInformationMutex.Unlock() 258 if fake.UnsetOrganizationInformationStub != nil { 259 fake.UnsetOrganizationInformationStub() 260 } 261 } 262 263 func (fake *FakeConfig) UnsetOrganizationInformationCallCount() int { 264 fake.unsetOrganizationInformationMutex.RLock() 265 defer fake.unsetOrganizationInformationMutex.RUnlock() 266 return len(fake.unsetOrganizationInformationArgsForCall) 267 } 268 269 func (fake *FakeConfig) UnsetSpaceInformation() { 270 fake.unsetSpaceInformationMutex.Lock() 271 fake.unsetSpaceInformationArgsForCall = append(fake.unsetSpaceInformationArgsForCall, struct{}{}) 272 fake.recordInvocation("UnsetSpaceInformation", []interface{}{}) 273 fake.unsetSpaceInformationMutex.Unlock() 274 if fake.UnsetSpaceInformationStub != nil { 275 fake.UnsetSpaceInformationStub() 276 } 277 } 278 279 func (fake *FakeConfig) UnsetSpaceInformationCallCount() int { 280 fake.unsetSpaceInformationMutex.RLock() 281 defer fake.unsetSpaceInformationMutex.RUnlock() 282 return len(fake.unsetSpaceInformationArgsForCall) 283 } 284 285 func (fake *FakeConfig) Invocations() map[string][][]interface{} { 286 fake.invocationsMutex.RLock() 287 defer fake.invocationsMutex.RUnlock() 288 fake.pollingIntervalMutex.RLock() 289 defer fake.pollingIntervalMutex.RUnlock() 290 fake.setTargetInformationMutex.RLock() 291 defer fake.setTargetInformationMutex.RUnlock() 292 fake.setTokenInformationMutex.RLock() 293 defer fake.setTokenInformationMutex.RUnlock() 294 fake.skipSSLValidationMutex.RLock() 295 defer fake.skipSSLValidationMutex.RUnlock() 296 fake.stagingTimeoutMutex.RLock() 297 defer fake.stagingTimeoutMutex.RUnlock() 298 fake.startupTimeoutMutex.RLock() 299 defer fake.startupTimeoutMutex.RUnlock() 300 fake.targetMutex.RLock() 301 defer fake.targetMutex.RUnlock() 302 fake.unsetOrganizationInformationMutex.RLock() 303 defer fake.unsetOrganizationInformationMutex.RUnlock() 304 fake.unsetSpaceInformationMutex.RLock() 305 defer fake.unsetSpaceInformationMutex.RUnlock() 306 return fake.invocations 307 } 308 309 func (fake *FakeConfig) recordInvocation(key string, args []interface{}) { 310 fake.invocationsMutex.Lock() 311 defer fake.invocationsMutex.Unlock() 312 if fake.invocations == nil { 313 fake.invocations = map[string][][]interface{}{} 314 } 315 if fake.invocations[key] == nil { 316 fake.invocations[key] = [][]interface{}{} 317 } 318 fake.invocations[key] = append(fake.invocations[key], args) 319 } 320 321 var _ v2action.Config = new(FakeConfig)