Class TestHttpClientUtils

java.lang.Object
org.jboss.as.test.http.util.TestHttpClientUtils

public class TestHttpClientUtils extends Object
Utility class with http/https utilities. Not to be confused with Apache HttpClientUtils.
Version:
August 2015
Author:
Dominik Pospisil <dpospisi@redhat.com>, Peter Skopek, Stuart Douglas, Radoslav Husar
  • Constructor Details

    • TestHttpClientUtils

      public TestHttpClientUtils()
  • Method Details

    • getHttpsClient

      public static org.apache.http.impl.client.CloseableHttpClient getHttpsClient(org.apache.http.client.CredentialsProvider credentialsProvider)
      Parameters:
      credentialsProvider - optional cred provider
      Returns:
      client that doesn't verify https connections
    • getSslContext

      public static SSLContext getSslContext() throws NoSuchAlgorithmException, KeyManagementException
      Throws:
      NoSuchAlgorithmException
      KeyManagementException
    • promiscuousCookieHttpClient

      public static org.apache.http.impl.client.CloseableHttpClient promiscuousCookieHttpClient()
      Creates a http client that sends cookies to every domain, not just the originating domain. As we don't actually have a load balancer for the clustering tests, we use this instead.
      Returns:
      CloseableHttpClient that gives free cookies to everybody
      See Also:
    • promiscuousCookieHttpClientBuilder

      public static org.apache.http.impl.client.HttpClientBuilder promiscuousCookieHttpClientBuilder()
      Same as promiscuousCookieHttpClient() but instead returns a builder that can be further configured.
      Returns:
      HttpClientBuilder of the http client that gives free cookies to everybody
      See Also: