Search in sources :

Example 1 with CustomHttpComponentsClientHttpRequestFactory

use of org.springframework.boot.test.web.client.TestRestTemplate.CustomHttpComponentsClientHttpRequestFactory in project spring-boot by spring-projects.

the class TestRestTemplateTests method options.

@Test
public void options() throws Exception {
    TestRestTemplate template = new TestRestTemplate(HttpClientOption.ENABLE_REDIRECTS);
    CustomHttpComponentsClientHttpRequestFactory factory = (CustomHttpComponentsClientHttpRequestFactory) template.getRestTemplate().getRequestFactory();
    RequestConfig config = factory.getRequestConfig();
    assertThat(config.isRedirectsEnabled()).isTrue();
}
Also used : CustomHttpComponentsClientHttpRequestFactory(org.springframework.boot.test.web.client.TestRestTemplate.CustomHttpComponentsClientHttpRequestFactory) RequestConfig(org.apache.http.client.config.RequestConfig) Test(org.junit.Test)

Aggregations

RequestConfig (org.apache.http.client.config.RequestConfig)1 Test (org.junit.Test)1 CustomHttpComponentsClientHttpRequestFactory (org.springframework.boot.test.web.client.TestRestTemplate.CustomHttpComponentsClientHttpRequestFactory)1