github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/cf/api/apifakes/fake_route_service_binding_repository.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package apifakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/cf/api" 8 ) 9 10 type FakeRouteServiceBindingRepository struct { 11 BindStub func(string, string, bool, string) error 12 bindMutex sync.RWMutex 13 bindArgsForCall []struct { 14 arg1 string 15 arg2 string 16 arg3 bool 17 arg4 string 18 } 19 bindReturns struct { 20 result1 error 21 } 22 bindReturnsOnCall map[int]struct { 23 result1 error 24 } 25 UnbindStub func(string, string, bool) error 26 unbindMutex sync.RWMutex 27 unbindArgsForCall []struct { 28 arg1 string 29 arg2 string 30 arg3 bool 31 } 32 unbindReturns struct { 33 result1 error 34 } 35 unbindReturnsOnCall map[int]struct { 36 result1 error 37 } 38 invocations map[string][][]interface{} 39 invocationsMutex sync.RWMutex 40 } 41 42 func (fake *FakeRouteServiceBindingRepository) Bind(arg1 string, arg2 string, arg3 bool, arg4 string) error { 43 fake.bindMutex.Lock() 44 ret, specificReturn := fake.bindReturnsOnCall[len(fake.bindArgsForCall)] 45 fake.bindArgsForCall = append(fake.bindArgsForCall, struct { 46 arg1 string 47 arg2 string 48 arg3 bool 49 arg4 string 50 }{arg1, arg2, arg3, arg4}) 51 fake.recordInvocation("Bind", []interface{}{arg1, arg2, arg3, arg4}) 52 fake.bindMutex.Unlock() 53 if fake.BindStub != nil { 54 return fake.BindStub(arg1, arg2, arg3, arg4) 55 } 56 if specificReturn { 57 return ret.result1 58 } 59 fakeReturns := fake.bindReturns 60 return fakeReturns.result1 61 } 62 63 func (fake *FakeRouteServiceBindingRepository) BindCallCount() int { 64 fake.bindMutex.RLock() 65 defer fake.bindMutex.RUnlock() 66 return len(fake.bindArgsForCall) 67 } 68 69 func (fake *FakeRouteServiceBindingRepository) BindCalls(stub func(string, string, bool, string) error) { 70 fake.bindMutex.Lock() 71 defer fake.bindMutex.Unlock() 72 fake.BindStub = stub 73 } 74 75 func (fake *FakeRouteServiceBindingRepository) BindArgsForCall(i int) (string, string, bool, string) { 76 fake.bindMutex.RLock() 77 defer fake.bindMutex.RUnlock() 78 argsForCall := fake.bindArgsForCall[i] 79 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4 80 } 81 82 func (fake *FakeRouteServiceBindingRepository) BindReturns(result1 error) { 83 fake.bindMutex.Lock() 84 defer fake.bindMutex.Unlock() 85 fake.BindStub = nil 86 fake.bindReturns = struct { 87 result1 error 88 }{result1} 89 } 90 91 func (fake *FakeRouteServiceBindingRepository) BindReturnsOnCall(i int, result1 error) { 92 fake.bindMutex.Lock() 93 defer fake.bindMutex.Unlock() 94 fake.BindStub = nil 95 if fake.bindReturnsOnCall == nil { 96 fake.bindReturnsOnCall = make(map[int]struct { 97 result1 error 98 }) 99 } 100 fake.bindReturnsOnCall[i] = struct { 101 result1 error 102 }{result1} 103 } 104 105 func (fake *FakeRouteServiceBindingRepository) Unbind(arg1 string, arg2 string, arg3 bool) error { 106 fake.unbindMutex.Lock() 107 ret, specificReturn := fake.unbindReturnsOnCall[len(fake.unbindArgsForCall)] 108 fake.unbindArgsForCall = append(fake.unbindArgsForCall, struct { 109 arg1 string 110 arg2 string 111 arg3 bool 112 }{arg1, arg2, arg3}) 113 fake.recordInvocation("Unbind", []interface{}{arg1, arg2, arg3}) 114 fake.unbindMutex.Unlock() 115 if fake.UnbindStub != nil { 116 return fake.UnbindStub(arg1, arg2, arg3) 117 } 118 if specificReturn { 119 return ret.result1 120 } 121 fakeReturns := fake.unbindReturns 122 return fakeReturns.result1 123 } 124 125 func (fake *FakeRouteServiceBindingRepository) UnbindCallCount() int { 126 fake.unbindMutex.RLock() 127 defer fake.unbindMutex.RUnlock() 128 return len(fake.unbindArgsForCall) 129 } 130 131 func (fake *FakeRouteServiceBindingRepository) UnbindCalls(stub func(string, string, bool) error) { 132 fake.unbindMutex.Lock() 133 defer fake.unbindMutex.Unlock() 134 fake.UnbindStub = stub 135 } 136 137 func (fake *FakeRouteServiceBindingRepository) UnbindArgsForCall(i int) (string, string, bool) { 138 fake.unbindMutex.RLock() 139 defer fake.unbindMutex.RUnlock() 140 argsForCall := fake.unbindArgsForCall[i] 141 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 142 } 143 144 func (fake *FakeRouteServiceBindingRepository) UnbindReturns(result1 error) { 145 fake.unbindMutex.Lock() 146 defer fake.unbindMutex.Unlock() 147 fake.UnbindStub = nil 148 fake.unbindReturns = struct { 149 result1 error 150 }{result1} 151 } 152 153 func (fake *FakeRouteServiceBindingRepository) UnbindReturnsOnCall(i int, result1 error) { 154 fake.unbindMutex.Lock() 155 defer fake.unbindMutex.Unlock() 156 fake.UnbindStub = nil 157 if fake.unbindReturnsOnCall == nil { 158 fake.unbindReturnsOnCall = make(map[int]struct { 159 result1 error 160 }) 161 } 162 fake.unbindReturnsOnCall[i] = struct { 163 result1 error 164 }{result1} 165 } 166 167 func (fake *FakeRouteServiceBindingRepository) Invocations() map[string][][]interface{} { 168 fake.invocationsMutex.RLock() 169 defer fake.invocationsMutex.RUnlock() 170 fake.bindMutex.RLock() 171 defer fake.bindMutex.RUnlock() 172 fake.unbindMutex.RLock() 173 defer fake.unbindMutex.RUnlock() 174 copiedInvocations := map[string][][]interface{}{} 175 for key, value := range fake.invocations { 176 copiedInvocations[key] = value 177 } 178 return copiedInvocations 179 } 180 181 func (fake *FakeRouteServiceBindingRepository) recordInvocation(key string, args []interface{}) { 182 fake.invocationsMutex.Lock() 183 defer fake.invocationsMutex.Unlock() 184 if fake.invocations == nil { 185 fake.invocations = map[string][][]interface{}{} 186 } 187 if fake.invocations[key] == nil { 188 fake.invocations[key] = [][]interface{}{} 189 } 190 fake.invocations[key] = append(fake.invocations[key], args) 191 } 192 193 var _ api.RouteServiceBindingRepository = new(FakeRouteServiceBindingRepository)