1
0
mirror of synced 2026-08-05 17:57:15 +00:00

SEC-756: Add checks for duplicate use of namespace elements such as global-method-security

http://jira.springframework.org/browse/SEC-756. Refactored HttpSecurityBDP and added check for duplicate usage of the element.
This commit is contained in:
Luke Taylor
2008-04-22 21:25:35 +00:00
parent 083644f2fe
commit 1ae167434a
5 changed files with 183 additions and 143 deletions
@@ -8,6 +8,7 @@ import java.util.List;
import org.junit.After;
import org.junit.Test;
import org.springframework.beans.factory.parsing.BeanDefinitionParsingException;
import org.springframework.context.support.AbstractXmlApplicationContext;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
@@ -76,6 +77,11 @@ public class HttpSecurityBeanDefinitionParserTests {
checkAutoConfigFilters(filterList);
}
@Test(expected=BeanDefinitionParsingException.class)
public void duplicateElementCausesError() throws Exception {
setContext("<http auto-config='true' /><http auto-config='true' />" + AUTH_PROVIDER_XML);
}
private void checkAutoConfigFilters(List filterList) throws Exception {
assertEquals("Expected 11 filters in chain", 11, filterList.size());