public class MockClientHttpResponse extends java.lang.Object implements ClientHttpResponse
ClientHttpResponse
.Constructor and Description |
---|
MockClientHttpResponse(HttpStatus status) |
Modifier and Type | Method and Description |
---|---|
reactor.core.publisher.Flux<DataBuffer> |
getBody()
Return the body of the message as a
Publisher . |
reactor.core.publisher.Mono<java.lang.String> |
getBodyAsString()
Return the response body aggregated and converted to a String using the
charset of the Content-Type response or otherwise as "UTF-8".
|
MultiValueMap<java.lang.String,ResponseCookie> |
getCookies()
Return a read-only map of response cookies received from the server.
|
HttpHeaders |
getHeaders()
Return the headers of this message.
|
HttpStatus |
getStatusCode()
Return the HTTP status as an
HttpStatus enum value. |
void |
setBody(org.reactivestreams.Publisher<DataBuffer> body) |
void |
setBody(java.lang.String body) |
void |
setBody(java.lang.String body,
java.nio.charset.Charset charset) |
public MockClientHttpResponse(HttpStatus status)
public HttpStatus getStatusCode()
ClientHttpResponse
HttpStatus
enum value.getStatusCode
in interface ClientHttpResponse
public HttpHeaders getHeaders()
HttpMessage
getHeaders
in interface HttpMessage
null
)public MultiValueMap<java.lang.String,ResponseCookie> getCookies()
ClientHttpResponse
getCookies
in interface ClientHttpResponse
public void setBody(org.reactivestreams.Publisher<DataBuffer> body)
public void setBody(java.lang.String body)
public void setBody(java.lang.String body, java.nio.charset.Charset charset)
public reactor.core.publisher.Flux<DataBuffer> getBody()
ReactiveHttpInputMessage
Publisher
.getBody
in interface ReactiveHttpInputMessage
public reactor.core.publisher.Mono<java.lang.String> getBodyAsString()