]> WPIA git - gigi.git/blobdiff - tests/org/cacert/gigi/TestSeparateSessionScope.java
Format code according do BenBE's formatter.
[gigi.git] / tests / org / cacert / gigi / TestSeparateSessionScope.java
index a28def7c5abbc8b6a1d66137b89e89f310e1da53..e676e51bde2501c77e9b74b0c68e093190d768cc 100644 (file)
@@ -17,31 +17,31 @@ import org.junit.Test;
 
 public class TestSeparateSessionScope extends ManagedTest {
 
-       @Test
-       public void testSeparateScope() throws IOException, GeneralSecurityException, SQLException, InterruptedException {
-               String mail = "thisgo" + createUniqueName() + "@example.com";
-               int user = createAssuranceUser("test", "tugo", mail, TEST_PASSWORD);
-               String cookie = login(mail, TEST_PASSWORD);
-               String[] csr = generateCSR("/CN=felix@dogcraft.de");
-               Certificate c = new Certificate(user, "/CN=testmail@example.com", "sha256", csr[1], CSRType.CSR);
-               final PrivateKey pk = PemKey.parsePEMPrivateKey(csr[0]);
-               c.issue().waitFor(60000);
-               final X509Certificate ce = c.cert();
-               String scookie = login(pk, ce);
-
-               assertTrue(isLoggedin(cookie));
-               assertFalse(isLoggedin(scookie));
-
-               URL u = new URL("https://" + getServerName().replaceAll("^www", "secure") + SECURE_REFERENCE);
-               HttpURLConnection huc = (HttpURLConnection) u.openConnection();
-               authenticateClientCert(pk, ce, huc);
-               huc.setRequestProperty("Cookie", scookie);
-               assertEquals(200, huc.getResponseCode());
-
-               HttpURLConnection huc2 = (HttpURLConnection) u.openConnection();
-               authenticateClientCert(pk, ce, huc2);
-               huc2.setRequestProperty("Cookie", cookie);
-               assertEquals(302, huc2.getResponseCode());
-
-       }
+    @Test
+    public void testSeparateScope() throws IOException, GeneralSecurityException, SQLException, InterruptedException {
+        String mail = "thisgo" + createUniqueName() + "@example.com";
+        int user = createAssuranceUser("test", "tugo", mail, TEST_PASSWORD);
+        String cookie = login(mail, TEST_PASSWORD);
+        String[] csr = generateCSR("/CN=felix@dogcraft.de");
+        Certificate c = new Certificate(user, "/CN=testmail@example.com", "sha256", csr[1], CSRType.CSR);
+        final PrivateKey pk = PemKey.parsePEMPrivateKey(csr[0]);
+        c.issue().waitFor(60000);
+        final X509Certificate ce = c.cert();
+        String scookie = login(pk, ce);
+
+        assertTrue(isLoggedin(cookie));
+        assertFalse(isLoggedin(scookie));
+
+        URL u = new URL("https://" + getServerName().replaceAll("^www", "secure") + SECURE_REFERENCE);
+        HttpURLConnection huc = (HttpURLConnection) u.openConnection();
+        authenticateClientCert(pk, ce, huc);
+        huc.setRequestProperty("Cookie", scookie);
+        assertEquals(200, huc.getResponseCode());
+
+        HttpURLConnection huc2 = (HttpURLConnection) u.openConnection();
+        authenticateClientCert(pk, ce, huc2);
+        huc2.setRequestProperty("Cookie", cookie);
+        assertEquals(302, huc2.getResponseCode());
+
+    }
 }