X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=tests%2Fclub%2Fwpia%2Fgigi%2Fpages%2Fadmin%2FTestSEAdminPageCertSearch.java;fp=tests%2Fclub%2Fwpia%2Fgigi%2Fpages%2Fadmin%2FTestSEAdminPageCertSearch.java;h=dd7d1970614d99291c172da74418857087abc3ea;hp=a42aef84f938e9ceb3e7a403802a83657684705e;hb=b9f6b59fc48b5acf76da58e3f02a9d7a4ef1f87c;hpb=f14ca64e640fc3a9ea5f9cc035413bc095c4fd30 diff --git a/tests/club/wpia/gigi/pages/admin/TestSEAdminPageCertSearch.java b/tests/club/wpia/gigi/pages/admin/TestSEAdminPageCertSearch.java index a42aef84..dd7d1970 100644 --- a/tests/club/wpia/gigi/pages/admin/TestSEAdminPageCertSearch.java +++ b/tests/club/wpia/gigi/pages/admin/TestSEAdminPageCertSearch.java @@ -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; @@ -72,6 +73,22 @@ 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")); + boolean hadSupport = false; + boolean hadUser = false; + for (int i = 0; i < 2; i++) { + TestMail tm = getMailReceiver().receive(); + if (tm.getTo().equals(ServerConstants.getSupportMailAddress())) { + hadSupport = true; + } else if (tm.getTo().equals(certMail)) { + hadUser = true; + } else { + throw new Error("Unknown mail:" + tm.getTo()); + } + assertThat(tm.getMessage(), CoreMatchers.containsString(certMail)); + assertThat(tm.getMessage(), CoreMatchers.containsString(c.getSerial())); + } + assertTrue(hadSupport); + assertTrue(hadUser); assertEquals(CertificateStatus.REVOKED, c.getStatus()); }