use of org.springframework.security.web.access.intercept.FilterSecurityInterceptor in project spring-security by spring-projects.
the class Issue55Tests method multiHttpWebSecurityConfigurerAdapterDefaultsToAutowired.
@Test
public void multiHttpWebSecurityConfigurerAdapterDefaultsToAutowired() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
TestingAuthenticationToken token = new TestingAuthenticationToken("test", "this");
this.spring.register(MultiWebSecurityConfigurerAdapterDefaultsAuthManagerConfig.class);
this.spring.getContext().getBean(FilterChainProxy.class);
FilterSecurityInterceptor filter = (FilterSecurityInterceptor) findFilter(FilterSecurityInterceptor.class, 0);
assertThat(filter.getAuthenticationManager().authenticate(token)).isEqualTo(CustomAuthenticationManager.RESULT);
FilterSecurityInterceptor secondFilter = (FilterSecurityInterceptor) findFilter(FilterSecurityInterceptor.class, 1);
assertThat(secondFilter.getAuthenticationManager().authenticate(token)).isEqualTo(CustomAuthenticationManager.RESULT);
}
use of org.springframework.security.web.access.intercept.FilterSecurityInterceptor in project spring-security by spring-projects.
the class Issue55Tests method webSecurityConfigurerAdapterDefaultToAutowired.
@Test
public void webSecurityConfigurerAdapterDefaultToAutowired() {
TestingAuthenticationToken token = new TestingAuthenticationToken("test", "this");
this.spring.register(WebSecurityConfigurerAdapterDefaultsAuthManagerConfig.class);
this.spring.getContext().getBean(FilterChainProxy.class);
FilterSecurityInterceptor filter = (FilterSecurityInterceptor) findFilter(FilterSecurityInterceptor.class, 0);
assertThat(filter.getAuthenticationManager().authenticate(token)).isEqualTo(CustomAuthenticationManager.RESULT);
}
use of org.springframework.security.web.access.intercept.FilterSecurityInterceptor in project spring-security by spring-projects.
the class MiscHttpConfigTests method configureWhenOncePerRequestIsFalseThenFilterSecurityInterceptorExercisedForForwards.
@Test
public void configureWhenOncePerRequestIsFalseThenFilterSecurityInterceptorExercisedForForwards() {
this.spring.configLocations(xml("OncePerRequest")).autowire();
FilterSecurityInterceptor filterSecurityInterceptor = getFilter(FilterSecurityInterceptor.class);
assertThat(filterSecurityInterceptor.isObserveOncePerRequest()).isFalse();
}
Aggregations