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()
void
reset()
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:HTTPClient
Sends an HTTP request and returns the response.Note that
HttpRequest
is 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:
send
in interfaceHTTPClient
- Parameters:
request
- HTTP request- Returns:
- HTTP response
- Throws:
IOException
InterruptedException
URISyntaxException
-
requests
-
beforeRequest
-
afterResponse
-
reset
public void reset()
-