|
1 | 1 | /*
|
2 |
| - * Copyright 2012-2024 the original author or authors. |
| 2 | + * Copyright 2012-2025 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
44 | 44 | import org.junit.platform.commons.util.ReflectionUtils;
|
45 | 45 |
|
46 | 46 | import org.springframework.boot.testsupport.BuildOutput;
|
47 |
| -import org.springframework.http.HttpMethod; |
48 |
| -import org.springframework.http.client.ClientHttpResponse; |
49 | 47 | import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
|
50 | 48 | import org.springframework.util.FileSystemUtils;
|
51 | 49 | import org.springframework.util.StringUtils;
|
52 |
| -import org.springframework.web.client.ResponseErrorHandler; |
| 50 | +import org.springframework.web.client.NoOpResponseErrorHandler; |
53 | 51 | import org.springframework.web.client.RestTemplate;
|
54 | 52 | import org.springframework.web.util.UriTemplateHandler;
|
55 | 53 |
|
@@ -188,23 +186,7 @@ public Object resolveParameter(ParameterContext parameterContext, ExtensionConte
|
188 | 186 | RestTemplate rest = new RestTemplate(new HttpComponentsClientHttpRequestFactory(HttpClients.custom()
|
189 | 187 | .setRetryStrategy(new DefaultHttpRequestRetryStrategy(10, TimeValue.of(1, TimeUnit.SECONDS)))
|
190 | 188 | .build()));
|
191 |
| - rest.setErrorHandler(new ResponseErrorHandler() { |
192 |
| - |
193 |
| - @Override |
194 |
| - public boolean hasError(ClientHttpResponse response) throws IOException { |
195 |
| - return false; |
196 |
| - } |
197 |
| - |
198 |
| - @Override |
199 |
| - @SuppressWarnings("removal") |
200 |
| - public void handleError(ClientHttpResponse response) throws IOException { |
201 |
| - } |
202 |
| - |
203 |
| - @Override |
204 |
| - public void handleError(URI url, HttpMethod method, ClientHttpResponse response) throws IOException { |
205 |
| - } |
206 |
| - |
207 |
| - }); |
| 189 | + rest.setErrorHandler(new NoOpResponseErrorHandler()); |
208 | 190 | rest.setUriTemplateHandler(new UriTemplateHandler() {
|
209 | 191 |
|
210 | 192 | @Override
|
|
0 commit comments