]> WPIA git - gigi.git/blob - tests/org/cacert/gigi/LoginTest.java
Factor out more test-things.
[gigi.git] / tests / org / cacert / gigi / LoginTest.java
1 package org.cacert.gigi;
2
3 import java.io.IOException;
4 import static org.junit.Assert.*;
5 import org.cacert.gigi.testUtils.ManagedTest;
6 import org.junit.Test;
7
8 public class LoginTest extends ManagedTest {
9
10         @Test
11         public void testLoginUnverified() throws IOException {
12                 long uniq = System.currentTimeMillis();
13                 String email = "system" + uniq + "@testmail.org";
14                 String pw = "1'aAaA";
15                 registerUser("an", "bn", email, pw);
16                 waitForMail();
17                 assertFalse(isLoggedin(login(email, pw)));
18         }
19
20         @Test
21         public void testLoginVerified() throws IOException {
22                 long uniq = System.currentTimeMillis();
23                 String email = "system2" + uniq + "@testmail.org";
24                 String pw = "1'aAaA";
25                 createVerifiedUser("an", "bn", email, pw);
26                 assertTrue(isLoggedin(login(email, pw)));
27         }
28
29 }