X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=tests%2Fclub%2Fwpia%2Fgigi%2Fpages%2Fadmin%2FTestSEAdminPageDetails.java;h=9187c4f18156eaa87ad033f8d92cdd18a4e8ac97;hp=9b92fcbc08dfb20dc52e1d83dc1a8472a242b3c1;hb=7c9a443cdc81dfc8129f898d510e13bccc558ee0;hpb=1fb06a8d7882c839d4b78319e96d1f5c01f261c2 diff --git a/tests/club/wpia/gigi/pages/admin/TestSEAdminPageDetails.java b/tests/club/wpia/gigi/pages/admin/TestSEAdminPageDetails.java index 9b92fcbc..9187c4f1 100644 --- a/tests/club/wpia/gigi/pages/admin/TestSEAdminPageDetails.java +++ b/tests/club/wpia/gigi/pages/admin/TestSEAdminPageDetails.java @@ -15,6 +15,7 @@ import org.junit.Test; import club.wpia.gigi.GigiApiException; import club.wpia.gigi.database.GigiPreparedStatement; +import club.wpia.gigi.dbObjects.Certificate; import club.wpia.gigi.dbObjects.EmailAddress; import club.wpia.gigi.dbObjects.ObjectCache; import club.wpia.gigi.dbObjects.User; @@ -27,7 +28,11 @@ import club.wpia.gigi.util.DayDate; public class TestSEAdminPageDetails extends SEClientTest { - public TestSEAdminPageDetails() throws IOException, GigiApiException {} + private Certificate cs; + + public TestSEAdminPageDetails() throws IOException, GigiApiException { + cs = loginCertificate; + } @Test public void testUserDetailsDisplay() throws MalformedURLException, IOException { @@ -118,12 +123,13 @@ public class TestSEAdminPageDetails extends SEClientTest { String clientCookie = login(email, TEST_PASSWORD); // try to open mypoints as user + loginCertificate = null; HttpURLConnection uc = get(clientCookie, SupportUserDetailsPage.PATH + id + "/points"); assertEquals(403, uc.getResponseCode()); // enter verification and open mypoints as supporter - + loginCertificate = cs; makeAgent(this.id); String location = createUniqueName(); try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `notary` SET `from`=?, `to`=?, `points`=?, `location`=?, `date`=?, `when`=? ")) { @@ -157,7 +163,10 @@ public class TestSEAdminPageDetails extends SEClientTest { } private int logCountUser(String cookie) throws IOException { - return getLogEntryCount(IOUtils.readURL(get(cookie, History.PATH))); + loginCertificate = null; + int count = getLogEntryCount(IOUtils.readURL(get(cookie, History.PATH))); + loginCertificate = cs; + return count; } private int getLogEntryCount(String readURL) {