X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fclub%2Fwpia%2Fgigi%2FtestUtils%2FSEClientTest.java;h=a77967295bd6c9bc87c33754284bbe8ff307cabd;hb=c23bd923858a6c589bddecebd65fdf0739c62e6a;hp=358a8c1ef4cea043cbb84907ab12939832c0ff72;hpb=7c9a443cdc81dfc8129f898d510e13bccc558ee0;p=gigi.git diff --git a/tests/club/wpia/gigi/testUtils/SEClientTest.java b/tests/club/wpia/gigi/testUtils/SEClientTest.java index 358a8c1e..a7796729 100644 --- a/tests/club/wpia/gigi/testUtils/SEClientTest.java +++ b/tests/club/wpia/gigi/testUtils/SEClientTest.java @@ -3,15 +3,8 @@ package club.wpia.gigi.testUtils; import static org.junit.Assert.*; import java.io.IOException; -import java.security.GeneralSecurityException; -import java.security.KeyPair; -import java.security.PrivateKey; -import java.security.cert.X509Certificate; import club.wpia.gigi.GigiApiException; -import club.wpia.gigi.dbObjects.Certificate; -import club.wpia.gigi.dbObjects.Certificate.CSRType; -import club.wpia.gigi.dbObjects.Digest; import club.wpia.gigi.dbObjects.Group; import club.wpia.gigi.pages.admin.support.SupportEnterTicketPage; @@ -23,22 +16,7 @@ public abstract class SEClientTest extends ClientTest { public SEClientTest() throws IOException, GigiApiException { grant(u, Group.SUPPORTER); - try { - KeyPair kp = generateKeypair(); - String csr = generatePEMCSR(kp, "CN=" + u.getPreferredName().toString()); - Certificate c = new Certificate(u, u, Certificate.buildDN("CN", u.getPreferredName().toString()), Digest.SHA256, csr, CSRType.CSR, getClientProfile()); - final PrivateKey pk = kp.getPrivate(); - await(c.issue(null, "2y", u)); - final X509Certificate ce = c.cert(); - c.setLoginEnabled(true); - loginCertificate = c; - loginPrivateKey = pk; - cookie = login(pk, ce); - } catch (InterruptedException e) { - throw new GigiApiException(e.toString()); - } catch (GeneralSecurityException e) { - throw new GigiApiException(e.toString()); - } + cookie = cookieWithCertificateLogin(u); assertEquals(302, post(cookie, SupportEnterTicketPage.PATH, "ticketno=a20140808.8&setTicket=action", 0).getResponseCode()); }