public class MockClientHttpResponse extends MockHttpInputMessage implements ClientHttpResponse
ClientHttpResponse.| Constructor and Description | 
|---|
| MockClientHttpResponse(byte[] body,
                      HttpStatus statusCode)Constructor with response body as a byte array. | 
| MockClientHttpResponse(InputStream body,
                      HttpStatus statusCode)Constructor with response body as InputStream. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | close()Close this response, freeing any resources created. | 
| int | getRawStatusCode()Get the HTTP status code (potentially non-standard and not
 resolvable through the  HttpStatusenum) as an integer. | 
| HttpStatus | getStatusCode()Get the HTTP status code as an  HttpStatusenum value. | 
| String | getStatusText()Get the HTTP status text of the response. | 
getBody, getHeadersclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetBodygetHeaderspublic MockClientHttpResponse(byte[] body,
                              HttpStatus statusCode)
public MockClientHttpResponse(InputStream body, HttpStatus statusCode)
public HttpStatus getStatusCode() throws IOException
ClientHttpResponseHttpStatus enum value.
 For status codes not supported by HttpStatus, use
 ClientHttpResponse.getRawStatusCode() instead.
getStatusCode in interface ClientHttpResponsenull)IOException - in case of I/O errorsHttpStatus.valueOf(int)public int getRawStatusCode()
                     throws IOException
ClientHttpResponseHttpStatus enum) as an integer.getRawStatusCode in interface ClientHttpResponseIOException - in case of I/O errorsClientHttpResponse.getStatusCode(), 
HttpStatus.resolve(int)public String getStatusText() throws IOException
ClientHttpResponsegetStatusText in interface ClientHttpResponseIOException - in case of I/O errorspublic void close()
ClientHttpResponseclose in interface Closeableclose in interface AutoCloseableclose in interface ClientHttpResponse