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 {
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;
- }
-
}