Support for testing Spring WebFlux server endpoints via
WebTestClient
.
-
WebTestClient.ControllerSpec.argumentResolvers(Consumer<org.springframework.web.reactive.result.method.annotation.ArgumentResolverConfigurer> configurer)
Configure resolvers for custom controller method arguments.
Use this server setup to test one @Controller
at a time.
WebTestClient.ControllerSpec.contentTypeResolver(Consumer<org.springframework.web.reactive.accept.RequestedContentTypeResolverBuilder> consumer)
Customize content type resolution.
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)
WebTestClient.ControllerSpec.formatters(Consumer<org.springframework.format.FormatterRegistry> consumer)
Register formatters and converters to use for type conversion.
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.