github.com/swisscom/cloudfoundry-cli@v7.1.0+incompatible/actor/v2action/v2actionfakes/fake_uaaclient.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package v2actionfakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/actor/v2action" 8 "code.cloudfoundry.org/cli/api/uaa" 9 "code.cloudfoundry.org/cli/api/uaa/constant" 10 ) 11 12 type FakeUAAClient struct { 13 APIVersionStub func() string 14 aPIVersionMutex sync.RWMutex 15 aPIVersionArgsForCall []struct { 16 } 17 aPIVersionReturns struct { 18 result1 string 19 } 20 aPIVersionReturnsOnCall map[int]struct { 21 result1 string 22 } 23 AuthenticateStub func(map[string]string, string, constant.GrantType) (string, string, error) 24 authenticateMutex sync.RWMutex 25 authenticateArgsForCall []struct { 26 arg1 map[string]string 27 arg2 string 28 arg3 constant.GrantType 29 } 30 authenticateReturns struct { 31 result1 string 32 result2 string 33 result3 error 34 } 35 authenticateReturnsOnCall map[int]struct { 36 result1 string 37 result2 string 38 result3 error 39 } 40 CreateUserStub func(string, string, string) (uaa.User, error) 41 createUserMutex sync.RWMutex 42 createUserArgsForCall []struct { 43 arg1 string 44 arg2 string 45 arg3 string 46 } 47 createUserReturns struct { 48 result1 uaa.User 49 result2 error 50 } 51 createUserReturnsOnCall map[int]struct { 52 result1 uaa.User 53 result2 error 54 } 55 GetSSHPasscodeStub func(string, string) (string, error) 56 getSSHPasscodeMutex sync.RWMutex 57 getSSHPasscodeArgsForCall []struct { 58 arg1 string 59 arg2 string 60 } 61 getSSHPasscodeReturns struct { 62 result1 string 63 result2 error 64 } 65 getSSHPasscodeReturnsOnCall map[int]struct { 66 result1 string 67 result2 error 68 } 69 LoginPromptsStub func() map[string][]string 70 loginPromptsMutex sync.RWMutex 71 loginPromptsArgsForCall []struct { 72 } 73 loginPromptsReturns struct { 74 result1 map[string][]string 75 } 76 loginPromptsReturnsOnCall map[int]struct { 77 result1 map[string][]string 78 } 79 RefreshAccessTokenStub func(string) (uaa.RefreshedTokens, error) 80 refreshAccessTokenMutex sync.RWMutex 81 refreshAccessTokenArgsForCall []struct { 82 arg1 string 83 } 84 refreshAccessTokenReturns struct { 85 result1 uaa.RefreshedTokens 86 result2 error 87 } 88 refreshAccessTokenReturnsOnCall map[int]struct { 89 result1 uaa.RefreshedTokens 90 result2 error 91 } 92 invocations map[string][][]interface{} 93 invocationsMutex sync.RWMutex 94 } 95 96 func (fake *FakeUAAClient) APIVersion() string { 97 fake.aPIVersionMutex.Lock() 98 ret, specificReturn := fake.aPIVersionReturnsOnCall[len(fake.aPIVersionArgsForCall)] 99 fake.aPIVersionArgsForCall = append(fake.aPIVersionArgsForCall, struct { 100 }{}) 101 fake.recordInvocation("APIVersion", []interface{}{}) 102 fake.aPIVersionMutex.Unlock() 103 if fake.APIVersionStub != nil { 104 return fake.APIVersionStub() 105 } 106 if specificReturn { 107 return ret.result1 108 } 109 fakeReturns := fake.aPIVersionReturns 110 return fakeReturns.result1 111 } 112 113 func (fake *FakeUAAClient) APIVersionCallCount() int { 114 fake.aPIVersionMutex.RLock() 115 defer fake.aPIVersionMutex.RUnlock() 116 return len(fake.aPIVersionArgsForCall) 117 } 118 119 func (fake *FakeUAAClient) APIVersionCalls(stub func() string) { 120 fake.aPIVersionMutex.Lock() 121 defer fake.aPIVersionMutex.Unlock() 122 fake.APIVersionStub = stub 123 } 124 125 func (fake *FakeUAAClient) APIVersionReturns(result1 string) { 126 fake.aPIVersionMutex.Lock() 127 defer fake.aPIVersionMutex.Unlock() 128 fake.APIVersionStub = nil 129 fake.aPIVersionReturns = struct { 130 result1 string 131 }{result1} 132 } 133 134 func (fake *FakeUAAClient) APIVersionReturnsOnCall(i int, result1 string) { 135 fake.aPIVersionMutex.Lock() 136 defer fake.aPIVersionMutex.Unlock() 137 fake.APIVersionStub = nil 138 if fake.aPIVersionReturnsOnCall == nil { 139 fake.aPIVersionReturnsOnCall = make(map[int]struct { 140 result1 string 141 }) 142 } 143 fake.aPIVersionReturnsOnCall[i] = struct { 144 result1 string 145 }{result1} 146 } 147 148 func (fake *FakeUAAClient) Authenticate(arg1 map[string]string, arg2 string, arg3 constant.GrantType) (string, string, error) { 149 fake.authenticateMutex.Lock() 150 ret, specificReturn := fake.authenticateReturnsOnCall[len(fake.authenticateArgsForCall)] 151 fake.authenticateArgsForCall = append(fake.authenticateArgsForCall, struct { 152 arg1 map[string]string 153 arg2 string 154 arg3 constant.GrantType 155 }{arg1, arg2, arg3}) 156 fake.recordInvocation("Authenticate", []interface{}{arg1, arg2, arg3}) 157 fake.authenticateMutex.Unlock() 158 if fake.AuthenticateStub != nil { 159 return fake.AuthenticateStub(arg1, arg2, arg3) 160 } 161 if specificReturn { 162 return ret.result1, ret.result2, ret.result3 163 } 164 fakeReturns := fake.authenticateReturns 165 return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3 166 } 167 168 func (fake *FakeUAAClient) AuthenticateCallCount() int { 169 fake.authenticateMutex.RLock() 170 defer fake.authenticateMutex.RUnlock() 171 return len(fake.authenticateArgsForCall) 172 } 173 174 func (fake *FakeUAAClient) AuthenticateCalls(stub func(map[string]string, string, constant.GrantType) (string, string, error)) { 175 fake.authenticateMutex.Lock() 176 defer fake.authenticateMutex.Unlock() 177 fake.AuthenticateStub = stub 178 } 179 180 func (fake *FakeUAAClient) AuthenticateArgsForCall(i int) (map[string]string, string, constant.GrantType) { 181 fake.authenticateMutex.RLock() 182 defer fake.authenticateMutex.RUnlock() 183 argsForCall := fake.authenticateArgsForCall[i] 184 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 185 } 186 187 func (fake *FakeUAAClient) AuthenticateReturns(result1 string, result2 string, result3 error) { 188 fake.authenticateMutex.Lock() 189 defer fake.authenticateMutex.Unlock() 190 fake.AuthenticateStub = nil 191 fake.authenticateReturns = struct { 192 result1 string 193 result2 string 194 result3 error 195 }{result1, result2, result3} 196 } 197 198 func (fake *FakeUAAClient) AuthenticateReturnsOnCall(i int, result1 string, result2 string, result3 error) { 199 fake.authenticateMutex.Lock() 200 defer fake.authenticateMutex.Unlock() 201 fake.AuthenticateStub = nil 202 if fake.authenticateReturnsOnCall == nil { 203 fake.authenticateReturnsOnCall = make(map[int]struct { 204 result1 string 205 result2 string 206 result3 error 207 }) 208 } 209 fake.authenticateReturnsOnCall[i] = struct { 210 result1 string 211 result2 string 212 result3 error 213 }{result1, result2, result3} 214 } 215 216 func (fake *FakeUAAClient) CreateUser(arg1 string, arg2 string, arg3 string) (uaa.User, error) { 217 fake.createUserMutex.Lock() 218 ret, specificReturn := fake.createUserReturnsOnCall[len(fake.createUserArgsForCall)] 219 fake.createUserArgsForCall = append(fake.createUserArgsForCall, struct { 220 arg1 string 221 arg2 string 222 arg3 string 223 }{arg1, arg2, arg3}) 224 fake.recordInvocation("CreateUser", []interface{}{arg1, arg2, arg3}) 225 fake.createUserMutex.Unlock() 226 if fake.CreateUserStub != nil { 227 return fake.CreateUserStub(arg1, arg2, arg3) 228 } 229 if specificReturn { 230 return ret.result1, ret.result2 231 } 232 fakeReturns := fake.createUserReturns 233 return fakeReturns.result1, fakeReturns.result2 234 } 235 236 func (fake *FakeUAAClient) CreateUserCallCount() int { 237 fake.createUserMutex.RLock() 238 defer fake.createUserMutex.RUnlock() 239 return len(fake.createUserArgsForCall) 240 } 241 242 func (fake *FakeUAAClient) CreateUserCalls(stub func(string, string, string) (uaa.User, error)) { 243 fake.createUserMutex.Lock() 244 defer fake.createUserMutex.Unlock() 245 fake.CreateUserStub = stub 246 } 247 248 func (fake *FakeUAAClient) CreateUserArgsForCall(i int) (string, string, string) { 249 fake.createUserMutex.RLock() 250 defer fake.createUserMutex.RUnlock() 251 argsForCall := fake.createUserArgsForCall[i] 252 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 253 } 254 255 func (fake *FakeUAAClient) CreateUserReturns(result1 uaa.User, result2 error) { 256 fake.createUserMutex.Lock() 257 defer fake.createUserMutex.Unlock() 258 fake.CreateUserStub = nil 259 fake.createUserReturns = struct { 260 result1 uaa.User 261 result2 error 262 }{result1, result2} 263 } 264 265 func (fake *FakeUAAClient) CreateUserReturnsOnCall(i int, result1 uaa.User, result2 error) { 266 fake.createUserMutex.Lock() 267 defer fake.createUserMutex.Unlock() 268 fake.CreateUserStub = nil 269 if fake.createUserReturnsOnCall == nil { 270 fake.createUserReturnsOnCall = make(map[int]struct { 271 result1 uaa.User 272 result2 error 273 }) 274 } 275 fake.createUserReturnsOnCall[i] = struct { 276 result1 uaa.User 277 result2 error 278 }{result1, result2} 279 } 280 281 func (fake *FakeUAAClient) GetSSHPasscode(arg1 string, arg2 string) (string, error) { 282 fake.getSSHPasscodeMutex.Lock() 283 ret, specificReturn := fake.getSSHPasscodeReturnsOnCall[len(fake.getSSHPasscodeArgsForCall)] 284 fake.getSSHPasscodeArgsForCall = append(fake.getSSHPasscodeArgsForCall, struct { 285 arg1 string 286 arg2 string 287 }{arg1, arg2}) 288 fake.recordInvocation("GetSSHPasscode", []interface{}{arg1, arg2}) 289 fake.getSSHPasscodeMutex.Unlock() 290 if fake.GetSSHPasscodeStub != nil { 291 return fake.GetSSHPasscodeStub(arg1, arg2) 292 } 293 if specificReturn { 294 return ret.result1, ret.result2 295 } 296 fakeReturns := fake.getSSHPasscodeReturns 297 return fakeReturns.result1, fakeReturns.result2 298 } 299 300 func (fake *FakeUAAClient) GetSSHPasscodeCallCount() int { 301 fake.getSSHPasscodeMutex.RLock() 302 defer fake.getSSHPasscodeMutex.RUnlock() 303 return len(fake.getSSHPasscodeArgsForCall) 304 } 305 306 func (fake *FakeUAAClient) GetSSHPasscodeCalls(stub func(string, string) (string, error)) { 307 fake.getSSHPasscodeMutex.Lock() 308 defer fake.getSSHPasscodeMutex.Unlock() 309 fake.GetSSHPasscodeStub = stub 310 } 311 312 func (fake *FakeUAAClient) GetSSHPasscodeArgsForCall(i int) (string, string) { 313 fake.getSSHPasscodeMutex.RLock() 314 defer fake.getSSHPasscodeMutex.RUnlock() 315 argsForCall := fake.getSSHPasscodeArgsForCall[i] 316 return argsForCall.arg1, argsForCall.arg2 317 } 318 319 func (fake *FakeUAAClient) GetSSHPasscodeReturns(result1 string, result2 error) { 320 fake.getSSHPasscodeMutex.Lock() 321 defer fake.getSSHPasscodeMutex.Unlock() 322 fake.GetSSHPasscodeStub = nil 323 fake.getSSHPasscodeReturns = struct { 324 result1 string 325 result2 error 326 }{result1, result2} 327 } 328 329 func (fake *FakeUAAClient) GetSSHPasscodeReturnsOnCall(i int, result1 string, result2 error) { 330 fake.getSSHPasscodeMutex.Lock() 331 defer fake.getSSHPasscodeMutex.Unlock() 332 fake.GetSSHPasscodeStub = nil 333 if fake.getSSHPasscodeReturnsOnCall == nil { 334 fake.getSSHPasscodeReturnsOnCall = make(map[int]struct { 335 result1 string 336 result2 error 337 }) 338 } 339 fake.getSSHPasscodeReturnsOnCall[i] = struct { 340 result1 string 341 result2 error 342 }{result1, result2} 343 } 344 345 func (fake *FakeUAAClient) LoginPrompts() map[string][]string { 346 fake.loginPromptsMutex.Lock() 347 ret, specificReturn := fake.loginPromptsReturnsOnCall[len(fake.loginPromptsArgsForCall)] 348 fake.loginPromptsArgsForCall = append(fake.loginPromptsArgsForCall, struct { 349 }{}) 350 fake.recordInvocation("LoginPrompts", []interface{}{}) 351 fake.loginPromptsMutex.Unlock() 352 if fake.LoginPromptsStub != nil { 353 return fake.LoginPromptsStub() 354 } 355 if specificReturn { 356 return ret.result1 357 } 358 fakeReturns := fake.loginPromptsReturns 359 return fakeReturns.result1 360 } 361 362 func (fake *FakeUAAClient) LoginPromptsCallCount() int { 363 fake.loginPromptsMutex.RLock() 364 defer fake.loginPromptsMutex.RUnlock() 365 return len(fake.loginPromptsArgsForCall) 366 } 367 368 func (fake *FakeUAAClient) LoginPromptsCalls(stub func() map[string][]string) { 369 fake.loginPromptsMutex.Lock() 370 defer fake.loginPromptsMutex.Unlock() 371 fake.LoginPromptsStub = stub 372 } 373 374 func (fake *FakeUAAClient) LoginPromptsReturns(result1 map[string][]string) { 375 fake.loginPromptsMutex.Lock() 376 defer fake.loginPromptsMutex.Unlock() 377 fake.LoginPromptsStub = nil 378 fake.loginPromptsReturns = struct { 379 result1 map[string][]string 380 }{result1} 381 } 382 383 func (fake *FakeUAAClient) LoginPromptsReturnsOnCall(i int, result1 map[string][]string) { 384 fake.loginPromptsMutex.Lock() 385 defer fake.loginPromptsMutex.Unlock() 386 fake.LoginPromptsStub = nil 387 if fake.loginPromptsReturnsOnCall == nil { 388 fake.loginPromptsReturnsOnCall = make(map[int]struct { 389 result1 map[string][]string 390 }) 391 } 392 fake.loginPromptsReturnsOnCall[i] = struct { 393 result1 map[string][]string 394 }{result1} 395 } 396 397 func (fake *FakeUAAClient) RefreshAccessToken(arg1 string) (uaa.RefreshedTokens, error) { 398 fake.refreshAccessTokenMutex.Lock() 399 ret, specificReturn := fake.refreshAccessTokenReturnsOnCall[len(fake.refreshAccessTokenArgsForCall)] 400 fake.refreshAccessTokenArgsForCall = append(fake.refreshAccessTokenArgsForCall, struct { 401 arg1 string 402 }{arg1}) 403 fake.recordInvocation("RefreshAccessToken", []interface{}{arg1}) 404 fake.refreshAccessTokenMutex.Unlock() 405 if fake.RefreshAccessTokenStub != nil { 406 return fake.RefreshAccessTokenStub(arg1) 407 } 408 if specificReturn { 409 return ret.result1, ret.result2 410 } 411 fakeReturns := fake.refreshAccessTokenReturns 412 return fakeReturns.result1, fakeReturns.result2 413 } 414 415 func (fake *FakeUAAClient) RefreshAccessTokenCallCount() int { 416 fake.refreshAccessTokenMutex.RLock() 417 defer fake.refreshAccessTokenMutex.RUnlock() 418 return len(fake.refreshAccessTokenArgsForCall) 419 } 420 421 func (fake *FakeUAAClient) RefreshAccessTokenCalls(stub func(string) (uaa.RefreshedTokens, error)) { 422 fake.refreshAccessTokenMutex.Lock() 423 defer fake.refreshAccessTokenMutex.Unlock() 424 fake.RefreshAccessTokenStub = stub 425 } 426 427 func (fake *FakeUAAClient) RefreshAccessTokenArgsForCall(i int) string { 428 fake.refreshAccessTokenMutex.RLock() 429 defer fake.refreshAccessTokenMutex.RUnlock() 430 argsForCall := fake.refreshAccessTokenArgsForCall[i] 431 return argsForCall.arg1 432 } 433 434 func (fake *FakeUAAClient) RefreshAccessTokenReturns(result1 uaa.RefreshedTokens, result2 error) { 435 fake.refreshAccessTokenMutex.Lock() 436 defer fake.refreshAccessTokenMutex.Unlock() 437 fake.RefreshAccessTokenStub = nil 438 fake.refreshAccessTokenReturns = struct { 439 result1 uaa.RefreshedTokens 440 result2 error 441 }{result1, result2} 442 } 443 444 func (fake *FakeUAAClient) RefreshAccessTokenReturnsOnCall(i int, result1 uaa.RefreshedTokens, result2 error) { 445 fake.refreshAccessTokenMutex.Lock() 446 defer fake.refreshAccessTokenMutex.Unlock() 447 fake.RefreshAccessTokenStub = nil 448 if fake.refreshAccessTokenReturnsOnCall == nil { 449 fake.refreshAccessTokenReturnsOnCall = make(map[int]struct { 450 result1 uaa.RefreshedTokens 451 result2 error 452 }) 453 } 454 fake.refreshAccessTokenReturnsOnCall[i] = struct { 455 result1 uaa.RefreshedTokens 456 result2 error 457 }{result1, result2} 458 } 459 460 func (fake *FakeUAAClient) Invocations() map[string][][]interface{} { 461 fake.invocationsMutex.RLock() 462 defer fake.invocationsMutex.RUnlock() 463 fake.aPIVersionMutex.RLock() 464 defer fake.aPIVersionMutex.RUnlock() 465 fake.authenticateMutex.RLock() 466 defer fake.authenticateMutex.RUnlock() 467 fake.createUserMutex.RLock() 468 defer fake.createUserMutex.RUnlock() 469 fake.getSSHPasscodeMutex.RLock() 470 defer fake.getSSHPasscodeMutex.RUnlock() 471 fake.loginPromptsMutex.RLock() 472 defer fake.loginPromptsMutex.RUnlock() 473 fake.refreshAccessTokenMutex.RLock() 474 defer fake.refreshAccessTokenMutex.RUnlock() 475 copiedInvocations := map[string][][]interface{}{} 476 for key, value := range fake.invocations { 477 copiedInvocations[key] = value 478 } 479 return copiedInvocations 480 } 481 482 func (fake *FakeUAAClient) recordInvocation(key string, args []interface{}) { 483 fake.invocationsMutex.Lock() 484 defer fake.invocationsMutex.Unlock() 485 if fake.invocations == nil { 486 fake.invocations = map[string][][]interface{}{} 487 } 488 if fake.invocations[key] == nil { 489 fake.invocations[key] = [][]interface{}{} 490 } 491 fake.invocations[key] = append(fake.invocations[key], args) 492 } 493 494 var _ v2action.UAAClient = new(FakeUAAClient)