Package org.springframework.test.web.reactive.server

# Interface WebTestClient.ControllerSpec

All Superinterfaces:
  `WebTestClient.MockServerSpec<WebTestClient.ControllerSpec>`

Enclosing interface:
  WebTestClient

public static interface WebTestClient.ControllerSpec extends WebTestClient.MockServerSpec<WebTestClient.ControllerSpec>
Specification for customizing controller configuration equivalent to, and internally delegating to, a `WebFluxConfigurer`.

## Method Summary

Modifier and Type
Method
Description
`WebTestClient.ControllerSpec`
`argumentResolvers(Consumer<org.springframework.web.reactive.result.method.annotation.ArgumentResolverConfigurer> configurer)`
Configure resolvers for custom controller method arguments.
`WebTestClient.ControllerSpec`
`blockingExecution(Consumer<org.springframework.web.reactive.config.BlockingExecutionConfigurer> consumer)`
Configure blocking execution options.
`WebTestClient.ControllerSpec`
`contentTypeResolver(Consumer<org.springframework.web.reactive.accept.RequestedContentTypeResolverBuilder> consumer)`
Customize content type resolution.
`WebTestClient.ControllerSpec`
`controllerAdvice(Object... controllerAdvice)`
Register one or more `ControllerAdvice` instances to be used in tests (specified `Class` will be turned into instance).
`WebTestClient.ControllerSpec`
`corsMappings(Consumer<org.springframework.web.reactive.config.CorsRegistry> consumer)`
Configure CORS support.
`WebTestClient.ControllerSpec`
`formatters(Consumer<org.springframework.format.FormatterRegistry> consumer)`
Register formatters and converters to use for type conversion.
`WebTestClient.ControllerSpec`
`httpMessageCodecs(Consumer<org.springframework.http.codec.ServerCodecConfigurer> configurer)`
Configure custom HTTP message readers and writers or override built-in ones.
`WebTestClient.ControllerSpec`
`pathMatching(Consumer<org.springframework.web.reactive.config.PathMatchConfigurer> consumer)`
Configure path matching options.
`WebTestClient.ControllerSpec`
`validator(org.springframework.validation.Validator validator)`
Configure a global Validator.
`WebTestClient.ControllerSpec`
`viewResolvers(Consumer<org.springframework.web.reactive.config.ViewResolverRegistry> consumer)`
Configure view resolution.

### Methods inherited from interface org.springframework.test.web.reactive.server.WebTestClient.MockServerSpec

`apply, build, configureClient, webFilter, webSessionManager`

## Method Details

### controllerAdvice

WebTestClient.ControllerSpec controllerAdvice(Object... controllerAdvice)
Register one or more `ControllerAdvice` instances to be used in tests (specified `Class` will be turned into instance).

### contentTypeResolver

WebTestClient.ControllerSpec contentTypeResolver(Consumer<org.springframework.web.reactive.accept.RequestedContentTypeResolverBuilder> consumer)
Customize content type resolution.

See Also:
  - `WebFluxConfigurer.configureContentTypeResolver(org.springframework.web.reactive.accept.RequestedContentTypeResolverBuilder)`

### corsMappings

WebTestClient.ControllerSpec corsMappings(Consumer<org.springframework.web.reactive.config.CorsRegistry> consumer)
Configure CORS support.

See Also:
  - `WebFluxConfigurer.addCorsMappings(org.springframework.web.reactive.config.CorsRegistry)`

### pathMatching

WebTestClient.ControllerSpec pathMatching(Consumer<org.springframework.web.reactive.config.PathMatchConfigurer> consumer)
Configure path matching options.

See Also:
  - `WebFluxConfigurer.configurePathMatching(org.springframework.web.reactive.config.PathMatchConfigurer)`

### argumentResolvers

WebTestClient.ControllerSpec argumentResolvers(Consumer<org.springframework.web.reactive.result.method.annotation.ArgumentResolverConfigurer> configurer)
Configure resolvers for custom controller method arguments.

See Also:
  - `WebFluxConfigurer.configureHttpMessageCodecs(org.springframework.http.codec.ServerCodecConfigurer)`

### httpMessageCodecs

WebTestClient.ControllerSpec httpMessageCodecs(Consumer<org.springframework.http.codec.ServerCodecConfigurer> configurer)
Configure custom HTTP message readers and writers or override built-in ones.

See Also:
  - `WebFluxConfigurer.configureHttpMessageCodecs(org.springframework.http.codec.ServerCodecConfigurer)`

### formatters

WebTestClient.ControllerSpec formatters(Consumer<org.springframework.format.FormatterRegistry> consumer)
Register formatters and converters to use for type conversion.

See Also:
  - `WebFluxConfigurer.addFormatters(org.springframework.format.FormatterRegistry)`

### validator

WebTestClient.ControllerSpec validator(org.springframework.validation.Validator validator)
Configure a global Validator.

See Also:
  - `WebFluxConfigurer.getValidator()`

### viewResolvers

WebTestClient.ControllerSpec viewResolvers(Consumer<org.springframework.web.reactive.config.ViewResolverRegistry> consumer)
Configure view resolution.

See Also:
  - `WebFluxConfigurer.configureViewResolvers(org.springframework.web.reactive.config.ViewResolverRegistry)`

### blockingExecution

WebTestClient.ControllerSpec blockingExecution(Consumer<org.springframework.web.reactive.config.BlockingExecutionConfigurer> consumer)
Configure blocking execution options.

Since:
  6.1
See Also:
  - `WebFluxConfigurer.configureBlockingExecution(org.springframework.web.reactive.config.BlockingExecutionConfigurer)`