github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/cf/errors/errorsfakes/fake_httperror.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package errorsfakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/cf/errors" 8 ) 9 10 type FakeHTTPError struct { 11 ErrorStub func() string 12 errorMutex sync.RWMutex 13 errorArgsForCall []struct { 14 } 15 errorReturns struct { 16 result1 string 17 } 18 errorReturnsOnCall map[int]struct { 19 result1 string 20 } 21 ErrorCodeStub func() string 22 errorCodeMutex sync.RWMutex 23 errorCodeArgsForCall []struct { 24 } 25 errorCodeReturns struct { 26 result1 string 27 } 28 errorCodeReturnsOnCall map[int]struct { 29 result1 string 30 } 31 StatusCodeStub func() int 32 statusCodeMutex sync.RWMutex 33 statusCodeArgsForCall []struct { 34 } 35 statusCodeReturns struct { 36 result1 int 37 } 38 statusCodeReturnsOnCall map[int]struct { 39 result1 int 40 } 41 invocations map[string][][]interface{} 42 invocationsMutex sync.RWMutex 43 } 44 45 func (fake *FakeHTTPError) Error() string { 46 fake.errorMutex.Lock() 47 ret, specificReturn := fake.errorReturnsOnCall[len(fake.errorArgsForCall)] 48 fake.errorArgsForCall = append(fake.errorArgsForCall, struct { 49 }{}) 50 fake.recordInvocation("Error", []interface{}{}) 51 fake.errorMutex.Unlock() 52 if fake.ErrorStub != nil { 53 return fake.ErrorStub() 54 } 55 if specificReturn { 56 return ret.result1 57 } 58 fakeReturns := fake.errorReturns 59 return fakeReturns.result1 60 } 61 62 func (fake *FakeHTTPError) ErrorCallCount() int { 63 fake.errorMutex.RLock() 64 defer fake.errorMutex.RUnlock() 65 return len(fake.errorArgsForCall) 66 } 67 68 func (fake *FakeHTTPError) ErrorCalls(stub func() string) { 69 fake.errorMutex.Lock() 70 defer fake.errorMutex.Unlock() 71 fake.ErrorStub = stub 72 } 73 74 func (fake *FakeHTTPError) ErrorReturns(result1 string) { 75 fake.errorMutex.Lock() 76 defer fake.errorMutex.Unlock() 77 fake.ErrorStub = nil 78 fake.errorReturns = struct { 79 result1 string 80 }{result1} 81 } 82 83 func (fake *FakeHTTPError) ErrorReturnsOnCall(i int, result1 string) { 84 fake.errorMutex.Lock() 85 defer fake.errorMutex.Unlock() 86 fake.ErrorStub = nil 87 if fake.errorReturnsOnCall == nil { 88 fake.errorReturnsOnCall = make(map[int]struct { 89 result1 string 90 }) 91 } 92 fake.errorReturnsOnCall[i] = struct { 93 result1 string 94 }{result1} 95 } 96 97 func (fake *FakeHTTPError) ErrorCode() string { 98 fake.errorCodeMutex.Lock() 99 ret, specificReturn := fake.errorCodeReturnsOnCall[len(fake.errorCodeArgsForCall)] 100 fake.errorCodeArgsForCall = append(fake.errorCodeArgsForCall, struct { 101 }{}) 102 fake.recordInvocation("ErrorCode", []interface{}{}) 103 fake.errorCodeMutex.Unlock() 104 if fake.ErrorCodeStub != nil { 105 return fake.ErrorCodeStub() 106 } 107 if specificReturn { 108 return ret.result1 109 } 110 fakeReturns := fake.errorCodeReturns 111 return fakeReturns.result1 112 } 113 114 func (fake *FakeHTTPError) ErrorCodeCallCount() int { 115 fake.errorCodeMutex.RLock() 116 defer fake.errorCodeMutex.RUnlock() 117 return len(fake.errorCodeArgsForCall) 118 } 119 120 func (fake *FakeHTTPError) ErrorCodeCalls(stub func() string) { 121 fake.errorCodeMutex.Lock() 122 defer fake.errorCodeMutex.Unlock() 123 fake.ErrorCodeStub = stub 124 } 125 126 func (fake *FakeHTTPError) ErrorCodeReturns(result1 string) { 127 fake.errorCodeMutex.Lock() 128 defer fake.errorCodeMutex.Unlock() 129 fake.ErrorCodeStub = nil 130 fake.errorCodeReturns = struct { 131 result1 string 132 }{result1} 133 } 134 135 func (fake *FakeHTTPError) ErrorCodeReturnsOnCall(i int, result1 string) { 136 fake.errorCodeMutex.Lock() 137 defer fake.errorCodeMutex.Unlock() 138 fake.ErrorCodeStub = nil 139 if fake.errorCodeReturnsOnCall == nil { 140 fake.errorCodeReturnsOnCall = make(map[int]struct { 141 result1 string 142 }) 143 } 144 fake.errorCodeReturnsOnCall[i] = struct { 145 result1 string 146 }{result1} 147 } 148 149 func (fake *FakeHTTPError) StatusCode() int { 150 fake.statusCodeMutex.Lock() 151 ret, specificReturn := fake.statusCodeReturnsOnCall[len(fake.statusCodeArgsForCall)] 152 fake.statusCodeArgsForCall = append(fake.statusCodeArgsForCall, struct { 153 }{}) 154 fake.recordInvocation("StatusCode", []interface{}{}) 155 fake.statusCodeMutex.Unlock() 156 if fake.StatusCodeStub != nil { 157 return fake.StatusCodeStub() 158 } 159 if specificReturn { 160 return ret.result1 161 } 162 fakeReturns := fake.statusCodeReturns 163 return fakeReturns.result1 164 } 165 166 func (fake *FakeHTTPError) StatusCodeCallCount() int { 167 fake.statusCodeMutex.RLock() 168 defer fake.statusCodeMutex.RUnlock() 169 return len(fake.statusCodeArgsForCall) 170 } 171 172 func (fake *FakeHTTPError) StatusCodeCalls(stub func() int) { 173 fake.statusCodeMutex.Lock() 174 defer fake.statusCodeMutex.Unlock() 175 fake.StatusCodeStub = stub 176 } 177 178 func (fake *FakeHTTPError) StatusCodeReturns(result1 int) { 179 fake.statusCodeMutex.Lock() 180 defer fake.statusCodeMutex.Unlock() 181 fake.StatusCodeStub = nil 182 fake.statusCodeReturns = struct { 183 result1 int 184 }{result1} 185 } 186 187 func (fake *FakeHTTPError) StatusCodeReturnsOnCall(i int, result1 int) { 188 fake.statusCodeMutex.Lock() 189 defer fake.statusCodeMutex.Unlock() 190 fake.StatusCodeStub = nil 191 if fake.statusCodeReturnsOnCall == nil { 192 fake.statusCodeReturnsOnCall = make(map[int]struct { 193 result1 int 194 }) 195 } 196 fake.statusCodeReturnsOnCall[i] = struct { 197 result1 int 198 }{result1} 199 } 200 201 func (fake *FakeHTTPError) Invocations() map[string][][]interface{} { 202 fake.invocationsMutex.RLock() 203 defer fake.invocationsMutex.RUnlock() 204 fake.errorMutex.RLock() 205 defer fake.errorMutex.RUnlock() 206 fake.errorCodeMutex.RLock() 207 defer fake.errorCodeMutex.RUnlock() 208 fake.statusCodeMutex.RLock() 209 defer fake.statusCodeMutex.RUnlock() 210 copiedInvocations := map[string][][]interface{}{} 211 for key, value := range fake.invocations { 212 copiedInvocations[key] = value 213 } 214 return copiedInvocations 215 } 216 217 func (fake *FakeHTTPError) recordInvocation(key string, args []interface{}) { 218 fake.invocationsMutex.Lock() 219 defer fake.invocationsMutex.Unlock() 220 if fake.invocations == nil { 221 fake.invocations = map[string][][]interface{}{} 222 } 223 if fake.invocations[key] == nil { 224 fake.invocations[key] = [][]interface{}{} 225 } 226 fake.invocations[key] = append(fake.invocations[key], args) 227 } 228 229 var _ errors.HTTPError = new(FakeHTTPError)