]> WPIA git - gigi.git/blobdiff - tests/org/cacert/gigi/TestSeparateSessionScope.java
Update Certificate-DN-API (for escape-safe-strings)
[gigi.git] / tests / org / cacert / gigi / TestSeparateSessionScope.java
index 6f78dbac150142af354af80eb2f1e51dc1fca20f..20dd6ae9de11d557633dc7abdbf2f005ad8b0c5a 100644 (file)
@@ -11,22 +11,25 @@ import java.security.PrivateKey;
 import java.security.cert.X509Certificate;
 import java.sql.SQLException;
 
-import org.cacert.gigi.Certificate.CSRType;
+import org.cacert.gigi.dbObjects.Certificate;
+import org.cacert.gigi.dbObjects.Certificate.CSRType;
+import org.cacert.gigi.dbObjects.CertificateProfile;
+import org.cacert.gigi.dbObjects.User;
 import org.cacert.gigi.testUtils.ManagedTest;
 import org.junit.Test;
 
 public class TestSeparateSessionScope extends ManagedTest {
 
     @Test
-    public void testSeparateScope() throws IOException, GeneralSecurityException, SQLException, InterruptedException {
+    public void testSeparateScope() throws IOException, GeneralSecurityException, SQLException, InterruptedException, GigiApiException {
         String mail = "thisgo" + createUniqueName() + "@example.com";
         int user = createAssuranceUser("test", "tugo", mail, TEST_PASSWORD);
         String cookie = login(mail, TEST_PASSWORD);
         KeyPair kp = generateKeypair();
         String csr = generatePEMCSR(kp, "CN=felix@dogcraft.de");
-        Certificate c = new Certificate(user, "/CN=testmail@example.com", "sha256", csr, CSRType.CSR);
+        Certificate c = new Certificate(User.getById(user), Certificate.buildDN("CN", "testmail@example.com"), "sha256", csr, CSRType.CSR, CertificateProfile.getById(1));
         final PrivateKey pk = kp.getPrivate();
-        c.issue().waitFor(60000);
+        c.issue(null, "2y").waitFor(60000);
         final X509Certificate ce = c.cert();
         String scookie = login(pk, ce);