public class MockClientHttpResponse extends MockHttpInputMessage implements org.springframework.http.client.ClientHttpResponse
ClientHttpResponse.| Constructor and Description |
|---|
MockClientHttpResponse(byte[] body,
org.springframework.http.HttpStatus statusCode)
Constructor with response body as a byte array.
|
MockClientHttpResponse(java.io.InputStream body,
org.springframework.http.HttpStatus statusCode)
Constructor with response body as InputStream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
int |
getRawStatusCode() |
org.springframework.http.HttpStatus |
getStatusCode() |
java.lang.String |
getStatusText() |
getBody, getHeaderspublic MockClientHttpResponse(byte[] body,
org.springframework.http.HttpStatus statusCode)
public MockClientHttpResponse(java.io.InputStream body,
org.springframework.http.HttpStatus statusCode)
public org.springframework.http.HttpStatus getStatusCode()
throws java.io.IOException
getStatusCode in interface org.springframework.http.client.ClientHttpResponsejava.io.IOExceptionpublic int getRawStatusCode()
throws java.io.IOException
getRawStatusCode in interface org.springframework.http.client.ClientHttpResponsejava.io.IOExceptionpublic java.lang.String getStatusText()
throws java.io.IOException
getStatusText in interface org.springframework.http.client.ClientHttpResponsejava.io.IOExceptionpublic void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface org.springframework.http.client.ClientHttpResponse