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) { HttpClientOption... httpClientOptions) {
Assert.notNull(restTemplate, "RestTemplate must not be null"); Assert.notNull(restTemplate, "RestTemplate must not be null");
this.httpClientOptions = httpClientOptions; this.httpClientOptions = httpClientOptions;
if (getRequestFactoryClass(restTemplate).getName().equals( if (getRequestFactoryClass(restTemplate).isAssignableFrom(
"org.springframework.http.client.HttpComponentsClientHttpRequestFactory")) { HttpComponentsClientHttpRequestFactory.class)) {
restTemplate.setRequestFactory( restTemplate.setRequestFactory(
new CustomHttpComponentsClientHttpRequestFactory(httpClientOptions)); new CustomHttpComponentsClientHttpRequestFactory(httpClientOptions));
} }

Loading…
Cancel
Save