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(byte[] body,
int statusCode)
Variant of
MockClientHttpResponse(byte[], HttpStatus) with a
custom HTTP status code. |
MockClientHttpResponse(InputStream body,
org.springframework.http.HttpStatus statusCode)
Constructor with response body as InputStream.
|
MockClientHttpResponse(InputStream body,
int statusCode)
Variant of
MockClientHttpResponse(InputStream, HttpStatus) with a
custom HTTP status code. |
Modifier and Type | Method and Description |
---|---|
void |
close() |
int |
getRawStatusCode() |
org.springframework.http.HttpStatus |
getStatusCode() |
String |
getStatusText() |
getBody, getHeaders
public MockClientHttpResponse(byte[] body, org.springframework.http.HttpStatus statusCode)
public MockClientHttpResponse(byte[] body, int statusCode)
MockClientHttpResponse(byte[], HttpStatus)
with a
custom HTTP status code.public MockClientHttpResponse(InputStream body, org.springframework.http.HttpStatus statusCode)
public MockClientHttpResponse(InputStream body, int statusCode)
MockClientHttpResponse(InputStream, HttpStatus)
with a
custom HTTP status code.public org.springframework.http.HttpStatus getStatusCode()
getStatusCode
in interface org.springframework.http.client.ClientHttpResponse
public int getRawStatusCode()
getRawStatusCode
in interface org.springframework.http.client.ClientHttpResponse
public String getStatusText()
getStatusText
in interface org.springframework.http.client.ClientHttpResponse
public void close()
close
in interface Closeable
close
in interface AutoCloseable
close
in interface org.springframework.http.client.ClientHttpResponse