use of org.asynchttpclient.DefaultAsyncHttpClientConfig in project async-http-client by AsyncHttpClient.
the class HttpUtilsTest method testDefaultFollowRedirect.
@Test
public void testDefaultFollowRedirect() {
Request request = Dsl.get("http://stackoverflow.com/questions/1057564").setVirtualHost("example.com").build();
DefaultAsyncHttpClientConfig config = new DefaultAsyncHttpClientConfig.Builder().build();
boolean followRedirect = HttpUtils.followRedirect(config, request);
assertFalse(followRedirect, "Default value of redirect should be false");
}
use of org.asynchttpclient.DefaultAsyncHttpClientConfig in project async-http-client by AsyncHttpClient.
the class HttpUtilsTest method testGetFollowRedirectPriorityGivenToRequest.
@Test
public void testGetFollowRedirectPriorityGivenToRequest() {
Request request = Dsl.get("http://stackoverflow.com/questions/1057564").setFollowRedirect(false).build();
DefaultAsyncHttpClientConfig config = new DefaultAsyncHttpClientConfig.Builder().setFollowRedirect(true).build();
boolean followRedirect = HttpUtils.followRedirect(config, request);
assertFalse(followRedirect, "Follow redirect value set in request should be given priority");
}
use of org.asynchttpclient.DefaultAsyncHttpClientConfig in project async-http-client by AsyncHttpClient.
the class HttpUtilsTest method testGetFollowRedirectInRequest.
@Test
public void testGetFollowRedirectInRequest() {
Request request = Dsl.get("http://stackoverflow.com/questions/1057564").setFollowRedirect(true).build();
DefaultAsyncHttpClientConfig config = new DefaultAsyncHttpClientConfig.Builder().build();
boolean followRedirect = HttpUtils.followRedirect(config, request);
assertTrue(followRedirect, "Follow redirect must be true as set in the request");
}
use of org.asynchttpclient.DefaultAsyncHttpClientConfig in project async-http-client by AsyncHttpClient.
the class HttpUtilsTest method testGetFollowRedirectInConfig.
@Test
public void testGetFollowRedirectInConfig() {
Request request = Dsl.get("http://stackoverflow.com/questions/1057564").build();
DefaultAsyncHttpClientConfig config = new DefaultAsyncHttpClientConfig.Builder().setFollowRedirect(true).build();
boolean followRedirect = HttpUtils.followRedirect(config, request);
assertTrue(followRedirect, "Follow redirect should be equal to value specified in config when not specified in request");
}
Aggregations