github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/cf/commands/user/userfakes/fake_org_role_setter.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package userfakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/cf/commandregistry" 8 "code.cloudfoundry.org/cli/cf/commands/user" 9 "code.cloudfoundry.org/cli/cf/flags" 10 "code.cloudfoundry.org/cli/cf/models" 11 "code.cloudfoundry.org/cli/cf/requirements" 12 ) 13 14 type FakeOrgRoleSetter struct { 15 ExecuteStub func(flags.FlagContext) error 16 executeMutex sync.RWMutex 17 executeArgsForCall []struct { 18 arg1 flags.FlagContext 19 } 20 executeReturns struct { 21 result1 error 22 } 23 executeReturnsOnCall map[int]struct { 24 result1 error 25 } 26 MetaDataStub func() commandregistry.CommandMetadata 27 metaDataMutex sync.RWMutex 28 metaDataArgsForCall []struct { 29 } 30 metaDataReturns struct { 31 result1 commandregistry.CommandMetadata 32 } 33 metaDataReturnsOnCall map[int]struct { 34 result1 commandregistry.CommandMetadata 35 } 36 RequirementsStub func(requirements.Factory, flags.FlagContext) ([]requirements.Requirement, error) 37 requirementsMutex sync.RWMutex 38 requirementsArgsForCall []struct { 39 arg1 requirements.Factory 40 arg2 flags.FlagContext 41 } 42 requirementsReturns struct { 43 result1 []requirements.Requirement 44 result2 error 45 } 46 requirementsReturnsOnCall map[int]struct { 47 result1 []requirements.Requirement 48 result2 error 49 } 50 SetDependencyStub func(commandregistry.Dependency, bool) commandregistry.Command 51 setDependencyMutex sync.RWMutex 52 setDependencyArgsForCall []struct { 53 arg1 commandregistry.Dependency 54 arg2 bool 55 } 56 setDependencyReturns struct { 57 result1 commandregistry.Command 58 } 59 setDependencyReturnsOnCall map[int]struct { 60 result1 commandregistry.Command 61 } 62 SetOrgRoleStub func(string, models.Role, string, string) error 63 setOrgRoleMutex sync.RWMutex 64 setOrgRoleArgsForCall []struct { 65 arg1 string 66 arg2 models.Role 67 arg3 string 68 arg4 string 69 } 70 setOrgRoleReturns struct { 71 result1 error 72 } 73 setOrgRoleReturnsOnCall map[int]struct { 74 result1 error 75 } 76 invocations map[string][][]interface{} 77 invocationsMutex sync.RWMutex 78 } 79 80 func (fake *FakeOrgRoleSetter) Execute(arg1 flags.FlagContext) error { 81 fake.executeMutex.Lock() 82 ret, specificReturn := fake.executeReturnsOnCall[len(fake.executeArgsForCall)] 83 fake.executeArgsForCall = append(fake.executeArgsForCall, struct { 84 arg1 flags.FlagContext 85 }{arg1}) 86 fake.recordInvocation("Execute", []interface{}{arg1}) 87 fake.executeMutex.Unlock() 88 if fake.ExecuteStub != nil { 89 return fake.ExecuteStub(arg1) 90 } 91 if specificReturn { 92 return ret.result1 93 } 94 fakeReturns := fake.executeReturns 95 return fakeReturns.result1 96 } 97 98 func (fake *FakeOrgRoleSetter) ExecuteCallCount() int { 99 fake.executeMutex.RLock() 100 defer fake.executeMutex.RUnlock() 101 return len(fake.executeArgsForCall) 102 } 103 104 func (fake *FakeOrgRoleSetter) ExecuteCalls(stub func(flags.FlagContext) error) { 105 fake.executeMutex.Lock() 106 defer fake.executeMutex.Unlock() 107 fake.ExecuteStub = stub 108 } 109 110 func (fake *FakeOrgRoleSetter) ExecuteArgsForCall(i int) flags.FlagContext { 111 fake.executeMutex.RLock() 112 defer fake.executeMutex.RUnlock() 113 argsForCall := fake.executeArgsForCall[i] 114 return argsForCall.arg1 115 } 116 117 func (fake *FakeOrgRoleSetter) ExecuteReturns(result1 error) { 118 fake.executeMutex.Lock() 119 defer fake.executeMutex.Unlock() 120 fake.ExecuteStub = nil 121 fake.executeReturns = struct { 122 result1 error 123 }{result1} 124 } 125 126 func (fake *FakeOrgRoleSetter) ExecuteReturnsOnCall(i int, result1 error) { 127 fake.executeMutex.Lock() 128 defer fake.executeMutex.Unlock() 129 fake.ExecuteStub = nil 130 if fake.executeReturnsOnCall == nil { 131 fake.executeReturnsOnCall = make(map[int]struct { 132 result1 error 133 }) 134 } 135 fake.executeReturnsOnCall[i] = struct { 136 result1 error 137 }{result1} 138 } 139 140 func (fake *FakeOrgRoleSetter) MetaData() commandregistry.CommandMetadata { 141 fake.metaDataMutex.Lock() 142 ret, specificReturn := fake.metaDataReturnsOnCall[len(fake.metaDataArgsForCall)] 143 fake.metaDataArgsForCall = append(fake.metaDataArgsForCall, struct { 144 }{}) 145 fake.recordInvocation("MetaData", []interface{}{}) 146 fake.metaDataMutex.Unlock() 147 if fake.MetaDataStub != nil { 148 return fake.MetaDataStub() 149 } 150 if specificReturn { 151 return ret.result1 152 } 153 fakeReturns := fake.metaDataReturns 154 return fakeReturns.result1 155 } 156 157 func (fake *FakeOrgRoleSetter) MetaDataCallCount() int { 158 fake.metaDataMutex.RLock() 159 defer fake.metaDataMutex.RUnlock() 160 return len(fake.metaDataArgsForCall) 161 } 162 163 func (fake *FakeOrgRoleSetter) MetaDataCalls(stub func() commandregistry.CommandMetadata) { 164 fake.metaDataMutex.Lock() 165 defer fake.metaDataMutex.Unlock() 166 fake.MetaDataStub = stub 167 } 168 169 func (fake *FakeOrgRoleSetter) MetaDataReturns(result1 commandregistry.CommandMetadata) { 170 fake.metaDataMutex.Lock() 171 defer fake.metaDataMutex.Unlock() 172 fake.MetaDataStub = nil 173 fake.metaDataReturns = struct { 174 result1 commandregistry.CommandMetadata 175 }{result1} 176 } 177 178 func (fake *FakeOrgRoleSetter) MetaDataReturnsOnCall(i int, result1 commandregistry.CommandMetadata) { 179 fake.metaDataMutex.Lock() 180 defer fake.metaDataMutex.Unlock() 181 fake.MetaDataStub = nil 182 if fake.metaDataReturnsOnCall == nil { 183 fake.metaDataReturnsOnCall = make(map[int]struct { 184 result1 commandregistry.CommandMetadata 185 }) 186 } 187 fake.metaDataReturnsOnCall[i] = struct { 188 result1 commandregistry.CommandMetadata 189 }{result1} 190 } 191 192 func (fake *FakeOrgRoleSetter) Requirements(arg1 requirements.Factory, arg2 flags.FlagContext) ([]requirements.Requirement, error) { 193 fake.requirementsMutex.Lock() 194 ret, specificReturn := fake.requirementsReturnsOnCall[len(fake.requirementsArgsForCall)] 195 fake.requirementsArgsForCall = append(fake.requirementsArgsForCall, struct { 196 arg1 requirements.Factory 197 arg2 flags.FlagContext 198 }{arg1, arg2}) 199 fake.recordInvocation("Requirements", []interface{}{arg1, arg2}) 200 fake.requirementsMutex.Unlock() 201 if fake.RequirementsStub != nil { 202 return fake.RequirementsStub(arg1, arg2) 203 } 204 if specificReturn { 205 return ret.result1, ret.result2 206 } 207 fakeReturns := fake.requirementsReturns 208 return fakeReturns.result1, fakeReturns.result2 209 } 210 211 func (fake *FakeOrgRoleSetter) RequirementsCallCount() int { 212 fake.requirementsMutex.RLock() 213 defer fake.requirementsMutex.RUnlock() 214 return len(fake.requirementsArgsForCall) 215 } 216 217 func (fake *FakeOrgRoleSetter) RequirementsCalls(stub func(requirements.Factory, flags.FlagContext) ([]requirements.Requirement, error)) { 218 fake.requirementsMutex.Lock() 219 defer fake.requirementsMutex.Unlock() 220 fake.RequirementsStub = stub 221 } 222 223 func (fake *FakeOrgRoleSetter) RequirementsArgsForCall(i int) (requirements.Factory, flags.FlagContext) { 224 fake.requirementsMutex.RLock() 225 defer fake.requirementsMutex.RUnlock() 226 argsForCall := fake.requirementsArgsForCall[i] 227 return argsForCall.arg1, argsForCall.arg2 228 } 229 230 func (fake *FakeOrgRoleSetter) RequirementsReturns(result1 []requirements.Requirement, result2 error) { 231 fake.requirementsMutex.Lock() 232 defer fake.requirementsMutex.Unlock() 233 fake.RequirementsStub = nil 234 fake.requirementsReturns = struct { 235 result1 []requirements.Requirement 236 result2 error 237 }{result1, result2} 238 } 239 240 func (fake *FakeOrgRoleSetter) RequirementsReturnsOnCall(i int, result1 []requirements.Requirement, result2 error) { 241 fake.requirementsMutex.Lock() 242 defer fake.requirementsMutex.Unlock() 243 fake.RequirementsStub = nil 244 if fake.requirementsReturnsOnCall == nil { 245 fake.requirementsReturnsOnCall = make(map[int]struct { 246 result1 []requirements.Requirement 247 result2 error 248 }) 249 } 250 fake.requirementsReturnsOnCall[i] = struct { 251 result1 []requirements.Requirement 252 result2 error 253 }{result1, result2} 254 } 255 256 func (fake *FakeOrgRoleSetter) SetDependency(arg1 commandregistry.Dependency, arg2 bool) commandregistry.Command { 257 fake.setDependencyMutex.Lock() 258 ret, specificReturn := fake.setDependencyReturnsOnCall[len(fake.setDependencyArgsForCall)] 259 fake.setDependencyArgsForCall = append(fake.setDependencyArgsForCall, struct { 260 arg1 commandregistry.Dependency 261 arg2 bool 262 }{arg1, arg2}) 263 fake.recordInvocation("SetDependency", []interface{}{arg1, arg2}) 264 fake.setDependencyMutex.Unlock() 265 if fake.SetDependencyStub != nil { 266 return fake.SetDependencyStub(arg1, arg2) 267 } 268 if specificReturn { 269 return ret.result1 270 } 271 fakeReturns := fake.setDependencyReturns 272 return fakeReturns.result1 273 } 274 275 func (fake *FakeOrgRoleSetter) SetDependencyCallCount() int { 276 fake.setDependencyMutex.RLock() 277 defer fake.setDependencyMutex.RUnlock() 278 return len(fake.setDependencyArgsForCall) 279 } 280 281 func (fake *FakeOrgRoleSetter) SetDependencyCalls(stub func(commandregistry.Dependency, bool) commandregistry.Command) { 282 fake.setDependencyMutex.Lock() 283 defer fake.setDependencyMutex.Unlock() 284 fake.SetDependencyStub = stub 285 } 286 287 func (fake *FakeOrgRoleSetter) SetDependencyArgsForCall(i int) (commandregistry.Dependency, bool) { 288 fake.setDependencyMutex.RLock() 289 defer fake.setDependencyMutex.RUnlock() 290 argsForCall := fake.setDependencyArgsForCall[i] 291 return argsForCall.arg1, argsForCall.arg2 292 } 293 294 func (fake *FakeOrgRoleSetter) SetDependencyReturns(result1 commandregistry.Command) { 295 fake.setDependencyMutex.Lock() 296 defer fake.setDependencyMutex.Unlock() 297 fake.SetDependencyStub = nil 298 fake.setDependencyReturns = struct { 299 result1 commandregistry.Command 300 }{result1} 301 } 302 303 func (fake *FakeOrgRoleSetter) SetDependencyReturnsOnCall(i int, result1 commandregistry.Command) { 304 fake.setDependencyMutex.Lock() 305 defer fake.setDependencyMutex.Unlock() 306 fake.SetDependencyStub = nil 307 if fake.setDependencyReturnsOnCall == nil { 308 fake.setDependencyReturnsOnCall = make(map[int]struct { 309 result1 commandregistry.Command 310 }) 311 } 312 fake.setDependencyReturnsOnCall[i] = struct { 313 result1 commandregistry.Command 314 }{result1} 315 } 316 317 func (fake *FakeOrgRoleSetter) SetOrgRole(arg1 string, arg2 models.Role, arg3 string, arg4 string) error { 318 fake.setOrgRoleMutex.Lock() 319 ret, specificReturn := fake.setOrgRoleReturnsOnCall[len(fake.setOrgRoleArgsForCall)] 320 fake.setOrgRoleArgsForCall = append(fake.setOrgRoleArgsForCall, struct { 321 arg1 string 322 arg2 models.Role 323 arg3 string 324 arg4 string 325 }{arg1, arg2, arg3, arg4}) 326 fake.recordInvocation("SetOrgRole", []interface{}{arg1, arg2, arg3, arg4}) 327 fake.setOrgRoleMutex.Unlock() 328 if fake.SetOrgRoleStub != nil { 329 return fake.SetOrgRoleStub(arg1, arg2, arg3, arg4) 330 } 331 if specificReturn { 332 return ret.result1 333 } 334 fakeReturns := fake.setOrgRoleReturns 335 return fakeReturns.result1 336 } 337 338 func (fake *FakeOrgRoleSetter) SetOrgRoleCallCount() int { 339 fake.setOrgRoleMutex.RLock() 340 defer fake.setOrgRoleMutex.RUnlock() 341 return len(fake.setOrgRoleArgsForCall) 342 } 343 344 func (fake *FakeOrgRoleSetter) SetOrgRoleCalls(stub func(string, models.Role, string, string) error) { 345 fake.setOrgRoleMutex.Lock() 346 defer fake.setOrgRoleMutex.Unlock() 347 fake.SetOrgRoleStub = stub 348 } 349 350 func (fake *FakeOrgRoleSetter) SetOrgRoleArgsForCall(i int) (string, models.Role, string, string) { 351 fake.setOrgRoleMutex.RLock() 352 defer fake.setOrgRoleMutex.RUnlock() 353 argsForCall := fake.setOrgRoleArgsForCall[i] 354 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4 355 } 356 357 func (fake *FakeOrgRoleSetter) SetOrgRoleReturns(result1 error) { 358 fake.setOrgRoleMutex.Lock() 359 defer fake.setOrgRoleMutex.Unlock() 360 fake.SetOrgRoleStub = nil 361 fake.setOrgRoleReturns = struct { 362 result1 error 363 }{result1} 364 } 365 366 func (fake *FakeOrgRoleSetter) SetOrgRoleReturnsOnCall(i int, result1 error) { 367 fake.setOrgRoleMutex.Lock() 368 defer fake.setOrgRoleMutex.Unlock() 369 fake.SetOrgRoleStub = nil 370 if fake.setOrgRoleReturnsOnCall == nil { 371 fake.setOrgRoleReturnsOnCall = make(map[int]struct { 372 result1 error 373 }) 374 } 375 fake.setOrgRoleReturnsOnCall[i] = struct { 376 result1 error 377 }{result1} 378 } 379 380 func (fake *FakeOrgRoleSetter) Invocations() map[string][][]interface{} { 381 fake.invocationsMutex.RLock() 382 defer fake.invocationsMutex.RUnlock() 383 fake.executeMutex.RLock() 384 defer fake.executeMutex.RUnlock() 385 fake.metaDataMutex.RLock() 386 defer fake.metaDataMutex.RUnlock() 387 fake.requirementsMutex.RLock() 388 defer fake.requirementsMutex.RUnlock() 389 fake.setDependencyMutex.RLock() 390 defer fake.setDependencyMutex.RUnlock() 391 fake.setOrgRoleMutex.RLock() 392 defer fake.setOrgRoleMutex.RUnlock() 393 copiedInvocations := map[string][][]interface{}{} 394 for key, value := range fake.invocations { 395 copiedInvocations[key] = value 396 } 397 return copiedInvocations 398 } 399 400 func (fake *FakeOrgRoleSetter) recordInvocation(key string, args []interface{}) { 401 fake.invocationsMutex.Lock() 402 defer fake.invocationsMutex.Unlock() 403 if fake.invocations == nil { 404 fake.invocations = map[string][][]interface{}{} 405 } 406 if fake.invocations[key] == nil { 407 fake.invocations[key] = [][]interface{}{} 408 } 409 fake.invocations[key] = append(fake.invocations[key], args) 410 } 411 412 var _ user.OrgRoleSetter = new(FakeOrgRoleSetter)