github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/cf/commands/commandsfakes/fake_sshcode_getter.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package commandsfakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/cf/commandregistry" 8 "code.cloudfoundry.org/cli/cf/commands" 9 "code.cloudfoundry.org/cli/cf/flags" 10 "code.cloudfoundry.org/cli/cf/requirements" 11 ) 12 13 type FakeSSHCodeGetter struct { 14 ExecuteStub func(flags.FlagContext) error 15 executeMutex sync.RWMutex 16 executeArgsForCall []struct { 17 arg1 flags.FlagContext 18 } 19 executeReturns struct { 20 result1 error 21 } 22 executeReturnsOnCall map[int]struct { 23 result1 error 24 } 25 GetStub func() (string, error) 26 getMutex sync.RWMutex 27 getArgsForCall []struct { 28 } 29 getReturns struct { 30 result1 string 31 result2 error 32 } 33 getReturnsOnCall map[int]struct { 34 result1 string 35 result2 error 36 } 37 MetaDataStub func() commandregistry.CommandMetadata 38 metaDataMutex sync.RWMutex 39 metaDataArgsForCall []struct { 40 } 41 metaDataReturns struct { 42 result1 commandregistry.CommandMetadata 43 } 44 metaDataReturnsOnCall map[int]struct { 45 result1 commandregistry.CommandMetadata 46 } 47 RequirementsStub func(requirements.Factory, flags.FlagContext) ([]requirements.Requirement, error) 48 requirementsMutex sync.RWMutex 49 requirementsArgsForCall []struct { 50 arg1 requirements.Factory 51 arg2 flags.FlagContext 52 } 53 requirementsReturns struct { 54 result1 []requirements.Requirement 55 result2 error 56 } 57 requirementsReturnsOnCall map[int]struct { 58 result1 []requirements.Requirement 59 result2 error 60 } 61 SetDependencyStub func(commandregistry.Dependency, bool) commandregistry.Command 62 setDependencyMutex sync.RWMutex 63 setDependencyArgsForCall []struct { 64 arg1 commandregistry.Dependency 65 arg2 bool 66 } 67 setDependencyReturns struct { 68 result1 commandregistry.Command 69 } 70 setDependencyReturnsOnCall map[int]struct { 71 result1 commandregistry.Command 72 } 73 invocations map[string][][]interface{} 74 invocationsMutex sync.RWMutex 75 } 76 77 func (fake *FakeSSHCodeGetter) Execute(arg1 flags.FlagContext) error { 78 fake.executeMutex.Lock() 79 ret, specificReturn := fake.executeReturnsOnCall[len(fake.executeArgsForCall)] 80 fake.executeArgsForCall = append(fake.executeArgsForCall, struct { 81 arg1 flags.FlagContext 82 }{arg1}) 83 fake.recordInvocation("Execute", []interface{}{arg1}) 84 fake.executeMutex.Unlock() 85 if fake.ExecuteStub != nil { 86 return fake.ExecuteStub(arg1) 87 } 88 if specificReturn { 89 return ret.result1 90 } 91 fakeReturns := fake.executeReturns 92 return fakeReturns.result1 93 } 94 95 func (fake *FakeSSHCodeGetter) ExecuteCallCount() int { 96 fake.executeMutex.RLock() 97 defer fake.executeMutex.RUnlock() 98 return len(fake.executeArgsForCall) 99 } 100 101 func (fake *FakeSSHCodeGetter) ExecuteCalls(stub func(flags.FlagContext) error) { 102 fake.executeMutex.Lock() 103 defer fake.executeMutex.Unlock() 104 fake.ExecuteStub = stub 105 } 106 107 func (fake *FakeSSHCodeGetter) ExecuteArgsForCall(i int) flags.FlagContext { 108 fake.executeMutex.RLock() 109 defer fake.executeMutex.RUnlock() 110 argsForCall := fake.executeArgsForCall[i] 111 return argsForCall.arg1 112 } 113 114 func (fake *FakeSSHCodeGetter) ExecuteReturns(result1 error) { 115 fake.executeMutex.Lock() 116 defer fake.executeMutex.Unlock() 117 fake.ExecuteStub = nil 118 fake.executeReturns = struct { 119 result1 error 120 }{result1} 121 } 122 123 func (fake *FakeSSHCodeGetter) ExecuteReturnsOnCall(i int, result1 error) { 124 fake.executeMutex.Lock() 125 defer fake.executeMutex.Unlock() 126 fake.ExecuteStub = nil 127 if fake.executeReturnsOnCall == nil { 128 fake.executeReturnsOnCall = make(map[int]struct { 129 result1 error 130 }) 131 } 132 fake.executeReturnsOnCall[i] = struct { 133 result1 error 134 }{result1} 135 } 136 137 func (fake *FakeSSHCodeGetter) Get() (string, error) { 138 fake.getMutex.Lock() 139 ret, specificReturn := fake.getReturnsOnCall[len(fake.getArgsForCall)] 140 fake.getArgsForCall = append(fake.getArgsForCall, struct { 141 }{}) 142 fake.recordInvocation("Get", []interface{}{}) 143 fake.getMutex.Unlock() 144 if fake.GetStub != nil { 145 return fake.GetStub() 146 } 147 if specificReturn { 148 return ret.result1, ret.result2 149 } 150 fakeReturns := fake.getReturns 151 return fakeReturns.result1, fakeReturns.result2 152 } 153 154 func (fake *FakeSSHCodeGetter) GetCallCount() int { 155 fake.getMutex.RLock() 156 defer fake.getMutex.RUnlock() 157 return len(fake.getArgsForCall) 158 } 159 160 func (fake *FakeSSHCodeGetter) GetCalls(stub func() (string, error)) { 161 fake.getMutex.Lock() 162 defer fake.getMutex.Unlock() 163 fake.GetStub = stub 164 } 165 166 func (fake *FakeSSHCodeGetter) GetReturns(result1 string, result2 error) { 167 fake.getMutex.Lock() 168 defer fake.getMutex.Unlock() 169 fake.GetStub = nil 170 fake.getReturns = struct { 171 result1 string 172 result2 error 173 }{result1, result2} 174 } 175 176 func (fake *FakeSSHCodeGetter) GetReturnsOnCall(i int, result1 string, result2 error) { 177 fake.getMutex.Lock() 178 defer fake.getMutex.Unlock() 179 fake.GetStub = nil 180 if fake.getReturnsOnCall == nil { 181 fake.getReturnsOnCall = make(map[int]struct { 182 result1 string 183 result2 error 184 }) 185 } 186 fake.getReturnsOnCall[i] = struct { 187 result1 string 188 result2 error 189 }{result1, result2} 190 } 191 192 func (fake *FakeSSHCodeGetter) MetaData() commandregistry.CommandMetadata { 193 fake.metaDataMutex.Lock() 194 ret, specificReturn := fake.metaDataReturnsOnCall[len(fake.metaDataArgsForCall)] 195 fake.metaDataArgsForCall = append(fake.metaDataArgsForCall, struct { 196 }{}) 197 fake.recordInvocation("MetaData", []interface{}{}) 198 fake.metaDataMutex.Unlock() 199 if fake.MetaDataStub != nil { 200 return fake.MetaDataStub() 201 } 202 if specificReturn { 203 return ret.result1 204 } 205 fakeReturns := fake.metaDataReturns 206 return fakeReturns.result1 207 } 208 209 func (fake *FakeSSHCodeGetter) MetaDataCallCount() int { 210 fake.metaDataMutex.RLock() 211 defer fake.metaDataMutex.RUnlock() 212 return len(fake.metaDataArgsForCall) 213 } 214 215 func (fake *FakeSSHCodeGetter) MetaDataCalls(stub func() commandregistry.CommandMetadata) { 216 fake.metaDataMutex.Lock() 217 defer fake.metaDataMutex.Unlock() 218 fake.MetaDataStub = stub 219 } 220 221 func (fake *FakeSSHCodeGetter) MetaDataReturns(result1 commandregistry.CommandMetadata) { 222 fake.metaDataMutex.Lock() 223 defer fake.metaDataMutex.Unlock() 224 fake.MetaDataStub = nil 225 fake.metaDataReturns = struct { 226 result1 commandregistry.CommandMetadata 227 }{result1} 228 } 229 230 func (fake *FakeSSHCodeGetter) MetaDataReturnsOnCall(i int, result1 commandregistry.CommandMetadata) { 231 fake.metaDataMutex.Lock() 232 defer fake.metaDataMutex.Unlock() 233 fake.MetaDataStub = nil 234 if fake.metaDataReturnsOnCall == nil { 235 fake.metaDataReturnsOnCall = make(map[int]struct { 236 result1 commandregistry.CommandMetadata 237 }) 238 } 239 fake.metaDataReturnsOnCall[i] = struct { 240 result1 commandregistry.CommandMetadata 241 }{result1} 242 } 243 244 func (fake *FakeSSHCodeGetter) Requirements(arg1 requirements.Factory, arg2 flags.FlagContext) ([]requirements.Requirement, error) { 245 fake.requirementsMutex.Lock() 246 ret, specificReturn := fake.requirementsReturnsOnCall[len(fake.requirementsArgsForCall)] 247 fake.requirementsArgsForCall = append(fake.requirementsArgsForCall, struct { 248 arg1 requirements.Factory 249 arg2 flags.FlagContext 250 }{arg1, arg2}) 251 fake.recordInvocation("Requirements", []interface{}{arg1, arg2}) 252 fake.requirementsMutex.Unlock() 253 if fake.RequirementsStub != nil { 254 return fake.RequirementsStub(arg1, arg2) 255 } 256 if specificReturn { 257 return ret.result1, ret.result2 258 } 259 fakeReturns := fake.requirementsReturns 260 return fakeReturns.result1, fakeReturns.result2 261 } 262 263 func (fake *FakeSSHCodeGetter) RequirementsCallCount() int { 264 fake.requirementsMutex.RLock() 265 defer fake.requirementsMutex.RUnlock() 266 return len(fake.requirementsArgsForCall) 267 } 268 269 func (fake *FakeSSHCodeGetter) RequirementsCalls(stub func(requirements.Factory, flags.FlagContext) ([]requirements.Requirement, error)) { 270 fake.requirementsMutex.Lock() 271 defer fake.requirementsMutex.Unlock() 272 fake.RequirementsStub = stub 273 } 274 275 func (fake *FakeSSHCodeGetter) RequirementsArgsForCall(i int) (requirements.Factory, flags.FlagContext) { 276 fake.requirementsMutex.RLock() 277 defer fake.requirementsMutex.RUnlock() 278 argsForCall := fake.requirementsArgsForCall[i] 279 return argsForCall.arg1, argsForCall.arg2 280 } 281 282 func (fake *FakeSSHCodeGetter) RequirementsReturns(result1 []requirements.Requirement, result2 error) { 283 fake.requirementsMutex.Lock() 284 defer fake.requirementsMutex.Unlock() 285 fake.RequirementsStub = nil 286 fake.requirementsReturns = struct { 287 result1 []requirements.Requirement 288 result2 error 289 }{result1, result2} 290 } 291 292 func (fake *FakeSSHCodeGetter) RequirementsReturnsOnCall(i int, result1 []requirements.Requirement, result2 error) { 293 fake.requirementsMutex.Lock() 294 defer fake.requirementsMutex.Unlock() 295 fake.RequirementsStub = nil 296 if fake.requirementsReturnsOnCall == nil { 297 fake.requirementsReturnsOnCall = make(map[int]struct { 298 result1 []requirements.Requirement 299 result2 error 300 }) 301 } 302 fake.requirementsReturnsOnCall[i] = struct { 303 result1 []requirements.Requirement 304 result2 error 305 }{result1, result2} 306 } 307 308 func (fake *FakeSSHCodeGetter) SetDependency(arg1 commandregistry.Dependency, arg2 bool) commandregistry.Command { 309 fake.setDependencyMutex.Lock() 310 ret, specificReturn := fake.setDependencyReturnsOnCall[len(fake.setDependencyArgsForCall)] 311 fake.setDependencyArgsForCall = append(fake.setDependencyArgsForCall, struct { 312 arg1 commandregistry.Dependency 313 arg2 bool 314 }{arg1, arg2}) 315 fake.recordInvocation("SetDependency", []interface{}{arg1, arg2}) 316 fake.setDependencyMutex.Unlock() 317 if fake.SetDependencyStub != nil { 318 return fake.SetDependencyStub(arg1, arg2) 319 } 320 if specificReturn { 321 return ret.result1 322 } 323 fakeReturns := fake.setDependencyReturns 324 return fakeReturns.result1 325 } 326 327 func (fake *FakeSSHCodeGetter) SetDependencyCallCount() int { 328 fake.setDependencyMutex.RLock() 329 defer fake.setDependencyMutex.RUnlock() 330 return len(fake.setDependencyArgsForCall) 331 } 332 333 func (fake *FakeSSHCodeGetter) SetDependencyCalls(stub func(commandregistry.Dependency, bool) commandregistry.Command) { 334 fake.setDependencyMutex.Lock() 335 defer fake.setDependencyMutex.Unlock() 336 fake.SetDependencyStub = stub 337 } 338 339 func (fake *FakeSSHCodeGetter) SetDependencyArgsForCall(i int) (commandregistry.Dependency, bool) { 340 fake.setDependencyMutex.RLock() 341 defer fake.setDependencyMutex.RUnlock() 342 argsForCall := fake.setDependencyArgsForCall[i] 343 return argsForCall.arg1, argsForCall.arg2 344 } 345 346 func (fake *FakeSSHCodeGetter) SetDependencyReturns(result1 commandregistry.Command) { 347 fake.setDependencyMutex.Lock() 348 defer fake.setDependencyMutex.Unlock() 349 fake.SetDependencyStub = nil 350 fake.setDependencyReturns = struct { 351 result1 commandregistry.Command 352 }{result1} 353 } 354 355 func (fake *FakeSSHCodeGetter) SetDependencyReturnsOnCall(i int, result1 commandregistry.Command) { 356 fake.setDependencyMutex.Lock() 357 defer fake.setDependencyMutex.Unlock() 358 fake.SetDependencyStub = nil 359 if fake.setDependencyReturnsOnCall == nil { 360 fake.setDependencyReturnsOnCall = make(map[int]struct { 361 result1 commandregistry.Command 362 }) 363 } 364 fake.setDependencyReturnsOnCall[i] = struct { 365 result1 commandregistry.Command 366 }{result1} 367 } 368 369 func (fake *FakeSSHCodeGetter) Invocations() map[string][][]interface{} { 370 fake.invocationsMutex.RLock() 371 defer fake.invocationsMutex.RUnlock() 372 fake.executeMutex.RLock() 373 defer fake.executeMutex.RUnlock() 374 fake.getMutex.RLock() 375 defer fake.getMutex.RUnlock() 376 fake.metaDataMutex.RLock() 377 defer fake.metaDataMutex.RUnlock() 378 fake.requirementsMutex.RLock() 379 defer fake.requirementsMutex.RUnlock() 380 fake.setDependencyMutex.RLock() 381 defer fake.setDependencyMutex.RUnlock() 382 copiedInvocations := map[string][][]interface{}{} 383 for key, value := range fake.invocations { 384 copiedInvocations[key] = value 385 } 386 return copiedInvocations 387 } 388 389 func (fake *FakeSSHCodeGetter) recordInvocation(key string, args []interface{}) { 390 fake.invocationsMutex.Lock() 391 defer fake.invocationsMutex.Unlock() 392 if fake.invocations == nil { 393 fake.invocations = map[string][][]interface{}{} 394 } 395 if fake.invocations[key] == nil { 396 fake.invocations[key] = [][]interface{}{} 397 } 398 fake.invocations[key] = append(fake.invocations[key], args) 399 } 400 401 var _ commands.SSHCodeGetter = new(FakeSSHCodeGetter)