Merge pull request #12472 from igor-suhorukov

* pr/12472:
  avoid check class by string name
pull/12472/merge
Brian Clozel 7 years ago
commit 079851ebb4

@ -138,8 +138,8 @@ public class TestRestTemplate {
HttpClientOption... httpClientOptions) {
Assert.notNull(restTemplate, "RestTemplate must not be null");
this.httpClientOptions = httpClientOptions;
if (getRequestFactoryClass(restTemplate).getName().equals(
"org.springframework.http.client.HttpComponentsClientHttpRequestFactory")) {
if (getRequestFactoryClass(restTemplate).isAssignableFrom(
HttpComponentsClientHttpRequestFactory.class)) {
restTemplate.setRequestFactory(
new CustomHttpComponentsClientHttpRequestFactory(httpClientOptions));
}

Loading…
Cancel
Save