github.com/wanddynosios/cli/v8@v8.7.9-0.20240221182337-1a92e3a7017f/actor/v7action/v7actionfakes/fake_shared_actor.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package v7actionfakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/actor/sharedaction" 8 "code.cloudfoundry.org/cli/actor/v7action" 9 ) 10 11 type FakeSharedActor struct { 12 GatherArchiveResourcesStub func(string) ([]sharedaction.Resource, error) 13 gatherArchiveResourcesMutex sync.RWMutex 14 gatherArchiveResourcesArgsForCall []struct { 15 arg1 string 16 } 17 gatherArchiveResourcesReturns struct { 18 result1 []sharedaction.Resource 19 result2 error 20 } 21 gatherArchiveResourcesReturnsOnCall map[int]struct { 22 result1 []sharedaction.Resource 23 result2 error 24 } 25 GatherDirectoryResourcesStub func(string) ([]sharedaction.Resource, error) 26 gatherDirectoryResourcesMutex sync.RWMutex 27 gatherDirectoryResourcesArgsForCall []struct { 28 arg1 string 29 } 30 gatherDirectoryResourcesReturns struct { 31 result1 []sharedaction.Resource 32 result2 error 33 } 34 gatherDirectoryResourcesReturnsOnCall map[int]struct { 35 result1 []sharedaction.Resource 36 result2 error 37 } 38 ZipArchiveResourcesStub func(string, []sharedaction.Resource) (string, error) 39 zipArchiveResourcesMutex sync.RWMutex 40 zipArchiveResourcesArgsForCall []struct { 41 arg1 string 42 arg2 []sharedaction.Resource 43 } 44 zipArchiveResourcesReturns struct { 45 result1 string 46 result2 error 47 } 48 zipArchiveResourcesReturnsOnCall map[int]struct { 49 result1 string 50 result2 error 51 } 52 ZipDirectoryResourcesStub func(string, []sharedaction.Resource) (string, error) 53 zipDirectoryResourcesMutex sync.RWMutex 54 zipDirectoryResourcesArgsForCall []struct { 55 arg1 string 56 arg2 []sharedaction.Resource 57 } 58 zipDirectoryResourcesReturns struct { 59 result1 string 60 result2 error 61 } 62 zipDirectoryResourcesReturnsOnCall map[int]struct { 63 result1 string 64 result2 error 65 } 66 invocations map[string][][]interface{} 67 invocationsMutex sync.RWMutex 68 } 69 70 func (fake *FakeSharedActor) GatherArchiveResources(arg1 string) ([]sharedaction.Resource, error) { 71 fake.gatherArchiveResourcesMutex.Lock() 72 ret, specificReturn := fake.gatherArchiveResourcesReturnsOnCall[len(fake.gatherArchiveResourcesArgsForCall)] 73 fake.gatherArchiveResourcesArgsForCall = append(fake.gatherArchiveResourcesArgsForCall, struct { 74 arg1 string 75 }{arg1}) 76 fake.recordInvocation("GatherArchiveResources", []interface{}{arg1}) 77 fake.gatherArchiveResourcesMutex.Unlock() 78 if fake.GatherArchiveResourcesStub != nil { 79 return fake.GatherArchiveResourcesStub(arg1) 80 } 81 if specificReturn { 82 return ret.result1, ret.result2 83 } 84 fakeReturns := fake.gatherArchiveResourcesReturns 85 return fakeReturns.result1, fakeReturns.result2 86 } 87 88 func (fake *FakeSharedActor) GatherArchiveResourcesCallCount() int { 89 fake.gatherArchiveResourcesMutex.RLock() 90 defer fake.gatherArchiveResourcesMutex.RUnlock() 91 return len(fake.gatherArchiveResourcesArgsForCall) 92 } 93 94 func (fake *FakeSharedActor) GatherArchiveResourcesCalls(stub func(string) ([]sharedaction.Resource, error)) { 95 fake.gatherArchiveResourcesMutex.Lock() 96 defer fake.gatherArchiveResourcesMutex.Unlock() 97 fake.GatherArchiveResourcesStub = stub 98 } 99 100 func (fake *FakeSharedActor) GatherArchiveResourcesArgsForCall(i int) string { 101 fake.gatherArchiveResourcesMutex.RLock() 102 defer fake.gatherArchiveResourcesMutex.RUnlock() 103 argsForCall := fake.gatherArchiveResourcesArgsForCall[i] 104 return argsForCall.arg1 105 } 106 107 func (fake *FakeSharedActor) GatherArchiveResourcesReturns(result1 []sharedaction.Resource, result2 error) { 108 fake.gatherArchiveResourcesMutex.Lock() 109 defer fake.gatherArchiveResourcesMutex.Unlock() 110 fake.GatherArchiveResourcesStub = nil 111 fake.gatherArchiveResourcesReturns = struct { 112 result1 []sharedaction.Resource 113 result2 error 114 }{result1, result2} 115 } 116 117 func (fake *FakeSharedActor) GatherArchiveResourcesReturnsOnCall(i int, result1 []sharedaction.Resource, result2 error) { 118 fake.gatherArchiveResourcesMutex.Lock() 119 defer fake.gatherArchiveResourcesMutex.Unlock() 120 fake.GatherArchiveResourcesStub = nil 121 if fake.gatherArchiveResourcesReturnsOnCall == nil { 122 fake.gatherArchiveResourcesReturnsOnCall = make(map[int]struct { 123 result1 []sharedaction.Resource 124 result2 error 125 }) 126 } 127 fake.gatherArchiveResourcesReturnsOnCall[i] = struct { 128 result1 []sharedaction.Resource 129 result2 error 130 }{result1, result2} 131 } 132 133 func (fake *FakeSharedActor) GatherDirectoryResources(arg1 string) ([]sharedaction.Resource, error) { 134 fake.gatherDirectoryResourcesMutex.Lock() 135 ret, specificReturn := fake.gatherDirectoryResourcesReturnsOnCall[len(fake.gatherDirectoryResourcesArgsForCall)] 136 fake.gatherDirectoryResourcesArgsForCall = append(fake.gatherDirectoryResourcesArgsForCall, struct { 137 arg1 string 138 }{arg1}) 139 fake.recordInvocation("GatherDirectoryResources", []interface{}{arg1}) 140 fake.gatherDirectoryResourcesMutex.Unlock() 141 if fake.GatherDirectoryResourcesStub != nil { 142 return fake.GatherDirectoryResourcesStub(arg1) 143 } 144 if specificReturn { 145 return ret.result1, ret.result2 146 } 147 fakeReturns := fake.gatherDirectoryResourcesReturns 148 return fakeReturns.result1, fakeReturns.result2 149 } 150 151 func (fake *FakeSharedActor) GatherDirectoryResourcesCallCount() int { 152 fake.gatherDirectoryResourcesMutex.RLock() 153 defer fake.gatherDirectoryResourcesMutex.RUnlock() 154 return len(fake.gatherDirectoryResourcesArgsForCall) 155 } 156 157 func (fake *FakeSharedActor) GatherDirectoryResourcesCalls(stub func(string) ([]sharedaction.Resource, error)) { 158 fake.gatherDirectoryResourcesMutex.Lock() 159 defer fake.gatherDirectoryResourcesMutex.Unlock() 160 fake.GatherDirectoryResourcesStub = stub 161 } 162 163 func (fake *FakeSharedActor) GatherDirectoryResourcesArgsForCall(i int) string { 164 fake.gatherDirectoryResourcesMutex.RLock() 165 defer fake.gatherDirectoryResourcesMutex.RUnlock() 166 argsForCall := fake.gatherDirectoryResourcesArgsForCall[i] 167 return argsForCall.arg1 168 } 169 170 func (fake *FakeSharedActor) GatherDirectoryResourcesReturns(result1 []sharedaction.Resource, result2 error) { 171 fake.gatherDirectoryResourcesMutex.Lock() 172 defer fake.gatherDirectoryResourcesMutex.Unlock() 173 fake.GatherDirectoryResourcesStub = nil 174 fake.gatherDirectoryResourcesReturns = struct { 175 result1 []sharedaction.Resource 176 result2 error 177 }{result1, result2} 178 } 179 180 func (fake *FakeSharedActor) GatherDirectoryResourcesReturnsOnCall(i int, result1 []sharedaction.Resource, result2 error) { 181 fake.gatherDirectoryResourcesMutex.Lock() 182 defer fake.gatherDirectoryResourcesMutex.Unlock() 183 fake.GatherDirectoryResourcesStub = nil 184 if fake.gatherDirectoryResourcesReturnsOnCall == nil { 185 fake.gatherDirectoryResourcesReturnsOnCall = make(map[int]struct { 186 result1 []sharedaction.Resource 187 result2 error 188 }) 189 } 190 fake.gatherDirectoryResourcesReturnsOnCall[i] = struct { 191 result1 []sharedaction.Resource 192 result2 error 193 }{result1, result2} 194 } 195 196 func (fake *FakeSharedActor) ZipArchiveResources(arg1 string, arg2 []sharedaction.Resource) (string, error) { 197 var arg2Copy []sharedaction.Resource 198 if arg2 != nil { 199 arg2Copy = make([]sharedaction.Resource, len(arg2)) 200 copy(arg2Copy, arg2) 201 } 202 fake.zipArchiveResourcesMutex.Lock() 203 ret, specificReturn := fake.zipArchiveResourcesReturnsOnCall[len(fake.zipArchiveResourcesArgsForCall)] 204 fake.zipArchiveResourcesArgsForCall = append(fake.zipArchiveResourcesArgsForCall, struct { 205 arg1 string 206 arg2 []sharedaction.Resource 207 }{arg1, arg2Copy}) 208 fake.recordInvocation("ZipArchiveResources", []interface{}{arg1, arg2Copy}) 209 fake.zipArchiveResourcesMutex.Unlock() 210 if fake.ZipArchiveResourcesStub != nil { 211 return fake.ZipArchiveResourcesStub(arg1, arg2) 212 } 213 if specificReturn { 214 return ret.result1, ret.result2 215 } 216 fakeReturns := fake.zipArchiveResourcesReturns 217 return fakeReturns.result1, fakeReturns.result2 218 } 219 220 func (fake *FakeSharedActor) ZipArchiveResourcesCallCount() int { 221 fake.zipArchiveResourcesMutex.RLock() 222 defer fake.zipArchiveResourcesMutex.RUnlock() 223 return len(fake.zipArchiveResourcesArgsForCall) 224 } 225 226 func (fake *FakeSharedActor) ZipArchiveResourcesCalls(stub func(string, []sharedaction.Resource) (string, error)) { 227 fake.zipArchiveResourcesMutex.Lock() 228 defer fake.zipArchiveResourcesMutex.Unlock() 229 fake.ZipArchiveResourcesStub = stub 230 } 231 232 func (fake *FakeSharedActor) ZipArchiveResourcesArgsForCall(i int) (string, []sharedaction.Resource) { 233 fake.zipArchiveResourcesMutex.RLock() 234 defer fake.zipArchiveResourcesMutex.RUnlock() 235 argsForCall := fake.zipArchiveResourcesArgsForCall[i] 236 return argsForCall.arg1, argsForCall.arg2 237 } 238 239 func (fake *FakeSharedActor) ZipArchiveResourcesReturns(result1 string, result2 error) { 240 fake.zipArchiveResourcesMutex.Lock() 241 defer fake.zipArchiveResourcesMutex.Unlock() 242 fake.ZipArchiveResourcesStub = nil 243 fake.zipArchiveResourcesReturns = struct { 244 result1 string 245 result2 error 246 }{result1, result2} 247 } 248 249 func (fake *FakeSharedActor) ZipArchiveResourcesReturnsOnCall(i int, result1 string, result2 error) { 250 fake.zipArchiveResourcesMutex.Lock() 251 defer fake.zipArchiveResourcesMutex.Unlock() 252 fake.ZipArchiveResourcesStub = nil 253 if fake.zipArchiveResourcesReturnsOnCall == nil { 254 fake.zipArchiveResourcesReturnsOnCall = make(map[int]struct { 255 result1 string 256 result2 error 257 }) 258 } 259 fake.zipArchiveResourcesReturnsOnCall[i] = struct { 260 result1 string 261 result2 error 262 }{result1, result2} 263 } 264 265 func (fake *FakeSharedActor) ZipDirectoryResources(arg1 string, arg2 []sharedaction.Resource) (string, error) { 266 var arg2Copy []sharedaction.Resource 267 if arg2 != nil { 268 arg2Copy = make([]sharedaction.Resource, len(arg2)) 269 copy(arg2Copy, arg2) 270 } 271 fake.zipDirectoryResourcesMutex.Lock() 272 ret, specificReturn := fake.zipDirectoryResourcesReturnsOnCall[len(fake.zipDirectoryResourcesArgsForCall)] 273 fake.zipDirectoryResourcesArgsForCall = append(fake.zipDirectoryResourcesArgsForCall, struct { 274 arg1 string 275 arg2 []sharedaction.Resource 276 }{arg1, arg2Copy}) 277 fake.recordInvocation("ZipDirectoryResources", []interface{}{arg1, arg2Copy}) 278 fake.zipDirectoryResourcesMutex.Unlock() 279 if fake.ZipDirectoryResourcesStub != nil { 280 return fake.ZipDirectoryResourcesStub(arg1, arg2) 281 } 282 if specificReturn { 283 return ret.result1, ret.result2 284 } 285 fakeReturns := fake.zipDirectoryResourcesReturns 286 return fakeReturns.result1, fakeReturns.result2 287 } 288 289 func (fake *FakeSharedActor) ZipDirectoryResourcesCallCount() int { 290 fake.zipDirectoryResourcesMutex.RLock() 291 defer fake.zipDirectoryResourcesMutex.RUnlock() 292 return len(fake.zipDirectoryResourcesArgsForCall) 293 } 294 295 func (fake *FakeSharedActor) ZipDirectoryResourcesCalls(stub func(string, []sharedaction.Resource) (string, error)) { 296 fake.zipDirectoryResourcesMutex.Lock() 297 defer fake.zipDirectoryResourcesMutex.Unlock() 298 fake.ZipDirectoryResourcesStub = stub 299 } 300 301 func (fake *FakeSharedActor) ZipDirectoryResourcesArgsForCall(i int) (string, []sharedaction.Resource) { 302 fake.zipDirectoryResourcesMutex.RLock() 303 defer fake.zipDirectoryResourcesMutex.RUnlock() 304 argsForCall := fake.zipDirectoryResourcesArgsForCall[i] 305 return argsForCall.arg1, argsForCall.arg2 306 } 307 308 func (fake *FakeSharedActor) ZipDirectoryResourcesReturns(result1 string, result2 error) { 309 fake.zipDirectoryResourcesMutex.Lock() 310 defer fake.zipDirectoryResourcesMutex.Unlock() 311 fake.ZipDirectoryResourcesStub = nil 312 fake.zipDirectoryResourcesReturns = struct { 313 result1 string 314 result2 error 315 }{result1, result2} 316 } 317 318 func (fake *FakeSharedActor) ZipDirectoryResourcesReturnsOnCall(i int, result1 string, result2 error) { 319 fake.zipDirectoryResourcesMutex.Lock() 320 defer fake.zipDirectoryResourcesMutex.Unlock() 321 fake.ZipDirectoryResourcesStub = nil 322 if fake.zipDirectoryResourcesReturnsOnCall == nil { 323 fake.zipDirectoryResourcesReturnsOnCall = make(map[int]struct { 324 result1 string 325 result2 error 326 }) 327 } 328 fake.zipDirectoryResourcesReturnsOnCall[i] = struct { 329 result1 string 330 result2 error 331 }{result1, result2} 332 } 333 334 func (fake *FakeSharedActor) Invocations() map[string][][]interface{} { 335 fake.invocationsMutex.RLock() 336 defer fake.invocationsMutex.RUnlock() 337 fake.gatherArchiveResourcesMutex.RLock() 338 defer fake.gatherArchiveResourcesMutex.RUnlock() 339 fake.gatherDirectoryResourcesMutex.RLock() 340 defer fake.gatherDirectoryResourcesMutex.RUnlock() 341 fake.zipArchiveResourcesMutex.RLock() 342 defer fake.zipArchiveResourcesMutex.RUnlock() 343 fake.zipDirectoryResourcesMutex.RLock() 344 defer fake.zipDirectoryResourcesMutex.RUnlock() 345 copiedInvocations := map[string][][]interface{}{} 346 for key, value := range fake.invocations { 347 copiedInvocations[key] = value 348 } 349 return copiedInvocations 350 } 351 352 func (fake *FakeSharedActor) recordInvocation(key string, args []interface{}) { 353 fake.invocationsMutex.Lock() 354 defer fake.invocationsMutex.Unlock() 355 if fake.invocations == nil { 356 fake.invocations = map[string][][]interface{}{} 357 } 358 if fake.invocations[key] == nil { 359 fake.invocations[key] = [][]interface{}{} 360 } 361 fake.invocations[key] = append(fake.invocations[key], args) 362 } 363 364 var _ v7action.SharedActor = new(FakeSharedActor)