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() |
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, getHeaders
public 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.HttpRequest
public void setURI(URI uri)
public URI getURI()
getURI
in interface org.springframework.http.HttpRequest
public 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.ClientHttpRequest
IOException
executeInternal()
protected org.springframework.http.client.ClientHttpResponse executeInternal() throws IOException
response
.
Override this method to execute the request and provide a response, potentially different than the configured response.
IOException