]> WPIA git - gigi.git/blobdiff - tests/org/cacert/gigi/testUtils/ManagedTest.java
Fix: some nullpointer references (coverity).
[gigi.git] / tests / org / cacert / gigi / testUtils / ManagedTest.java
index 4c3a8c9de640fdd9e6d0fcb249958f29d7c07d5b..8f6e6c5d44f360301e6efd0f5e323583bcc4081f 100644 (file)
@@ -53,6 +53,7 @@ import org.cacert.gigi.util.ServerConstants;
 import org.cacert.gigi.util.SimpleSigner;
 import org.junit.After;
 import org.junit.AfterClass;
+import org.junit.Assert;
 import org.junit.BeforeClass;
 
 /**
@@ -104,6 +105,7 @@ public class ManagedTest extends ConfiguredTest {
                 url = testProps.getProperty("name.www") + ":" + testProps.getProperty("serverPort.https");
                 String[] parts = testProps.getProperty("mail").split(":", 2);
                 ter = new TestEmailReciever(new InetSocketAddress(parts[0], Integer.parseInt(parts[1])));
+                ter.start();
                 return;
             }
             url = testProps.getProperty("name.www") + ":" + testProps.getProperty("serverPort.https");
@@ -277,6 +279,7 @@ public class ManagedTest extends ConfiguredTest {
         registerUser(firstName, lastName, email, password);
         try {
             TestMail tm = ter.recieve();
+            Assert.assertNotNull(tm);
             tm.verify();
             GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("SELECT id FROM users where email=?");
             ps.setString(1, email);
@@ -468,6 +471,7 @@ public class ManagedTest extends ConfiguredTest {
         EmailAddress adrr = new EmailAddress(u, createUniqueName() + "test@test.tld");
         adrr.insert(Language.getInstance(Locale.ENGLISH));
         TestMail testMail = getMailReciever().recieve();
+        Assert.assertNotNull(testMail);
         assertEquals(adrr.getAddress(), testMail.getTo());
         String hash = testMail.extractLink().substring(testMail.extractLink().lastIndexOf('=') + 1);
         adrr.verify(hash);