github.com/sleungcy-sap/cli@v7.1.0+incompatible/cf/requirements/requirementsfakes/fake_organization_requirement.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 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 FakeOrganizationRequirement struct { 12 ExecuteStub func() error 13 executeMutex sync.RWMutex 14 executeArgsForCall []struct { 15 } 16 executeReturns struct { 17 result1 error 18 } 19 executeReturnsOnCall map[int]struct { 20 result1 error 21 } 22 GetOrganizationStub func() models.Organization 23 getOrganizationMutex sync.RWMutex 24 getOrganizationArgsForCall []struct { 25 } 26 getOrganizationReturns struct { 27 result1 models.Organization 28 } 29 getOrganizationReturnsOnCall map[int]struct { 30 result1 models.Organization 31 } 32 SetOrganizationNameStub func(string) 33 setOrganizationNameMutex sync.RWMutex 34 setOrganizationNameArgsForCall []struct { 35 arg1 string 36 } 37 invocations map[string][][]interface{} 38 invocationsMutex sync.RWMutex 39 } 40 41 func (fake *FakeOrganizationRequirement) Execute() error { 42 fake.executeMutex.Lock() 43 ret, specificReturn := fake.executeReturnsOnCall[len(fake.executeArgsForCall)] 44 fake.executeArgsForCall = append(fake.executeArgsForCall, struct { 45 }{}) 46 fake.recordInvocation("Execute", []interface{}{}) 47 fake.executeMutex.Unlock() 48 if fake.ExecuteStub != nil { 49 return fake.ExecuteStub() 50 } 51 if specificReturn { 52 return ret.result1 53 } 54 fakeReturns := fake.executeReturns 55 return fakeReturns.result1 56 } 57 58 func (fake *FakeOrganizationRequirement) ExecuteCallCount() int { 59 fake.executeMutex.RLock() 60 defer fake.executeMutex.RUnlock() 61 return len(fake.executeArgsForCall) 62 } 63 64 func (fake *FakeOrganizationRequirement) ExecuteCalls(stub func() error) { 65 fake.executeMutex.Lock() 66 defer fake.executeMutex.Unlock() 67 fake.ExecuteStub = stub 68 } 69 70 func (fake *FakeOrganizationRequirement) ExecuteReturns(result1 error) { 71 fake.executeMutex.Lock() 72 defer fake.executeMutex.Unlock() 73 fake.ExecuteStub = nil 74 fake.executeReturns = struct { 75 result1 error 76 }{result1} 77 } 78 79 func (fake *FakeOrganizationRequirement) ExecuteReturnsOnCall(i int, result1 error) { 80 fake.executeMutex.Lock() 81 defer fake.executeMutex.Unlock() 82 fake.ExecuteStub = nil 83 if fake.executeReturnsOnCall == nil { 84 fake.executeReturnsOnCall = make(map[int]struct { 85 result1 error 86 }) 87 } 88 fake.executeReturnsOnCall[i] = struct { 89 result1 error 90 }{result1} 91 } 92 93 func (fake *FakeOrganizationRequirement) GetOrganization() models.Organization { 94 fake.getOrganizationMutex.Lock() 95 ret, specificReturn := fake.getOrganizationReturnsOnCall[len(fake.getOrganizationArgsForCall)] 96 fake.getOrganizationArgsForCall = append(fake.getOrganizationArgsForCall, struct { 97 }{}) 98 fake.recordInvocation("GetOrganization", []interface{}{}) 99 fake.getOrganizationMutex.Unlock() 100 if fake.GetOrganizationStub != nil { 101 return fake.GetOrganizationStub() 102 } 103 if specificReturn { 104 return ret.result1 105 } 106 fakeReturns := fake.getOrganizationReturns 107 return fakeReturns.result1 108 } 109 110 func (fake *FakeOrganizationRequirement) GetOrganizationCallCount() int { 111 fake.getOrganizationMutex.RLock() 112 defer fake.getOrganizationMutex.RUnlock() 113 return len(fake.getOrganizationArgsForCall) 114 } 115 116 func (fake *FakeOrganizationRequirement) GetOrganizationCalls(stub func() models.Organization) { 117 fake.getOrganizationMutex.Lock() 118 defer fake.getOrganizationMutex.Unlock() 119 fake.GetOrganizationStub = stub 120 } 121 122 func (fake *FakeOrganizationRequirement) GetOrganizationReturns(result1 models.Organization) { 123 fake.getOrganizationMutex.Lock() 124 defer fake.getOrganizationMutex.Unlock() 125 fake.GetOrganizationStub = nil 126 fake.getOrganizationReturns = struct { 127 result1 models.Organization 128 }{result1} 129 } 130 131 func (fake *FakeOrganizationRequirement) GetOrganizationReturnsOnCall(i int, result1 models.Organization) { 132 fake.getOrganizationMutex.Lock() 133 defer fake.getOrganizationMutex.Unlock() 134 fake.GetOrganizationStub = nil 135 if fake.getOrganizationReturnsOnCall == nil { 136 fake.getOrganizationReturnsOnCall = make(map[int]struct { 137 result1 models.Organization 138 }) 139 } 140 fake.getOrganizationReturnsOnCall[i] = struct { 141 result1 models.Organization 142 }{result1} 143 } 144 145 func (fake *FakeOrganizationRequirement) SetOrganizationName(arg1 string) { 146 fake.setOrganizationNameMutex.Lock() 147 fake.setOrganizationNameArgsForCall = append(fake.setOrganizationNameArgsForCall, struct { 148 arg1 string 149 }{arg1}) 150 fake.recordInvocation("SetOrganizationName", []interface{}{arg1}) 151 fake.setOrganizationNameMutex.Unlock() 152 if fake.SetOrganizationNameStub != nil { 153 fake.SetOrganizationNameStub(arg1) 154 } 155 } 156 157 func (fake *FakeOrganizationRequirement) SetOrganizationNameCallCount() int { 158 fake.setOrganizationNameMutex.RLock() 159 defer fake.setOrganizationNameMutex.RUnlock() 160 return len(fake.setOrganizationNameArgsForCall) 161 } 162 163 func (fake *FakeOrganizationRequirement) SetOrganizationNameCalls(stub func(string)) { 164 fake.setOrganizationNameMutex.Lock() 165 defer fake.setOrganizationNameMutex.Unlock() 166 fake.SetOrganizationNameStub = stub 167 } 168 169 func (fake *FakeOrganizationRequirement) SetOrganizationNameArgsForCall(i int) string { 170 fake.setOrganizationNameMutex.RLock() 171 defer fake.setOrganizationNameMutex.RUnlock() 172 argsForCall := fake.setOrganizationNameArgsForCall[i] 173 return argsForCall.arg1 174 } 175 176 func (fake *FakeOrganizationRequirement) Invocations() map[string][][]interface{} { 177 fake.invocationsMutex.RLock() 178 defer fake.invocationsMutex.RUnlock() 179 fake.executeMutex.RLock() 180 defer fake.executeMutex.RUnlock() 181 fake.getOrganizationMutex.RLock() 182 defer fake.getOrganizationMutex.RUnlock() 183 fake.setOrganizationNameMutex.RLock() 184 defer fake.setOrganizationNameMutex.RUnlock() 185 copiedInvocations := map[string][][]interface{}{} 186 for key, value := range fake.invocations { 187 copiedInvocations[key] = value 188 } 189 return copiedInvocations 190 } 191 192 func (fake *FakeOrganizationRequirement) recordInvocation(key string, args []interface{}) { 193 fake.invocationsMutex.Lock() 194 defer fake.invocationsMutex.Unlock() 195 if fake.invocations == nil { 196 fake.invocations = map[string][][]interface{}{} 197 } 198 if fake.invocations[key] == nil { 199 fake.invocations[key] = [][]interface{}{} 200 } 201 fake.invocations[key] = append(fake.invocations[key], args) 202 } 203 204 var _ requirements.OrganizationRequirement = new(FakeOrganizationRequirement)