]> WPIA git - gigi.git/blobdiff - tests/club/wpia/gigi/pages/admin/TestSEAdminPageCertSearch.java
Merge "add: show more certificates on the "roots" page"
[gigi.git] / tests / club / wpia / gigi / pages / admin / TestSEAdminPageCertSearch.java
index a42aef84f938e9ceb3e7a403802a83657684705e..e61f559ee8dfed4918679434a107ec9d74165a46 100644 (file)
@@ -24,6 +24,7 @@ import club.wpia.gigi.pages.admin.support.FindCertPage;
 import club.wpia.gigi.pages.admin.support.SupportEnterTicketPage;
 import club.wpia.gigi.testUtils.ClientTest;
 import club.wpia.gigi.testUtils.IOUtils;
+import club.wpia.gigi.testUtils.TestEmailReceiver.TestMail;
 import club.wpia.gigi.util.ServerConstants;
 import club.wpia.gigi.util.ServerConstants.Host;
 
@@ -38,7 +39,7 @@ public class TestSEAdminPageCertSearch extends ClientTest {
         cookie = login(email, TEST_PASSWORD);
         assertEquals(302, post(cookie, SupportEnterTicketPage.PATH, "ticketno=a20140808.8&setTicket=action", 0).getResponseCode());
 
-        certMail = uniq + "_certOwner@example.com";
+        certMail = uniq + "_certowner@example.com";
         int id = createVerifiedUser("fn", "ln", certMail, TEST_PASSWORD);
         User u1 = User.getById(id);
         KeyPair kp = generateKeypair();
@@ -72,6 +73,11 @@ public class TestSEAdminPageCertSearch extends ClientTest {
     public void testRevoke() throws IOException {
         URLConnection conn = post(Certificates.SUPPORT_PATH + "/" + c.getSerial(), "action=revoke");
         assertEquals("https://" + ServerConstants.getHostNamePortSecure(Host.WWW) + Certificates.SUPPORT_PATH + "/" + c.getSerial(), conn.getHeaderField("Location"));
+        for (int i = 0; i < 2; i++) {
+            TestMail tm = getMailReceiver().receive(i == 0 ? ServerConstants.getSupportMailAddress() : certMail);
+            assertThat(tm.getMessage(), CoreMatchers.containsString(certMail));
+            assertThat(tm.getMessage(), CoreMatchers.containsString(c.getSerial()));
+        }
         assertEquals(CertificateStatus.REVOKED, c.getStatus());
     }