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