Skip to content

Commit 942cc69

Browse files
committed
Bumping versions
1 parent ed3349b commit 942cc69

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/clientconfig/HttpClient5FeignConfiguration.java

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,17 @@ public CloseableHttpClient httpClient5(HttpClientConnectionManager connectionMan
9292
FeignHttpClientProperties httpClientProperties,
9393
ObjectProvider<List<HttpClientBuilderCustomizer>> customizerProvider) {
9494
HttpClientBuilder httpClientBuilder = HttpClients.custom().disableCookieManagement().useSystemProperties()
95-
.setConnectionManager(connectionManager).evictExpiredConnections()
96-
.setDefaultRequestConfig(RequestConfig.custom()
97-
.setConnectTimeout(
98-
Timeout.of(httpClientProperties.getConnectionTimeout(), TimeUnit.MILLISECONDS))
99-
.setRedirectsEnabled(httpClientProperties.isFollowRedirects())
100-
.setConnectionRequestTimeout(
101-
Timeout.of(httpClientProperties.getHc5().getConnectionRequestTimeout(),
102-
httpClientProperties.getHc5().getConnectionRequestTimeoutUnit()))
103-
.build());
104-
105-
customizerProvider.getIfAvailable(List::of)
106-
.forEach(c -> c.customize(httpClientBuilder));
95+
.setConnectionManager(connectionManager).evictExpiredConnections()
96+
.setDefaultRequestConfig(RequestConfig.custom()
97+
.setConnectTimeout(
98+
Timeout.of(httpClientProperties.getConnectionTimeout(), TimeUnit.MILLISECONDS))
99+
.setRedirectsEnabled(httpClientProperties.isFollowRedirects())
100+
.setConnectionRequestTimeout(
101+
Timeout.of(httpClientProperties.getHc5().getConnectionRequestTimeout(),
102+
httpClientProperties.getHc5().getConnectionRequestTimeoutUnit()))
103+
.build());
104+
105+
customizerProvider.getIfAvailable(List::of).forEach(c -> c.customize(httpClientBuilder));
107106

108107
httpClient5 = httpClientBuilder.build();
109108
return httpClient5;
@@ -156,7 +155,8 @@ public X509Certificate[] getAcceptedIssuers() {
156155
}
157156

158157
/**
159-
* Callback interface that customize {@link HttpClientBuilder} objects before HttpClient created.
158+
* Callback interface that customize {@link HttpClientBuilder} objects before
159+
* HttpClient created.
160160
*
161161
* @author Kwangyong Kim
162162
* @since 4.1.0
@@ -170,4 +170,5 @@ public interface HttpClientBuilderCustomizer {
170170
void customize(HttpClientBuilder builder);
171171

172172
}
173+
173174
}

spring-cloud-openfeign-core/src/test/java/org/springframework/cloud/openfeign/FeignHttpClient5ConfigurationTests.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,8 @@ void shouldNotInstantiateHttpClient5ByWhenDependenciesPresentButPropertyDisabled
8282

8383
@Test
8484
void shouldInstantiateHttpClient5ByUsingHttpClientBuilderCustomizer() {
85-
ConfigurableApplicationContext context = new SpringApplicationBuilder()
86-
.web(WebApplicationType.NONE)
87-
.sources(FeignAutoConfiguration.class, Config.class)
88-
.run();
85+
ConfigurableApplicationContext context = new SpringApplicationBuilder().web(WebApplicationType.NONE)
86+
.sources(FeignAutoConfiguration.class, Config.class).run();
8987

9088
CloseableHttpClient httpClient = context.getBean(CloseableHttpClient.class);
9189
assertThat(httpClient).isNotNull();
@@ -99,9 +97,12 @@ void shouldInstantiateHttpClient5ByUsingHttpClientBuilderCustomizer() {
9997

10098
@Configuration
10199
static class Config {
100+
102101
@Bean
103102
HttpClientBuilderCustomizer customizer() {
104103
return Mockito.mock(HttpClientBuilderCustomizer.class);
105104
}
105+
106106
}
107+
107108
}

0 commit comments

Comments
 (0)