1
0
mirror of synced 2026-08-05 09:47:05 +00:00

Make Spring Security filters implement the Ordered interface, for use when post-processing the application context

This commit is contained in:
Luke Taylor
2007-10-20 23:09:23 +00:00
parent 9b8c06e9f6
commit 2b14d2da98
10 changed files with 89 additions and 174 deletions
@@ -480,6 +480,10 @@ public class AbstractProcessingFilterTests extends TestCase {
public boolean requiresAuthentication(HttpServletRequest request, HttpServletResponse response) {
return super.requiresAuthentication(request, response);
}
public int getOrder() {
return 0;
}
}
private class MockFilterChain implements FilterChain {
@@ -46,8 +46,7 @@ import javax.servlet.ServletResponse;
* benalex $
*/
public class ExceptionTranslationFilterTests extends TestCase {
// ~ Constructors
// ===================================================================================================
//~ Constructors ===================================================================================================
public ExceptionTranslationFilterTests() {
super();
@@ -57,16 +56,8 @@ public class ExceptionTranslationFilterTests extends TestCase {
super(arg0);
}
// ~ Methods
// ========================================================================================================
//~ Methods ========================================================================================================
public static void main(String[] args) {
junit.textui.TestRunner.run(ExceptionTranslationFilterTests.class);
}
public final void setUp() throws Exception {
super.setUp();
}
protected void tearDown() throws Exception {
super.tearDown();
@@ -139,7 +130,7 @@ public class ExceptionTranslationFilterTests extends TestCase {
fail("Should have thrown ServletException");
}
catch (ServletException expected) {
assertEquals("HttpServletRequest required", expected.getMessage());
assertEquals("Can only process HttpServletRequest", expected.getMessage());
}
}
@@ -152,7 +143,7 @@ public class ExceptionTranslationFilterTests extends TestCase {
fail("Should have thrown ServletException");
}
catch (ServletException expected) {
assertEquals("HttpServletResponse required", expected.getMessage());
assertEquals("Can only process HttpServletResponse", expected.getMessage());
}
}