github.com/LukasHeimann/cloudfoundrycli/v8@v8.4.4/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 "github.com/LukasHeimann/cloudfoundrycli/v8/command/v7" 8 "github.com/LukasHeimann/cloudfoundrycli/v8/util/manifestparser" 9 "github.com/cloudfoundry/bosh-cli/director/template" 10 ) 11 12 type FakeManifestParser struct { 13 InterpolateManifestStub func(string, []string, []template.VarKV) ([]byte, error) 14 interpolateManifestMutex sync.RWMutex 15 interpolateManifestArgsForCall []struct { 16 arg1 string 17 arg2 []string 18 arg3 []template.VarKV 19 } 20 interpolateManifestReturns struct { 21 result1 []byte 22 result2 error 23 } 24 interpolateManifestReturnsOnCall map[int]struct { 25 result1 []byte 26 result2 error 27 } 28 MarshalManifestStub func(manifestparser.Manifest) ([]byte, error) 29 marshalManifestMutex sync.RWMutex 30 marshalManifestArgsForCall []struct { 31 arg1 manifestparser.Manifest 32 } 33 marshalManifestReturns struct { 34 result1 []byte 35 result2 error 36 } 37 marshalManifestReturnsOnCall map[int]struct { 38 result1 []byte 39 result2 error 40 } 41 ParseManifestStub func(string, []byte) (manifestparser.Manifest, error) 42 parseManifestMutex sync.RWMutex 43 parseManifestArgsForCall []struct { 44 arg1 string 45 arg2 []byte 46 } 47 parseManifestReturns struct { 48 result1 manifestparser.Manifest 49 result2 error 50 } 51 parseManifestReturnsOnCall map[int]struct { 52 result1 manifestparser.Manifest 53 result2 error 54 } 55 invocations map[string][][]interface{} 56 invocationsMutex sync.RWMutex 57 } 58 59 func (fake *FakeManifestParser) InterpolateManifest(arg1 string, arg2 []string, arg3 []template.VarKV) ([]byte, error) { 60 var arg2Copy []string 61 if arg2 != nil { 62 arg2Copy = make([]string, len(arg2)) 63 copy(arg2Copy, arg2) 64 } 65 var arg3Copy []template.VarKV 66 if arg3 != nil { 67 arg3Copy = make([]template.VarKV, len(arg3)) 68 copy(arg3Copy, arg3) 69 } 70 fake.interpolateManifestMutex.Lock() 71 ret, specificReturn := fake.interpolateManifestReturnsOnCall[len(fake.interpolateManifestArgsForCall)] 72 fake.interpolateManifestArgsForCall = append(fake.interpolateManifestArgsForCall, struct { 73 arg1 string 74 arg2 []string 75 arg3 []template.VarKV 76 }{arg1, arg2Copy, arg3Copy}) 77 fake.recordInvocation("InterpolateManifest", []interface{}{arg1, arg2Copy, arg3Copy}) 78 fake.interpolateManifestMutex.Unlock() 79 if fake.InterpolateManifestStub != nil { 80 return fake.InterpolateManifestStub(arg1, arg2, arg3) 81 } 82 if specificReturn { 83 return ret.result1, ret.result2 84 } 85 fakeReturns := fake.interpolateManifestReturns 86 return fakeReturns.result1, fakeReturns.result2 87 } 88 89 func (fake *FakeManifestParser) InterpolateManifestCallCount() int { 90 fake.interpolateManifestMutex.RLock() 91 defer fake.interpolateManifestMutex.RUnlock() 92 return len(fake.interpolateManifestArgsForCall) 93 } 94 95 func (fake *FakeManifestParser) InterpolateManifestCalls(stub func(string, []string, []template.VarKV) ([]byte, error)) { 96 fake.interpolateManifestMutex.Lock() 97 defer fake.interpolateManifestMutex.Unlock() 98 fake.InterpolateManifestStub = stub 99 } 100 101 func (fake *FakeManifestParser) InterpolateManifestArgsForCall(i int) (string, []string, []template.VarKV) { 102 fake.interpolateManifestMutex.RLock() 103 defer fake.interpolateManifestMutex.RUnlock() 104 argsForCall := fake.interpolateManifestArgsForCall[i] 105 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 106 } 107 108 func (fake *FakeManifestParser) InterpolateManifestReturns(result1 []byte, result2 error) { 109 fake.interpolateManifestMutex.Lock() 110 defer fake.interpolateManifestMutex.Unlock() 111 fake.InterpolateManifestStub = nil 112 fake.interpolateManifestReturns = struct { 113 result1 []byte 114 result2 error 115 }{result1, result2} 116 } 117 118 func (fake *FakeManifestParser) InterpolateManifestReturnsOnCall(i int, result1 []byte, result2 error) { 119 fake.interpolateManifestMutex.Lock() 120 defer fake.interpolateManifestMutex.Unlock() 121 fake.InterpolateManifestStub = nil 122 if fake.interpolateManifestReturnsOnCall == nil { 123 fake.interpolateManifestReturnsOnCall = make(map[int]struct { 124 result1 []byte 125 result2 error 126 }) 127 } 128 fake.interpolateManifestReturnsOnCall[i] = struct { 129 result1 []byte 130 result2 error 131 }{result1, result2} 132 } 133 134 func (fake *FakeManifestParser) MarshalManifest(arg1 manifestparser.Manifest) ([]byte, error) { 135 fake.marshalManifestMutex.Lock() 136 ret, specificReturn := fake.marshalManifestReturnsOnCall[len(fake.marshalManifestArgsForCall)] 137 fake.marshalManifestArgsForCall = append(fake.marshalManifestArgsForCall, struct { 138 arg1 manifestparser.Manifest 139 }{arg1}) 140 fake.recordInvocation("MarshalManifest", []interface{}{arg1}) 141 fake.marshalManifestMutex.Unlock() 142 if fake.MarshalManifestStub != nil { 143 return fake.MarshalManifestStub(arg1) 144 } 145 if specificReturn { 146 return ret.result1, ret.result2 147 } 148 fakeReturns := fake.marshalManifestReturns 149 return fakeReturns.result1, fakeReturns.result2 150 } 151 152 func (fake *FakeManifestParser) MarshalManifestCallCount() int { 153 fake.marshalManifestMutex.RLock() 154 defer fake.marshalManifestMutex.RUnlock() 155 return len(fake.marshalManifestArgsForCall) 156 } 157 158 func (fake *FakeManifestParser) MarshalManifestCalls(stub func(manifestparser.Manifest) ([]byte, error)) { 159 fake.marshalManifestMutex.Lock() 160 defer fake.marshalManifestMutex.Unlock() 161 fake.MarshalManifestStub = stub 162 } 163 164 func (fake *FakeManifestParser) MarshalManifestArgsForCall(i int) manifestparser.Manifest { 165 fake.marshalManifestMutex.RLock() 166 defer fake.marshalManifestMutex.RUnlock() 167 argsForCall := fake.marshalManifestArgsForCall[i] 168 return argsForCall.arg1 169 } 170 171 func (fake *FakeManifestParser) MarshalManifestReturns(result1 []byte, result2 error) { 172 fake.marshalManifestMutex.Lock() 173 defer fake.marshalManifestMutex.Unlock() 174 fake.MarshalManifestStub = nil 175 fake.marshalManifestReturns = struct { 176 result1 []byte 177 result2 error 178 }{result1, result2} 179 } 180 181 func (fake *FakeManifestParser) MarshalManifestReturnsOnCall(i int, result1 []byte, result2 error) { 182 fake.marshalManifestMutex.Lock() 183 defer fake.marshalManifestMutex.Unlock() 184 fake.MarshalManifestStub = nil 185 if fake.marshalManifestReturnsOnCall == nil { 186 fake.marshalManifestReturnsOnCall = make(map[int]struct { 187 result1 []byte 188 result2 error 189 }) 190 } 191 fake.marshalManifestReturnsOnCall[i] = struct { 192 result1 []byte 193 result2 error 194 }{result1, result2} 195 } 196 197 func (fake *FakeManifestParser) ParseManifest(arg1 string, arg2 []byte) (manifestparser.Manifest, error) { 198 var arg2Copy []byte 199 if arg2 != nil { 200 arg2Copy = make([]byte, len(arg2)) 201 copy(arg2Copy, arg2) 202 } 203 fake.parseManifestMutex.Lock() 204 ret, specificReturn := fake.parseManifestReturnsOnCall[len(fake.parseManifestArgsForCall)] 205 fake.parseManifestArgsForCall = append(fake.parseManifestArgsForCall, struct { 206 arg1 string 207 arg2 []byte 208 }{arg1, arg2Copy}) 209 fake.recordInvocation("ParseManifest", []interface{}{arg1, arg2Copy}) 210 fake.parseManifestMutex.Unlock() 211 if fake.ParseManifestStub != nil { 212 return fake.ParseManifestStub(arg1, arg2) 213 } 214 if specificReturn { 215 return ret.result1, ret.result2 216 } 217 fakeReturns := fake.parseManifestReturns 218 return fakeReturns.result1, fakeReturns.result2 219 } 220 221 func (fake *FakeManifestParser) ParseManifestCallCount() int { 222 fake.parseManifestMutex.RLock() 223 defer fake.parseManifestMutex.RUnlock() 224 return len(fake.parseManifestArgsForCall) 225 } 226 227 func (fake *FakeManifestParser) ParseManifestCalls(stub func(string, []byte) (manifestparser.Manifest, error)) { 228 fake.parseManifestMutex.Lock() 229 defer fake.parseManifestMutex.Unlock() 230 fake.ParseManifestStub = stub 231 } 232 233 func (fake *FakeManifestParser) ParseManifestArgsForCall(i int) (string, []byte) { 234 fake.parseManifestMutex.RLock() 235 defer fake.parseManifestMutex.RUnlock() 236 argsForCall := fake.parseManifestArgsForCall[i] 237 return argsForCall.arg1, argsForCall.arg2 238 } 239 240 func (fake *FakeManifestParser) ParseManifestReturns(result1 manifestparser.Manifest, result2 error) { 241 fake.parseManifestMutex.Lock() 242 defer fake.parseManifestMutex.Unlock() 243 fake.ParseManifestStub = nil 244 fake.parseManifestReturns = struct { 245 result1 manifestparser.Manifest 246 result2 error 247 }{result1, result2} 248 } 249 250 func (fake *FakeManifestParser) ParseManifestReturnsOnCall(i int, result1 manifestparser.Manifest, result2 error) { 251 fake.parseManifestMutex.Lock() 252 defer fake.parseManifestMutex.Unlock() 253 fake.ParseManifestStub = nil 254 if fake.parseManifestReturnsOnCall == nil { 255 fake.parseManifestReturnsOnCall = make(map[int]struct { 256 result1 manifestparser.Manifest 257 result2 error 258 }) 259 } 260 fake.parseManifestReturnsOnCall[i] = struct { 261 result1 manifestparser.Manifest 262 result2 error 263 }{result1, result2} 264 } 265 266 func (fake *FakeManifestParser) Invocations() map[string][][]interface{} { 267 fake.invocationsMutex.RLock() 268 defer fake.invocationsMutex.RUnlock() 269 fake.interpolateManifestMutex.RLock() 270 defer fake.interpolateManifestMutex.RUnlock() 271 fake.marshalManifestMutex.RLock() 272 defer fake.marshalManifestMutex.RUnlock() 273 fake.parseManifestMutex.RLock() 274 defer fake.parseManifestMutex.RUnlock() 275 copiedInvocations := map[string][][]interface{}{} 276 for key, value := range fake.invocations { 277 copiedInvocations[key] = value 278 } 279 return copiedInvocations 280 } 281 282 func (fake *FakeManifestParser) recordInvocation(key string, args []interface{}) { 283 fake.invocationsMutex.Lock() 284 defer fake.invocationsMutex.Unlock() 285 if fake.invocations == nil { 286 fake.invocations = map[string][][]interface{}{} 287 } 288 if fake.invocations[key] == nil { 289 fake.invocations[key] = [][]interface{}{} 290 } 291 fake.invocations[key] = append(fake.invocations[key], args) 292 } 293 294 var _ v7.ManifestParser = new(FakeManifestParser)