github.com/swisscom/cloudfoundry-cli@v7.1.0+incompatible/actor/v2action/v2actionfakes/fake_router_client.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package v2actionfakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/actor/v2action" 8 "code.cloudfoundry.org/cli/api/router" 9 ) 10 11 type FakeRouterClient struct { 12 GetRouterGroupByNameStub func(string) (router.RouterGroup, error) 13 getRouterGroupByNameMutex sync.RWMutex 14 getRouterGroupByNameArgsForCall []struct { 15 arg1 string 16 } 17 getRouterGroupByNameReturns struct { 18 result1 router.RouterGroup 19 result2 error 20 } 21 getRouterGroupByNameReturnsOnCall map[int]struct { 22 result1 router.RouterGroup 23 result2 error 24 } 25 invocations map[string][][]interface{} 26 invocationsMutex sync.RWMutex 27 } 28 29 func (fake *FakeRouterClient) GetRouterGroupByName(arg1 string) (router.RouterGroup, error) { 30 fake.getRouterGroupByNameMutex.Lock() 31 ret, specificReturn := fake.getRouterGroupByNameReturnsOnCall[len(fake.getRouterGroupByNameArgsForCall)] 32 fake.getRouterGroupByNameArgsForCall = append(fake.getRouterGroupByNameArgsForCall, struct { 33 arg1 string 34 }{arg1}) 35 fake.recordInvocation("GetRouterGroupByName", []interface{}{arg1}) 36 fake.getRouterGroupByNameMutex.Unlock() 37 if fake.GetRouterGroupByNameStub != nil { 38 return fake.GetRouterGroupByNameStub(arg1) 39 } 40 if specificReturn { 41 return ret.result1, ret.result2 42 } 43 fakeReturns := fake.getRouterGroupByNameReturns 44 return fakeReturns.result1, fakeReturns.result2 45 } 46 47 func (fake *FakeRouterClient) GetRouterGroupByNameCallCount() int { 48 fake.getRouterGroupByNameMutex.RLock() 49 defer fake.getRouterGroupByNameMutex.RUnlock() 50 return len(fake.getRouterGroupByNameArgsForCall) 51 } 52 53 func (fake *FakeRouterClient) GetRouterGroupByNameCalls(stub func(string) (router.RouterGroup, error)) { 54 fake.getRouterGroupByNameMutex.Lock() 55 defer fake.getRouterGroupByNameMutex.Unlock() 56 fake.GetRouterGroupByNameStub = stub 57 } 58 59 func (fake *FakeRouterClient) GetRouterGroupByNameArgsForCall(i int) string { 60 fake.getRouterGroupByNameMutex.RLock() 61 defer fake.getRouterGroupByNameMutex.RUnlock() 62 argsForCall := fake.getRouterGroupByNameArgsForCall[i] 63 return argsForCall.arg1 64 } 65 66 func (fake *FakeRouterClient) GetRouterGroupByNameReturns(result1 router.RouterGroup, result2 error) { 67 fake.getRouterGroupByNameMutex.Lock() 68 defer fake.getRouterGroupByNameMutex.Unlock() 69 fake.GetRouterGroupByNameStub = nil 70 fake.getRouterGroupByNameReturns = struct { 71 result1 router.RouterGroup 72 result2 error 73 }{result1, result2} 74 } 75 76 func (fake *FakeRouterClient) GetRouterGroupByNameReturnsOnCall(i int, result1 router.RouterGroup, result2 error) { 77 fake.getRouterGroupByNameMutex.Lock() 78 defer fake.getRouterGroupByNameMutex.Unlock() 79 fake.GetRouterGroupByNameStub = nil 80 if fake.getRouterGroupByNameReturnsOnCall == nil { 81 fake.getRouterGroupByNameReturnsOnCall = make(map[int]struct { 82 result1 router.RouterGroup 83 result2 error 84 }) 85 } 86 fake.getRouterGroupByNameReturnsOnCall[i] = struct { 87 result1 router.RouterGroup 88 result2 error 89 }{result1, result2} 90 } 91 92 func (fake *FakeRouterClient) Invocations() map[string][][]interface{} { 93 fake.invocationsMutex.RLock() 94 defer fake.invocationsMutex.RUnlock() 95 fake.getRouterGroupByNameMutex.RLock() 96 defer fake.getRouterGroupByNameMutex.RUnlock() 97 copiedInvocations := map[string][][]interface{}{} 98 for key, value := range fake.invocations { 99 copiedInvocations[key] = value 100 } 101 return copiedInvocations 102 } 103 104 func (fake *FakeRouterClient) recordInvocation(key string, args []interface{}) { 105 fake.invocationsMutex.Lock() 106 defer fake.invocationsMutex.Unlock() 107 if fake.invocations == nil { 108 fake.invocations = map[string][][]interface{}{} 109 } 110 if fake.invocations[key] == nil { 111 fake.invocations[key] = [][]interface{}{} 112 } 113 fake.invocations[key] = append(fake.invocations[key], args) 114 } 115 116 var _ v2action.RouterClient = new(FakeRouterClient)