github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/cf/api/apifakes/fake_route_service_binding_repository.go (about) 1 // This file was generated by counterfeiter 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(instanceGUID, routeGUID string, userProvided bool, parameters string) error 12 bindMutex sync.RWMutex 13 bindArgsForCall []struct { 14 instanceGUID string 15 routeGUID string 16 userProvided bool 17 parameters string 18 } 19 bindReturns struct { 20 result1 error 21 } 22 UnbindStub func(instanceGUID, routeGUID string, userProvided bool) error 23 unbindMutex sync.RWMutex 24 unbindArgsForCall []struct { 25 instanceGUID string 26 routeGUID string 27 userProvided bool 28 } 29 unbindReturns struct { 30 result1 error 31 } 32 invocations map[string][][]interface{} 33 invocationsMutex sync.RWMutex 34 } 35 36 func (fake *FakeRouteServiceBindingRepository) Bind(instanceGUID string, routeGUID string, userProvided bool, parameters string) error { 37 fake.bindMutex.Lock() 38 fake.bindArgsForCall = append(fake.bindArgsForCall, struct { 39 instanceGUID string 40 routeGUID string 41 userProvided bool 42 parameters string 43 }{instanceGUID, routeGUID, userProvided, parameters}) 44 fake.recordInvocation("Bind", []interface{}{instanceGUID, routeGUID, userProvided, parameters}) 45 fake.bindMutex.Unlock() 46 if fake.BindStub != nil { 47 return fake.BindStub(instanceGUID, routeGUID, userProvided, parameters) 48 } else { 49 return fake.bindReturns.result1 50 } 51 } 52 53 func (fake *FakeRouteServiceBindingRepository) BindCallCount() int { 54 fake.bindMutex.RLock() 55 defer fake.bindMutex.RUnlock() 56 return len(fake.bindArgsForCall) 57 } 58 59 func (fake *FakeRouteServiceBindingRepository) BindArgsForCall(i int) (string, string, bool, string) { 60 fake.bindMutex.RLock() 61 defer fake.bindMutex.RUnlock() 62 return fake.bindArgsForCall[i].instanceGUID, fake.bindArgsForCall[i].routeGUID, fake.bindArgsForCall[i].userProvided, fake.bindArgsForCall[i].parameters 63 } 64 65 func (fake *FakeRouteServiceBindingRepository) BindReturns(result1 error) { 66 fake.BindStub = nil 67 fake.bindReturns = struct { 68 result1 error 69 }{result1} 70 } 71 72 func (fake *FakeRouteServiceBindingRepository) Unbind(instanceGUID string, routeGUID string, userProvided bool) error { 73 fake.unbindMutex.Lock() 74 fake.unbindArgsForCall = append(fake.unbindArgsForCall, struct { 75 instanceGUID string 76 routeGUID string 77 userProvided bool 78 }{instanceGUID, routeGUID, userProvided}) 79 fake.recordInvocation("Unbind", []interface{}{instanceGUID, routeGUID, userProvided}) 80 fake.unbindMutex.Unlock() 81 if fake.UnbindStub != nil { 82 return fake.UnbindStub(instanceGUID, routeGUID, userProvided) 83 } else { 84 return fake.unbindReturns.result1 85 } 86 } 87 88 func (fake *FakeRouteServiceBindingRepository) UnbindCallCount() int { 89 fake.unbindMutex.RLock() 90 defer fake.unbindMutex.RUnlock() 91 return len(fake.unbindArgsForCall) 92 } 93 94 func (fake *FakeRouteServiceBindingRepository) UnbindArgsForCall(i int) (string, string, bool) { 95 fake.unbindMutex.RLock() 96 defer fake.unbindMutex.RUnlock() 97 return fake.unbindArgsForCall[i].instanceGUID, fake.unbindArgsForCall[i].routeGUID, fake.unbindArgsForCall[i].userProvided 98 } 99 100 func (fake *FakeRouteServiceBindingRepository) UnbindReturns(result1 error) { 101 fake.UnbindStub = nil 102 fake.unbindReturns = struct { 103 result1 error 104 }{result1} 105 } 106 107 func (fake *FakeRouteServiceBindingRepository) Invocations() map[string][][]interface{} { 108 fake.invocationsMutex.RLock() 109 defer fake.invocationsMutex.RUnlock() 110 fake.bindMutex.RLock() 111 defer fake.bindMutex.RUnlock() 112 fake.unbindMutex.RLock() 113 defer fake.unbindMutex.RUnlock() 114 return fake.invocations 115 } 116 117 func (fake *FakeRouteServiceBindingRepository) recordInvocation(key string, args []interface{}) { 118 fake.invocationsMutex.Lock() 119 defer fake.invocationsMutex.Unlock() 120 if fake.invocations == nil { 121 fake.invocations = map[string][][]interface{}{} 122 } 123 if fake.invocations[key] == nil { 124 fake.invocations[key] = [][]interface{}{} 125 } 126 fake.invocations[key] = append(fake.invocations[key], args) 127 } 128 129 var _ api.RouteServiceBindingRepository = new(FakeRouteServiceBindingRepository)