+ @Test
+ public void testShowRevocation() throws GeneralSecurityException, IOException, GigiApiException, InterruptedException {
+ Certificate c1 = createCertificate();
+ await(c1.revoke(RevocationType.SUPPORT));
+ URLConnection uc = post(cookie, FindCertPage.PATH, "certType=email&process=Next&cert=" + URLEncoder.encode(certMail, "UTF-8"), 0);
+ SimpleDateFormat sdf = new SimpleDateFormat(Template.UTC_TIMESTAMP_FORMAT);
+ String revokeDate = sdf.format(c1.getRevocationDate());
+ String result = IOUtils.readURL(uc);
+ assertThat(result, CoreMatchers.containsString(revokeDate));
+ assertThat(result, CoreMatchers.containsString("N/A"));
+ }
+
+ private Certificate createCertificate() throws GeneralSecurityException, IOException, GigiApiException, InterruptedException {
+ User u1 = User.getById(id);
+ KeyPair kp = generateKeypair();
+ String key = generatePEMCSR(kp, "CN=" + certMail);
+ Certificate c1 = new Certificate(u1, u1, Certificate.buildDN("CN", certMail), Digest.SHA512, key, CSRType.CSR, getClientProfile(), new Certificate.SubjectAlternateName(SANType.EMAIL, certMail));
+ await(c1.issue(null, "2y", u));
+ return c1;
+ }