X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=tests%2Forg%2Fcacert%2Fgigi%2FLoginTest.java;h=8a71090f601aeb7c768294980263b0e55a471d51;hb=d937840c661248a848580e307b618950bbf34ef8;hp=729a5988e8053f4f4cf4e3b26828acec9b801a63;hpb=a4d3540a6ff67ca7673d0ff0c308b1ff56a76612;p=gigi.git diff --git a/tests/org/cacert/gigi/LoginTest.java b/tests/org/cacert/gigi/LoginTest.java index 729a5988..8a71090f 100644 --- a/tests/org/cacert/gigi/LoginTest.java +++ b/tests/org/cacert/gigi/LoginTest.java @@ -2,16 +2,11 @@ package org.cacert.gigi; import java.io.IOException; import static org.junit.Assert.*; -import java.io.OutputStream; -import java.net.HttpURLConnection; -import java.net.URL; -import java.net.URLEncoder; - import org.cacert.gigi.testUtils.ManagedTest; import org.junit.Test; public class LoginTest extends ManagedTest { - public static final String secureReference = "/account/certs/email"; + @Test public void testLoginUnverified() throws IOException { long uniq = System.currentTimeMillis(); @@ -21,6 +16,7 @@ public class LoginTest extends ManagedTest { waitForMail(); assertFalse(isLoggedin(login(email, pw))); } + @Test public void testLoginVerified() throws IOException { long uniq = System.currentTimeMillis(); @@ -29,11 +25,5 @@ public class LoginTest extends ManagedTest { createVerifiedUser("an", "bn", email, pw); assertTrue(isLoggedin(login(email, pw))); } - public boolean isLoggedin(String cookie) throws IOException { - URL u = new URL("https://" + getServerName() + secureReference); - HttpURLConnection huc = (HttpURLConnection) u.openConnection(); - huc.addRequestProperty("Cookie", cookie); - return huc.getResponseCode() == 200; - } }