public class MockClientHttpRequest extends MockHttpOutputMessage implements org.springframework.http.client.ClientHttpRequest
ClientHttpRequest
.Constructor and Description |
---|
MockClientHttpRequest()
Default constructor.
|
MockClientHttpRequest(org.springframework.http.HttpMethod httpMethod,
java.net.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() |
java.net.URI |
getURI() |
boolean |
isExecuted() |
void |
setMethod(org.springframework.http.HttpMethod httpMethod) |
void |
setResponse(org.springframework.http.client.ClientHttpResponse clientHttpResponse) |
void |
setURI(java.net.URI uri) |
java.lang.String |
toString() |
getBody, getBodyAsBytes, getBodyAsString, getBodyAsString, getHeaders
public MockClientHttpRequest()
public MockClientHttpRequest(org.springframework.http.HttpMethod httpMethod, java.net.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(java.net.URI uri)
public java.net.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 java.io.IOException
execute
in interface org.springframework.http.client.ClientHttpRequest
java.io.IOException
executeInternal()
protected org.springframework.http.client.ClientHttpResponse executeInternal() throws java.io.IOException
response
.
Override this method to execute the request and provide a response, potentially different than the configured response.
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object