public class MockClientHttpRequest extends Object implements org.springframework.http.client.ClientHttpRequest, ResponseActions
ClientHttpRequest. Implements ResponseActions to form a fluent API.| Constructor and Description |
|---|
MockClientHttpRequest() |
| Modifier and Type | Method and Description |
|---|---|
ResponseActions |
andExpect(RequestMatcher requestMatcher)
Allows for further expectations to be set on the request.
|
void |
andRespond(ResponseCreator responseCreator)
Sets the
ResponseCreator for this mock. |
org.springframework.http.client.ClientHttpResponse |
execute() |
OutputStream |
getBody() |
String |
getBodyContent() |
org.springframework.http.HttpHeaders |
getHeaders() |
org.springframework.http.HttpMethod |
getMethod() |
URI |
getURI() |
void |
setHttpMethod(org.springframework.http.HttpMethod httpMethod) |
void |
setUri(URI uri) |
public void setUri(URI uri)
public void setHttpMethod(org.springframework.http.HttpMethod httpMethod)
public ResponseActions andExpect(RequestMatcher requestMatcher)
ResponseActionsandExpect in interface ResponseActionspublic void andRespond(ResponseCreator responseCreator)
ResponseActionsResponseCreator for this mock.andRespond in interface ResponseActionsresponseCreator - the response creatorpublic org.springframework.http.HttpMethod getMethod()
getMethod in interface org.springframework.http.HttpRequestpublic URI getURI()
getURI in interface org.springframework.http.HttpRequestpublic org.springframework.http.HttpHeaders getHeaders()
getHeaders in interface org.springframework.http.HttpMessagepublic OutputStream getBody() throws IOException
getBody in interface org.springframework.http.HttpOutputMessageIOExceptionpublic String getBodyContent() throws IOException
IOExceptionpublic org.springframework.http.client.ClientHttpResponse execute()
throws IOException
execute in interface org.springframework.http.client.ClientHttpRequestIOExceptionCopyright © 2016. All rights reserved.