github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/cf/requirements/requirementsfakes/fake_application_requirement.go (about) 1 // This file was generated by counterfeiter 2 package requirementsfakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/cf/models" 8 "code.cloudfoundry.org/cli/cf/requirements" 9 ) 10 11 type FakeApplicationRequirement struct { 12 ExecuteStub func() error 13 executeMutex sync.RWMutex 14 executeArgsForCall []struct{} 15 executeReturns struct { 16 result1 error 17 } 18 GetApplicationStub func() models.Application 19 getApplicationMutex sync.RWMutex 20 getApplicationArgsForCall []struct{} 21 getApplicationReturns struct { 22 result1 models.Application 23 } 24 invocations map[string][][]interface{} 25 invocationsMutex sync.RWMutex 26 } 27 28 func (fake *FakeApplicationRequirement) Execute() error { 29 fake.executeMutex.Lock() 30 fake.executeArgsForCall = append(fake.executeArgsForCall, struct{}{}) 31 fake.recordInvocation("Execute", []interface{}{}) 32 fake.executeMutex.Unlock() 33 if fake.ExecuteStub != nil { 34 return fake.ExecuteStub() 35 } else { 36 return fake.executeReturns.result1 37 } 38 } 39 40 func (fake *FakeApplicationRequirement) ExecuteCallCount() int { 41 fake.executeMutex.RLock() 42 defer fake.executeMutex.RUnlock() 43 return len(fake.executeArgsForCall) 44 } 45 46 func (fake *FakeApplicationRequirement) ExecuteReturns(result1 error) { 47 fake.ExecuteStub = nil 48 fake.executeReturns = struct { 49 result1 error 50 }{result1} 51 } 52 53 func (fake *FakeApplicationRequirement) GetApplication() models.Application { 54 fake.getApplicationMutex.Lock() 55 fake.getApplicationArgsForCall = append(fake.getApplicationArgsForCall, struct{}{}) 56 fake.recordInvocation("GetApplication", []interface{}{}) 57 fake.getApplicationMutex.Unlock() 58 if fake.GetApplicationStub != nil { 59 return fake.GetApplicationStub() 60 } else { 61 return fake.getApplicationReturns.result1 62 } 63 } 64 65 func (fake *FakeApplicationRequirement) GetApplicationCallCount() int { 66 fake.getApplicationMutex.RLock() 67 defer fake.getApplicationMutex.RUnlock() 68 return len(fake.getApplicationArgsForCall) 69 } 70 71 func (fake *FakeApplicationRequirement) GetApplicationReturns(result1 models.Application) { 72 fake.GetApplicationStub = nil 73 fake.getApplicationReturns = struct { 74 result1 models.Application 75 }{result1} 76 } 77 78 func (fake *FakeApplicationRequirement) Invocations() map[string][][]interface{} { 79 fake.invocationsMutex.RLock() 80 defer fake.invocationsMutex.RUnlock() 81 fake.executeMutex.RLock() 82 defer fake.executeMutex.RUnlock() 83 fake.getApplicationMutex.RLock() 84 defer fake.getApplicationMutex.RUnlock() 85 return fake.invocations 86 } 87 88 func (fake *FakeApplicationRequirement) recordInvocation(key string, args []interface{}) { 89 fake.invocationsMutex.Lock() 90 defer fake.invocationsMutex.Unlock() 91 if fake.invocations == nil { 92 fake.invocations = map[string][][]interface{}{} 93 } 94 if fake.invocations[key] == nil { 95 fake.invocations[key] = [][]interface{}{} 96 } 97 fake.invocations[key] = append(fake.invocations[key], args) 98 } 99 100 var _ requirements.ApplicationRequirement = new(FakeApplicationRequirement)