Package com.styra.opa.openapi.utils
Class RecordingClient
java.lang.Object
com.styra.opa.openapi.utils.RecordingClient
- All Implemented Interfaces:
HTTPClient
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionrequests()voidreset()send(HttpRequest request) Sends an HTTP request and returns the response.
-
Constructor Details
-
RecordingClient
public RecordingClient()
-
-
Method Details
-
send
public HttpResponse<InputStream> send(HttpRequest request) throws IOException, InterruptedException, URISyntaxException Description copied from interface:HTTPClientSends an HTTP request and returns the response.Note that
HttpRequestis immutable. To modify the request you can useHttpRequest.newBuilder(HttpRequest, BiPredicate<String, String>)with JDK 16 and later (which will copy the request for modification in a builder). If that method is not available then useHelpers.copy(java.net.http.HttpRequest)(which also returns a builder).- Specified by:
sendin interfaceHTTPClient- Parameters:
request- HTTP request- Returns:
- HTTP response
- Throws:
IOExceptionInterruptedExceptionURISyntaxException
-
requests
-
beforeRequest
-
afterResponse
-
reset
public void reset()
-