mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-26 05:42:31 +00:00
MockFilterChain extended TestCase but had no public constructor and no test methods.
The expectedToProceed test is internally handled by a static call to TestCase.assertTrue() and TestCase.fail()
This commit is contained in:
parent
a3818184f4
commit
8b24b1cf7a
@ -17,12 +17,11 @@ package net.sf.acegisecurity.util;
|
|||||||
|
|
||||||
import junit.framework.TestCase;
|
import junit.framework.TestCase;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import javax.servlet.FilterChain;
|
import javax.servlet.FilterChain;
|
||||||
import javax.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
import javax.servlet.ServletRequest;
|
import javax.servlet.ServletRequest;
|
||||||
import javax.servlet.ServletResponse;
|
import javax.servlet.ServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -31,7 +30,7 @@ import javax.servlet.ServletResponse;
|
|||||||
* @author Ben Alex
|
* @author Ben Alex
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
public class MockFilterChain extends TestCase implements FilterChain {
|
public class MockFilterChain implements FilterChain {
|
||||||
//~ Instance fields ========================================================
|
//~ Instance fields ========================================================
|
||||||
|
|
||||||
private boolean expectToProceed;
|
private boolean expectToProceed;
|
||||||
@ -42,18 +41,14 @@ public class MockFilterChain extends TestCase implements FilterChain {
|
|||||||
this.expectToProceed = expectToProceed;
|
this.expectToProceed = expectToProceed;
|
||||||
}
|
}
|
||||||
|
|
||||||
private MockFilterChain() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
//~ Methods ================================================================
|
//~ Methods ================================================================
|
||||||
|
|
||||||
public void doFilter(ServletRequest request, ServletResponse response)
|
public void doFilter(ServletRequest request, ServletResponse response)
|
||||||
throws IOException, ServletException {
|
throws IOException, ServletException {
|
||||||
if (expectToProceed) {
|
if (expectToProceed) {
|
||||||
assertTrue(true);
|
TestCase.assertTrue(true);
|
||||||
} else {
|
} else {
|
||||||
fail("Did not expect filter chain to proceed");
|
TestCase.fail("Did not expect filter chain to proceed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user