class DefaultControllerSpec extends AbstractMockServerSpec<WebTestClient.ControllerSpec> implements WebTestClient.ControllerSpec
WebTestClient.ControllerSpec
.Modifier and Type | Class and Description |
---|---|
private class |
DefaultControllerSpec.TestWebFluxConfigurer |
Modifier and Type | Field and Description |
---|---|
private DefaultControllerSpec.TestWebFluxConfigurer |
configurer |
private java.util.List<java.lang.Object> |
controllerAdvice |
private java.util.List<java.lang.Object> |
controllers |
Constructor and Description |
---|
DefaultControllerSpec(java.lang.Object... controllers) |
Modifier and Type | Method and Description |
---|---|
DefaultControllerSpec |
argumentResolvers(java.util.function.Consumer<ArgumentResolverConfigurer> consumer)
Configure resolvers for custom controller method arguments.
|
DefaultControllerSpec |
contentTypeResolver(java.util.function.Consumer<RequestedContentTypeResolverBuilder> consumer)
Customize content type resolution.
|
DefaultControllerSpec |
controllerAdvice(java.lang.Object... controllerAdvice)
Register one or more
ControllerAdvice instances to be used in tests. |
DefaultControllerSpec |
corsMappings(java.util.function.Consumer<CorsRegistry> consumer)
Configure CORS support.
|
DefaultControllerSpec |
formatters(java.util.function.Consumer<FormatterRegistry> consumer)
Register formatters and converters to use for type conversion.
|
DefaultControllerSpec |
httpMessageCodecs(java.util.function.Consumer<ServerCodecConfigurer> consumer)
Configure custom HTTP message readers and writers or override built-in ones.
|
private ApplicationContext |
initApplicationContext() |
protected WebHttpHandlerBuilder |
initHttpHandlerBuilder()
Sub-classes must create an
WebHttpHandlerBuilder that will then
be used to create the HttpHandler for the mock server. |
DefaultControllerSpec |
pathMatching(java.util.function.Consumer<PathMatchConfigurer> consumer)
Configure path matching options.
|
DefaultControllerSpec |
validator(Validator validator)
Configure a global Validator.
|
DefaultControllerSpec |
viewResolvers(java.util.function.Consumer<ViewResolverRegistry> consumer)
Configure view resolution.
|
apply, build, configureClient, webFilter, webSessionManager
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
apply, build, configureClient, webFilter, webSessionManager
private final java.util.List<java.lang.Object> controllers
private final java.util.List<java.lang.Object> controllerAdvice
private final DefaultControllerSpec.TestWebFluxConfigurer configurer
public DefaultControllerSpec controllerAdvice(java.lang.Object... controllerAdvice)
WebTestClient.ControllerSpec
ControllerAdvice
instances to be used in tests.controllerAdvice
in interface WebTestClient.ControllerSpec
public DefaultControllerSpec contentTypeResolver(java.util.function.Consumer<RequestedContentTypeResolverBuilder> consumer)
WebTestClient.ControllerSpec
public DefaultControllerSpec corsMappings(java.util.function.Consumer<CorsRegistry> consumer)
WebTestClient.ControllerSpec
corsMappings
in interface WebTestClient.ControllerSpec
WebFluxConfigurer.addCorsMappings(org.springframework.web.reactive.config.CorsRegistry)
public DefaultControllerSpec argumentResolvers(java.util.function.Consumer<ArgumentResolverConfigurer> consumer)
WebTestClient.ControllerSpec
argumentResolvers
in interface WebTestClient.ControllerSpec
WebFluxConfigurer.configureHttpMessageCodecs(org.springframework.http.codec.ServerCodecConfigurer)
public DefaultControllerSpec pathMatching(java.util.function.Consumer<PathMatchConfigurer> consumer)
WebTestClient.ControllerSpec
pathMatching
in interface WebTestClient.ControllerSpec
WebFluxConfigurer.configurePathMatching(org.springframework.web.reactive.config.PathMatchConfigurer)
public DefaultControllerSpec httpMessageCodecs(java.util.function.Consumer<ServerCodecConfigurer> consumer)
WebTestClient.ControllerSpec
httpMessageCodecs
in interface WebTestClient.ControllerSpec
WebFluxConfigurer.configureHttpMessageCodecs(org.springframework.http.codec.ServerCodecConfigurer)
public DefaultControllerSpec formatters(java.util.function.Consumer<FormatterRegistry> consumer)
WebTestClient.ControllerSpec
formatters
in interface WebTestClient.ControllerSpec
WebFluxConfigurer.addFormatters(org.springframework.format.FormatterRegistry)
public DefaultControllerSpec validator(Validator validator)
WebTestClient.ControllerSpec
validator
in interface WebTestClient.ControllerSpec
WebFluxConfigurer.getValidator()
public DefaultControllerSpec viewResolvers(java.util.function.Consumer<ViewResolverRegistry> consumer)
WebTestClient.ControllerSpec
viewResolvers
in interface WebTestClient.ControllerSpec
WebFluxConfigurer.configureViewResolvers(org.springframework.web.reactive.config.ViewResolverRegistry)
protected WebHttpHandlerBuilder initHttpHandlerBuilder()
AbstractMockServerSpec
WebHttpHandlerBuilder
that will then
be used to create the HttpHandler for the mock server.initHttpHandlerBuilder
in class AbstractMockServerSpec<WebTestClient.ControllerSpec>
private ApplicationContext initApplicationContext()