Package org.springframework.mock.web.reactive.function.server

# 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
Modifier and Type
Class
Description
`static interface`
`MockServerRequest.Builder`
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
`Map<String,Object>`
`attributes()`
`<T> reactor.core.publisher.Mono<T>`
`bind(Class<T> bindType)`
`<T> reactor.core.publisher.Mono<T>`
`bind(Class<T> bindType, Consumer<org.springframework.web.bind.WebDataBinder> dataBinderCustomizer)`
`<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()`
`reactor.core.publisher.Mono<org.springframework.util.MultiValueMap<String,String>>`
`formData()`
`org.springframework.web.reactive.function.server.ServerRequest.Headers`
`headers()`
`Optional<InetSocketAddress>`
`localAddress()`
`List<org.springframework.http.codec.HttpMessageReader<?>>`
`messageReaders()`
`org.springframework.http.HttpMethod`
`method()`
`String`
`methodName()`
Deprecated.
`reactor.core.publisher.Mono<org.springframework.util.MultiValueMap<String,org.springframework.http.codec.multipart.Part>>`
`multipartData()`
`Map<String,String>`
`pathVariables()`
`reactor.core.publisher.Mono<? extends Principal>`
`principal()`
`org.springframework.util.MultiValueMap<String,String>`
`queryParams()`
`Optional<InetSocketAddress>`
`remoteAddress()`
`org.springframework.http.server.RequestPath`
`requestPath()`
`reactor.core.publisher.Mono<org.springframework.web.server.WebSession>`
`session()`
`URI`
`uri()`
`org.springframework.web.util.UriBuilder`
`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`

### bind

public <T> reactor.core.publisher.Mono<T> bind(Class<T> bindType)

Specified by:
  `bind` in interface `org.springframework.web.reactive.function.server.ServerRequest`

### bind

public <T> reactor.core.publisher.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 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()