public class MockClientHttpRequest extends MockHttpOutputMessage implements ClientHttpRequest
ClientHttpRequest.| Constructor and Description |
|---|
MockClientHttpRequest()
Default constructor.
|
MockClientHttpRequest(HttpMethod httpMethod,
URI uri)
Create an instance with the given HttpMethod and URI.
|
| Modifier and Type | Method and Description |
|---|---|
ClientHttpResponse |
execute()
|
protected ClientHttpResponse |
executeInternal()
The default implementation returns the configured
response. |
HttpMethod |
getMethod()
Return the HTTP method of the request.
|
String |
getMethodValue()
Return the HTTP method of the request as a String value.
|
URI |
getURI()
Return the URI of the request (including a query string if any,
but only if it is well-formed for a URI representation).
|
boolean |
isExecuted() |
void |
setMethod(HttpMethod httpMethod) |
void |
setResponse(ClientHttpResponse clientHttpResponse) |
void |
setURI(URI uri) |
String |
toString() |
getBody, getBodyAsBytes, getBodyAsString, getBodyAsString, getHeadersclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetBodygetHeaderspublic MockClientHttpRequest()
public MockClientHttpRequest(HttpMethod httpMethod, URI uri)
public void setMethod(HttpMethod httpMethod)
public HttpMethod getMethod()
HttpRequestgetMethod in interface HttpRequestnull
if not resolvable (e.g. in case of a non-standard HTTP method)HttpRequest.getMethodValue(),
HttpMethod.resolve(String)public String getMethodValue()
HttpRequestgetMethodValue in interface HttpRequestHttpRequest.getMethod()public void setURI(URI uri)
public URI getURI()
HttpRequestgetURI in interface HttpRequestnull)public void setResponse(ClientHttpResponse clientHttpResponse)
public boolean isExecuted()
public final ClientHttpResponse execute() throws IOException
execute in interface ClientHttpRequestIOException - in case of I/O errorsexecuteInternal()protected ClientHttpResponse executeInternal() throws IOException
response.
Override this method to execute the request and provide a response, potentially different from the configured response.
IOException