@Test
    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(3, chain.size());
        Filter[] filters = new Filter[chain.size()];
        filters = chain.toArray(filters);
        // global filter
        assertTrue(filters[0] instanceof InvalidRequestFilter);
        assertTrue(filters[1] instanceof DummyFilter);
        assertTrue(filters[2] instanceof FormAuthenticationFilter);
    }
Unit tests for the {@link ShiroFilterFactoryBean} implementation.

@since 1.0
support/spring/src/test/java/org/apache/shiro/spring/web/ShiroFilterFactoryBeanTest.java