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
    Modifier and Type
    Class
    Description
    static interface 
    Builder for MockServerRequest.

    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 Type
    Method
    Description
     
    <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)
     
     
    org.springframework.util.MultiValueMap<String,org.springframework.http.HttpCookie>
     
    org.springframework.web.server.ServerWebExchange
     
    reactor.core.publisher.Mono<org.springframework.util.MultiValueMap<String,String>>
     
    org.springframework.web.reactive.function.server.ServerRequest.Headers
     
     
    List<org.springframework.http.codec.HttpMessageReader<?>>
     
    org.springframework.http.HttpMethod
     
    Deprecated.
    reactor.core.publisher.Mono<org.springframework.util.MultiValueMap<String,org.springframework.http.codec.multipart.Part>>
     
     
    reactor.core.publisher.Mono<? extends Principal>
     
    org.springframework.util.MultiValueMap<String,String>
     
     
    org.springframework.http.server.RequestPath
     
    reactor.core.publisher.Mono<org.springframework.web.server.WebSession>
     
    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 interface org.springframework.web.reactive.function.server.ServerRequest
    • methodName

      @Deprecated public String methodName()
      Deprecated.
      Specified by:
      methodName in interface org.springframework.web.reactive.function.server.ServerRequest
    • uri

      public URI uri()
      Specified by:
      uri in interface org.springframework.web.reactive.function.server.ServerRequest
    • uriBuilder

      public org.springframework.web.util.UriBuilder uriBuilder()
      Specified by:
      uriBuilder in interface org.springframework.web.reactive.function.server.ServerRequest
    • requestPath

      public org.springframework.http.server.RequestPath requestPath()
      Specified by:
      requestPath in interface org.springframework.web.reactive.function.server.ServerRequest
    • headers

      public org.springframework.web.reactive.function.server.ServerRequest.Headers headers()
      Specified by:
      headers in interface org.springframework.web.reactive.function.server.ServerRequest
    • cookies

      public org.springframework.util.MultiValueMap<String,org.springframework.http.HttpCookie> cookies()
      Specified by:
      cookies in interface org.springframework.web.reactive.function.server.ServerRequest
    • remoteAddress

      public Optional<InetSocketAddress> remoteAddress()
      Specified by:
      remoteAddress in interface org.springframework.web.reactive.function.server.ServerRequest
    • localAddress

      public Optional<InetSocketAddress> localAddress()
      Specified by:
      localAddress in interface org.springframework.web.reactive.function.server.ServerRequest
    • messageReaders

      public List<org.springframework.http.codec.HttpMessageReader<?>> messageReaders()
      Specified by:
      messageReaders in interface org.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 interface org.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 interface org.springframework.web.reactive.function.server.ServerRequest
    • bodyToMono

      public <S> reactor.core.publisher.Mono<S> bodyToMono(Class<? extends S> elementClass)
      Specified by:
      bodyToMono in interface org.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 interface org.springframework.web.reactive.function.server.ServerRequest
    • bodyToFlux

      public <S> reactor.core.publisher.Flux<S> bodyToFlux(Class<? extends S> elementClass)
      Specified by:
      bodyToFlux in interface org.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 interface org.springframework.web.reactive.function.server.ServerRequest
    • attributes

      public Map<String,Object> attributes()
      Specified by:
      attributes in interface org.springframework.web.reactive.function.server.ServerRequest
    • queryParams

      public org.springframework.util.MultiValueMap<String,String> queryParams()
      Specified by:
      queryParams in interface org.springframework.web.reactive.function.server.ServerRequest
    • pathVariables

      public Map<String,String> pathVariables()
      Specified by:
      pathVariables in interface org.springframework.web.reactive.function.server.ServerRequest
    • session

      public reactor.core.publisher.Mono<org.springframework.web.server.WebSession> session()
      Specified by:
      session in interface org.springframework.web.reactive.function.server.ServerRequest
    • principal

      public reactor.core.publisher.Mono<? extends Principal> principal()
      Specified by:
      principal in interface org.springframework.web.reactive.function.server.ServerRequest
    • formData

      public reactor.core.publisher.Mono<org.springframework.util.MultiValueMap<String,String>> formData()
      Specified by:
      formData in interface org.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 interface org.springframework.web.reactive.function.server.ServerRequest
    • exchange

      public org.springframework.web.server.ServerWebExchange exchange()
      Specified by:
      exchange in interface org.springframework.web.reactive.function.server.ServerRequest
    • builder

      public static MockServerRequest.Builder builder()