From 3f52d8925e50f1ca9304bd7e93fc341728ec9535 Mon Sep 17 00:00:00 2001 From: spencergibb Date: Mon, 17 Oct 2022 12:22:27 -0400 Subject: [PATCH] Use apache 4 for ConfigurableHttpConnectionFactoryIntegrationTests --- ...gurableHttpConnectionFactoryIntegrationTests.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/ConfigurableHttpConnectionFactoryIntegrationTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/ConfigurableHttpConnectionFactoryIntegrationTests.java index e6d3b540..3127fdfe 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/ConfigurableHttpConnectionFactoryIntegrationTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/ConfigurableHttpConnectionFactoryIntegrationTests.java @@ -29,7 +29,8 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; -import org.apache.hc.client5.http.classic.HttpClient; +import org.apache.http.client.HttpClient; +import org.apache.http.client.methods.HttpGet; import org.eclipse.jgit.transport.HttpTransport; import org.eclipse.jgit.transport.http.HttpConnection; import org.eclipse.jgit.transport.http.HttpConnectionFactory; @@ -47,9 +48,7 @@ import org.springframework.cloud.config.server.config.EnvironmentRepositoryConfi import org.springframework.cloud.config.server.proxy.ProxyHostProperties; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; -import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.test.util.ReflectionTestUtils; -import org.springframework.web.client.RestTemplate; import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.Matchers.allOf; @@ -249,8 +248,11 @@ public class ConfigurableHttpConnectionFactoryIntegrationTests { } private void makeRequest(HttpClient httpClient, String url) { - RestTemplate restTemplate = new RestTemplate(new HttpComponentsClientHttpRequestFactory(httpClient)); - restTemplate.getForObject(url, String.class); + try { + httpClient.execute(new HttpGet(url)); + } catch (IOException e) { + throw new RuntimeException(e); + } } private HttpClient getHttpClientForUrl(String repoUrl) throws IOException {