]> WPIA git - gigi.git/blob - tests/org/cacert/gigi/pages/account/TestDomain.java
3780366c353144e95109094aa0055778a337f3b4
[gigi.git] / tests / org / cacert / gigi / pages / account / TestDomain.java
1 package org.cacert.gigi.pages.account;
2
3 import static org.junit.Assert.*;
4
5 import java.io.IOException;
6 import java.net.URLEncoder;
7
8 import org.cacert.gigi.User;
9 import org.cacert.gigi.testUtils.ManagedTest;
10 import org.junit.Test;
11
12 public class TestDomain extends ManagedTest {
13
14     User u = User.getById(createVerifiedUser("testuser", "testname", uniq + "@testdom.com", TEST_PASSWORD));
15
16     String session = login(uniq + "@testdom.com", TEST_PASSWORD);
17
18     public TestDomain() throws IOException {}
19
20     @Test
21     public void testAdd() throws IOException {
22         assertNull(addDomain(session, uniq + ".tld"));
23         assertNotNull(addDomain(session, uniq + ".tld"));
24     }
25
26     public static String addDomain(String session, String domain) throws IOException {
27         return executeBasicWebInteraction(session, DomainOverview.PATH, "adddomain&newdomain=" + URLEncoder.encode(domain, "UTF-8"), 1);
28     }
29 }