]> WPIA git - gigi.git/blobdiff - tests/org/cacert/gigi/pages/account/TestMailManagement.java
UPD: change "email"-constructor to match the syntax of the
[gigi.git] / tests / org / cacert / gigi / pages / account / TestMailManagement.java
index 2adbf106ed0f9635ae8a6121099fb801c2962a3e..5ad75a60ee23af66323dce418a27a9b74457766c 100644 (file)
@@ -6,11 +6,13 @@ import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 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.Language;
-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.testUtils.ManagedTest;
 import org.junit.Test;
 
@@ -35,7 +37,7 @@ public class TestMailManagement extends ManagedTest {
     @Test
     public void testMailAddInternalFaulty() {
         try {
-            new EmailAddress("kurti ", u);
+            new EmailAddress(u, "kurti ");
             fail();
         } catch (IllegalArgumentException e) {
             // Intended.
@@ -69,6 +71,7 @@ public class TestMailManagement extends ManagedTest {
 
     @Test
     public void testMailSetDefaultWeb() throws MalformedURLException, UnsupportedEncodingException, IOException, InterruptedException, GigiApiException {
+        ObjectCache.clearAllCashes();
         EmailAddress adrr = createVerifiedEmail(u);
         assertNull(executeBasicWebInteraction(cookie, path, "makedefault&emailid=" + adrr.getId()));
         assertEquals(User.getById(u.getId()).getEmail(), adrr.getAddress());
@@ -76,8 +79,8 @@ public class TestMailManagement extends ManagedTest {
 
     @Test
     public void testMailSetDefaultWebUnverified() throws MalformedURLException, UnsupportedEncodingException, IOException, InterruptedException, GigiApiException {
-        EmailAddress adrr = new EmailAddress(createUniqueName() + "test@test.tld", u);
-        adrr.insert(Language.getInstance("en"));
+        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());
         getMailReciever().clearMails();