X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=tests%2Forg%2Fcacert%2Fgigi%2FtestUtils%2FManagedTest.java;h=b0f3670a68f1be76e9077f337d392c6e3b9756a4;hp=a9dd42015c8bdb4930d9fb1e6225b69c2ef0ef5f;hb=7d12c09641a69f141b92d9914d0915d62a436a2d;hpb=2cef253ba7943a41231e703674bdaad9b9770968 diff --git a/tests/org/cacert/gigi/testUtils/ManagedTest.java b/tests/org/cacert/gigi/testUtils/ManagedTest.java index a9dd4201..b0f3670a 100644 --- a/tests/org/cacert/gigi/testUtils/ManagedTest.java +++ b/tests/org/cacert/gigi/testUtils/ManagedTest.java @@ -78,6 +78,11 @@ public class ManagedTest { } static Properties testProps = new Properties(); + + public static Properties getTestProps() { + return testProps; + } + static { InitTruststore.run(); HttpURLConnection.setFollowRedirects(false); @@ -395,6 +400,10 @@ public class ManagedTest { public static String getCSRF(URLConnection u, int formIndex) throws IOException { String content = IOUtils.readURL(u); + return getCSRF(formIndex, content); + } + + public static String getCSRF(int formIndex, String content) throws Error { Pattern p = Pattern.compile(""); Matcher m = p.matcher(content); for (int i = 0; i < formIndex + 1; i++) { @@ -459,4 +468,9 @@ public class ManagedTest { return adrr; } + public static URLConnection cookie(URLConnection openConnection, String cookie) { + openConnection.setRequestProperty("Cookie", cookie); + return openConnection; + } + }