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
  • Method Details

    • method

      public org.springframework.http.HttpMethod method()
      Specified by:
      method 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
    • apiVersionStrategy

      public @Nullable org.springframework.web.reactive.accept.ApiVersionStrategy apiVersionStrategy()
      Specified by:
      apiVersionStrategy 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> Mono<S> bodyToMono(Class<? extends S> elementClass)
      Specified by:
      bodyToMono in interface org.springframework.web.reactive.function.server.ServerRequest
    • bodyToMono

      public <S> Mono<S> bodyToMono(org.springframework.core.ParameterizedTypeReference<S> typeReference)
      Specified by:
      bodyToMono in interface org.springframework.web.reactive.function.server.ServerRequest
    • bodyToFlux

      public <S> Flux<S> bodyToFlux(Class<? extends S> elementClass)
      Specified by:
      bodyToFlux in interface org.springframework.web.reactive.function.server.ServerRequest
    • bodyToFlux

      public <S> Flux<S> bodyToFlux(org.springframework.core.ParameterizedTypeReference<S> typeReference)
      Specified by:
      bodyToFlux in interface org.springframework.web.reactive.function.server.ServerRequest
    • bind

      public <T> Mono<T> bind(Class<T> bindType)
      Specified by:
      bind in interface org.springframework.web.reactive.function.server.ServerRequest
    • bind

      public <T> Mono<T> bind(Class<T> bindType, Consumer<org.springframework.web.bind.WebDataBinder> dataBinderCustomizer)
      Specified by:
      bind 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 Mono<org.springframework.web.server.WebSession> session()
      Specified by:
      session in interface org.springframework.web.reactive.function.server.ServerRequest
    • principal

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

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

      public 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()