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