public class MockServerHttpResponse extends Object implements org.springframework.http.server.reactive.ServerHttpResponse
ServerHttpResponse.| Constructor and Description |
|---|
MockServerHttpResponse() |
| Modifier and Type | Method and Description |
|---|---|
void |
beforeCommit(Supplier<? extends reactor.core.publisher.Mono<Void>> action) |
org.springframework.core.io.buffer.DataBufferFactory |
bufferFactory() |
String |
encodeUrl(String url) |
org.reactivestreams.Publisher<org.springframework.core.io.buffer.DataBuffer> |
getBody() |
reactor.core.publisher.Mono<String> |
getBodyAsString()
Return the body of the response aggregated and converted to a String
using the charset of the Content-Type response or otherwise defaulting
to "UTF-8".
|
org.reactivestreams.Publisher<org.reactivestreams.Publisher<org.springframework.core.io.buffer.DataBuffer>> |
getBodyWithFlush() |
org.springframework.util.MultiValueMap<String,org.springframework.http.ResponseCookie> |
getCookies() |
org.springframework.http.HttpHeaders |
getHeaders() |
org.springframework.http.HttpStatus |
getStatusCode() |
void |
registerUrlEncoder(Function<String,String> encoder) |
reactor.core.publisher.Mono<Void> |
setComplete() |
boolean |
setStatusCode(org.springframework.http.HttpStatus status) |
reactor.core.publisher.Mono<Void> |
writeAndFlushWith(org.reactivestreams.Publisher<? extends org.reactivestreams.Publisher<? extends org.springframework.core.io.buffer.DataBuffer>> body) |
reactor.core.publisher.Mono<Void> |
writeWith(org.reactivestreams.Publisher<? extends org.springframework.core.io.buffer.DataBuffer> body) |
public boolean setStatusCode(org.springframework.http.HttpStatus status)
setStatusCode in interface org.springframework.http.server.reactive.ServerHttpResponsepublic org.springframework.http.HttpStatus getStatusCode()
getStatusCode in interface org.springframework.http.server.reactive.ServerHttpResponsepublic org.springframework.http.HttpHeaders getHeaders()
getHeaders in interface org.springframework.http.HttpMessagepublic org.springframework.util.MultiValueMap<String,org.springframework.http.ResponseCookie> getCookies()
getCookies in interface org.springframework.http.server.reactive.ServerHttpResponsepublic String encodeUrl(String url)
encodeUrl in interface org.springframework.http.server.reactive.ServerHttpResponsepublic void registerUrlEncoder(Function<String,String> encoder)
registerUrlEncoder in interface org.springframework.http.server.reactive.ServerHttpResponsepublic org.reactivestreams.Publisher<org.springframework.core.io.buffer.DataBuffer> getBody()
public org.reactivestreams.Publisher<org.reactivestreams.Publisher<org.springframework.core.io.buffer.DataBuffer>> getBodyWithFlush()
public reactor.core.publisher.Mono<Void> writeWith(org.reactivestreams.Publisher<? extends org.springframework.core.io.buffer.DataBuffer> body)
writeWith in interface org.springframework.http.ReactiveHttpOutputMessagepublic reactor.core.publisher.Mono<Void> writeAndFlushWith(org.reactivestreams.Publisher<? extends org.reactivestreams.Publisher<? extends org.springframework.core.io.buffer.DataBuffer>> body)
writeAndFlushWith in interface org.springframework.http.ReactiveHttpOutputMessagepublic void beforeCommit(Supplier<? extends reactor.core.publisher.Mono<Void>> action)
beforeCommit in interface org.springframework.http.ReactiveHttpOutputMessagepublic reactor.core.publisher.Mono<Void> setComplete()
setComplete in interface org.springframework.http.ReactiveHttpOutputMessagepublic org.springframework.core.io.buffer.DataBufferFactory bufferFactory()
bufferFactory in interface org.springframework.http.ReactiveHttpOutputMessagepublic reactor.core.publisher.Mono<String> getBodyAsString()