github.com/arunkumar7540/cli@v6.45.0+incompatible/command/v7/v7fakes/fake_manifest_parser.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package v7fakes 3 4 import ( 5 "sync" 6 7 v7 "code.cloudfoundry.org/cli/command/v7" 8 "code.cloudfoundry.org/cli/util/manifestparser" 9 "github.com/cloudfoundry/bosh-cli/director/template" 10 ) 11 12 type FakeManifestParser struct { 13 AppsStub func(string) ([]manifestparser.Application, error) 14 appsMutex sync.RWMutex 15 appsArgsForCall []struct { 16 arg1 string 17 } 18 appsReturns struct { 19 result1 []manifestparser.Application 20 result2 error 21 } 22 appsReturnsOnCall map[int]struct { 23 result1 []manifestparser.Application 24 result2 error 25 } 26 ContainsManifestStub func() bool 27 containsManifestMutex sync.RWMutex 28 containsManifestArgsForCall []struct { 29 } 30 containsManifestReturns struct { 31 result1 bool 32 } 33 containsManifestReturnsOnCall map[int]struct { 34 result1 bool 35 } 36 ContainsMultipleAppsStub func() bool 37 containsMultipleAppsMutex sync.RWMutex 38 containsMultipleAppsArgsForCall []struct { 39 } 40 containsMultipleAppsReturns struct { 41 result1 bool 42 } 43 containsMultipleAppsReturnsOnCall map[int]struct { 44 result1 bool 45 } 46 ContainsPrivateDockerImagesStub func() bool 47 containsPrivateDockerImagesMutex sync.RWMutex 48 containsPrivateDockerImagesArgsForCall []struct { 49 } 50 containsPrivateDockerImagesReturns struct { 51 result1 bool 52 } 53 containsPrivateDockerImagesReturnsOnCall map[int]struct { 54 result1 bool 55 } 56 FullRawManifestStub func() []byte 57 fullRawManifestMutex sync.RWMutex 58 fullRawManifestArgsForCall []struct { 59 } 60 fullRawManifestReturns struct { 61 result1 []byte 62 } 63 fullRawManifestReturnsOnCall map[int]struct { 64 result1 []byte 65 } 66 InterpolateAndParseStub func(string, []string, []template.VarKV) error 67 interpolateAndParseMutex sync.RWMutex 68 interpolateAndParseArgsForCall []struct { 69 arg1 string 70 arg2 []string 71 arg3 []template.VarKV 72 } 73 interpolateAndParseReturns struct { 74 result1 error 75 } 76 interpolateAndParseReturnsOnCall map[int]struct { 77 result1 error 78 } 79 RawAppManifestStub func(string) ([]byte, error) 80 rawAppManifestMutex sync.RWMutex 81 rawAppManifestArgsForCall []struct { 82 arg1 string 83 } 84 rawAppManifestReturns struct { 85 result1 []byte 86 result2 error 87 } 88 rawAppManifestReturnsOnCall map[int]struct { 89 result1 []byte 90 result2 error 91 } 92 invocations map[string][][]interface{} 93 invocationsMutex sync.RWMutex 94 } 95 96 func (fake *FakeManifestParser) Apps(arg1 string) ([]manifestparser.Application, error) { 97 fake.appsMutex.Lock() 98 ret, specificReturn := fake.appsReturnsOnCall[len(fake.appsArgsForCall)] 99 fake.appsArgsForCall = append(fake.appsArgsForCall, struct { 100 arg1 string 101 }{arg1}) 102 fake.recordInvocation("Apps", []interface{}{arg1}) 103 fake.appsMutex.Unlock() 104 if fake.AppsStub != nil { 105 return fake.AppsStub(arg1) 106 } 107 if specificReturn { 108 return ret.result1, ret.result2 109 } 110 fakeReturns := fake.appsReturns 111 return fakeReturns.result1, fakeReturns.result2 112 } 113 114 func (fake *FakeManifestParser) AppsCallCount() int { 115 fake.appsMutex.RLock() 116 defer fake.appsMutex.RUnlock() 117 return len(fake.appsArgsForCall) 118 } 119 120 func (fake *FakeManifestParser) AppsCalls(stub func(string) ([]manifestparser.Application, error)) { 121 fake.appsMutex.Lock() 122 defer fake.appsMutex.Unlock() 123 fake.AppsStub = stub 124 } 125 126 func (fake *FakeManifestParser) AppsArgsForCall(i int) string { 127 fake.appsMutex.RLock() 128 defer fake.appsMutex.RUnlock() 129 argsForCall := fake.appsArgsForCall[i] 130 return argsForCall.arg1 131 } 132 133 func (fake *FakeManifestParser) AppsReturns(result1 []manifestparser.Application, result2 error) { 134 fake.appsMutex.Lock() 135 defer fake.appsMutex.Unlock() 136 fake.AppsStub = nil 137 fake.appsReturns = struct { 138 result1 []manifestparser.Application 139 result2 error 140 }{result1, result2} 141 } 142 143 func (fake *FakeManifestParser) AppsReturnsOnCall(i int, result1 []manifestparser.Application, result2 error) { 144 fake.appsMutex.Lock() 145 defer fake.appsMutex.Unlock() 146 fake.AppsStub = nil 147 if fake.appsReturnsOnCall == nil { 148 fake.appsReturnsOnCall = make(map[int]struct { 149 result1 []manifestparser.Application 150 result2 error 151 }) 152 } 153 fake.appsReturnsOnCall[i] = struct { 154 result1 []manifestparser.Application 155 result2 error 156 }{result1, result2} 157 } 158 159 func (fake *FakeManifestParser) ContainsManifest() bool { 160 fake.containsManifestMutex.Lock() 161 ret, specificReturn := fake.containsManifestReturnsOnCall[len(fake.containsManifestArgsForCall)] 162 fake.containsManifestArgsForCall = append(fake.containsManifestArgsForCall, struct { 163 }{}) 164 fake.recordInvocation("ContainsManifest", []interface{}{}) 165 fake.containsManifestMutex.Unlock() 166 if fake.ContainsManifestStub != nil { 167 return fake.ContainsManifestStub() 168 } 169 if specificReturn { 170 return ret.result1 171 } 172 fakeReturns := fake.containsManifestReturns 173 return fakeReturns.result1 174 } 175 176 func (fake *FakeManifestParser) ContainsManifestCallCount() int { 177 fake.containsManifestMutex.RLock() 178 defer fake.containsManifestMutex.RUnlock() 179 return len(fake.containsManifestArgsForCall) 180 } 181 182 func (fake *FakeManifestParser) ContainsManifestCalls(stub func() bool) { 183 fake.containsManifestMutex.Lock() 184 defer fake.containsManifestMutex.Unlock() 185 fake.ContainsManifestStub = stub 186 } 187 188 func (fake *FakeManifestParser) ContainsManifestReturns(result1 bool) { 189 fake.containsManifestMutex.Lock() 190 defer fake.containsManifestMutex.Unlock() 191 fake.ContainsManifestStub = nil 192 fake.containsManifestReturns = struct { 193 result1 bool 194 }{result1} 195 } 196 197 func (fake *FakeManifestParser) ContainsManifestReturnsOnCall(i int, result1 bool) { 198 fake.containsManifestMutex.Lock() 199 defer fake.containsManifestMutex.Unlock() 200 fake.ContainsManifestStub = nil 201 if fake.containsManifestReturnsOnCall == nil { 202 fake.containsManifestReturnsOnCall = make(map[int]struct { 203 result1 bool 204 }) 205 } 206 fake.containsManifestReturnsOnCall[i] = struct { 207 result1 bool 208 }{result1} 209 } 210 211 func (fake *FakeManifestParser) ContainsMultipleApps() bool { 212 fake.containsMultipleAppsMutex.Lock() 213 ret, specificReturn := fake.containsMultipleAppsReturnsOnCall[len(fake.containsMultipleAppsArgsForCall)] 214 fake.containsMultipleAppsArgsForCall = append(fake.containsMultipleAppsArgsForCall, struct { 215 }{}) 216 fake.recordInvocation("ContainsMultipleApps", []interface{}{}) 217 fake.containsMultipleAppsMutex.Unlock() 218 if fake.ContainsMultipleAppsStub != nil { 219 return fake.ContainsMultipleAppsStub() 220 } 221 if specificReturn { 222 return ret.result1 223 } 224 fakeReturns := fake.containsMultipleAppsReturns 225 return fakeReturns.result1 226 } 227 228 func (fake *FakeManifestParser) ContainsMultipleAppsCallCount() int { 229 fake.containsMultipleAppsMutex.RLock() 230 defer fake.containsMultipleAppsMutex.RUnlock() 231 return len(fake.containsMultipleAppsArgsForCall) 232 } 233 234 func (fake *FakeManifestParser) ContainsMultipleAppsCalls(stub func() bool) { 235 fake.containsMultipleAppsMutex.Lock() 236 defer fake.containsMultipleAppsMutex.Unlock() 237 fake.ContainsMultipleAppsStub = stub 238 } 239 240 func (fake *FakeManifestParser) ContainsMultipleAppsReturns(result1 bool) { 241 fake.containsMultipleAppsMutex.Lock() 242 defer fake.containsMultipleAppsMutex.Unlock() 243 fake.ContainsMultipleAppsStub = nil 244 fake.containsMultipleAppsReturns = struct { 245 result1 bool 246 }{result1} 247 } 248 249 func (fake *FakeManifestParser) ContainsMultipleAppsReturnsOnCall(i int, result1 bool) { 250 fake.containsMultipleAppsMutex.Lock() 251 defer fake.containsMultipleAppsMutex.Unlock() 252 fake.ContainsMultipleAppsStub = nil 253 if fake.containsMultipleAppsReturnsOnCall == nil { 254 fake.containsMultipleAppsReturnsOnCall = make(map[int]struct { 255 result1 bool 256 }) 257 } 258 fake.containsMultipleAppsReturnsOnCall[i] = struct { 259 result1 bool 260 }{result1} 261 } 262 263 func (fake *FakeManifestParser) ContainsPrivateDockerImages() bool { 264 fake.containsPrivateDockerImagesMutex.Lock() 265 ret, specificReturn := fake.containsPrivateDockerImagesReturnsOnCall[len(fake.containsPrivateDockerImagesArgsForCall)] 266 fake.containsPrivateDockerImagesArgsForCall = append(fake.containsPrivateDockerImagesArgsForCall, struct { 267 }{}) 268 fake.recordInvocation("ContainsPrivateDockerImages", []interface{}{}) 269 fake.containsPrivateDockerImagesMutex.Unlock() 270 if fake.ContainsPrivateDockerImagesStub != nil { 271 return fake.ContainsPrivateDockerImagesStub() 272 } 273 if specificReturn { 274 return ret.result1 275 } 276 fakeReturns := fake.containsPrivateDockerImagesReturns 277 return fakeReturns.result1 278 } 279 280 func (fake *FakeManifestParser) ContainsPrivateDockerImagesCallCount() int { 281 fake.containsPrivateDockerImagesMutex.RLock() 282 defer fake.containsPrivateDockerImagesMutex.RUnlock() 283 return len(fake.containsPrivateDockerImagesArgsForCall) 284 } 285 286 func (fake *FakeManifestParser) ContainsPrivateDockerImagesCalls(stub func() bool) { 287 fake.containsPrivateDockerImagesMutex.Lock() 288 defer fake.containsPrivateDockerImagesMutex.Unlock() 289 fake.ContainsPrivateDockerImagesStub = stub 290 } 291 292 func (fake *FakeManifestParser) ContainsPrivateDockerImagesReturns(result1 bool) { 293 fake.containsPrivateDockerImagesMutex.Lock() 294 defer fake.containsPrivateDockerImagesMutex.Unlock() 295 fake.ContainsPrivateDockerImagesStub = nil 296 fake.containsPrivateDockerImagesReturns = struct { 297 result1 bool 298 }{result1} 299 } 300 301 func (fake *FakeManifestParser) ContainsPrivateDockerImagesReturnsOnCall(i int, result1 bool) { 302 fake.containsPrivateDockerImagesMutex.Lock() 303 defer fake.containsPrivateDockerImagesMutex.Unlock() 304 fake.ContainsPrivateDockerImagesStub = nil 305 if fake.containsPrivateDockerImagesReturnsOnCall == nil { 306 fake.containsPrivateDockerImagesReturnsOnCall = make(map[int]struct { 307 result1 bool 308 }) 309 } 310 fake.containsPrivateDockerImagesReturnsOnCall[i] = struct { 311 result1 bool 312 }{result1} 313 } 314 315 func (fake *FakeManifestParser) FullRawManifest() []byte { 316 fake.fullRawManifestMutex.Lock() 317 ret, specificReturn := fake.fullRawManifestReturnsOnCall[len(fake.fullRawManifestArgsForCall)] 318 fake.fullRawManifestArgsForCall = append(fake.fullRawManifestArgsForCall, struct { 319 }{}) 320 fake.recordInvocation("FullRawManifest", []interface{}{}) 321 fake.fullRawManifestMutex.Unlock() 322 if fake.FullRawManifestStub != nil { 323 return fake.FullRawManifestStub() 324 } 325 if specificReturn { 326 return ret.result1 327 } 328 fakeReturns := fake.fullRawManifestReturns 329 return fakeReturns.result1 330 } 331 332 func (fake *FakeManifestParser) FullRawManifestCallCount() int { 333 fake.fullRawManifestMutex.RLock() 334 defer fake.fullRawManifestMutex.RUnlock() 335 return len(fake.fullRawManifestArgsForCall) 336 } 337 338 func (fake *FakeManifestParser) FullRawManifestCalls(stub func() []byte) { 339 fake.fullRawManifestMutex.Lock() 340 defer fake.fullRawManifestMutex.Unlock() 341 fake.FullRawManifestStub = stub 342 } 343 344 func (fake *FakeManifestParser) FullRawManifestReturns(result1 []byte) { 345 fake.fullRawManifestMutex.Lock() 346 defer fake.fullRawManifestMutex.Unlock() 347 fake.FullRawManifestStub = nil 348 fake.fullRawManifestReturns = struct { 349 result1 []byte 350 }{result1} 351 } 352 353 func (fake *FakeManifestParser) FullRawManifestReturnsOnCall(i int, result1 []byte) { 354 fake.fullRawManifestMutex.Lock() 355 defer fake.fullRawManifestMutex.Unlock() 356 fake.FullRawManifestStub = nil 357 if fake.fullRawManifestReturnsOnCall == nil { 358 fake.fullRawManifestReturnsOnCall = make(map[int]struct { 359 result1 []byte 360 }) 361 } 362 fake.fullRawManifestReturnsOnCall[i] = struct { 363 result1 []byte 364 }{result1} 365 } 366 367 func (fake *FakeManifestParser) InterpolateAndParse(arg1 string, arg2 []string, arg3 []template.VarKV) error { 368 var arg2Copy []string 369 if arg2 != nil { 370 arg2Copy = make([]string, len(arg2)) 371 copy(arg2Copy, arg2) 372 } 373 var arg3Copy []template.VarKV 374 if arg3 != nil { 375 arg3Copy = make([]template.VarKV, len(arg3)) 376 copy(arg3Copy, arg3) 377 } 378 fake.interpolateAndParseMutex.Lock() 379 ret, specificReturn := fake.interpolateAndParseReturnsOnCall[len(fake.interpolateAndParseArgsForCall)] 380 fake.interpolateAndParseArgsForCall = append(fake.interpolateAndParseArgsForCall, struct { 381 arg1 string 382 arg2 []string 383 arg3 []template.VarKV 384 }{arg1, arg2Copy, arg3Copy}) 385 fake.recordInvocation("InterpolateAndParse", []interface{}{arg1, arg2Copy, arg3Copy}) 386 fake.interpolateAndParseMutex.Unlock() 387 if fake.InterpolateAndParseStub != nil { 388 return fake.InterpolateAndParseStub(arg1, arg2, arg3) 389 } 390 if specificReturn { 391 return ret.result1 392 } 393 fakeReturns := fake.interpolateAndParseReturns 394 return fakeReturns.result1 395 } 396 397 func (fake *FakeManifestParser) InterpolateAndParseCallCount() int { 398 fake.interpolateAndParseMutex.RLock() 399 defer fake.interpolateAndParseMutex.RUnlock() 400 return len(fake.interpolateAndParseArgsForCall) 401 } 402 403 func (fake *FakeManifestParser) InterpolateAndParseCalls(stub func(string, []string, []template.VarKV) error) { 404 fake.interpolateAndParseMutex.Lock() 405 defer fake.interpolateAndParseMutex.Unlock() 406 fake.InterpolateAndParseStub = stub 407 } 408 409 func (fake *FakeManifestParser) InterpolateAndParseArgsForCall(i int) (string, []string, []template.VarKV) { 410 fake.interpolateAndParseMutex.RLock() 411 defer fake.interpolateAndParseMutex.RUnlock() 412 argsForCall := fake.interpolateAndParseArgsForCall[i] 413 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 414 } 415 416 func (fake *FakeManifestParser) InterpolateAndParseReturns(result1 error) { 417 fake.interpolateAndParseMutex.Lock() 418 defer fake.interpolateAndParseMutex.Unlock() 419 fake.InterpolateAndParseStub = nil 420 fake.interpolateAndParseReturns = struct { 421 result1 error 422 }{result1} 423 } 424 425 func (fake *FakeManifestParser) InterpolateAndParseReturnsOnCall(i int, result1 error) { 426 fake.interpolateAndParseMutex.Lock() 427 defer fake.interpolateAndParseMutex.Unlock() 428 fake.InterpolateAndParseStub = nil 429 if fake.interpolateAndParseReturnsOnCall == nil { 430 fake.interpolateAndParseReturnsOnCall = make(map[int]struct { 431 result1 error 432 }) 433 } 434 fake.interpolateAndParseReturnsOnCall[i] = struct { 435 result1 error 436 }{result1} 437 } 438 439 func (fake *FakeManifestParser) RawAppManifest(arg1 string) ([]byte, error) { 440 fake.rawAppManifestMutex.Lock() 441 ret, specificReturn := fake.rawAppManifestReturnsOnCall[len(fake.rawAppManifestArgsForCall)] 442 fake.rawAppManifestArgsForCall = append(fake.rawAppManifestArgsForCall, struct { 443 arg1 string 444 }{arg1}) 445 fake.recordInvocation("RawAppManifest", []interface{}{arg1}) 446 fake.rawAppManifestMutex.Unlock() 447 if fake.RawAppManifestStub != nil { 448 return fake.RawAppManifestStub(arg1) 449 } 450 if specificReturn { 451 return ret.result1, ret.result2 452 } 453 fakeReturns := fake.rawAppManifestReturns 454 return fakeReturns.result1, fakeReturns.result2 455 } 456 457 func (fake *FakeManifestParser) RawAppManifestCallCount() int { 458 fake.rawAppManifestMutex.RLock() 459 defer fake.rawAppManifestMutex.RUnlock() 460 return len(fake.rawAppManifestArgsForCall) 461 } 462 463 func (fake *FakeManifestParser) RawAppManifestCalls(stub func(string) ([]byte, error)) { 464 fake.rawAppManifestMutex.Lock() 465 defer fake.rawAppManifestMutex.Unlock() 466 fake.RawAppManifestStub = stub 467 } 468 469 func (fake *FakeManifestParser) RawAppManifestArgsForCall(i int) string { 470 fake.rawAppManifestMutex.RLock() 471 defer fake.rawAppManifestMutex.RUnlock() 472 argsForCall := fake.rawAppManifestArgsForCall[i] 473 return argsForCall.arg1 474 } 475 476 func (fake *FakeManifestParser) RawAppManifestReturns(result1 []byte, result2 error) { 477 fake.rawAppManifestMutex.Lock() 478 defer fake.rawAppManifestMutex.Unlock() 479 fake.RawAppManifestStub = nil 480 fake.rawAppManifestReturns = struct { 481 result1 []byte 482 result2 error 483 }{result1, result2} 484 } 485 486 func (fake *FakeManifestParser) RawAppManifestReturnsOnCall(i int, result1 []byte, result2 error) { 487 fake.rawAppManifestMutex.Lock() 488 defer fake.rawAppManifestMutex.Unlock() 489 fake.RawAppManifestStub = nil 490 if fake.rawAppManifestReturnsOnCall == nil { 491 fake.rawAppManifestReturnsOnCall = make(map[int]struct { 492 result1 []byte 493 result2 error 494 }) 495 } 496 fake.rawAppManifestReturnsOnCall[i] = struct { 497 result1 []byte 498 result2 error 499 }{result1, result2} 500 } 501 502 func (fake *FakeManifestParser) Invocations() map[string][][]interface{} { 503 fake.invocationsMutex.RLock() 504 defer fake.invocationsMutex.RUnlock() 505 fake.appsMutex.RLock() 506 defer fake.appsMutex.RUnlock() 507 fake.containsManifestMutex.RLock() 508 defer fake.containsManifestMutex.RUnlock() 509 fake.containsMultipleAppsMutex.RLock() 510 defer fake.containsMultipleAppsMutex.RUnlock() 511 fake.containsPrivateDockerImagesMutex.RLock() 512 defer fake.containsPrivateDockerImagesMutex.RUnlock() 513 fake.fullRawManifestMutex.RLock() 514 defer fake.fullRawManifestMutex.RUnlock() 515 fake.interpolateAndParseMutex.RLock() 516 defer fake.interpolateAndParseMutex.RUnlock() 517 fake.rawAppManifestMutex.RLock() 518 defer fake.rawAppManifestMutex.RUnlock() 519 copiedInvocations := map[string][][]interface{}{} 520 for key, value := range fake.invocations { 521 copiedInvocations[key] = value 522 } 523 return copiedInvocations 524 } 525 526 func (fake *FakeManifestParser) recordInvocation(key string, args []interface{}) { 527 fake.invocationsMutex.Lock() 528 defer fake.invocationsMutex.Unlock() 529 if fake.invocations == nil { 530 fake.invocations = map[string][][]interface{}{} 531 } 532 if fake.invocations[key] == nil { 533 fake.invocations[key] = [][]interface{}{} 534 } 535 fake.invocations[key] = append(fake.invocations[key], args) 536 } 537 538 var _ v7.ManifestParser = new(FakeManifestParser)