github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/cf/commands/user/userfakes/fake_space_role_setter.go (about) 1 // This file was generated by counterfeiter 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 FakeSpaceRoleSetter struct { 15 MetaDataStub func() commandregistry.CommandMetadata 16 metaDataMutex sync.RWMutex 17 metaDataArgsForCall []struct{} 18 metaDataReturns struct { 19 result1 commandregistry.CommandMetadata 20 } 21 SetDependencyStub func(deps commandregistry.Dependency, pluginCall bool) commandregistry.Command 22 setDependencyMutex sync.RWMutex 23 setDependencyArgsForCall []struct { 24 deps commandregistry.Dependency 25 pluginCall bool 26 } 27 setDependencyReturns struct { 28 result1 commandregistry.Command 29 } 30 RequirementsStub func(requirementsFactory requirements.Factory, context flags.FlagContext) ([]requirements.Requirement, error) 31 requirementsMutex sync.RWMutex 32 requirementsArgsForCall []struct { 33 requirementsFactory requirements.Factory 34 context flags.FlagContext 35 } 36 requirementsReturns struct { 37 result1 []requirements.Requirement 38 result2 error 39 } 40 ExecuteStub func(context flags.FlagContext) error 41 executeMutex sync.RWMutex 42 executeArgsForCall []struct { 43 context flags.FlagContext 44 } 45 executeReturns struct { 46 result1 error 47 } 48 SetSpaceRoleStub func(space models.Space, orgGUID, orgName string, role models.Role, userGUID, userName string) (err error) 49 setSpaceRoleMutex sync.RWMutex 50 setSpaceRoleArgsForCall []struct { 51 space models.Space 52 orgGUID string 53 orgName string 54 role models.Role 55 userGUID string 56 userName string 57 } 58 setSpaceRoleReturns struct { 59 result1 error 60 } 61 invocations map[string][][]interface{} 62 invocationsMutex sync.RWMutex 63 } 64 65 func (fake *FakeSpaceRoleSetter) MetaData() commandregistry.CommandMetadata { 66 fake.metaDataMutex.Lock() 67 fake.metaDataArgsForCall = append(fake.metaDataArgsForCall, struct{}{}) 68 fake.recordInvocation("MetaData", []interface{}{}) 69 fake.metaDataMutex.Unlock() 70 if fake.MetaDataStub != nil { 71 return fake.MetaDataStub() 72 } else { 73 return fake.metaDataReturns.result1 74 } 75 } 76 77 func (fake *FakeSpaceRoleSetter) MetaDataCallCount() int { 78 fake.metaDataMutex.RLock() 79 defer fake.metaDataMutex.RUnlock() 80 return len(fake.metaDataArgsForCall) 81 } 82 83 func (fake *FakeSpaceRoleSetter) MetaDataReturns(result1 commandregistry.CommandMetadata) { 84 fake.MetaDataStub = nil 85 fake.metaDataReturns = struct { 86 result1 commandregistry.CommandMetadata 87 }{result1} 88 } 89 90 func (fake *FakeSpaceRoleSetter) SetDependency(deps commandregistry.Dependency, pluginCall bool) commandregistry.Command { 91 fake.setDependencyMutex.Lock() 92 fake.setDependencyArgsForCall = append(fake.setDependencyArgsForCall, struct { 93 deps commandregistry.Dependency 94 pluginCall bool 95 }{deps, pluginCall}) 96 fake.recordInvocation("SetDependency", []interface{}{deps, pluginCall}) 97 fake.setDependencyMutex.Unlock() 98 if fake.SetDependencyStub != nil { 99 return fake.SetDependencyStub(deps, pluginCall) 100 } else { 101 return fake.setDependencyReturns.result1 102 } 103 } 104 105 func (fake *FakeSpaceRoleSetter) SetDependencyCallCount() int { 106 fake.setDependencyMutex.RLock() 107 defer fake.setDependencyMutex.RUnlock() 108 return len(fake.setDependencyArgsForCall) 109 } 110 111 func (fake *FakeSpaceRoleSetter) SetDependencyArgsForCall(i int) (commandregistry.Dependency, bool) { 112 fake.setDependencyMutex.RLock() 113 defer fake.setDependencyMutex.RUnlock() 114 return fake.setDependencyArgsForCall[i].deps, fake.setDependencyArgsForCall[i].pluginCall 115 } 116 117 func (fake *FakeSpaceRoleSetter) SetDependencyReturns(result1 commandregistry.Command) { 118 fake.SetDependencyStub = nil 119 fake.setDependencyReturns = struct { 120 result1 commandregistry.Command 121 }{result1} 122 } 123 124 func (fake *FakeSpaceRoleSetter) Requirements(requirementsFactory requirements.Factory, context flags.FlagContext) ([]requirements.Requirement, error) { 125 fake.requirementsMutex.Lock() 126 fake.requirementsArgsForCall = append(fake.requirementsArgsForCall, struct { 127 requirementsFactory requirements.Factory 128 context flags.FlagContext 129 }{requirementsFactory, context}) 130 fake.recordInvocation("Requirements", []interface{}{requirementsFactory, context}) 131 fake.requirementsMutex.Unlock() 132 if fake.RequirementsStub != nil { 133 return fake.RequirementsStub(requirementsFactory, context) 134 } else { 135 return fake.requirementsReturns.result1, fake.requirementsReturns.result2 136 } 137 } 138 139 func (fake *FakeSpaceRoleSetter) RequirementsCallCount() int { 140 fake.requirementsMutex.RLock() 141 defer fake.requirementsMutex.RUnlock() 142 return len(fake.requirementsArgsForCall) 143 } 144 145 func (fake *FakeSpaceRoleSetter) RequirementsArgsForCall(i int) (requirements.Factory, flags.FlagContext) { 146 fake.requirementsMutex.RLock() 147 defer fake.requirementsMutex.RUnlock() 148 return fake.requirementsArgsForCall[i].requirementsFactory, fake.requirementsArgsForCall[i].context 149 } 150 151 func (fake *FakeSpaceRoleSetter) RequirementsReturns(result1 []requirements.Requirement, result2 error) { 152 fake.RequirementsStub = nil 153 fake.requirementsReturns = struct { 154 result1 []requirements.Requirement 155 result2 error 156 }{result1, result2} 157 } 158 159 func (fake *FakeSpaceRoleSetter) Execute(context flags.FlagContext) error { 160 fake.executeMutex.Lock() 161 fake.executeArgsForCall = append(fake.executeArgsForCall, struct { 162 context flags.FlagContext 163 }{context}) 164 fake.recordInvocation("Execute", []interface{}{context}) 165 fake.executeMutex.Unlock() 166 if fake.ExecuteStub != nil { 167 return fake.ExecuteStub(context) 168 } else { 169 return fake.executeReturns.result1 170 } 171 } 172 173 func (fake *FakeSpaceRoleSetter) ExecuteCallCount() int { 174 fake.executeMutex.RLock() 175 defer fake.executeMutex.RUnlock() 176 return len(fake.executeArgsForCall) 177 } 178 179 func (fake *FakeSpaceRoleSetter) ExecuteArgsForCall(i int) flags.FlagContext { 180 fake.executeMutex.RLock() 181 defer fake.executeMutex.RUnlock() 182 return fake.executeArgsForCall[i].context 183 } 184 185 func (fake *FakeSpaceRoleSetter) ExecuteReturns(result1 error) { 186 fake.ExecuteStub = nil 187 fake.executeReturns = struct { 188 result1 error 189 }{result1} 190 } 191 192 func (fake *FakeSpaceRoleSetter) SetSpaceRole(space models.Space, orgGUID string, orgName string, role models.Role, userGUID string, userName string) (err error) { 193 fake.setSpaceRoleMutex.Lock() 194 fake.setSpaceRoleArgsForCall = append(fake.setSpaceRoleArgsForCall, struct { 195 space models.Space 196 orgGUID string 197 orgName string 198 role models.Role 199 userGUID string 200 userName string 201 }{space, orgGUID, orgName, role, userGUID, userName}) 202 fake.recordInvocation("SetSpaceRole", []interface{}{space, orgGUID, orgName, role, userGUID, userName}) 203 fake.setSpaceRoleMutex.Unlock() 204 if fake.SetSpaceRoleStub != nil { 205 return fake.SetSpaceRoleStub(space, orgGUID, orgName, role, userGUID, userName) 206 } else { 207 return fake.setSpaceRoleReturns.result1 208 } 209 } 210 211 func (fake *FakeSpaceRoleSetter) SetSpaceRoleCallCount() int { 212 fake.setSpaceRoleMutex.RLock() 213 defer fake.setSpaceRoleMutex.RUnlock() 214 return len(fake.setSpaceRoleArgsForCall) 215 } 216 217 func (fake *FakeSpaceRoleSetter) SetSpaceRoleArgsForCall(i int) (models.Space, string, string, models.Role, string, string) { 218 fake.setSpaceRoleMutex.RLock() 219 defer fake.setSpaceRoleMutex.RUnlock() 220 return fake.setSpaceRoleArgsForCall[i].space, fake.setSpaceRoleArgsForCall[i].orgGUID, fake.setSpaceRoleArgsForCall[i].orgName, fake.setSpaceRoleArgsForCall[i].role, fake.setSpaceRoleArgsForCall[i].userGUID, fake.setSpaceRoleArgsForCall[i].userName 221 } 222 223 func (fake *FakeSpaceRoleSetter) SetSpaceRoleReturns(result1 error) { 224 fake.SetSpaceRoleStub = nil 225 fake.setSpaceRoleReturns = struct { 226 result1 error 227 }{result1} 228 } 229 230 func (fake *FakeSpaceRoleSetter) Invocations() map[string][][]interface{} { 231 fake.invocationsMutex.RLock() 232 defer fake.invocationsMutex.RUnlock() 233 fake.metaDataMutex.RLock() 234 defer fake.metaDataMutex.RUnlock() 235 fake.setDependencyMutex.RLock() 236 defer fake.setDependencyMutex.RUnlock() 237 fake.requirementsMutex.RLock() 238 defer fake.requirementsMutex.RUnlock() 239 fake.executeMutex.RLock() 240 defer fake.executeMutex.RUnlock() 241 fake.setSpaceRoleMutex.RLock() 242 defer fake.setSpaceRoleMutex.RUnlock() 243 return fake.invocations 244 } 245 246 func (fake *FakeSpaceRoleSetter) recordInvocation(key string, args []interface{}) { 247 fake.invocationsMutex.Lock() 248 defer fake.invocationsMutex.Unlock() 249 if fake.invocations == nil { 250 fake.invocations = map[string][][]interface{}{} 251 } 252 if fake.invocations[key] == nil { 253 fake.invocations[key] = [][]interface{}{} 254 } 255 fake.invocations[key] = append(fake.invocations[key], args) 256 } 257 258 var _ user.SpaceRoleSetter = new(FakeSpaceRoleSetter)