@@ -0,0 +1,3070 @@
+package org.springframework.security.config;%0A%0Aimport static org.junit.Assert.*;%0A%0Aimport org.junit.After;%0Aimport org.junit.Test;%0Aimport org.springframework.context.support.AbstractXmlApplicationContext;%0Aimport org.springframework.mock.web.MockFilterChain;%0Aimport org.springframework.mock.web.MockHttpServletRequest;%0Aimport org.springframework.mock.web.MockHttpServletResponse;%0Aimport org.springframework.security.ConfigAttributeDefinition;%0Aimport org.springframework.security.SecurityConfig;%0Aimport org.springframework.security.intercept.web.DefaultFilterInvocationDefinitionSource;%0Aimport org.springframework.security.intercept.web.FilterInvocation;%0Aimport org.springframework.security.util.InMemoryXmlApplicationContext;%0A%0A/**%0A * %0A * @author Luke Taylor%0A * @version $Id$%0A */%0Apublic class FilterInvocationDefinitionSourceParserTests %7B%0A    private AbstractXmlApplicationContext appContext;%0A    %0A    @After%0A    public void closeAppContext() %7B%0A        if (appContext != null) %7B%0A            appContext.close();%0A            appContext = null;%0A        %7D%0A    %7D    %0A    %0A    private void setContext(String context) %7B%0A        appContext = new InMemoryXmlApplicationContext(context);%0A    %7D    %0A    %0A    @Test%0A    public void parsingMinimalConfigurationIsSuccessful() %7B%0A        setContext(%0A                %22%3Cfilter-invocation-definition-source id='fids'%3E%22 +%0A                %22   %3Cintercept-url pattern='/**' access='ROLE_A'/%3E%22 +                %0A        %09%09%22%3C/filter-invocation-definition-source%3E%22);%0A        DefaultFilterInvocationDefinitionSource fids = (DefaultFilterInvocationDefinitionSource) appContext.getBean(%22fids%22);%0A        ConfigAttributeDefinition cad = fids.getAttributes(createFilterInvocation(%22/anything%22, %22GET%22));%0A        assertTrue(cad.contains(new SecurityConfig(%22ROLE_A%22)));%0A    %7D%0A    %0A    @Test%0A    public void parsingWithinFilterSecurityInterceptorIsSuccessful() %7B%0A        setContext(%0A                %22%3Chttp auto-config='true'/%3E%22 +%0A                %22%3Cb:bean id='fsi' class='org.springframework.security.intercept.web.FilterSecurityInterceptor' autowire='byType'%3E%22 +%0A                %22   %3Cb:property name='objectDefinitionSource'%3E%22 +%0A                %22       %3Cfilter-invocation-definition-source%3E%22 +%0A                %22           %3Cintercept-url pattern='/secure/extreme/**' access='ROLE_SUPERVISOR'/%3E%22 +%0A                %22           %3Cintercept-url pattern='/secure/**' access='ROLE_USER'/%3E%22 +%0A                %22           %3Cintercept-url pattern='/**' access='ROLE_USER'/%3E%22 +%0A                %22       %3C/filter-invocation-definition-source%3E%22 +%0A                %22   %3C/b:property%3E%22 +%0A                %22%3C/b:bean%3E%22 + HttpSecurityBeanDefinitionParserTests.AUTH_PROVIDER_XML);%0A        %0A        %0A    %7D%0A    %0A    %0A    private FilterInvocation createFilterInvocation(String path, String method) %7B%0A        MockHttpServletRequest request = new MockHttpServletRequest();%0A        request.setRequestURI(null);%0A        request.setMethod(method);%0A%0A        request.setServletPath(path);%0A%0A        return new FilterInvocation(request, new MockHttpServletResponse(), new MockFilterChain());%0A    %7D%0A%7D%0A

Test class for FilterInvocationDefinitionSourceParser