github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/cf/api/apifakes/fake_service_summary_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 "code.cloudfoundry.org/cli/cf/models" 9 ) 10 11 type FakeServiceSummaryRepository struct { 12 GetSummariesInCurrentSpaceStub func() ([]models.ServiceInstance, error) 13 getSummariesInCurrentSpaceMutex sync.RWMutex 14 getSummariesInCurrentSpaceArgsForCall []struct { 15 } 16 getSummariesInCurrentSpaceReturns struct { 17 result1 []models.ServiceInstance 18 result2 error 19 } 20 getSummariesInCurrentSpaceReturnsOnCall map[int]struct { 21 result1 []models.ServiceInstance 22 result2 error 23 } 24 invocations map[string][][]interface{} 25 invocationsMutex sync.RWMutex 26 } 27 28 func (fake *FakeServiceSummaryRepository) GetSummariesInCurrentSpace() ([]models.ServiceInstance, error) { 29 fake.getSummariesInCurrentSpaceMutex.Lock() 30 ret, specificReturn := fake.getSummariesInCurrentSpaceReturnsOnCall[len(fake.getSummariesInCurrentSpaceArgsForCall)] 31 fake.getSummariesInCurrentSpaceArgsForCall = append(fake.getSummariesInCurrentSpaceArgsForCall, struct { 32 }{}) 33 fake.recordInvocation("GetSummariesInCurrentSpace", []interface{}{}) 34 fake.getSummariesInCurrentSpaceMutex.Unlock() 35 if fake.GetSummariesInCurrentSpaceStub != nil { 36 return fake.GetSummariesInCurrentSpaceStub() 37 } 38 if specificReturn { 39 return ret.result1, ret.result2 40 } 41 fakeReturns := fake.getSummariesInCurrentSpaceReturns 42 return fakeReturns.result1, fakeReturns.result2 43 } 44 45 func (fake *FakeServiceSummaryRepository) GetSummariesInCurrentSpaceCallCount() int { 46 fake.getSummariesInCurrentSpaceMutex.RLock() 47 defer fake.getSummariesInCurrentSpaceMutex.RUnlock() 48 return len(fake.getSummariesInCurrentSpaceArgsForCall) 49 } 50 51 func (fake *FakeServiceSummaryRepository) GetSummariesInCurrentSpaceCalls(stub func() ([]models.ServiceInstance, error)) { 52 fake.getSummariesInCurrentSpaceMutex.Lock() 53 defer fake.getSummariesInCurrentSpaceMutex.Unlock() 54 fake.GetSummariesInCurrentSpaceStub = stub 55 } 56 57 func (fake *FakeServiceSummaryRepository) GetSummariesInCurrentSpaceReturns(result1 []models.ServiceInstance, result2 error) { 58 fake.getSummariesInCurrentSpaceMutex.Lock() 59 defer fake.getSummariesInCurrentSpaceMutex.Unlock() 60 fake.GetSummariesInCurrentSpaceStub = nil 61 fake.getSummariesInCurrentSpaceReturns = struct { 62 result1 []models.ServiceInstance 63 result2 error 64 }{result1, result2} 65 } 66 67 func (fake *FakeServiceSummaryRepository) GetSummariesInCurrentSpaceReturnsOnCall(i int, result1 []models.ServiceInstance, result2 error) { 68 fake.getSummariesInCurrentSpaceMutex.Lock() 69 defer fake.getSummariesInCurrentSpaceMutex.Unlock() 70 fake.GetSummariesInCurrentSpaceStub = nil 71 if fake.getSummariesInCurrentSpaceReturnsOnCall == nil { 72 fake.getSummariesInCurrentSpaceReturnsOnCall = make(map[int]struct { 73 result1 []models.ServiceInstance 74 result2 error 75 }) 76 } 77 fake.getSummariesInCurrentSpaceReturnsOnCall[i] = struct { 78 result1 []models.ServiceInstance 79 result2 error 80 }{result1, result2} 81 } 82 83 func (fake *FakeServiceSummaryRepository) Invocations() map[string][][]interface{} { 84 fake.invocationsMutex.RLock() 85 defer fake.invocationsMutex.RUnlock() 86 fake.getSummariesInCurrentSpaceMutex.RLock() 87 defer fake.getSummariesInCurrentSpaceMutex.RUnlock() 88 copiedInvocations := map[string][][]interface{}{} 89 for key, value := range fake.invocations { 90 copiedInvocations[key] = value 91 } 92 return copiedInvocations 93 } 94 95 func (fake *FakeServiceSummaryRepository) recordInvocation(key string, args []interface{}) { 96 fake.invocationsMutex.Lock() 97 defer fake.invocationsMutex.Unlock() 98 if fake.invocations == nil { 99 fake.invocations = map[string][][]interface{}{} 100 } 101 if fake.invocations[key] == nil { 102 fake.invocations[key] = [][]interface{}{} 103 } 104 fake.invocations[key] = append(fake.invocations[key], args) 105 } 106 107 var _ api.ServiceSummaryRepository = new(FakeServiceSummaryRepository)