github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/cf/api/apifakes/fake_routing_apirepository.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 FakeRoutingAPIRepository struct { 12 ListRouterGroupsStub func(func(models.RouterGroup) bool) error 13 listRouterGroupsMutex sync.RWMutex 14 listRouterGroupsArgsForCall []struct { 15 arg1 func(models.RouterGroup) bool 16 } 17 listRouterGroupsReturns struct { 18 result1 error 19 } 20 listRouterGroupsReturnsOnCall map[int]struct { 21 result1 error 22 } 23 invocations map[string][][]interface{} 24 invocationsMutex sync.RWMutex 25 } 26 27 func (fake *FakeRoutingAPIRepository) ListRouterGroups(arg1 func(models.RouterGroup) bool) error { 28 fake.listRouterGroupsMutex.Lock() 29 ret, specificReturn := fake.listRouterGroupsReturnsOnCall[len(fake.listRouterGroupsArgsForCall)] 30 fake.listRouterGroupsArgsForCall = append(fake.listRouterGroupsArgsForCall, struct { 31 arg1 func(models.RouterGroup) bool 32 }{arg1}) 33 fake.recordInvocation("ListRouterGroups", []interface{}{arg1}) 34 fake.listRouterGroupsMutex.Unlock() 35 if fake.ListRouterGroupsStub != nil { 36 return fake.ListRouterGroupsStub(arg1) 37 } 38 if specificReturn { 39 return ret.result1 40 } 41 fakeReturns := fake.listRouterGroupsReturns 42 return fakeReturns.result1 43 } 44 45 func (fake *FakeRoutingAPIRepository) ListRouterGroupsCallCount() int { 46 fake.listRouterGroupsMutex.RLock() 47 defer fake.listRouterGroupsMutex.RUnlock() 48 return len(fake.listRouterGroupsArgsForCall) 49 } 50 51 func (fake *FakeRoutingAPIRepository) ListRouterGroupsCalls(stub func(func(models.RouterGroup) bool) error) { 52 fake.listRouterGroupsMutex.Lock() 53 defer fake.listRouterGroupsMutex.Unlock() 54 fake.ListRouterGroupsStub = stub 55 } 56 57 func (fake *FakeRoutingAPIRepository) ListRouterGroupsArgsForCall(i int) func(models.RouterGroup) bool { 58 fake.listRouterGroupsMutex.RLock() 59 defer fake.listRouterGroupsMutex.RUnlock() 60 argsForCall := fake.listRouterGroupsArgsForCall[i] 61 return argsForCall.arg1 62 } 63 64 func (fake *FakeRoutingAPIRepository) ListRouterGroupsReturns(result1 error) { 65 fake.listRouterGroupsMutex.Lock() 66 defer fake.listRouterGroupsMutex.Unlock() 67 fake.ListRouterGroupsStub = nil 68 fake.listRouterGroupsReturns = struct { 69 result1 error 70 }{result1} 71 } 72 73 func (fake *FakeRoutingAPIRepository) ListRouterGroupsReturnsOnCall(i int, result1 error) { 74 fake.listRouterGroupsMutex.Lock() 75 defer fake.listRouterGroupsMutex.Unlock() 76 fake.ListRouterGroupsStub = nil 77 if fake.listRouterGroupsReturnsOnCall == nil { 78 fake.listRouterGroupsReturnsOnCall = make(map[int]struct { 79 result1 error 80 }) 81 } 82 fake.listRouterGroupsReturnsOnCall[i] = struct { 83 result1 error 84 }{result1} 85 } 86 87 func (fake *FakeRoutingAPIRepository) Invocations() map[string][][]interface{} { 88 fake.invocationsMutex.RLock() 89 defer fake.invocationsMutex.RUnlock() 90 fake.listRouterGroupsMutex.RLock() 91 defer fake.listRouterGroupsMutex.RUnlock() 92 copiedInvocations := map[string][][]interface{}{} 93 for key, value := range fake.invocations { 94 copiedInvocations[key] = value 95 } 96 return copiedInvocations 97 } 98 99 func (fake *FakeRoutingAPIRepository) recordInvocation(key string, args []interface{}) { 100 fake.invocationsMutex.Lock() 101 defer fake.invocationsMutex.Unlock() 102 if fake.invocations == nil { 103 fake.invocations = map[string][][]interface{}{} 104 } 105 if fake.invocations[key] == nil { 106 fake.invocations[key] = [][]interface{}{} 107 } 108 fake.invocations[key] = append(fake.invocations[key], args) 109 } 110 111 var _ api.RoutingAPIRepository = new(FakeRoutingAPIRepository)