|
@@ -16,6 +16,11 @@
|
|
package org.springframework.security.util;
|
|
package org.springframework.security.util;
|
|
|
|
|
|
|
|
|
|
|
|
+import org.junit.After;
|
|
|
|
+import static org.junit.Assert.*;
|
|
|
|
+import org.junit.Before;
|
|
|
|
+import org.junit.Test;
|
|
|
|
+import org.springframework.beans.factory.BeanCreationException;
|
|
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
|
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
|
import org.springframework.mock.web.MockHttpServletRequest;
|
|
import org.springframework.mock.web.MockHttpServletRequest;
|
|
import org.springframework.mock.web.MockHttpServletResponse;
|
|
import org.springframework.mock.web.MockHttpServletResponse;
|
|
@@ -28,11 +33,6 @@ import org.springframework.security.intercept.web.MockFilterInvocationDefinition
|
|
import org.springframework.security.intercept.web.PathBasedFilterInvocationDefinitionMap;
|
|
import org.springframework.security.intercept.web.PathBasedFilterInvocationDefinitionMap;
|
|
import org.springframework.security.ui.webapp.AuthenticationProcessingFilter;
|
|
import org.springframework.security.ui.webapp.AuthenticationProcessingFilter;
|
|
|
|
|
|
-import org.junit.After;
|
|
|
|
-import org.junit.Before;
|
|
|
|
-import org.junit.Test;
|
|
|
|
-import static org.junit.Assert.*;
|
|
|
|
-
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -126,6 +126,15 @@ public class FilterChainProxyTests {
|
|
assertFalse(filter.isWasDestroyed());
|
|
assertFalse(filter.isWasDestroyed());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Test
|
|
|
|
+ public void misplacedUniversalPathShouldBeDetected() throws Exception {
|
|
|
|
+ try {
|
|
|
|
+ appCtx.getBean("newFilterChainProxyWrongPathOrder", FilterChainProxy.class);
|
|
|
|
+ fail("Expected BeanCreationException");
|
|
|
|
+ } catch (BeanCreationException expected) {
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
@Test
|
|
@Test
|
|
public void normalOperation() throws Exception {
|
|
public void normalOperation() throws Exception {
|
|
FilterChainProxy filterChainProxy = (FilterChainProxy) appCtx.getBean("filterChain", FilterChainProxy.class);
|
|
FilterChainProxy filterChainProxy = (FilterChainProxy) appCtx.getBean("filterChain", FilterChainProxy.class);
|