github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/cf/commands/service/servicefakes/fake_binder.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package servicefakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/cf/commands/service" 8 "code.cloudfoundry.org/cli/cf/models" 9 ) 10 11 type FakeBinder struct { 12 BindApplicationStub func(models.Application, models.ServiceInstance, map[string]interface{}) error 13 bindApplicationMutex sync.RWMutex 14 bindApplicationArgsForCall []struct { 15 arg1 models.Application 16 arg2 models.ServiceInstance 17 arg3 map[string]interface{} 18 } 19 bindApplicationReturns struct { 20 result1 error 21 } 22 bindApplicationReturnsOnCall map[int]struct { 23 result1 error 24 } 25 invocations map[string][][]interface{} 26 invocationsMutex sync.RWMutex 27 } 28 29 func (fake *FakeBinder) BindApplication(arg1 models.Application, arg2 models.ServiceInstance, arg3 map[string]interface{}) error { 30 fake.bindApplicationMutex.Lock() 31 ret, specificReturn := fake.bindApplicationReturnsOnCall[len(fake.bindApplicationArgsForCall)] 32 fake.bindApplicationArgsForCall = append(fake.bindApplicationArgsForCall, struct { 33 arg1 models.Application 34 arg2 models.ServiceInstance 35 arg3 map[string]interface{} 36 }{arg1, arg2, arg3}) 37 fake.recordInvocation("BindApplication", []interface{}{arg1, arg2, arg3}) 38 fake.bindApplicationMutex.Unlock() 39 if fake.BindApplicationStub != nil { 40 return fake.BindApplicationStub(arg1, arg2, arg3) 41 } 42 if specificReturn { 43 return ret.result1 44 } 45 fakeReturns := fake.bindApplicationReturns 46 return fakeReturns.result1 47 } 48 49 func (fake *FakeBinder) BindApplicationCallCount() int { 50 fake.bindApplicationMutex.RLock() 51 defer fake.bindApplicationMutex.RUnlock() 52 return len(fake.bindApplicationArgsForCall) 53 } 54 55 func (fake *FakeBinder) BindApplicationCalls(stub func(models.Application, models.ServiceInstance, map[string]interface{}) error) { 56 fake.bindApplicationMutex.Lock() 57 defer fake.bindApplicationMutex.Unlock() 58 fake.BindApplicationStub = stub 59 } 60 61 func (fake *FakeBinder) BindApplicationArgsForCall(i int) (models.Application, models.ServiceInstance, map[string]interface{}) { 62 fake.bindApplicationMutex.RLock() 63 defer fake.bindApplicationMutex.RUnlock() 64 argsForCall := fake.bindApplicationArgsForCall[i] 65 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 66 } 67 68 func (fake *FakeBinder) BindApplicationReturns(result1 error) { 69 fake.bindApplicationMutex.Lock() 70 defer fake.bindApplicationMutex.Unlock() 71 fake.BindApplicationStub = nil 72 fake.bindApplicationReturns = struct { 73 result1 error 74 }{result1} 75 } 76 77 func (fake *FakeBinder) BindApplicationReturnsOnCall(i int, result1 error) { 78 fake.bindApplicationMutex.Lock() 79 defer fake.bindApplicationMutex.Unlock() 80 fake.BindApplicationStub = nil 81 if fake.bindApplicationReturnsOnCall == nil { 82 fake.bindApplicationReturnsOnCall = make(map[int]struct { 83 result1 error 84 }) 85 } 86 fake.bindApplicationReturnsOnCall[i] = struct { 87 result1 error 88 }{result1} 89 } 90 91 func (fake *FakeBinder) Invocations() map[string][][]interface{} { 92 fake.invocationsMutex.RLock() 93 defer fake.invocationsMutex.RUnlock() 94 fake.bindApplicationMutex.RLock() 95 defer fake.bindApplicationMutex.RUnlock() 96 copiedInvocations := map[string][][]interface{}{} 97 for key, value := range fake.invocations { 98 copiedInvocations[key] = value 99 } 100 return copiedInvocations 101 } 102 103 func (fake *FakeBinder) recordInvocation(key string, args []interface{}) { 104 fake.invocationsMutex.Lock() 105 defer fake.invocationsMutex.Unlock() 106 if fake.invocations == nil { 107 fake.invocations = map[string][][]interface{}{} 108 } 109 if fake.invocations[key] == nil { 110 fake.invocations[key] = [][]interface{}{} 111 } 112 fake.invocations[key] = append(fake.invocations[key], args) 113 } 114 115 var _ service.Binder = new(FakeBinder)