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(java.io.InputStream body,
HttpStatus statusCode)
Constructor with response body as InputStream.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this response, freeing any resources created.
|
int |
getRawStatusCode()
Return the HTTP status code of the response as integer
|
HttpStatus |
getStatusCode()
Return the HTTP status code of the response.
|
java.lang.String |
getStatusText()
Return the HTTP status text of the response.
|
getBody, getHeaders
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBody
getHeaders
public MockClientHttpResponse(byte[] body, HttpStatus statusCode)
public MockClientHttpResponse(java.io.InputStream body, HttpStatus statusCode)
public HttpStatus getStatusCode() throws java.io.IOException
ClientHttpResponse
getStatusCode
in interface ClientHttpResponse
java.io.IOException
- in case of I/O errorspublic int getRawStatusCode() throws java.io.IOException
ClientHttpResponse
getRawStatusCode
in interface ClientHttpResponse
java.io.IOException
- in case of I/O errorspublic java.lang.String getStatusText() throws java.io.IOException
ClientHttpResponse
getStatusText
in interface ClientHttpResponse
java.io.IOException
- in case of I/O errorspublic void close()
ClientHttpResponse
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface ClientHttpResponse