Files
spring-boot/module/spring-boot-security-test
Andy Wilkinson 64969bfea8 Ensure that mock infra is defined before Security auto-config
We need to ensure that MockMvcAutoConfiguration has defined its
DispatcherServletPath bean before the condition that checks for it in
ServletWebSecurityAutoConfiguration is evaluated.

Ideally, ServletWebSecurityAutoConfiguration in spring-boot-security
would not know about test-specific code but there's no easy way to
establish the required ordering without this link. One alternative
option is an auto-configuration class in spring-boot-security-test
that's purely for ordering purposes. This was rejected as it would
introduce new public API (as we enforce that all auto-configurations
are public).

Fixes gh-49854
2026-04-09 08:42:36 +01:00
..