github.com/dcarley/cf-cli@v6.24.1-0.20170220111324-4225ff346898+incompatible/command/v3/v3fakes/fake_terminate_task_actor.go (about) 1 // This file was generated by counterfeiter 2 package v3fakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/actor/v3action" 8 "code.cloudfoundry.org/cli/command/v3" 9 ) 10 11 type FakeTerminateTaskActor struct { 12 GetApplicationByNameAndSpaceStub func(appName string, spaceGUID string) (v3action.Application, v3action.Warnings, error) 13 getApplicationByNameAndSpaceMutex sync.RWMutex 14 getApplicationByNameAndSpaceArgsForCall []struct { 15 appName string 16 spaceGUID string 17 } 18 getApplicationByNameAndSpaceReturns struct { 19 result1 v3action.Application 20 result2 v3action.Warnings 21 result3 error 22 } 23 GetTaskBySequenceIDAndApplicationStub func(sequenceID int, appGUID string) (v3action.Task, v3action.Warnings, error) 24 getTaskBySequenceIDAndApplicationMutex sync.RWMutex 25 getTaskBySequenceIDAndApplicationArgsForCall []struct { 26 sequenceID int 27 appGUID string 28 } 29 getTaskBySequenceIDAndApplicationReturns struct { 30 result1 v3action.Task 31 result2 v3action.Warnings 32 result3 error 33 } 34 TerminateTaskStub func(taskGUID string) (v3action.Task, v3action.Warnings, error) 35 terminateTaskMutex sync.RWMutex 36 terminateTaskArgsForCall []struct { 37 taskGUID string 38 } 39 terminateTaskReturns struct { 40 result1 v3action.Task 41 result2 v3action.Warnings 42 result3 error 43 } 44 CloudControllerAPIVersionStub func() string 45 cloudControllerAPIVersionMutex sync.RWMutex 46 cloudControllerAPIVersionArgsForCall []struct{} 47 cloudControllerAPIVersionReturns struct { 48 result1 string 49 } 50 invocations map[string][][]interface{} 51 invocationsMutex sync.RWMutex 52 } 53 54 func (fake *FakeTerminateTaskActor) GetApplicationByNameAndSpace(appName string, spaceGUID string) (v3action.Application, v3action.Warnings, error) { 55 fake.getApplicationByNameAndSpaceMutex.Lock() 56 fake.getApplicationByNameAndSpaceArgsForCall = append(fake.getApplicationByNameAndSpaceArgsForCall, struct { 57 appName string 58 spaceGUID string 59 }{appName, spaceGUID}) 60 fake.recordInvocation("GetApplicationByNameAndSpace", []interface{}{appName, spaceGUID}) 61 fake.getApplicationByNameAndSpaceMutex.Unlock() 62 if fake.GetApplicationByNameAndSpaceStub != nil { 63 return fake.GetApplicationByNameAndSpaceStub(appName, spaceGUID) 64 } else { 65 return fake.getApplicationByNameAndSpaceReturns.result1, fake.getApplicationByNameAndSpaceReturns.result2, fake.getApplicationByNameAndSpaceReturns.result3 66 } 67 } 68 69 func (fake *FakeTerminateTaskActor) GetApplicationByNameAndSpaceCallCount() int { 70 fake.getApplicationByNameAndSpaceMutex.RLock() 71 defer fake.getApplicationByNameAndSpaceMutex.RUnlock() 72 return len(fake.getApplicationByNameAndSpaceArgsForCall) 73 } 74 75 func (fake *FakeTerminateTaskActor) GetApplicationByNameAndSpaceArgsForCall(i int) (string, string) { 76 fake.getApplicationByNameAndSpaceMutex.RLock() 77 defer fake.getApplicationByNameAndSpaceMutex.RUnlock() 78 return fake.getApplicationByNameAndSpaceArgsForCall[i].appName, fake.getApplicationByNameAndSpaceArgsForCall[i].spaceGUID 79 } 80 81 func (fake *FakeTerminateTaskActor) GetApplicationByNameAndSpaceReturns(result1 v3action.Application, result2 v3action.Warnings, result3 error) { 82 fake.GetApplicationByNameAndSpaceStub = nil 83 fake.getApplicationByNameAndSpaceReturns = struct { 84 result1 v3action.Application 85 result2 v3action.Warnings 86 result3 error 87 }{result1, result2, result3} 88 } 89 90 func (fake *FakeTerminateTaskActor) GetTaskBySequenceIDAndApplication(sequenceID int, appGUID string) (v3action.Task, v3action.Warnings, error) { 91 fake.getTaskBySequenceIDAndApplicationMutex.Lock() 92 fake.getTaskBySequenceIDAndApplicationArgsForCall = append(fake.getTaskBySequenceIDAndApplicationArgsForCall, struct { 93 sequenceID int 94 appGUID string 95 }{sequenceID, appGUID}) 96 fake.recordInvocation("GetTaskBySequenceIDAndApplication", []interface{}{sequenceID, appGUID}) 97 fake.getTaskBySequenceIDAndApplicationMutex.Unlock() 98 if fake.GetTaskBySequenceIDAndApplicationStub != nil { 99 return fake.GetTaskBySequenceIDAndApplicationStub(sequenceID, appGUID) 100 } else { 101 return fake.getTaskBySequenceIDAndApplicationReturns.result1, fake.getTaskBySequenceIDAndApplicationReturns.result2, fake.getTaskBySequenceIDAndApplicationReturns.result3 102 } 103 } 104 105 func (fake *FakeTerminateTaskActor) GetTaskBySequenceIDAndApplicationCallCount() int { 106 fake.getTaskBySequenceIDAndApplicationMutex.RLock() 107 defer fake.getTaskBySequenceIDAndApplicationMutex.RUnlock() 108 return len(fake.getTaskBySequenceIDAndApplicationArgsForCall) 109 } 110 111 func (fake *FakeTerminateTaskActor) GetTaskBySequenceIDAndApplicationArgsForCall(i int) (int, string) { 112 fake.getTaskBySequenceIDAndApplicationMutex.RLock() 113 defer fake.getTaskBySequenceIDAndApplicationMutex.RUnlock() 114 return fake.getTaskBySequenceIDAndApplicationArgsForCall[i].sequenceID, fake.getTaskBySequenceIDAndApplicationArgsForCall[i].appGUID 115 } 116 117 func (fake *FakeTerminateTaskActor) GetTaskBySequenceIDAndApplicationReturns(result1 v3action.Task, result2 v3action.Warnings, result3 error) { 118 fake.GetTaskBySequenceIDAndApplicationStub = nil 119 fake.getTaskBySequenceIDAndApplicationReturns = struct { 120 result1 v3action.Task 121 result2 v3action.Warnings 122 result3 error 123 }{result1, result2, result3} 124 } 125 126 func (fake *FakeTerminateTaskActor) TerminateTask(taskGUID string) (v3action.Task, v3action.Warnings, error) { 127 fake.terminateTaskMutex.Lock() 128 fake.terminateTaskArgsForCall = append(fake.terminateTaskArgsForCall, struct { 129 taskGUID string 130 }{taskGUID}) 131 fake.recordInvocation("TerminateTask", []interface{}{taskGUID}) 132 fake.terminateTaskMutex.Unlock() 133 if fake.TerminateTaskStub != nil { 134 return fake.TerminateTaskStub(taskGUID) 135 } else { 136 return fake.terminateTaskReturns.result1, fake.terminateTaskReturns.result2, fake.terminateTaskReturns.result3 137 } 138 } 139 140 func (fake *FakeTerminateTaskActor) TerminateTaskCallCount() int { 141 fake.terminateTaskMutex.RLock() 142 defer fake.terminateTaskMutex.RUnlock() 143 return len(fake.terminateTaskArgsForCall) 144 } 145 146 func (fake *FakeTerminateTaskActor) TerminateTaskArgsForCall(i int) string { 147 fake.terminateTaskMutex.RLock() 148 defer fake.terminateTaskMutex.RUnlock() 149 return fake.terminateTaskArgsForCall[i].taskGUID 150 } 151 152 func (fake *FakeTerminateTaskActor) TerminateTaskReturns(result1 v3action.Task, result2 v3action.Warnings, result3 error) { 153 fake.TerminateTaskStub = nil 154 fake.terminateTaskReturns = struct { 155 result1 v3action.Task 156 result2 v3action.Warnings 157 result3 error 158 }{result1, result2, result3} 159 } 160 161 func (fake *FakeTerminateTaskActor) CloudControllerAPIVersion() string { 162 fake.cloudControllerAPIVersionMutex.Lock() 163 fake.cloudControllerAPIVersionArgsForCall = append(fake.cloudControllerAPIVersionArgsForCall, struct{}{}) 164 fake.recordInvocation("CloudControllerAPIVersion", []interface{}{}) 165 fake.cloudControllerAPIVersionMutex.Unlock() 166 if fake.CloudControllerAPIVersionStub != nil { 167 return fake.CloudControllerAPIVersionStub() 168 } else { 169 return fake.cloudControllerAPIVersionReturns.result1 170 } 171 } 172 173 func (fake *FakeTerminateTaskActor) CloudControllerAPIVersionCallCount() int { 174 fake.cloudControllerAPIVersionMutex.RLock() 175 defer fake.cloudControllerAPIVersionMutex.RUnlock() 176 return len(fake.cloudControllerAPIVersionArgsForCall) 177 } 178 179 func (fake *FakeTerminateTaskActor) CloudControllerAPIVersionReturns(result1 string) { 180 fake.CloudControllerAPIVersionStub = nil 181 fake.cloudControllerAPIVersionReturns = struct { 182 result1 string 183 }{result1} 184 } 185 186 func (fake *FakeTerminateTaskActor) Invocations() map[string][][]interface{} { 187 fake.invocationsMutex.RLock() 188 defer fake.invocationsMutex.RUnlock() 189 fake.getApplicationByNameAndSpaceMutex.RLock() 190 defer fake.getApplicationByNameAndSpaceMutex.RUnlock() 191 fake.getTaskBySequenceIDAndApplicationMutex.RLock() 192 defer fake.getTaskBySequenceIDAndApplicationMutex.RUnlock() 193 fake.terminateTaskMutex.RLock() 194 defer fake.terminateTaskMutex.RUnlock() 195 fake.cloudControllerAPIVersionMutex.RLock() 196 defer fake.cloudControllerAPIVersionMutex.RUnlock() 197 return fake.invocations 198 } 199 200 func (fake *FakeTerminateTaskActor) recordInvocation(key string, args []interface{}) { 201 fake.invocationsMutex.Lock() 202 defer fake.invocationsMutex.Unlock() 203 if fake.invocations == nil { 204 fake.invocations = map[string][][]interface{}{} 205 } 206 if fake.invocations[key] == nil { 207 fake.invocations[key] = [][]interface{}{} 208 } 209 fake.invocations[key] = append(fake.invocations[key], args) 210 } 211 212 var _ v3.TerminateTaskActor = new(FakeTerminateTaskActor)