java.lang.Object
io.wcm.siteapi.integrationtestsupport.httpclient.HttpClient

public final class HttpClient extends Object
Simple HTTP client wrapper to execute HTTP requests during integration tests. Uses java.net.http HTTP client internally.
  • Constructor Details

  • Method Details

    • get

      @NotNull public @NotNull HttpResponse<String> get(@NotNull @NotNull String url)
      Fetch HTTP content. Check status code of response for success.
      Parameters:
      url - URL
      Returns:
      HTTP response.
    • getBody

      @NotNull public @NotNull String getBody(@NotNull @NotNull String url)
      Fetch HTTP content. Fails with exception when request does not return successfully.
      Parameters:
      url - URL
      Returns:
      Body string.