Skip to content

Commit

Permalink
CustomBeanPostProcessor -> CountHttpSecurityBeanPostProcessor
Browse files Browse the repository at this point in the history
Issue gh-16370

Signed-off-by: Rob Winch <[email protected]>
  • Loading branch information
rwinch committed Jan 9, 2025
1 parent 28145ed commit b21850a
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -357,7 +358,7 @@ private void assertUserPermissions(WebInvocationPrivilegeEvaluator privilegeEval

@Configuration
@EnableWebSecurity
@Import(CustomBeanPostProcessor.class)
@Import(CountHttpSecurityBeanPostProcessor.class)
static class SecurityFilterChainConfig {

@Bean
Expand All @@ -367,7 +368,7 @@ SecurityFilterChain filterChain(HttpSecurity http) throws Exception {

}

static class CustomBeanPostProcessor implements BeanPostProcessor {
static class CountHttpSecurityBeanPostProcessor implements BeanPostProcessor {

int instantiationCount = 0;

Expand Down

0 comments on commit b21850a

Please sign in to comment.