diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurationTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurationTests.java index a17ed62723e..e546ffb6a13 100644 --- a/config/src/test/java/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurationTests.java +++ b/config/src/test/java/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurationTests.java @@ -331,7 +331,8 @@ public void loadConfigWhenTwoSecurityFilterChainsPresentAndSecondWithAnyRequestT @Test public void avoidUnnecessaryHttpSecurityInstantiationWhenProvideOneSecurityFilterChain() { this.spring.register(SecurityFilterChainConfig.class).autowire(); - assertThat(this.spring.getContext().getBean(CustomBeanPostProcessor.class).instantiationCount).isEqualTo(1); + assertThat(this.spring.getContext().getBean(CountHttpSecurityBeanPostProcessor.class).instantiationCount) + .isEqualTo(1); } private void assertAnotherUserPermission(WebInvocationPrivilegeEvaluator privilegeEvaluator) { @@ -357,7 +358,7 @@ private void assertUserPermissions(WebInvocationPrivilegeEvaluator privilegeEval @Configuration @EnableWebSecurity - @Import(CustomBeanPostProcessor.class) + @Import(CountHttpSecurityBeanPostProcessor.class) static class SecurityFilterChainConfig { @Bean @@ -367,7 +368,7 @@ SecurityFilterChain filterChain(HttpSecurity http) throws Exception { } - static class CustomBeanPostProcessor implements BeanPostProcessor { + static class CountHttpSecurityBeanPostProcessor implements BeanPostProcessor { int instantiationCount = 0;