public class MockClientHttpRequest extends MockHttpOutputMessage implements org.springframework.http.client.ClientHttpRequest
ClientHttpRequest.| Constructor and Description |
|---|
MockClientHttpRequest()
Default constructor.
|
MockClientHttpRequest(org.springframework.http.HttpMethod httpMethod,
URI uri)
Create an instance with the given HttpMethod and URI.
|
| Modifier and Type | Method and Description |
|---|---|
org.springframework.http.client.ClientHttpResponse |
execute()
|
protected org.springframework.http.client.ClientHttpResponse |
executeInternal()
The default implementation returns the configured
response. |
org.springframework.http.HttpMethod |
getMethod() |
String |
getMethodValue() |
URI |
getURI() |
boolean |
isExecuted() |
void |
setMethod(org.springframework.http.HttpMethod httpMethod) |
void |
setResponse(org.springframework.http.client.ClientHttpResponse clientHttpResponse) |
void |
setURI(URI uri) |
String |
toString() |
getBody, getBodyAsBytes, getBodyAsString, getBodyAsString, getHeaderspublic MockClientHttpRequest()
public MockClientHttpRequest(org.springframework.http.HttpMethod httpMethod,
URI uri)
public void setMethod(org.springframework.http.HttpMethod httpMethod)
public org.springframework.http.HttpMethod getMethod()
getMethod in interface org.springframework.http.HttpRequestpublic String getMethodValue()
getMethodValue in interface org.springframework.http.HttpRequestpublic void setURI(URI uri)
public URI getURI()
getURI in interface org.springframework.http.HttpRequestpublic void setResponse(org.springframework.http.client.ClientHttpResponse clientHttpResponse)
public boolean isExecuted()
public final org.springframework.http.client.ClientHttpResponse execute()
throws IOException
execute in interface org.springframework.http.client.ClientHttpRequestIOExceptionexecuteInternal()protected org.springframework.http.client.ClientHttpResponse executeInternal()
throws IOException
response.
Override this method to execute the request and provide a response, potentially different from the configured response.
IOException