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)
ResponseActions
andExpect
in interface ResponseActions
public void andRespond(ResponseCreator responseCreator)
ResponseActions
ResponseCreator
for this mock.andRespond
in interface ResponseActions
responseCreator
- the response creatorpublic org.springframework.http.HttpMethod getMethod()
getMethod
in interface org.springframework.http.HttpRequest
public URI getURI()
getURI
in interface org.springframework.http.HttpRequest
public org.springframework.http.HttpHeaders getHeaders()
getHeaders
in interface org.springframework.http.HttpMessage
public OutputStream getBody() throws IOException
getBody
in interface org.springframework.http.HttpOutputMessage
IOException
public String getBodyContent() throws IOException
IOException
public org.springframework.http.client.ClientHttpResponse execute() throws IOException
execute
in interface org.springframework.http.client.ClientHttpRequest
IOException
Copyright © 2016. All rights reserved.