github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/command/v7/v7fakes/fake_auth_actor.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package v7fakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/api/uaa/constant" 8 v7 "code.cloudfoundry.org/cli/command/v7" 9 ) 10 11 type FakeAuthActor struct { 12 AuthenticateStub func(map[string]string, string, constant.GrantType) error 13 authenticateMutex sync.RWMutex 14 authenticateArgsForCall []struct { 15 arg1 map[string]string 16 arg2 string 17 arg3 constant.GrantType 18 } 19 authenticateReturns struct { 20 result1 error 21 } 22 authenticateReturnsOnCall map[int]struct { 23 result1 error 24 } 25 CloudControllerAPIVersionStub func() string 26 cloudControllerAPIVersionMutex sync.RWMutex 27 cloudControllerAPIVersionArgsForCall []struct { 28 } 29 cloudControllerAPIVersionReturns struct { 30 result1 string 31 } 32 cloudControllerAPIVersionReturnsOnCall map[int]struct { 33 result1 string 34 } 35 UAAAPIVersionStub func() string 36 uAAAPIVersionMutex sync.RWMutex 37 uAAAPIVersionArgsForCall []struct { 38 } 39 uAAAPIVersionReturns struct { 40 result1 string 41 } 42 uAAAPIVersionReturnsOnCall map[int]struct { 43 result1 string 44 } 45 invocations map[string][][]interface{} 46 invocationsMutex sync.RWMutex 47 } 48 49 func (fake *FakeAuthActor) Authenticate(arg1 map[string]string, arg2 string, arg3 constant.GrantType) error { 50 fake.authenticateMutex.Lock() 51 ret, specificReturn := fake.authenticateReturnsOnCall[len(fake.authenticateArgsForCall)] 52 fake.authenticateArgsForCall = append(fake.authenticateArgsForCall, struct { 53 arg1 map[string]string 54 arg2 string 55 arg3 constant.GrantType 56 }{arg1, arg2, arg3}) 57 fake.recordInvocation("Authenticate", []interface{}{arg1, arg2, arg3}) 58 fake.authenticateMutex.Unlock() 59 if fake.AuthenticateStub != nil { 60 return fake.AuthenticateStub(arg1, arg2, arg3) 61 } 62 if specificReturn { 63 return ret.result1 64 } 65 fakeReturns := fake.authenticateReturns 66 return fakeReturns.result1 67 } 68 69 func (fake *FakeAuthActor) AuthenticateCallCount() int { 70 fake.authenticateMutex.RLock() 71 defer fake.authenticateMutex.RUnlock() 72 return len(fake.authenticateArgsForCall) 73 } 74 75 func (fake *FakeAuthActor) AuthenticateCalls(stub func(map[string]string, string, constant.GrantType) error) { 76 fake.authenticateMutex.Lock() 77 defer fake.authenticateMutex.Unlock() 78 fake.AuthenticateStub = stub 79 } 80 81 func (fake *FakeAuthActor) AuthenticateArgsForCall(i int) (map[string]string, string, constant.GrantType) { 82 fake.authenticateMutex.RLock() 83 defer fake.authenticateMutex.RUnlock() 84 argsForCall := fake.authenticateArgsForCall[i] 85 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 86 } 87 88 func (fake *FakeAuthActor) AuthenticateReturns(result1 error) { 89 fake.authenticateMutex.Lock() 90 defer fake.authenticateMutex.Unlock() 91 fake.AuthenticateStub = nil 92 fake.authenticateReturns = struct { 93 result1 error 94 }{result1} 95 } 96 97 func (fake *FakeAuthActor) AuthenticateReturnsOnCall(i int, result1 error) { 98 fake.authenticateMutex.Lock() 99 defer fake.authenticateMutex.Unlock() 100 fake.AuthenticateStub = nil 101 if fake.authenticateReturnsOnCall == nil { 102 fake.authenticateReturnsOnCall = make(map[int]struct { 103 result1 error 104 }) 105 } 106 fake.authenticateReturnsOnCall[i] = struct { 107 result1 error 108 }{result1} 109 } 110 111 func (fake *FakeAuthActor) CloudControllerAPIVersion() string { 112 fake.cloudControllerAPIVersionMutex.Lock() 113 ret, specificReturn := fake.cloudControllerAPIVersionReturnsOnCall[len(fake.cloudControllerAPIVersionArgsForCall)] 114 fake.cloudControllerAPIVersionArgsForCall = append(fake.cloudControllerAPIVersionArgsForCall, struct { 115 }{}) 116 fake.recordInvocation("CloudControllerAPIVersion", []interface{}{}) 117 fake.cloudControllerAPIVersionMutex.Unlock() 118 if fake.CloudControllerAPIVersionStub != nil { 119 return fake.CloudControllerAPIVersionStub() 120 } 121 if specificReturn { 122 return ret.result1 123 } 124 fakeReturns := fake.cloudControllerAPIVersionReturns 125 return fakeReturns.result1 126 } 127 128 func (fake *FakeAuthActor) CloudControllerAPIVersionCallCount() int { 129 fake.cloudControllerAPIVersionMutex.RLock() 130 defer fake.cloudControllerAPIVersionMutex.RUnlock() 131 return len(fake.cloudControllerAPIVersionArgsForCall) 132 } 133 134 func (fake *FakeAuthActor) CloudControllerAPIVersionCalls(stub func() string) { 135 fake.cloudControllerAPIVersionMutex.Lock() 136 defer fake.cloudControllerAPIVersionMutex.Unlock() 137 fake.CloudControllerAPIVersionStub = stub 138 } 139 140 func (fake *FakeAuthActor) CloudControllerAPIVersionReturns(result1 string) { 141 fake.cloudControllerAPIVersionMutex.Lock() 142 defer fake.cloudControllerAPIVersionMutex.Unlock() 143 fake.CloudControllerAPIVersionStub = nil 144 fake.cloudControllerAPIVersionReturns = struct { 145 result1 string 146 }{result1} 147 } 148 149 func (fake *FakeAuthActor) CloudControllerAPIVersionReturnsOnCall(i int, result1 string) { 150 fake.cloudControllerAPIVersionMutex.Lock() 151 defer fake.cloudControllerAPIVersionMutex.Unlock() 152 fake.CloudControllerAPIVersionStub = nil 153 if fake.cloudControllerAPIVersionReturnsOnCall == nil { 154 fake.cloudControllerAPIVersionReturnsOnCall = make(map[int]struct { 155 result1 string 156 }) 157 } 158 fake.cloudControllerAPIVersionReturnsOnCall[i] = struct { 159 result1 string 160 }{result1} 161 } 162 163 func (fake *FakeAuthActor) UAAAPIVersion() string { 164 fake.uAAAPIVersionMutex.Lock() 165 ret, specificReturn := fake.uAAAPIVersionReturnsOnCall[len(fake.uAAAPIVersionArgsForCall)] 166 fake.uAAAPIVersionArgsForCall = append(fake.uAAAPIVersionArgsForCall, struct { 167 }{}) 168 fake.recordInvocation("UAAAPIVersion", []interface{}{}) 169 fake.uAAAPIVersionMutex.Unlock() 170 if fake.UAAAPIVersionStub != nil { 171 return fake.UAAAPIVersionStub() 172 } 173 if specificReturn { 174 return ret.result1 175 } 176 fakeReturns := fake.uAAAPIVersionReturns 177 return fakeReturns.result1 178 } 179 180 func (fake *FakeAuthActor) UAAAPIVersionCallCount() int { 181 fake.uAAAPIVersionMutex.RLock() 182 defer fake.uAAAPIVersionMutex.RUnlock() 183 return len(fake.uAAAPIVersionArgsForCall) 184 } 185 186 func (fake *FakeAuthActor) UAAAPIVersionCalls(stub func() string) { 187 fake.uAAAPIVersionMutex.Lock() 188 defer fake.uAAAPIVersionMutex.Unlock() 189 fake.UAAAPIVersionStub = stub 190 } 191 192 func (fake *FakeAuthActor) UAAAPIVersionReturns(result1 string) { 193 fake.uAAAPIVersionMutex.Lock() 194 defer fake.uAAAPIVersionMutex.Unlock() 195 fake.UAAAPIVersionStub = nil 196 fake.uAAAPIVersionReturns = struct { 197 result1 string 198 }{result1} 199 } 200 201 func (fake *FakeAuthActor) UAAAPIVersionReturnsOnCall(i int, result1 string) { 202 fake.uAAAPIVersionMutex.Lock() 203 defer fake.uAAAPIVersionMutex.Unlock() 204 fake.UAAAPIVersionStub = nil 205 if fake.uAAAPIVersionReturnsOnCall == nil { 206 fake.uAAAPIVersionReturnsOnCall = make(map[int]struct { 207 result1 string 208 }) 209 } 210 fake.uAAAPIVersionReturnsOnCall[i] = struct { 211 result1 string 212 }{result1} 213 } 214 215 func (fake *FakeAuthActor) Invocations() map[string][][]interface{} { 216 fake.invocationsMutex.RLock() 217 defer fake.invocationsMutex.RUnlock() 218 fake.authenticateMutex.RLock() 219 defer fake.authenticateMutex.RUnlock() 220 fake.cloudControllerAPIVersionMutex.RLock() 221 defer fake.cloudControllerAPIVersionMutex.RUnlock() 222 fake.uAAAPIVersionMutex.RLock() 223 defer fake.uAAAPIVersionMutex.RUnlock() 224 copiedInvocations := map[string][][]interface{}{} 225 for key, value := range fake.invocations { 226 copiedInvocations[key] = value 227 } 228 return copiedInvocations 229 } 230 231 func (fake *FakeAuthActor) recordInvocation(key string, args []interface{}) { 232 fake.invocationsMutex.Lock() 233 defer fake.invocationsMutex.Unlock() 234 if fake.invocations == nil { 235 fake.invocations = map[string][][]interface{}{} 236 } 237 if fake.invocations[key] == nil { 238 fake.invocations[key] = [][]interface{}{} 239 } 240 fake.invocations[key] = append(fake.invocations[key], args) 241 } 242 243 var _ v7.AuthActor = new(FakeAuthActor)