use of org.codice.ddf.platform.filter.SecurityFilterChain in project ddf by codice.
the class PKIHandlerTest method testGetNormalizedTokenFailsWhenCrlFails.
/**
* Tests that the PKIHandler returns REDIRECTED when the cert fails to pass the CRL check
*/
@Test
public void testGetNormalizedTokenFailsWhenCrlFails() throws Exception {
PKIHandler handler = getPKIHandlerWithMockedCrl(false);
HttpServletRequest request = mock(HttpServletRequest.class);
HttpServletResponse response = mock(HttpServletResponse.class);
SecurityFilterChain chain = mock(SecurityFilterChain.class);
when(request.getAttribute(("javax.servlet.request.X509Certificate"))).thenReturn(getTestCerts());
// should return REDIRECTED
HandlerResult handlerResult = handler.getNormalizedToken(request, response, chain, true);
assertThat(handlerResult.getStatus(), equalTo(HandlerResult.Status.REDIRECTED));
}
Aggregations