github.com/swisscom/cloudfoundry-cli@v7.1.0+incompatible/actor/v2action/composite/compositefakes/fake_organization_actor.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package compositefakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/actor/v2action" 8 "code.cloudfoundry.org/cli/actor/v2action/composite" 9 ) 10 11 type FakeOrganizationActor struct { 12 GetOrganizationStub func(string) (v2action.Organization, v2action.Warnings, error) 13 getOrganizationMutex sync.RWMutex 14 getOrganizationArgsForCall []struct { 15 arg1 string 16 } 17 getOrganizationReturns struct { 18 result1 v2action.Organization 19 result2 v2action.Warnings 20 result3 error 21 } 22 getOrganizationReturnsOnCall map[int]struct { 23 result1 v2action.Organization 24 result2 v2action.Warnings 25 result3 error 26 } 27 OrganizationExistsWithNameStub func(string) (bool, v2action.Warnings, error) 28 organizationExistsWithNameMutex sync.RWMutex 29 organizationExistsWithNameArgsForCall []struct { 30 arg1 string 31 } 32 organizationExistsWithNameReturns struct { 33 result1 bool 34 result2 v2action.Warnings 35 result3 error 36 } 37 organizationExistsWithNameReturnsOnCall map[int]struct { 38 result1 bool 39 result2 v2action.Warnings 40 result3 error 41 } 42 invocations map[string][][]interface{} 43 invocationsMutex sync.RWMutex 44 } 45 46 func (fake *FakeOrganizationActor) GetOrganization(arg1 string) (v2action.Organization, v2action.Warnings, error) { 47 fake.getOrganizationMutex.Lock() 48 ret, specificReturn := fake.getOrganizationReturnsOnCall[len(fake.getOrganizationArgsForCall)] 49 fake.getOrganizationArgsForCall = append(fake.getOrganizationArgsForCall, struct { 50 arg1 string 51 }{arg1}) 52 fake.recordInvocation("GetOrganization", []interface{}{arg1}) 53 fake.getOrganizationMutex.Unlock() 54 if fake.GetOrganizationStub != nil { 55 return fake.GetOrganizationStub(arg1) 56 } 57 if specificReturn { 58 return ret.result1, ret.result2, ret.result3 59 } 60 fakeReturns := fake.getOrganizationReturns 61 return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3 62 } 63 64 func (fake *FakeOrganizationActor) GetOrganizationCallCount() int { 65 fake.getOrganizationMutex.RLock() 66 defer fake.getOrganizationMutex.RUnlock() 67 return len(fake.getOrganizationArgsForCall) 68 } 69 70 func (fake *FakeOrganizationActor) GetOrganizationCalls(stub func(string) (v2action.Organization, v2action.Warnings, error)) { 71 fake.getOrganizationMutex.Lock() 72 defer fake.getOrganizationMutex.Unlock() 73 fake.GetOrganizationStub = stub 74 } 75 76 func (fake *FakeOrganizationActor) GetOrganizationArgsForCall(i int) string { 77 fake.getOrganizationMutex.RLock() 78 defer fake.getOrganizationMutex.RUnlock() 79 argsForCall := fake.getOrganizationArgsForCall[i] 80 return argsForCall.arg1 81 } 82 83 func (fake *FakeOrganizationActor) GetOrganizationReturns(result1 v2action.Organization, result2 v2action.Warnings, result3 error) { 84 fake.getOrganizationMutex.Lock() 85 defer fake.getOrganizationMutex.Unlock() 86 fake.GetOrganizationStub = nil 87 fake.getOrganizationReturns = struct { 88 result1 v2action.Organization 89 result2 v2action.Warnings 90 result3 error 91 }{result1, result2, result3} 92 } 93 94 func (fake *FakeOrganizationActor) GetOrganizationReturnsOnCall(i int, result1 v2action.Organization, result2 v2action.Warnings, result3 error) { 95 fake.getOrganizationMutex.Lock() 96 defer fake.getOrganizationMutex.Unlock() 97 fake.GetOrganizationStub = nil 98 if fake.getOrganizationReturnsOnCall == nil { 99 fake.getOrganizationReturnsOnCall = make(map[int]struct { 100 result1 v2action.Organization 101 result2 v2action.Warnings 102 result3 error 103 }) 104 } 105 fake.getOrganizationReturnsOnCall[i] = struct { 106 result1 v2action.Organization 107 result2 v2action.Warnings 108 result3 error 109 }{result1, result2, result3} 110 } 111 112 func (fake *FakeOrganizationActor) OrganizationExistsWithName(arg1 string) (bool, v2action.Warnings, error) { 113 fake.organizationExistsWithNameMutex.Lock() 114 ret, specificReturn := fake.organizationExistsWithNameReturnsOnCall[len(fake.organizationExistsWithNameArgsForCall)] 115 fake.organizationExistsWithNameArgsForCall = append(fake.organizationExistsWithNameArgsForCall, struct { 116 arg1 string 117 }{arg1}) 118 fake.recordInvocation("OrganizationExistsWithName", []interface{}{arg1}) 119 fake.organizationExistsWithNameMutex.Unlock() 120 if fake.OrganizationExistsWithNameStub != nil { 121 return fake.OrganizationExistsWithNameStub(arg1) 122 } 123 if specificReturn { 124 return ret.result1, ret.result2, ret.result3 125 } 126 fakeReturns := fake.organizationExistsWithNameReturns 127 return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3 128 } 129 130 func (fake *FakeOrganizationActor) OrganizationExistsWithNameCallCount() int { 131 fake.organizationExistsWithNameMutex.RLock() 132 defer fake.organizationExistsWithNameMutex.RUnlock() 133 return len(fake.organizationExistsWithNameArgsForCall) 134 } 135 136 func (fake *FakeOrganizationActor) OrganizationExistsWithNameCalls(stub func(string) (bool, v2action.Warnings, error)) { 137 fake.organizationExistsWithNameMutex.Lock() 138 defer fake.organizationExistsWithNameMutex.Unlock() 139 fake.OrganizationExistsWithNameStub = stub 140 } 141 142 func (fake *FakeOrganizationActor) OrganizationExistsWithNameArgsForCall(i int) string { 143 fake.organizationExistsWithNameMutex.RLock() 144 defer fake.organizationExistsWithNameMutex.RUnlock() 145 argsForCall := fake.organizationExistsWithNameArgsForCall[i] 146 return argsForCall.arg1 147 } 148 149 func (fake *FakeOrganizationActor) OrganizationExistsWithNameReturns(result1 bool, result2 v2action.Warnings, result3 error) { 150 fake.organizationExistsWithNameMutex.Lock() 151 defer fake.organizationExistsWithNameMutex.Unlock() 152 fake.OrganizationExistsWithNameStub = nil 153 fake.organizationExistsWithNameReturns = struct { 154 result1 bool 155 result2 v2action.Warnings 156 result3 error 157 }{result1, result2, result3} 158 } 159 160 func (fake *FakeOrganizationActor) OrganizationExistsWithNameReturnsOnCall(i int, result1 bool, result2 v2action.Warnings, result3 error) { 161 fake.organizationExistsWithNameMutex.Lock() 162 defer fake.organizationExistsWithNameMutex.Unlock() 163 fake.OrganizationExistsWithNameStub = nil 164 if fake.organizationExistsWithNameReturnsOnCall == nil { 165 fake.organizationExistsWithNameReturnsOnCall = make(map[int]struct { 166 result1 bool 167 result2 v2action.Warnings 168 result3 error 169 }) 170 } 171 fake.organizationExistsWithNameReturnsOnCall[i] = struct { 172 result1 bool 173 result2 v2action.Warnings 174 result3 error 175 }{result1, result2, result3} 176 } 177 178 func (fake *FakeOrganizationActor) Invocations() map[string][][]interface{} { 179 fake.invocationsMutex.RLock() 180 defer fake.invocationsMutex.RUnlock() 181 fake.getOrganizationMutex.RLock() 182 defer fake.getOrganizationMutex.RUnlock() 183 fake.organizationExistsWithNameMutex.RLock() 184 defer fake.organizationExistsWithNameMutex.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 *FakeOrganizationActor) 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 _ composite.OrganizationActor = new(FakeOrganizationActor)