|
46 | 46 | import org.apache.hc.core5.ssl.SSLContextBuilder; |
47 | 47 | import org.apache.hc.core5.ssl.TrustStrategy; |
48 | 48 |
|
49 | | -import org.springframework.boot.web.client.ClientHttpRequestFactorySettings; |
| 49 | +import org.springframework.boot.http.client.ClientHttpRequestFactorySettings; |
50 | 50 | import org.springframework.boot.web.client.RestTemplateBuilder; |
51 | 51 | import org.springframework.boot.web.client.RootUriTemplateHandler; |
52 | 52 | import org.springframework.core.ParameterizedTypeReference; |
@@ -146,7 +146,7 @@ public TestRestTemplate(RestTemplateBuilder builder, String username, String pas |
146 | 146 | if (httpClientOptions != null) { |
147 | 147 | ClientHttpRequestFactory requestFactory = builder.buildRequestFactory(); |
148 | 148 | if (requestFactory instanceof HttpComponentsClientHttpRequestFactory) { |
149 | | - builder = builder.requestFactory( |
| 149 | + builder = builder.requestFactoryBuilder( |
150 | 150 | (settings) -> new CustomHttpComponentsClientHttpRequestFactory(httpClientOptions, settings)); |
151 | 151 | } |
152 | 152 | } |
@@ -1007,6 +1007,26 @@ protected static class CustomHttpComponentsClientHttpRequestFactory extends Http |
1007 | 1007 |
|
1008 | 1008 | private final boolean enableRedirects; |
1009 | 1009 |
|
| 1010 | + /** |
| 1011 | + * Create a new {@link CustomHttpComponentsClientHttpRequestFactory} instance. |
| 1012 | + * @param httpClientOptions the {@link HttpClient} options |
| 1013 | + * @param settings the settings to apply |
| 1014 | + * @deprecated since 3.4.0 for removal in 3.6.0 in favor of |
| 1015 | + * {@link #CustomHttpComponentsClientHttpRequestFactory(HttpClientOption[], ClientHttpRequestFactorySettings)} |
| 1016 | + */ |
| 1017 | + @Deprecated(since = "3.4.0", forRemoval = true) |
| 1018 | + @SuppressWarnings("removal") |
| 1019 | + public CustomHttpComponentsClientHttpRequestFactory(HttpClientOption[] httpClientOptions, |
| 1020 | + org.springframework.boot.web.client.ClientHttpRequestFactorySettings settings) { |
| 1021 | + this(httpClientOptions, new ClientHttpRequestFactorySettings(settings.connectTimeout(), |
| 1022 | + settings.readTimeout(), settings.sslBundle())); |
| 1023 | + } |
| 1024 | + |
| 1025 | + /** |
| 1026 | + * Create a new {@link CustomHttpComponentsClientHttpRequestFactory} instance. |
| 1027 | + * @param httpClientOptions the {@link HttpClient} options |
| 1028 | + * @param settings the settings to apply |
| 1029 | + */ |
1010 | 1030 | public CustomHttpComponentsClientHttpRequestFactory(HttpClientOption[] httpClientOptions, |
1011 | 1031 | ClientHttpRequestFactorySettings settings) { |
1012 | 1032 | Set<HttpClientOption> options = new HashSet<>(Arrays.asList(httpClientOptions)); |
|
0 commit comments