github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/cf/requirements/requirementsfakes/fake_targeted_org_requirement.go (about) 1 // This file was generated by counterfeiter 2 package requirementsfakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/cf/models" 8 "code.cloudfoundry.org/cli/cf/requirements" 9 ) 10 11 type FakeTargetedOrgRequirement struct { 12 ExecuteStub func() error 13 executeMutex sync.RWMutex 14 executeArgsForCall []struct{} 15 executeReturns struct { 16 result1 error 17 } 18 GetOrganizationFieldsStub func() models.OrganizationFields 19 getOrganizationFieldsMutex sync.RWMutex 20 getOrganizationFieldsArgsForCall []struct{} 21 getOrganizationFieldsReturns struct { 22 result1 models.OrganizationFields 23 } 24 invocations map[string][][]interface{} 25 invocationsMutex sync.RWMutex 26 } 27 28 func (fake *FakeTargetedOrgRequirement) Execute() error { 29 fake.executeMutex.Lock() 30 fake.executeArgsForCall = append(fake.executeArgsForCall, struct{}{}) 31 fake.recordInvocation("Execute", []interface{}{}) 32 fake.executeMutex.Unlock() 33 if fake.ExecuteStub != nil { 34 return fake.ExecuteStub() 35 } else { 36 return fake.executeReturns.result1 37 } 38 } 39 40 func (fake *FakeTargetedOrgRequirement) ExecuteCallCount() int { 41 fake.executeMutex.RLock() 42 defer fake.executeMutex.RUnlock() 43 return len(fake.executeArgsForCall) 44 } 45 46 func (fake *FakeTargetedOrgRequirement) ExecuteReturns(result1 error) { 47 fake.ExecuteStub = nil 48 fake.executeReturns = struct { 49 result1 error 50 }{result1} 51 } 52 53 func (fake *FakeTargetedOrgRequirement) GetOrganizationFields() models.OrganizationFields { 54 fake.getOrganizationFieldsMutex.Lock() 55 fake.getOrganizationFieldsArgsForCall = append(fake.getOrganizationFieldsArgsForCall, struct{}{}) 56 fake.recordInvocation("GetOrganizationFields", []interface{}{}) 57 fake.getOrganizationFieldsMutex.Unlock() 58 if fake.GetOrganizationFieldsStub != nil { 59 return fake.GetOrganizationFieldsStub() 60 } else { 61 return fake.getOrganizationFieldsReturns.result1 62 } 63 } 64 65 func (fake *FakeTargetedOrgRequirement) GetOrganizationFieldsCallCount() int { 66 fake.getOrganizationFieldsMutex.RLock() 67 defer fake.getOrganizationFieldsMutex.RUnlock() 68 return len(fake.getOrganizationFieldsArgsForCall) 69 } 70 71 func (fake *FakeTargetedOrgRequirement) GetOrganizationFieldsReturns(result1 models.OrganizationFields) { 72 fake.GetOrganizationFieldsStub = nil 73 fake.getOrganizationFieldsReturns = struct { 74 result1 models.OrganizationFields 75 }{result1} 76 } 77 78 func (fake *FakeTargetedOrgRequirement) Invocations() map[string][][]interface{} { 79 fake.invocationsMutex.RLock() 80 defer fake.invocationsMutex.RUnlock() 81 fake.executeMutex.RLock() 82 defer fake.executeMutex.RUnlock() 83 fake.getOrganizationFieldsMutex.RLock() 84 defer fake.getOrganizationFieldsMutex.RUnlock() 85 return fake.invocations 86 } 87 88 func (fake *FakeTargetedOrgRequirement) recordInvocation(key string, args []interface{}) { 89 fake.invocationsMutex.Lock() 90 defer fake.invocationsMutex.Unlock() 91 if fake.invocations == nil { 92 fake.invocations = map[string][][]interface{}{} 93 } 94 if fake.invocations[key] == nil { 95 fake.invocations[key] = [][]interface{}{} 96 } 97 fake.invocations[key] = append(fake.invocations[key], args) 98 } 99 100 var _ requirements.TargetedOrgRequirement = new(FakeTargetedOrgRequirement)