]> WPIA git - gigi.git/blobdiff - tests/org/cacert/gigi/ping/TestSSL.java
UPD: clean up/document/beatufy testcases.
[gigi.git] / tests / org / cacert / gigi / ping / TestSSL.java
index 26f276265d62577bc0a09158508c0524e4b82472..610e11536700513835604187bdce687a96dd0c0d 100644 (file)
@@ -1,6 +1,7 @@
 package org.cacert.gigi.ping;
 
 import static org.junit.Assert.*;
+import static org.junit.Assume.*;
 
 import java.io.IOException;
 import java.net.Socket;
@@ -29,8 +30,9 @@ import javax.net.ssl.X509TrustManager;
 
 import org.cacert.gigi.GigiApiException;
 import org.cacert.gigi.dbObjects.Certificate;
-import org.cacert.gigi.dbObjects.CertificateProfile;
 import org.cacert.gigi.dbObjects.Certificate.CSRType;
+import org.cacert.gigi.dbObjects.CertificateProfile;
+import org.cacert.gigi.dbObjects.User;
 import org.cacert.gigi.pages.account.domain.DomainOverview;
 import org.cacert.gigi.testUtils.IOUtils;
 import org.cacert.gigi.testUtils.PingTest;
@@ -88,7 +90,7 @@ public class TestSSL extends PingTest {
 
     private void testEmailAndSSL(int sslVariant, int emailVariant, boolean successMail) throws IOException, InterruptedException, SQLException, GeneralSecurityException, GigiApiException {
         String test = getTestProps().getProperty("domain.local");
-
+        assumeNotNull(test);
         URL u = new URL("https://" + getServerName() + DomainOverview.PATH);
 
         initailizeDomainForm(u);
@@ -137,7 +139,7 @@ public class TestSSL extends PingTest {
     private void createCertificate(String test, CertificateProfile profile) throws GeneralSecurityException, IOException, SQLException, InterruptedException, GigiApiException {
         kp = generateKeypair();
         String csr = generatePEMCSR(kp, "CN=" + test);
-        c = new Certificate(userid, "/CN=" + test, "sha256", csr, CSRType.CSR, profile);
+        c = new Certificate(User.getById(id), Certificate.buildDN("CN", test), "sha256", csr, CSRType.CSR, profile);
         c.issue(null, "2y").waitFor(60000);
     }