github.com/orange-cloudfoundry/cli@v7.1.0+incompatible/command/v6/shared/sharedfakes/fake_application_summary_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/v2v3action" 8 "code.cloudfoundry.org/cli/command/v6/shared" 9 ) 10 11 type FakeApplicationSummaryActor struct { 12 CloudControllerV3APIVersionStub func() string 13 cloudControllerV3APIVersionMutex sync.RWMutex 14 cloudControllerV3APIVersionArgsForCall []struct { 15 } 16 cloudControllerV3APIVersionReturns struct { 17 result1 string 18 } 19 cloudControllerV3APIVersionReturnsOnCall map[int]struct { 20 result1 string 21 } 22 GetApplicationSummaryByNameAndSpaceStub func(string, string, bool) (v2v3action.ApplicationSummary, v2v3action.Warnings, error) 23 getApplicationSummaryByNameAndSpaceMutex sync.RWMutex 24 getApplicationSummaryByNameAndSpaceArgsForCall []struct { 25 arg1 string 26 arg2 string 27 arg3 bool 28 } 29 getApplicationSummaryByNameAndSpaceReturns struct { 30 result1 v2v3action.ApplicationSummary 31 result2 v2v3action.Warnings 32 result3 error 33 } 34 getApplicationSummaryByNameAndSpaceReturnsOnCall map[int]struct { 35 result1 v2v3action.ApplicationSummary 36 result2 v2v3action.Warnings 37 result3 error 38 } 39 invocations map[string][][]interface{} 40 invocationsMutex sync.RWMutex 41 } 42 43 func (fake *FakeApplicationSummaryActor) CloudControllerV3APIVersion() string { 44 fake.cloudControllerV3APIVersionMutex.Lock() 45 ret, specificReturn := fake.cloudControllerV3APIVersionReturnsOnCall[len(fake.cloudControllerV3APIVersionArgsForCall)] 46 fake.cloudControllerV3APIVersionArgsForCall = append(fake.cloudControllerV3APIVersionArgsForCall, struct { 47 }{}) 48 fake.recordInvocation("CloudControllerV3APIVersion", []interface{}{}) 49 fake.cloudControllerV3APIVersionMutex.Unlock() 50 if fake.CloudControllerV3APIVersionStub != nil { 51 return fake.CloudControllerV3APIVersionStub() 52 } 53 if specificReturn { 54 return ret.result1 55 } 56 fakeReturns := fake.cloudControllerV3APIVersionReturns 57 return fakeReturns.result1 58 } 59 60 func (fake *FakeApplicationSummaryActor) CloudControllerV3APIVersionCallCount() int { 61 fake.cloudControllerV3APIVersionMutex.RLock() 62 defer fake.cloudControllerV3APIVersionMutex.RUnlock() 63 return len(fake.cloudControllerV3APIVersionArgsForCall) 64 } 65 66 func (fake *FakeApplicationSummaryActor) CloudControllerV3APIVersionCalls(stub func() string) { 67 fake.cloudControllerV3APIVersionMutex.Lock() 68 defer fake.cloudControllerV3APIVersionMutex.Unlock() 69 fake.CloudControllerV3APIVersionStub = stub 70 } 71 72 func (fake *FakeApplicationSummaryActor) CloudControllerV3APIVersionReturns(result1 string) { 73 fake.cloudControllerV3APIVersionMutex.Lock() 74 defer fake.cloudControllerV3APIVersionMutex.Unlock() 75 fake.CloudControllerV3APIVersionStub = nil 76 fake.cloudControllerV3APIVersionReturns = struct { 77 result1 string 78 }{result1} 79 } 80 81 func (fake *FakeApplicationSummaryActor) CloudControllerV3APIVersionReturnsOnCall(i int, result1 string) { 82 fake.cloudControllerV3APIVersionMutex.Lock() 83 defer fake.cloudControllerV3APIVersionMutex.Unlock() 84 fake.CloudControllerV3APIVersionStub = nil 85 if fake.cloudControllerV3APIVersionReturnsOnCall == nil { 86 fake.cloudControllerV3APIVersionReturnsOnCall = make(map[int]struct { 87 result1 string 88 }) 89 } 90 fake.cloudControllerV3APIVersionReturnsOnCall[i] = struct { 91 result1 string 92 }{result1} 93 } 94 95 func (fake *FakeApplicationSummaryActor) GetApplicationSummaryByNameAndSpace(arg1 string, arg2 string, arg3 bool) (v2v3action.ApplicationSummary, v2v3action.Warnings, error) { 96 fake.getApplicationSummaryByNameAndSpaceMutex.Lock() 97 ret, specificReturn := fake.getApplicationSummaryByNameAndSpaceReturnsOnCall[len(fake.getApplicationSummaryByNameAndSpaceArgsForCall)] 98 fake.getApplicationSummaryByNameAndSpaceArgsForCall = append(fake.getApplicationSummaryByNameAndSpaceArgsForCall, struct { 99 arg1 string 100 arg2 string 101 arg3 bool 102 }{arg1, arg2, arg3}) 103 fake.recordInvocation("GetApplicationSummaryByNameAndSpace", []interface{}{arg1, arg2, arg3}) 104 fake.getApplicationSummaryByNameAndSpaceMutex.Unlock() 105 if fake.GetApplicationSummaryByNameAndSpaceStub != nil { 106 return fake.GetApplicationSummaryByNameAndSpaceStub(arg1, arg2, arg3) 107 } 108 if specificReturn { 109 return ret.result1, ret.result2, ret.result3 110 } 111 fakeReturns := fake.getApplicationSummaryByNameAndSpaceReturns 112 return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3 113 } 114 115 func (fake *FakeApplicationSummaryActor) GetApplicationSummaryByNameAndSpaceCallCount() int { 116 fake.getApplicationSummaryByNameAndSpaceMutex.RLock() 117 defer fake.getApplicationSummaryByNameAndSpaceMutex.RUnlock() 118 return len(fake.getApplicationSummaryByNameAndSpaceArgsForCall) 119 } 120 121 func (fake *FakeApplicationSummaryActor) GetApplicationSummaryByNameAndSpaceCalls(stub func(string, string, bool) (v2v3action.ApplicationSummary, v2v3action.Warnings, error)) { 122 fake.getApplicationSummaryByNameAndSpaceMutex.Lock() 123 defer fake.getApplicationSummaryByNameAndSpaceMutex.Unlock() 124 fake.GetApplicationSummaryByNameAndSpaceStub = stub 125 } 126 127 func (fake *FakeApplicationSummaryActor) GetApplicationSummaryByNameAndSpaceArgsForCall(i int) (string, string, bool) { 128 fake.getApplicationSummaryByNameAndSpaceMutex.RLock() 129 defer fake.getApplicationSummaryByNameAndSpaceMutex.RUnlock() 130 argsForCall := fake.getApplicationSummaryByNameAndSpaceArgsForCall[i] 131 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 132 } 133 134 func (fake *FakeApplicationSummaryActor) GetApplicationSummaryByNameAndSpaceReturns(result1 v2v3action.ApplicationSummary, result2 v2v3action.Warnings, result3 error) { 135 fake.getApplicationSummaryByNameAndSpaceMutex.Lock() 136 defer fake.getApplicationSummaryByNameAndSpaceMutex.Unlock() 137 fake.GetApplicationSummaryByNameAndSpaceStub = nil 138 fake.getApplicationSummaryByNameAndSpaceReturns = struct { 139 result1 v2v3action.ApplicationSummary 140 result2 v2v3action.Warnings 141 result3 error 142 }{result1, result2, result3} 143 } 144 145 func (fake *FakeApplicationSummaryActor) GetApplicationSummaryByNameAndSpaceReturnsOnCall(i int, result1 v2v3action.ApplicationSummary, result2 v2v3action.Warnings, result3 error) { 146 fake.getApplicationSummaryByNameAndSpaceMutex.Lock() 147 defer fake.getApplicationSummaryByNameAndSpaceMutex.Unlock() 148 fake.GetApplicationSummaryByNameAndSpaceStub = nil 149 if fake.getApplicationSummaryByNameAndSpaceReturnsOnCall == nil { 150 fake.getApplicationSummaryByNameAndSpaceReturnsOnCall = make(map[int]struct { 151 result1 v2v3action.ApplicationSummary 152 result2 v2v3action.Warnings 153 result3 error 154 }) 155 } 156 fake.getApplicationSummaryByNameAndSpaceReturnsOnCall[i] = struct { 157 result1 v2v3action.ApplicationSummary 158 result2 v2v3action.Warnings 159 result3 error 160 }{result1, result2, result3} 161 } 162 163 func (fake *FakeApplicationSummaryActor) Invocations() map[string][][]interface{} { 164 fake.invocationsMutex.RLock() 165 defer fake.invocationsMutex.RUnlock() 166 fake.cloudControllerV3APIVersionMutex.RLock() 167 defer fake.cloudControllerV3APIVersionMutex.RUnlock() 168 fake.getApplicationSummaryByNameAndSpaceMutex.RLock() 169 defer fake.getApplicationSummaryByNameAndSpaceMutex.RUnlock() 170 copiedInvocations := map[string][][]interface{}{} 171 for key, value := range fake.invocations { 172 copiedInvocations[key] = value 173 } 174 return copiedInvocations 175 } 176 177 func (fake *FakeApplicationSummaryActor) recordInvocation(key string, args []interface{}) { 178 fake.invocationsMutex.Lock() 179 defer fake.invocationsMutex.Unlock() 180 if fake.invocations == nil { 181 fake.invocations = map[string][][]interface{}{} 182 } 183 if fake.invocations[key] == nil { 184 fake.invocations[key] = [][]interface{}{} 185 } 186 fake.invocations[key] = append(fake.invocations[key], args) 187 } 188 189 var _ shared.ApplicationSummaryActor = new(FakeApplicationSummaryActor)