github.com/nimakaviani/cli@v6.37.1-0.20180619223813-e734901a73fa+incompatible/command/v2/v2fakes/fake_bind_service_actor.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package v2fakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/actor/v2action" 8 "code.cloudfoundry.org/cli/command/v2" 9 ) 10 11 type FakeBindServiceActor struct { 12 BindServiceBySpaceStub func(appName string, ServiceInstanceName string, spaceGUID string, bindingName string, parameters map[string]interface{}) (v2action.Warnings, error) 13 bindServiceBySpaceMutex sync.RWMutex 14 bindServiceBySpaceArgsForCall []struct { 15 appName string 16 ServiceInstanceName string 17 spaceGUID string 18 bindingName string 19 parameters map[string]interface{} 20 } 21 bindServiceBySpaceReturns struct { 22 result1 v2action.Warnings 23 result2 error 24 } 25 bindServiceBySpaceReturnsOnCall map[int]struct { 26 result1 v2action.Warnings 27 result2 error 28 } 29 CloudControllerAPIVersionStub func() string 30 cloudControllerAPIVersionMutex sync.RWMutex 31 cloudControllerAPIVersionArgsForCall []struct{} 32 cloudControllerAPIVersionReturns struct { 33 result1 string 34 } 35 cloudControllerAPIVersionReturnsOnCall map[int]struct { 36 result1 string 37 } 38 invocations map[string][][]interface{} 39 invocationsMutex sync.RWMutex 40 } 41 42 func (fake *FakeBindServiceActor) BindServiceBySpace(appName string, ServiceInstanceName string, spaceGUID string, bindingName string, parameters map[string]interface{}) (v2action.Warnings, error) { 43 fake.bindServiceBySpaceMutex.Lock() 44 ret, specificReturn := fake.bindServiceBySpaceReturnsOnCall[len(fake.bindServiceBySpaceArgsForCall)] 45 fake.bindServiceBySpaceArgsForCall = append(fake.bindServiceBySpaceArgsForCall, struct { 46 appName string 47 ServiceInstanceName string 48 spaceGUID string 49 bindingName string 50 parameters map[string]interface{} 51 }{appName, ServiceInstanceName, spaceGUID, bindingName, parameters}) 52 fake.recordInvocation("BindServiceBySpace", []interface{}{appName, ServiceInstanceName, spaceGUID, bindingName, parameters}) 53 fake.bindServiceBySpaceMutex.Unlock() 54 if fake.BindServiceBySpaceStub != nil { 55 return fake.BindServiceBySpaceStub(appName, ServiceInstanceName, spaceGUID, bindingName, parameters) 56 } 57 if specificReturn { 58 return ret.result1, ret.result2 59 } 60 return fake.bindServiceBySpaceReturns.result1, fake.bindServiceBySpaceReturns.result2 61 } 62 63 func (fake *FakeBindServiceActor) BindServiceBySpaceCallCount() int { 64 fake.bindServiceBySpaceMutex.RLock() 65 defer fake.bindServiceBySpaceMutex.RUnlock() 66 return len(fake.bindServiceBySpaceArgsForCall) 67 } 68 69 func (fake *FakeBindServiceActor) BindServiceBySpaceArgsForCall(i int) (string, string, string, string, map[string]interface{}) { 70 fake.bindServiceBySpaceMutex.RLock() 71 defer fake.bindServiceBySpaceMutex.RUnlock() 72 return fake.bindServiceBySpaceArgsForCall[i].appName, fake.bindServiceBySpaceArgsForCall[i].ServiceInstanceName, fake.bindServiceBySpaceArgsForCall[i].spaceGUID, fake.bindServiceBySpaceArgsForCall[i].bindingName, fake.bindServiceBySpaceArgsForCall[i].parameters 73 } 74 75 func (fake *FakeBindServiceActor) BindServiceBySpaceReturns(result1 v2action.Warnings, result2 error) { 76 fake.BindServiceBySpaceStub = nil 77 fake.bindServiceBySpaceReturns = struct { 78 result1 v2action.Warnings 79 result2 error 80 }{result1, result2} 81 } 82 83 func (fake *FakeBindServiceActor) BindServiceBySpaceReturnsOnCall(i int, result1 v2action.Warnings, result2 error) { 84 fake.BindServiceBySpaceStub = nil 85 if fake.bindServiceBySpaceReturnsOnCall == nil { 86 fake.bindServiceBySpaceReturnsOnCall = make(map[int]struct { 87 result1 v2action.Warnings 88 result2 error 89 }) 90 } 91 fake.bindServiceBySpaceReturnsOnCall[i] = struct { 92 result1 v2action.Warnings 93 result2 error 94 }{result1, result2} 95 } 96 97 func (fake *FakeBindServiceActor) CloudControllerAPIVersion() string { 98 fake.cloudControllerAPIVersionMutex.Lock() 99 ret, specificReturn := fake.cloudControllerAPIVersionReturnsOnCall[len(fake.cloudControllerAPIVersionArgsForCall)] 100 fake.cloudControllerAPIVersionArgsForCall = append(fake.cloudControllerAPIVersionArgsForCall, struct{}{}) 101 fake.recordInvocation("CloudControllerAPIVersion", []interface{}{}) 102 fake.cloudControllerAPIVersionMutex.Unlock() 103 if fake.CloudControllerAPIVersionStub != nil { 104 return fake.CloudControllerAPIVersionStub() 105 } 106 if specificReturn { 107 return ret.result1 108 } 109 return fake.cloudControllerAPIVersionReturns.result1 110 } 111 112 func (fake *FakeBindServiceActor) CloudControllerAPIVersionCallCount() int { 113 fake.cloudControllerAPIVersionMutex.RLock() 114 defer fake.cloudControllerAPIVersionMutex.RUnlock() 115 return len(fake.cloudControllerAPIVersionArgsForCall) 116 } 117 118 func (fake *FakeBindServiceActor) CloudControllerAPIVersionReturns(result1 string) { 119 fake.CloudControllerAPIVersionStub = nil 120 fake.cloudControllerAPIVersionReturns = struct { 121 result1 string 122 }{result1} 123 } 124 125 func (fake *FakeBindServiceActor) CloudControllerAPIVersionReturnsOnCall(i int, result1 string) { 126 fake.CloudControllerAPIVersionStub = nil 127 if fake.cloudControllerAPIVersionReturnsOnCall == nil { 128 fake.cloudControllerAPIVersionReturnsOnCall = make(map[int]struct { 129 result1 string 130 }) 131 } 132 fake.cloudControllerAPIVersionReturnsOnCall[i] = struct { 133 result1 string 134 }{result1} 135 } 136 137 func (fake *FakeBindServiceActor) Invocations() map[string][][]interface{} { 138 fake.invocationsMutex.RLock() 139 defer fake.invocationsMutex.RUnlock() 140 fake.bindServiceBySpaceMutex.RLock() 141 defer fake.bindServiceBySpaceMutex.RUnlock() 142 fake.cloudControllerAPIVersionMutex.RLock() 143 defer fake.cloudControllerAPIVersionMutex.RUnlock() 144 copiedInvocations := map[string][][]interface{}{} 145 for key, value := range fake.invocations { 146 copiedInvocations[key] = value 147 } 148 return copiedInvocations 149 } 150 151 func (fake *FakeBindServiceActor) recordInvocation(key string, args []interface{}) { 152 fake.invocationsMutex.Lock() 153 defer fake.invocationsMutex.Unlock() 154 if fake.invocations == nil { 155 fake.invocations = map[string][][]interface{}{} 156 } 157 if fake.invocations[key] == nil { 158 fake.invocations[key] = [][]interface{}{} 159 } 160 fake.invocations[key] = append(fake.invocations[key], args) 161 } 162 163 var _ v2.BindServiceActor = new(FakeBindServiceActor)