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 TypeMethodDescriptionargumentResolvers
(Consumer<org.springframework.web.reactive.result.method.annotation.ArgumentResolverConfigurer> configurer) Configure resolvers for custom controller method arguments.contentTypeResolver
(Consumer<org.springframework.web.reactive.accept.RequestedContentTypeResolverBuilder> consumer) Customize content type resolution.controllerAdvice
(Object... controllerAdvice) Register one or moreControllerAdvice
instances to be used in tests (specifiedClass
will be turned into instance).corsMappings
(Consumer<org.springframework.web.reactive.config.CorsRegistry> consumer) Configure CORS support.formatters
(Consumer<org.springframework.format.FormatterRegistry> consumer) Register formatters and converters to use for type conversion.httpMessageCodecs
(Consumer<org.springframework.http.codec.ServerCodecConfigurer> configurer) Configure custom HTTP message readers and writers or override built-in ones.pathMatching
(Consumer<org.springframework.web.reactive.config.PathMatchConfigurer> consumer) Configure path matching options.validator
(org.springframework.validation.Validator validator) Configure a global Validator.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
Register one or moreControllerAdvice
instances to be used in tests (specifiedClass
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
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)
-