github.com/liamawhite/cli-with-i18n@v6.32.1-0.20171122084555-dede0a5c3448+incompatible/command/v2/v2fakes/fake_create_route_actor.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package v2fakes 3 4 import ( 5 "sync" 6 7 "github.com/liamawhite/cli-with-i18n/actor/v2action" 8 "github.com/liamawhite/cli-with-i18n/command/v2" 9 ) 10 11 type FakeCreateRouteActor struct { 12 CloudControllerAPIVersionStub func() string 13 cloudControllerAPIVersionMutex sync.RWMutex 14 cloudControllerAPIVersionArgsForCall []struct{} 15 cloudControllerAPIVersionReturns struct { 16 result1 string 17 } 18 cloudControllerAPIVersionReturnsOnCall map[int]struct { 19 result1 string 20 } 21 CreateRouteWithExistenceCheckStub func(orgGUID string, spaceName string, route v2action.Route, generatePort bool) (v2action.Route, v2action.Warnings, error) 22 createRouteWithExistenceCheckMutex sync.RWMutex 23 createRouteWithExistenceCheckArgsForCall []struct { 24 orgGUID string 25 spaceName string 26 route v2action.Route 27 generatePort bool 28 } 29 createRouteWithExistenceCheckReturns struct { 30 result1 v2action.Route 31 result2 v2action.Warnings 32 result3 error 33 } 34 createRouteWithExistenceCheckReturnsOnCall map[int]struct { 35 result1 v2action.Route 36 result2 v2action.Warnings 37 result3 error 38 } 39 invocations map[string][][]interface{} 40 invocationsMutex sync.RWMutex 41 } 42 43 func (fake *FakeCreateRouteActor) CloudControllerAPIVersion() string { 44 fake.cloudControllerAPIVersionMutex.Lock() 45 ret, specificReturn := fake.cloudControllerAPIVersionReturnsOnCall[len(fake.cloudControllerAPIVersionArgsForCall)] 46 fake.cloudControllerAPIVersionArgsForCall = append(fake.cloudControllerAPIVersionArgsForCall, struct{}{}) 47 fake.recordInvocation("CloudControllerAPIVersion", []interface{}{}) 48 fake.cloudControllerAPIVersionMutex.Unlock() 49 if fake.CloudControllerAPIVersionStub != nil { 50 return fake.CloudControllerAPIVersionStub() 51 } 52 if specificReturn { 53 return ret.result1 54 } 55 return fake.cloudControllerAPIVersionReturns.result1 56 } 57 58 func (fake *FakeCreateRouteActor) CloudControllerAPIVersionCallCount() int { 59 fake.cloudControllerAPIVersionMutex.RLock() 60 defer fake.cloudControllerAPIVersionMutex.RUnlock() 61 return len(fake.cloudControllerAPIVersionArgsForCall) 62 } 63 64 func (fake *FakeCreateRouteActor) CloudControllerAPIVersionReturns(result1 string) { 65 fake.CloudControllerAPIVersionStub = nil 66 fake.cloudControllerAPIVersionReturns = struct { 67 result1 string 68 }{result1} 69 } 70 71 func (fake *FakeCreateRouteActor) CloudControllerAPIVersionReturnsOnCall(i int, result1 string) { 72 fake.CloudControllerAPIVersionStub = nil 73 if fake.cloudControllerAPIVersionReturnsOnCall == nil { 74 fake.cloudControllerAPIVersionReturnsOnCall = make(map[int]struct { 75 result1 string 76 }) 77 } 78 fake.cloudControllerAPIVersionReturnsOnCall[i] = struct { 79 result1 string 80 }{result1} 81 } 82 83 func (fake *FakeCreateRouteActor) CreateRouteWithExistenceCheck(orgGUID string, spaceName string, route v2action.Route, generatePort bool) (v2action.Route, v2action.Warnings, error) { 84 fake.createRouteWithExistenceCheckMutex.Lock() 85 ret, specificReturn := fake.createRouteWithExistenceCheckReturnsOnCall[len(fake.createRouteWithExistenceCheckArgsForCall)] 86 fake.createRouteWithExistenceCheckArgsForCall = append(fake.createRouteWithExistenceCheckArgsForCall, struct { 87 orgGUID string 88 spaceName string 89 route v2action.Route 90 generatePort bool 91 }{orgGUID, spaceName, route, generatePort}) 92 fake.recordInvocation("CreateRouteWithExistenceCheck", []interface{}{orgGUID, spaceName, route, generatePort}) 93 fake.createRouteWithExistenceCheckMutex.Unlock() 94 if fake.CreateRouteWithExistenceCheckStub != nil { 95 return fake.CreateRouteWithExistenceCheckStub(orgGUID, spaceName, route, generatePort) 96 } 97 if specificReturn { 98 return ret.result1, ret.result2, ret.result3 99 } 100 return fake.createRouteWithExistenceCheckReturns.result1, fake.createRouteWithExistenceCheckReturns.result2, fake.createRouteWithExistenceCheckReturns.result3 101 } 102 103 func (fake *FakeCreateRouteActor) CreateRouteWithExistenceCheckCallCount() int { 104 fake.createRouteWithExistenceCheckMutex.RLock() 105 defer fake.createRouteWithExistenceCheckMutex.RUnlock() 106 return len(fake.createRouteWithExistenceCheckArgsForCall) 107 } 108 109 func (fake *FakeCreateRouteActor) CreateRouteWithExistenceCheckArgsForCall(i int) (string, string, v2action.Route, bool) { 110 fake.createRouteWithExistenceCheckMutex.RLock() 111 defer fake.createRouteWithExistenceCheckMutex.RUnlock() 112 return fake.createRouteWithExistenceCheckArgsForCall[i].orgGUID, fake.createRouteWithExistenceCheckArgsForCall[i].spaceName, fake.createRouteWithExistenceCheckArgsForCall[i].route, fake.createRouteWithExistenceCheckArgsForCall[i].generatePort 113 } 114 115 func (fake *FakeCreateRouteActor) CreateRouteWithExistenceCheckReturns(result1 v2action.Route, result2 v2action.Warnings, result3 error) { 116 fake.CreateRouteWithExistenceCheckStub = nil 117 fake.createRouteWithExistenceCheckReturns = struct { 118 result1 v2action.Route 119 result2 v2action.Warnings 120 result3 error 121 }{result1, result2, result3} 122 } 123 124 func (fake *FakeCreateRouteActor) CreateRouteWithExistenceCheckReturnsOnCall(i int, result1 v2action.Route, result2 v2action.Warnings, result3 error) { 125 fake.CreateRouteWithExistenceCheckStub = nil 126 if fake.createRouteWithExistenceCheckReturnsOnCall == nil { 127 fake.createRouteWithExistenceCheckReturnsOnCall = make(map[int]struct { 128 result1 v2action.Route 129 result2 v2action.Warnings 130 result3 error 131 }) 132 } 133 fake.createRouteWithExistenceCheckReturnsOnCall[i] = struct { 134 result1 v2action.Route 135 result2 v2action.Warnings 136 result3 error 137 }{result1, result2, result3} 138 } 139 140 func (fake *FakeCreateRouteActor) Invocations() map[string][][]interface{} { 141 fake.invocationsMutex.RLock() 142 defer fake.invocationsMutex.RUnlock() 143 fake.cloudControllerAPIVersionMutex.RLock() 144 defer fake.cloudControllerAPIVersionMutex.RUnlock() 145 fake.createRouteWithExistenceCheckMutex.RLock() 146 defer fake.createRouteWithExistenceCheckMutex.RUnlock() 147 copiedInvocations := map[string][][]interface{}{} 148 for key, value := range fake.invocations { 149 copiedInvocations[key] = value 150 } 151 return copiedInvocations 152 } 153 154 func (fake *FakeCreateRouteActor) recordInvocation(key string, args []interface{}) { 155 fake.invocationsMutex.Lock() 156 defer fake.invocationsMutex.Unlock() 157 if fake.invocations == nil { 158 fake.invocations = map[string][][]interface{}{} 159 } 160 if fake.invocations[key] == nil { 161 fake.invocations[key] = [][]interface{}{} 162 } 163 fake.invocations[key] = append(fake.invocations[key], args) 164 } 165 166 var _ v2.CreateRouteActor = new(FakeCreateRouteActor)