]> WPIA git - gigi.git/blobdiff - tests/org/cacert/gigi/testUtils/ManagedTest.java
upd: use a more strict pattern for handling forms
[gigi.git] / tests / org / cacert / gigi / testUtils / ManagedTest.java
index 22da1eab4a5ef9851d3187331cbabaff09608cbf..89b380a96520d2ab9a9062a456852ab78a68e8a0 100644 (file)
@@ -437,7 +437,10 @@ public class ManagedTest extends ConfiguredTest {
     }
 
     public static String executeBasicWebInteraction(String cookie, String path, String query, int formIndex) throws IOException, MalformedURLException, UnsupportedEncodingException {
-        URLConnection uc = post(cookie, path, query, formIndex);
+        HttpURLConnection uc = post(cookie, path, query, formIndex);
+        if (uc.getResponseCode() == 302) {
+            return null;
+        }
         String error = fetchStartErrorMessage(IOUtils.readURL(uc));
         return error;
     }
@@ -492,7 +495,7 @@ public class ManagedTest extends ConfiguredTest {
         int i = createVerifiedUser("fn", "ln", createUniqueName() + "@email.com", TEST_PASSWORD);
         try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `user_groups` SET `user`=?, `permission`=?::`userGroup`, `grantedby`=?")) {
             ps.setInt(1, i);
-            ps.setString(2, Group.SUPPORTER.getDatabaseName());
+            ps.setString(2, Group.SUPPORTER.getDBName());
             ps.setInt(3, i);
             ps.execute();
         }