X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=tests%2Forg%2Fcacert%2Fgigi%2Fapi%2FIssueCert.java;h=f6040008fd718b9e0f423c5e45b5a2a90dd7a1ab;hp=b37626ce24a30d1285d06e83fe1ae630d3046d7a;hb=9def69bd08ea69eb27786d5b34f00e154e09e9f3;hpb=6e23ad9bc75d6cb2aa86cb36654a6ef44a167011 diff --git a/tests/org/cacert/gigi/api/IssueCert.java b/tests/org/cacert/gigi/api/IssueCert.java index b37626ce..f6040008 100644 --- a/tests/org/cacert/gigi/api/IssueCert.java +++ b/tests/org/cacert/gigi/api/IssueCert.java @@ -22,7 +22,6 @@ import org.cacert.gigi.dbObjects.CertificateProfile; import org.cacert.gigi.dbObjects.Digest; import org.cacert.gigi.dbObjects.Domain; import org.cacert.gigi.dbObjects.Group; -import org.cacert.gigi.dbObjects.Name; import org.cacert.gigi.dbObjects.Organisation; import org.cacert.gigi.testUtils.ClientTest; import org.cacert.gigi.testUtils.IOUtils; @@ -46,7 +45,7 @@ public class IssueCert extends ClientTest { String key1 = generatePEMCSR(kp, "EMAIL=testmail@example.com"); c = new Certificate(u, u, Certificate.buildDN("EMAIL", "testmail@example.com"), Digest.SHA256, key1, CSRType.CSR, CertificateProfile.getById(1)); pk = kp.getPrivate(); - c.issue(null, "2y", u).waitFor(60000); + await(c.issue(null, "2y", u)); ce = c.cert(); } catch (Exception e) { throw new Error(e); @@ -73,13 +72,12 @@ public class IssueCert extends ClientTest { public void testIssueCertAssured() throws Exception { makeAssurer(id); - Name n = u.getName(); - String whishName = n.getFname() + " " + n.getLname(); - String cert = issueCert(generatePEMCSR(kp, "EMAIL=" + email + ",CN=" + whishName), "profile=client-a"); + String intendedName = "a b"; + String cert = issueCert(generatePEMCSR(kp, "EMAIL=" + email + ",CN=" + intendedName), "profile=client-a"); CertificateFactory cf = CertificateFactory.getInstance("X509"); java.security.cert.X509Certificate xcert = (X509Certificate) cf.generateCertificate(new ByteArrayInputStream(cert.getBytes("UTF-8"))); - assertEquals(whishName, ((X500Name) xcert.getSubjectDN()).getCommonName()); + assertEquals(intendedName, ((X500Name) xcert.getSubjectDN()).getCommonName()); } @@ -88,7 +86,7 @@ public class IssueCert extends ClientTest { makeAssurer(id); u.grantGroup(u, Group.ORGASSURER); - Organisation o1 = new Organisation("name", "st", "pr", "st", "test@mail", u); + Organisation o1 = new Organisation("name", "st", "pr", "st", "test@mail", "", "", u); o1.addAdmin(u, u, false); String testdom = createUniqueName() + "-example.com"; Domain d2 = new Domain(u, o1, testdom);