github.com/cloudfoundry-community/cloudfoundry-cli@v6.44.1-0.20240130060226-cda5ed8e89a5+incompatible/actor/v7pushaction/v7pushactionfakes/fake_manifest_parser.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package v7pushactionfakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/actor/v7pushaction" 8 "code.cloudfoundry.org/cli/util/manifestparser" 9 ) 10 11 type FakeManifestParser struct { 12 AppsStub func(string) ([]manifestparser.Application, error) 13 appsMutex sync.RWMutex 14 appsArgsForCall []struct { 15 arg1 string 16 } 17 appsReturns struct { 18 result1 []manifestparser.Application 19 result2 error 20 } 21 appsReturnsOnCall map[int]struct { 22 result1 []manifestparser.Application 23 result2 error 24 } 25 ContainsManifestStub func() bool 26 containsManifestMutex sync.RWMutex 27 containsManifestArgsForCall []struct { 28 } 29 containsManifestReturns struct { 30 result1 bool 31 } 32 containsManifestReturnsOnCall map[int]struct { 33 result1 bool 34 } 35 FullRawManifestStub func() []byte 36 fullRawManifestMutex sync.RWMutex 37 fullRawManifestArgsForCall []struct { 38 } 39 fullRawManifestReturns struct { 40 result1 []byte 41 } 42 fullRawManifestReturnsOnCall map[int]struct { 43 result1 []byte 44 } 45 RawAppManifestStub func(string) ([]byte, error) 46 rawAppManifestMutex sync.RWMutex 47 rawAppManifestArgsForCall []struct { 48 arg1 string 49 } 50 rawAppManifestReturns struct { 51 result1 []byte 52 result2 error 53 } 54 rawAppManifestReturnsOnCall map[int]struct { 55 result1 []byte 56 result2 error 57 } 58 invocations map[string][][]interface{} 59 invocationsMutex sync.RWMutex 60 } 61 62 func (fake *FakeManifestParser) Apps(arg1 string) ([]manifestparser.Application, error) { 63 fake.appsMutex.Lock() 64 ret, specificReturn := fake.appsReturnsOnCall[len(fake.appsArgsForCall)] 65 fake.appsArgsForCall = append(fake.appsArgsForCall, struct { 66 arg1 string 67 }{arg1}) 68 fake.recordInvocation("Apps", []interface{}{arg1}) 69 fake.appsMutex.Unlock() 70 if fake.AppsStub != nil { 71 return fake.AppsStub(arg1) 72 } 73 if specificReturn { 74 return ret.result1, ret.result2 75 } 76 fakeReturns := fake.appsReturns 77 return fakeReturns.result1, fakeReturns.result2 78 } 79 80 func (fake *FakeManifestParser) AppsCallCount() int { 81 fake.appsMutex.RLock() 82 defer fake.appsMutex.RUnlock() 83 return len(fake.appsArgsForCall) 84 } 85 86 func (fake *FakeManifestParser) AppsCalls(stub func(string) ([]manifestparser.Application, error)) { 87 fake.appsMutex.Lock() 88 defer fake.appsMutex.Unlock() 89 fake.AppsStub = stub 90 } 91 92 func (fake *FakeManifestParser) AppsArgsForCall(i int) string { 93 fake.appsMutex.RLock() 94 defer fake.appsMutex.RUnlock() 95 argsForCall := fake.appsArgsForCall[i] 96 return argsForCall.arg1 97 } 98 99 func (fake *FakeManifestParser) AppsReturns(result1 []manifestparser.Application, result2 error) { 100 fake.appsMutex.Lock() 101 defer fake.appsMutex.Unlock() 102 fake.AppsStub = nil 103 fake.appsReturns = struct { 104 result1 []manifestparser.Application 105 result2 error 106 }{result1, result2} 107 } 108 109 func (fake *FakeManifestParser) AppsReturnsOnCall(i int, result1 []manifestparser.Application, result2 error) { 110 fake.appsMutex.Lock() 111 defer fake.appsMutex.Unlock() 112 fake.AppsStub = nil 113 if fake.appsReturnsOnCall == nil { 114 fake.appsReturnsOnCall = make(map[int]struct { 115 result1 []manifestparser.Application 116 result2 error 117 }) 118 } 119 fake.appsReturnsOnCall[i] = struct { 120 result1 []manifestparser.Application 121 result2 error 122 }{result1, result2} 123 } 124 125 func (fake *FakeManifestParser) ContainsManifest() bool { 126 fake.containsManifestMutex.Lock() 127 ret, specificReturn := fake.containsManifestReturnsOnCall[len(fake.containsManifestArgsForCall)] 128 fake.containsManifestArgsForCall = append(fake.containsManifestArgsForCall, struct { 129 }{}) 130 fake.recordInvocation("ContainsManifest", []interface{}{}) 131 fake.containsManifestMutex.Unlock() 132 if fake.ContainsManifestStub != nil { 133 return fake.ContainsManifestStub() 134 } 135 if specificReturn { 136 return ret.result1 137 } 138 fakeReturns := fake.containsManifestReturns 139 return fakeReturns.result1 140 } 141 142 func (fake *FakeManifestParser) ContainsManifestCallCount() int { 143 fake.containsManifestMutex.RLock() 144 defer fake.containsManifestMutex.RUnlock() 145 return len(fake.containsManifestArgsForCall) 146 } 147 148 func (fake *FakeManifestParser) ContainsManifestCalls(stub func() bool) { 149 fake.containsManifestMutex.Lock() 150 defer fake.containsManifestMutex.Unlock() 151 fake.ContainsManifestStub = stub 152 } 153 154 func (fake *FakeManifestParser) ContainsManifestReturns(result1 bool) { 155 fake.containsManifestMutex.Lock() 156 defer fake.containsManifestMutex.Unlock() 157 fake.ContainsManifestStub = nil 158 fake.containsManifestReturns = struct { 159 result1 bool 160 }{result1} 161 } 162 163 func (fake *FakeManifestParser) ContainsManifestReturnsOnCall(i int, result1 bool) { 164 fake.containsManifestMutex.Lock() 165 defer fake.containsManifestMutex.Unlock() 166 fake.ContainsManifestStub = nil 167 if fake.containsManifestReturnsOnCall == nil { 168 fake.containsManifestReturnsOnCall = make(map[int]struct { 169 result1 bool 170 }) 171 } 172 fake.containsManifestReturnsOnCall[i] = struct { 173 result1 bool 174 }{result1} 175 } 176 177 func (fake *FakeManifestParser) FullRawManifest() []byte { 178 fake.fullRawManifestMutex.Lock() 179 ret, specificReturn := fake.fullRawManifestReturnsOnCall[len(fake.fullRawManifestArgsForCall)] 180 fake.fullRawManifestArgsForCall = append(fake.fullRawManifestArgsForCall, struct { 181 }{}) 182 fake.recordInvocation("FullRawManifest", []interface{}{}) 183 fake.fullRawManifestMutex.Unlock() 184 if fake.FullRawManifestStub != nil { 185 return fake.FullRawManifestStub() 186 } 187 if specificReturn { 188 return ret.result1 189 } 190 fakeReturns := fake.fullRawManifestReturns 191 return fakeReturns.result1 192 } 193 194 func (fake *FakeManifestParser) FullRawManifestCallCount() int { 195 fake.fullRawManifestMutex.RLock() 196 defer fake.fullRawManifestMutex.RUnlock() 197 return len(fake.fullRawManifestArgsForCall) 198 } 199 200 func (fake *FakeManifestParser) FullRawManifestCalls(stub func() []byte) { 201 fake.fullRawManifestMutex.Lock() 202 defer fake.fullRawManifestMutex.Unlock() 203 fake.FullRawManifestStub = stub 204 } 205 206 func (fake *FakeManifestParser) FullRawManifestReturns(result1 []byte) { 207 fake.fullRawManifestMutex.Lock() 208 defer fake.fullRawManifestMutex.Unlock() 209 fake.FullRawManifestStub = nil 210 fake.fullRawManifestReturns = struct { 211 result1 []byte 212 }{result1} 213 } 214 215 func (fake *FakeManifestParser) FullRawManifestReturnsOnCall(i int, result1 []byte) { 216 fake.fullRawManifestMutex.Lock() 217 defer fake.fullRawManifestMutex.Unlock() 218 fake.FullRawManifestStub = nil 219 if fake.fullRawManifestReturnsOnCall == nil { 220 fake.fullRawManifestReturnsOnCall = make(map[int]struct { 221 result1 []byte 222 }) 223 } 224 fake.fullRawManifestReturnsOnCall[i] = struct { 225 result1 []byte 226 }{result1} 227 } 228 229 func (fake *FakeManifestParser) RawAppManifest(arg1 string) ([]byte, error) { 230 fake.rawAppManifestMutex.Lock() 231 ret, specificReturn := fake.rawAppManifestReturnsOnCall[len(fake.rawAppManifestArgsForCall)] 232 fake.rawAppManifestArgsForCall = append(fake.rawAppManifestArgsForCall, struct { 233 arg1 string 234 }{arg1}) 235 fake.recordInvocation("RawAppManifest", []interface{}{arg1}) 236 fake.rawAppManifestMutex.Unlock() 237 if fake.RawAppManifestStub != nil { 238 return fake.RawAppManifestStub(arg1) 239 } 240 if specificReturn { 241 return ret.result1, ret.result2 242 } 243 fakeReturns := fake.rawAppManifestReturns 244 return fakeReturns.result1, fakeReturns.result2 245 } 246 247 func (fake *FakeManifestParser) RawAppManifestCallCount() int { 248 fake.rawAppManifestMutex.RLock() 249 defer fake.rawAppManifestMutex.RUnlock() 250 return len(fake.rawAppManifestArgsForCall) 251 } 252 253 func (fake *FakeManifestParser) RawAppManifestCalls(stub func(string) ([]byte, error)) { 254 fake.rawAppManifestMutex.Lock() 255 defer fake.rawAppManifestMutex.Unlock() 256 fake.RawAppManifestStub = stub 257 } 258 259 func (fake *FakeManifestParser) RawAppManifestArgsForCall(i int) string { 260 fake.rawAppManifestMutex.RLock() 261 defer fake.rawAppManifestMutex.RUnlock() 262 argsForCall := fake.rawAppManifestArgsForCall[i] 263 return argsForCall.arg1 264 } 265 266 func (fake *FakeManifestParser) RawAppManifestReturns(result1 []byte, result2 error) { 267 fake.rawAppManifestMutex.Lock() 268 defer fake.rawAppManifestMutex.Unlock() 269 fake.RawAppManifestStub = nil 270 fake.rawAppManifestReturns = struct { 271 result1 []byte 272 result2 error 273 }{result1, result2} 274 } 275 276 func (fake *FakeManifestParser) RawAppManifestReturnsOnCall(i int, result1 []byte, result2 error) { 277 fake.rawAppManifestMutex.Lock() 278 defer fake.rawAppManifestMutex.Unlock() 279 fake.RawAppManifestStub = nil 280 if fake.rawAppManifestReturnsOnCall == nil { 281 fake.rawAppManifestReturnsOnCall = make(map[int]struct { 282 result1 []byte 283 result2 error 284 }) 285 } 286 fake.rawAppManifestReturnsOnCall[i] = struct { 287 result1 []byte 288 result2 error 289 }{result1, result2} 290 } 291 292 func (fake *FakeManifestParser) Invocations() map[string][][]interface{} { 293 fake.invocationsMutex.RLock() 294 defer fake.invocationsMutex.RUnlock() 295 fake.appsMutex.RLock() 296 defer fake.appsMutex.RUnlock() 297 fake.containsManifestMutex.RLock() 298 defer fake.containsManifestMutex.RUnlock() 299 fake.fullRawManifestMutex.RLock() 300 defer fake.fullRawManifestMutex.RUnlock() 301 fake.rawAppManifestMutex.RLock() 302 defer fake.rawAppManifestMutex.RUnlock() 303 copiedInvocations := map[string][][]interface{}{} 304 for key, value := range fake.invocations { 305 copiedInvocations[key] = value 306 } 307 return copiedInvocations 308 } 309 310 func (fake *FakeManifestParser) recordInvocation(key string, args []interface{}) { 311 fake.invocationsMutex.Lock() 312 defer fake.invocationsMutex.Unlock() 313 if fake.invocations == nil { 314 fake.invocations = map[string][][]interface{}{} 315 } 316 if fake.invocations[key] == nil { 317 fake.invocations[key] = [][]interface{}{} 318 } 319 fake.invocations[key] = append(fake.invocations[key], args) 320 } 321 322 var _ v7pushaction.ManifestParser = new(FakeManifestParser)