Skip to content

Commit 3f52d89

Browse files
committed
Use apache 4 for ConfigurableHttpConnectionFactoryIntegrationTests
1 parent 45cb39f commit 3f52d89

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/ConfigurableHttpConnectionFactoryIntegrationTests.java

+7-5
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
import java.util.Collections;
3030
import java.util.List;
3131

32-
import org.apache.hc.client5.http.classic.HttpClient;
32+
import org.apache.http.client.HttpClient;
33+
import org.apache.http.client.methods.HttpGet;
3334
import org.eclipse.jgit.transport.HttpTransport;
3435
import org.eclipse.jgit.transport.http.HttpConnection;
3536
import org.eclipse.jgit.transport.http.HttpConnectionFactory;
@@ -47,9 +48,7 @@
4748
import org.springframework.cloud.config.server.proxy.ProxyHostProperties;
4849
import org.springframework.context.annotation.Configuration;
4950
import org.springframework.context.annotation.Import;
50-
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
5151
import org.springframework.test.util.ReflectionTestUtils;
52-
import org.springframework.web.client.RestTemplate;
5352

5453
import static org.assertj.core.api.Assertions.assertThat;
5554
import static org.hamcrest.Matchers.allOf;
@@ -249,8 +248,11 @@ private String[] gitProperties(String repoUrl, ProxyHostProperties httpProxy, Pr
249248
}
250249

251250
private void makeRequest(HttpClient httpClient, String url) {
252-
RestTemplate restTemplate = new RestTemplate(new HttpComponentsClientHttpRequestFactory(httpClient));
253-
restTemplate.getForObject(url, String.class);
251+
try {
252+
httpClient.execute(new HttpGet(url));
253+
} catch (IOException e) {
254+
throw new RuntimeException(e);
255+
}
254256
}
255257

256258
private HttpClient getHttpClientForUrl(String repoUrl) throws IOException {

0 commit comments

Comments
 (0)