use of org.apache.shiro.web.filter.authc.FormAuthenticationFilter in project shiro by apache.
the class ShiroFilterFactoryBeanTest method testFilterDefinition.
@Test
public void testFilterDefinition() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("org/apache/shiro/spring/web/ShiroFilterFactoryBeanTest.xml");
AbstractShiroFilter shiroFilter = (AbstractShiroFilter) context.getBean("shiroFilter");
PathMatchingFilterChainResolver resolver = (PathMatchingFilterChainResolver) shiroFilter.getFilterChainResolver();
DefaultFilterChainManager fcManager = (DefaultFilterChainManager) resolver.getFilterChainManager();
NamedFilterList chain = fcManager.getChain("/test");
assertNotNull(chain);
assertEquals(chain.size(), 2);
Filter[] filters = new Filter[chain.size()];
filters = chain.toArray(filters);
assertTrue(filters[0] instanceof DummyFilter);
assertTrue(filters[1] instanceof FormAuthenticationFilter);
}
Aggregations