From: Felix Dörre Date: Sun, 20 Aug 2017 23:14:38 +0000 (+0200) Subject: add: more tests for revocation by support X-Git-Url: https://code.wpia.club/?p=gigi.git;a=commitdiff_plain;h=b9f6b59fc48b5acf76da58e3f02a9d7a4ef1f87c add: more tests for revocation by support Change-Id: I1022e5e6cb743f1009f40157f9d9ce72645223fa --- 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()); } diff --git a/tests/club/wpia/gigi/testUtils/ConfiguredTest.java b/tests/club/wpia/gigi/testUtils/ConfiguredTest.java index 483f25e1..4dd091ed 100644 --- a/tests/club/wpia/gigi/testUtils/ConfiguredTest.java +++ b/tests/club/wpia/gigi/testUtils/ConfiguredTest.java @@ -131,6 +131,7 @@ public abstract class ConfiguredTest { mainProps.setProperty("name.www", testProps.getProperty("name.www")); mainProps.setProperty("name.static", testProps.getProperty("name.static")); mainProps.setProperty("name.api", testProps.getProperty("name.api")); + mainProps.setProperty("name.suffix", testProps.getProperty("name.suffix")); mainProps.setProperty("appName", "SomeCA"); mainProps.setProperty("appIdentifier", "someca");