]> WPIA git - gigi.git/blobdiff - tests/org/cacert/gigi/pages/account/TestMailManagement.java
Move email/certs/mail to their own packages
[gigi.git] / tests / org / cacert / gigi / pages / account / TestMailManagement.java
index 56ae01a0640d72fba4a76f314c492cfdb5f5a577..190dd5a0237e4ba98d1751ba7ff9e99f7747a456 100644 (file)
@@ -8,10 +8,12 @@ import java.net.MalformedURLException;
 import java.net.URLEncoder;
 import java.util.Locale;
 
-import org.cacert.gigi.EmailAddress;
 import org.cacert.gigi.GigiApiException;
-import org.cacert.gigi.User;
+import org.cacert.gigi.dbObjects.EmailAddress;
+import org.cacert.gigi.dbObjects.ObjectCache;
+import org.cacert.gigi.dbObjects.User;
 import org.cacert.gigi.localisation.Language;
+import org.cacert.gigi.pages.account.mail.MailOverview;
 import org.cacert.gigi.testUtils.ManagedTest;
 import org.junit.Test;
 
@@ -36,7 +38,7 @@ public class TestMailManagement extends ManagedTest {
     @Test
     public void testMailAddInternalFaulty() {
         try {
-            new EmailAddress("kurti ", u);
+            new EmailAddress(u, "kurti ");
             fail();
         } catch (IllegalArgumentException e) {
             // Intended.
@@ -72,12 +74,13 @@ public class TestMailManagement extends ManagedTest {
     public void testMailSetDefaultWeb() throws MalformedURLException, UnsupportedEncodingException, IOException, InterruptedException, GigiApiException {
         EmailAddress adrr = createVerifiedEmail(u);
         assertNull(executeBasicWebInteraction(cookie, path, "makedefault&emailid=" + adrr.getId()));
+        ObjectCache.clearAllCaches();
         assertEquals(User.getById(u.getId()).getEmail(), adrr.getAddress());
     }
 
     @Test
     public void testMailSetDefaultWebUnverified() throws MalformedURLException, UnsupportedEncodingException, IOException, InterruptedException, GigiApiException {
-        EmailAddress adrr = new EmailAddress(createUniqueName() + "test@test.tld", u);
+        EmailAddress adrr = new EmailAddress(u, createUniqueName() + "test@test.tld");
         adrr.insert(Language.getInstance(Locale.ENGLISH));
         assertNotNull(executeBasicWebInteraction(cookie, path, "makedefault&emailid=" + adrr.getId()));
         assertNotEquals(User.getById(u.getId()).getEmail(), adrr.getAddress());