Class MockServerRequest
java.lang.Object
org.springframework.mock.web.reactive.function.server.MockServerRequest
- All Implemented Interfaces:
org.springframework.web.reactive.function.server.ServerRequest
public final class MockServerRequest
extends Object
implements org.springframework.web.reactive.function.server.ServerRequest
Mock implementation of
ServerRequest
.- Since:
- 5.0
- Author:
- Arjen Poutsma
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.web.reactive.function.server.ServerRequest
org.springframework.web.reactive.function.server.ServerRequest.Headers
-
Method Summary
Modifier and TypeMethodDescription<S> S
body
(org.springframework.web.reactive.function.BodyExtractor<S, ? super org.springframework.http.server.reactive.ServerHttpRequest> extractor) <S> S
body
(org.springframework.web.reactive.function.BodyExtractor<S, ? super org.springframework.http.server.reactive.ServerHttpRequest> extractor, Map<String, Object> hints) <S> reactor.core.publisher.Flux<S>
bodyToFlux
(Class<? extends S> elementClass) <S> reactor.core.publisher.Flux<S>
bodyToFlux
(org.springframework.core.ParameterizedTypeReference<S> typeReference) <S> reactor.core.publisher.Mono<S>
bodyToMono
(Class<? extends S> elementClass) <S> reactor.core.publisher.Mono<S>
bodyToMono
(org.springframework.core.ParameterizedTypeReference<S> typeReference) static MockServerRequest.Builder
builder()
org.springframework.util.MultiValueMap<String,
org.springframework.http.HttpCookie> cookies()
org.springframework.web.server.ServerWebExchange
exchange()
formData()
org.springframework.web.reactive.function.server.ServerRequest.Headers
headers()
List<org.springframework.http.codec.HttpMessageReader<?>>
org.springframework.http.HttpMethod
method()
Deprecated.reactor.core.publisher.Mono<org.springframework.util.MultiValueMap<String,
org.springframework.http.codec.multipart.Part>> reactor.core.publisher.Mono<? extends Principal>
org.springframework.http.server.RequestPath
reactor.core.publisher.Mono<org.springframework.web.server.WebSession>
session()
uri()
org.springframework.web.util.UriBuilder
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.web.reactive.function.server.ServerRequest
attribute, checkNotModified, checkNotModified, checkNotModified, path, pathContainer, pathVariable, queryParam
-
Method Details
-
method
public org.springframework.http.HttpMethod method()- Specified by:
method
in interfaceorg.springframework.web.reactive.function.server.ServerRequest
-
methodName
Deprecated.- Specified by:
methodName
in interfaceorg.springframework.web.reactive.function.server.ServerRequest
-
uri
- Specified by:
uri
in interfaceorg.springframework.web.reactive.function.server.ServerRequest
-
uriBuilder
public org.springframework.web.util.UriBuilder uriBuilder()- Specified by:
uriBuilder
in interfaceorg.springframework.web.reactive.function.server.ServerRequest
-
requestPath
public org.springframework.http.server.RequestPath requestPath()- Specified by:
requestPath
in interfaceorg.springframework.web.reactive.function.server.ServerRequest
-
headers
public org.springframework.web.reactive.function.server.ServerRequest.Headers headers()- Specified by:
headers
in interfaceorg.springframework.web.reactive.function.server.ServerRequest
-
cookies
- Specified by:
cookies
in interfaceorg.springframework.web.reactive.function.server.ServerRequest
-
remoteAddress
- Specified by:
remoteAddress
in interfaceorg.springframework.web.reactive.function.server.ServerRequest
-
localAddress
- Specified by:
localAddress
in interfaceorg.springframework.web.reactive.function.server.ServerRequest
-
messageReaders
- Specified by:
messageReaders
in interfaceorg.springframework.web.reactive.function.server.ServerRequest
-
body
public <S> S body(org.springframework.web.reactive.function.BodyExtractor<S, ? super org.springframework.http.server.reactive.ServerHttpRequest> extractor) - Specified by:
body
in interfaceorg.springframework.web.reactive.function.server.ServerRequest
-
body
public <S> S body(org.springframework.web.reactive.function.BodyExtractor<S, ? super org.springframework.http.server.reactive.ServerHttpRequest> extractor, Map<String, Object> hints) - Specified by:
body
in interfaceorg.springframework.web.reactive.function.server.ServerRequest
-
bodyToMono
- Specified by:
bodyToMono
in interfaceorg.springframework.web.reactive.function.server.ServerRequest
-
bodyToMono
public <S> reactor.core.publisher.Mono<S> bodyToMono(org.springframework.core.ParameterizedTypeReference<S> typeReference) - Specified by:
bodyToMono
in interfaceorg.springframework.web.reactive.function.server.ServerRequest
-
bodyToFlux
- Specified by:
bodyToFlux
in interfaceorg.springframework.web.reactive.function.server.ServerRequest
-
bodyToFlux
public <S> reactor.core.publisher.Flux<S> bodyToFlux(org.springframework.core.ParameterizedTypeReference<S> typeReference) - Specified by:
bodyToFlux
in interfaceorg.springframework.web.reactive.function.server.ServerRequest
-
attributes
- Specified by:
attributes
in interfaceorg.springframework.web.reactive.function.server.ServerRequest
-
queryParams
- Specified by:
queryParams
in interfaceorg.springframework.web.reactive.function.server.ServerRequest
-
pathVariables
- Specified by:
pathVariables
in interfaceorg.springframework.web.reactive.function.server.ServerRequest
-
session
public reactor.core.publisher.Mono<org.springframework.web.server.WebSession> session()- Specified by:
session
in interfaceorg.springframework.web.reactive.function.server.ServerRequest
-
principal
- Specified by:
principal
in interfaceorg.springframework.web.reactive.function.server.ServerRequest
-
formData
public reactor.core.publisher.Mono<org.springframework.util.MultiValueMap<String,String>> formData()- Specified by:
formData
in interfaceorg.springframework.web.reactive.function.server.ServerRequest
-
multipartData
public reactor.core.publisher.Mono<org.springframework.util.MultiValueMap<String,org.springframework.http.codec.multipart.Part>> multipartData()- Specified by:
multipartData
in interfaceorg.springframework.web.reactive.function.server.ServerRequest
-
exchange
public org.springframework.web.server.ServerWebExchange exchange()- Specified by:
exchange
in interfaceorg.springframework.web.reactive.function.server.ServerRequest
-
builder
-