}
@Test
public void testInvalidCertificate() throws Exception {
this.enableTLS = true;
doThrow(new CertificateNotYetValidException()).when(mockCertificateNotValid).checkValidity();
when(mockRequest.getAttribute("javax.servlet.request.X509Certificate")).
thenReturn(new X509Certificate[] {mockCertificateNotValid});
doFilter(mockRequest, mockResponseInvalid, mockChain);
verify(mockResponseInvalid).sendError(Response.Status.FORBIDDEN.getStatusCode(),
"Request not authorized, valid certificates not presented");