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