github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/cf/api/password/passwordfakes/fake_repository.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package passwordfakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/cf/api/password" 8 ) 9 10 type FakeRepository struct { 11 UpdatePasswordStub func(string, string) error 12 updatePasswordMutex sync.RWMutex 13 updatePasswordArgsForCall []struct { 14 arg1 string 15 arg2 string 16 } 17 updatePasswordReturns struct { 18 result1 error 19 } 20 updatePasswordReturnsOnCall map[int]struct { 21 result1 error 22 } 23 invocations map[string][][]interface{} 24 invocationsMutex sync.RWMutex 25 } 26 27 func (fake *FakeRepository) UpdatePassword(arg1 string, arg2 string) error { 28 fake.updatePasswordMutex.Lock() 29 ret, specificReturn := fake.updatePasswordReturnsOnCall[len(fake.updatePasswordArgsForCall)] 30 fake.updatePasswordArgsForCall = append(fake.updatePasswordArgsForCall, struct { 31 arg1 string 32 arg2 string 33 }{arg1, arg2}) 34 fake.recordInvocation("UpdatePassword", []interface{}{arg1, arg2}) 35 fake.updatePasswordMutex.Unlock() 36 if fake.UpdatePasswordStub != nil { 37 return fake.UpdatePasswordStub(arg1, arg2) 38 } 39 if specificReturn { 40 return ret.result1 41 } 42 fakeReturns := fake.updatePasswordReturns 43 return fakeReturns.result1 44 } 45 46 func (fake *FakeRepository) UpdatePasswordCallCount() int { 47 fake.updatePasswordMutex.RLock() 48 defer fake.updatePasswordMutex.RUnlock() 49 return len(fake.updatePasswordArgsForCall) 50 } 51 52 func (fake *FakeRepository) UpdatePasswordCalls(stub func(string, string) error) { 53 fake.updatePasswordMutex.Lock() 54 defer fake.updatePasswordMutex.Unlock() 55 fake.UpdatePasswordStub = stub 56 } 57 58 func (fake *FakeRepository) UpdatePasswordArgsForCall(i int) (string, string) { 59 fake.updatePasswordMutex.RLock() 60 defer fake.updatePasswordMutex.RUnlock() 61 argsForCall := fake.updatePasswordArgsForCall[i] 62 return argsForCall.arg1, argsForCall.arg2 63 } 64 65 func (fake *FakeRepository) UpdatePasswordReturns(result1 error) { 66 fake.updatePasswordMutex.Lock() 67 defer fake.updatePasswordMutex.Unlock() 68 fake.UpdatePasswordStub = nil 69 fake.updatePasswordReturns = struct { 70 result1 error 71 }{result1} 72 } 73 74 func (fake *FakeRepository) UpdatePasswordReturnsOnCall(i int, result1 error) { 75 fake.updatePasswordMutex.Lock() 76 defer fake.updatePasswordMutex.Unlock() 77 fake.UpdatePasswordStub = nil 78 if fake.updatePasswordReturnsOnCall == nil { 79 fake.updatePasswordReturnsOnCall = make(map[int]struct { 80 result1 error 81 }) 82 } 83 fake.updatePasswordReturnsOnCall[i] = struct { 84 result1 error 85 }{result1} 86 } 87 88 func (fake *FakeRepository) Invocations() map[string][][]interface{} { 89 fake.invocationsMutex.RLock() 90 defer fake.invocationsMutex.RUnlock() 91 fake.updatePasswordMutex.RLock() 92 defer fake.updatePasswordMutex.RUnlock() 93 copiedInvocations := map[string][][]interface{}{} 94 for key, value := range fake.invocations { 95 copiedInvocations[key] = value 96 } 97 return copiedInvocations 98 } 99 100 func (fake *FakeRepository) recordInvocation(key string, args []interface{}) { 101 fake.invocationsMutex.Lock() 102 defer fake.invocationsMutex.Unlock() 103 if fake.invocations == nil { 104 fake.invocations = map[string][][]interface{}{} 105 } 106 if fake.invocations[key] == nil { 107 fake.invocations[key] = [][]interface{}{} 108 } 109 fake.invocations[key] = append(fake.invocations[key], args) 110 } 111 112 var _ password.Repository = new(FakeRepository)