public class MockClientHttpRequest extends MockHttpOutputMessage implements ClientHttpRequest
ClientHttpRequest.| Modifier and Type | Field and Description |
|---|---|
private ClientHttpResponse |
clientHttpResponse |
private boolean |
executed |
private HttpMethod |
httpMethod |
private java.net.URI |
uri |
| Constructor and Description |
|---|
MockClientHttpRequest()
Default constructor.
|
MockClientHttpRequest(HttpMethod httpMethod,
java.net.URI uri)
Create an instance with the given HttpMethod and URI.
|
| Modifier and Type | Method and Description |
|---|---|
ClientHttpResponse |
execute()
|
HttpMethod |
getMethod()
Return the HTTP method of the request.
|
java.net.URI |
getURI()
Return the URI of the request.
|
boolean |
isExecuted()
Whether the execute method was invoked.
|
void |
setMethod(HttpMethod httpMethod) |
void |
setResponse(ClientHttpResponse clientHttpResponse) |
void |
setURI(java.net.URI uri) |
java.lang.String |
toString() |
getBody, getBodyAsBytes, getBodyAsString, getBodyAsString, getHeadersclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetBodygetHeadersprivate java.net.URI uri
private HttpMethod httpMethod
private boolean executed
private ClientHttpResponse clientHttpResponse
public MockClientHttpRequest()
public MockClientHttpRequest(HttpMethod httpMethod, java.net.URI uri)
public java.net.URI getURI()
HttpRequestgetURI in interface HttpRequestpublic void setURI(java.net.URI uri)
public HttpMethod getMethod()
HttpRequestgetMethod in interface HttpRequestpublic void setMethod(HttpMethod httpMethod)
public void setResponse(ClientHttpResponse clientHttpResponse)
public boolean isExecuted()
public ClientHttpResponse execute() throws java.io.IOException
execute in interface ClientHttpRequestjava.io.IOException - in case of I/O errorspublic java.lang.String toString()
toString in class java.lang.Object