github.com/arunkumar7540/cli@v6.45.0+incompatible/command/v6/v6fakes/fake_manifest_parser.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package v6fakes 3 4 import ( 5 "sync" 6 7 v6 "code.cloudfoundry.org/cli/command/v6" 8 "github.com/cloudfoundry/bosh-cli/director/template" 9 ) 10 11 type FakeManifestParser struct { 12 AppNamesStub func() []string 13 appNamesMutex sync.RWMutex 14 appNamesArgsForCall []struct { 15 } 16 appNamesReturns struct { 17 result1 []string 18 } 19 appNamesReturnsOnCall map[int]struct { 20 result1 []string 21 } 22 InterpolateAndParseStub func(string, []string, []template.VarKV) error 23 interpolateAndParseMutex sync.RWMutex 24 interpolateAndParseArgsForCall []struct { 25 arg1 string 26 arg2 []string 27 arg3 []template.VarKV 28 } 29 interpolateAndParseReturns struct { 30 result1 error 31 } 32 interpolateAndParseReturnsOnCall map[int]struct { 33 result1 error 34 } 35 RawAppManifestStub func(string) ([]byte, error) 36 rawAppManifestMutex sync.RWMutex 37 rawAppManifestArgsForCall []struct { 38 arg1 string 39 } 40 rawAppManifestReturns struct { 41 result1 []byte 42 result2 error 43 } 44 rawAppManifestReturnsOnCall map[int]struct { 45 result1 []byte 46 result2 error 47 } 48 invocations map[string][][]interface{} 49 invocationsMutex sync.RWMutex 50 } 51 52 func (fake *FakeManifestParser) AppNames() []string { 53 fake.appNamesMutex.Lock() 54 ret, specificReturn := fake.appNamesReturnsOnCall[len(fake.appNamesArgsForCall)] 55 fake.appNamesArgsForCall = append(fake.appNamesArgsForCall, struct { 56 }{}) 57 fake.recordInvocation("AppNames", []interface{}{}) 58 fake.appNamesMutex.Unlock() 59 if fake.AppNamesStub != nil { 60 return fake.AppNamesStub() 61 } 62 if specificReturn { 63 return ret.result1 64 } 65 fakeReturns := fake.appNamesReturns 66 return fakeReturns.result1 67 } 68 69 func (fake *FakeManifestParser) AppNamesCallCount() int { 70 fake.appNamesMutex.RLock() 71 defer fake.appNamesMutex.RUnlock() 72 return len(fake.appNamesArgsForCall) 73 } 74 75 func (fake *FakeManifestParser) AppNamesCalls(stub func() []string) { 76 fake.appNamesMutex.Lock() 77 defer fake.appNamesMutex.Unlock() 78 fake.AppNamesStub = stub 79 } 80 81 func (fake *FakeManifestParser) AppNamesReturns(result1 []string) { 82 fake.appNamesMutex.Lock() 83 defer fake.appNamesMutex.Unlock() 84 fake.AppNamesStub = nil 85 fake.appNamesReturns = struct { 86 result1 []string 87 }{result1} 88 } 89 90 func (fake *FakeManifestParser) AppNamesReturnsOnCall(i int, result1 []string) { 91 fake.appNamesMutex.Lock() 92 defer fake.appNamesMutex.Unlock() 93 fake.AppNamesStub = nil 94 if fake.appNamesReturnsOnCall == nil { 95 fake.appNamesReturnsOnCall = make(map[int]struct { 96 result1 []string 97 }) 98 } 99 fake.appNamesReturnsOnCall[i] = struct { 100 result1 []string 101 }{result1} 102 } 103 104 func (fake *FakeManifestParser) InterpolateAndParse(arg1 string, arg2 []string, arg3 []template.VarKV) error { 105 var arg2Copy []string 106 if arg2 != nil { 107 arg2Copy = make([]string, len(arg2)) 108 copy(arg2Copy, arg2) 109 } 110 var arg3Copy []template.VarKV 111 if arg3 != nil { 112 arg3Copy = make([]template.VarKV, len(arg3)) 113 copy(arg3Copy, arg3) 114 } 115 fake.interpolateAndParseMutex.Lock() 116 ret, specificReturn := fake.interpolateAndParseReturnsOnCall[len(fake.interpolateAndParseArgsForCall)] 117 fake.interpolateAndParseArgsForCall = append(fake.interpolateAndParseArgsForCall, struct { 118 arg1 string 119 arg2 []string 120 arg3 []template.VarKV 121 }{arg1, arg2Copy, arg3Copy}) 122 fake.recordInvocation("InterpolateAndParse", []interface{}{arg1, arg2Copy, arg3Copy}) 123 fake.interpolateAndParseMutex.Unlock() 124 if fake.InterpolateAndParseStub != nil { 125 return fake.InterpolateAndParseStub(arg1, arg2, arg3) 126 } 127 if specificReturn { 128 return ret.result1 129 } 130 fakeReturns := fake.interpolateAndParseReturns 131 return fakeReturns.result1 132 } 133 134 func (fake *FakeManifestParser) InterpolateAndParseCallCount() int { 135 fake.interpolateAndParseMutex.RLock() 136 defer fake.interpolateAndParseMutex.RUnlock() 137 return len(fake.interpolateAndParseArgsForCall) 138 } 139 140 func (fake *FakeManifestParser) InterpolateAndParseCalls(stub func(string, []string, []template.VarKV) error) { 141 fake.interpolateAndParseMutex.Lock() 142 defer fake.interpolateAndParseMutex.Unlock() 143 fake.InterpolateAndParseStub = stub 144 } 145 146 func (fake *FakeManifestParser) InterpolateAndParseArgsForCall(i int) (string, []string, []template.VarKV) { 147 fake.interpolateAndParseMutex.RLock() 148 defer fake.interpolateAndParseMutex.RUnlock() 149 argsForCall := fake.interpolateAndParseArgsForCall[i] 150 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 151 } 152 153 func (fake *FakeManifestParser) InterpolateAndParseReturns(result1 error) { 154 fake.interpolateAndParseMutex.Lock() 155 defer fake.interpolateAndParseMutex.Unlock() 156 fake.InterpolateAndParseStub = nil 157 fake.interpolateAndParseReturns = struct { 158 result1 error 159 }{result1} 160 } 161 162 func (fake *FakeManifestParser) InterpolateAndParseReturnsOnCall(i int, result1 error) { 163 fake.interpolateAndParseMutex.Lock() 164 defer fake.interpolateAndParseMutex.Unlock() 165 fake.InterpolateAndParseStub = nil 166 if fake.interpolateAndParseReturnsOnCall == nil { 167 fake.interpolateAndParseReturnsOnCall = make(map[int]struct { 168 result1 error 169 }) 170 } 171 fake.interpolateAndParseReturnsOnCall[i] = struct { 172 result1 error 173 }{result1} 174 } 175 176 func (fake *FakeManifestParser) RawAppManifest(arg1 string) ([]byte, error) { 177 fake.rawAppManifestMutex.Lock() 178 ret, specificReturn := fake.rawAppManifestReturnsOnCall[len(fake.rawAppManifestArgsForCall)] 179 fake.rawAppManifestArgsForCall = append(fake.rawAppManifestArgsForCall, struct { 180 arg1 string 181 }{arg1}) 182 fake.recordInvocation("RawAppManifest", []interface{}{arg1}) 183 fake.rawAppManifestMutex.Unlock() 184 if fake.RawAppManifestStub != nil { 185 return fake.RawAppManifestStub(arg1) 186 } 187 if specificReturn { 188 return ret.result1, ret.result2 189 } 190 fakeReturns := fake.rawAppManifestReturns 191 return fakeReturns.result1, fakeReturns.result2 192 } 193 194 func (fake *FakeManifestParser) RawAppManifestCallCount() int { 195 fake.rawAppManifestMutex.RLock() 196 defer fake.rawAppManifestMutex.RUnlock() 197 return len(fake.rawAppManifestArgsForCall) 198 } 199 200 func (fake *FakeManifestParser) RawAppManifestCalls(stub func(string) ([]byte, error)) { 201 fake.rawAppManifestMutex.Lock() 202 defer fake.rawAppManifestMutex.Unlock() 203 fake.RawAppManifestStub = stub 204 } 205 206 func (fake *FakeManifestParser) RawAppManifestArgsForCall(i int) string { 207 fake.rawAppManifestMutex.RLock() 208 defer fake.rawAppManifestMutex.RUnlock() 209 argsForCall := fake.rawAppManifestArgsForCall[i] 210 return argsForCall.arg1 211 } 212 213 func (fake *FakeManifestParser) RawAppManifestReturns(result1 []byte, result2 error) { 214 fake.rawAppManifestMutex.Lock() 215 defer fake.rawAppManifestMutex.Unlock() 216 fake.RawAppManifestStub = nil 217 fake.rawAppManifestReturns = struct { 218 result1 []byte 219 result2 error 220 }{result1, result2} 221 } 222 223 func (fake *FakeManifestParser) RawAppManifestReturnsOnCall(i int, result1 []byte, result2 error) { 224 fake.rawAppManifestMutex.Lock() 225 defer fake.rawAppManifestMutex.Unlock() 226 fake.RawAppManifestStub = nil 227 if fake.rawAppManifestReturnsOnCall == nil { 228 fake.rawAppManifestReturnsOnCall = make(map[int]struct { 229 result1 []byte 230 result2 error 231 }) 232 } 233 fake.rawAppManifestReturnsOnCall[i] = struct { 234 result1 []byte 235 result2 error 236 }{result1, result2} 237 } 238 239 func (fake *FakeManifestParser) Invocations() map[string][][]interface{} { 240 fake.invocationsMutex.RLock() 241 defer fake.invocationsMutex.RUnlock() 242 fake.appNamesMutex.RLock() 243 defer fake.appNamesMutex.RUnlock() 244 fake.interpolateAndParseMutex.RLock() 245 defer fake.interpolateAndParseMutex.RUnlock() 246 fake.rawAppManifestMutex.RLock() 247 defer fake.rawAppManifestMutex.RUnlock() 248 copiedInvocations := map[string][][]interface{}{} 249 for key, value := range fake.invocations { 250 copiedInvocations[key] = value 251 } 252 return copiedInvocations 253 } 254 255 func (fake *FakeManifestParser) recordInvocation(key string, args []interface{}) { 256 fake.invocationsMutex.Lock() 257 defer fake.invocationsMutex.Unlock() 258 if fake.invocations == nil { 259 fake.invocations = map[string][][]interface{}{} 260 } 261 if fake.invocations[key] == nil { 262 fake.invocations[key] = [][]interface{}{} 263 } 264 fake.invocations[key] = append(fake.invocations[key], args) 265 } 266 267 var _ v6.ManifestParser = new(FakeManifestParser)