Class HttpClient
java.lang.Object
io.wcm.siteapi.integrationtestsupport.httpclient.HttpClient
Simple HTTP client wrapper to execute HTTP requests during integration tests.
Uses
java.net.http
HTTP client internally.-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
HttpClient
- Parameters:
builder
- Integration test context builder.
-
-
Method Details
-
get
Fetch HTTP content. Check status code of response for success.- Parameters:
url
- URL- Returns:
- HTTP response.
-
getBody
Fetch HTTP content. Fails with exception when request does not return successfully.- Parameters:
url
- URL- Returns:
- Body string.
-