TestSecurityFilterpublic class TestSecurityFilter extends org.apache.cactus.FilterTestCase
Fields Summary |
---|
private SecurityFilter | filter | private MockFilterChain | mockChain |
Constructors Summary |
---|
public TestSecurityFilter(String name)
super(name);
|
Methods Summary |
---|
public void | beginAuthenticatedUser(org.apache.cactus.WebRequest webRequest)
webRequest.setRedirectorName("SecureFilterRedirector");
webRequest.setAuthentication(
new BasicAuthentication("coyner_b", "secret"));
| public void | setUp()
this.filter = new SecurityFilter();
this.mockChain = new MockFilterChain();
| public void | testAuthenticatedUser()
this.mockChain.setExpectedInvocation(true);
this.filter.doFilter(this.request, this.response, this.mockChain);
this.mockChain.verify();
| public void | testNonAuthenticatedUser()
this.mockChain.setExpectedInvocation(false);
this.filter.doFilter(this.request, this.response, this.mockChain);
this.mockChain.verify();
|
|