import org.cacert.gigi.dbObjects.DomainPingType;
import org.cacert.gigi.dbObjects.EmailAddress;
import org.cacert.gigi.dbObjects.Group;
+import org.cacert.gigi.dbObjects.Job;
import org.cacert.gigi.dbObjects.ObjectCache;
import org.cacert.gigi.dbObjects.User;
import org.cacert.gigi.pages.Manager;
import org.cacert.gigi.util.DatabaseManager;
import org.cacert.gigi.util.ServerConstants;
import org.cacert.gigi.util.SimpleSigner;
+import org.hamcrest.CoreMatchers;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.BeforeClass;
String[] parts = testProps.getProperty("mail").split(":", 2);
ter = new TestEmailReceiver(new InetSocketAddress(parts[0], Integer.parseInt(parts[1])));
ter.start();
+ if (testProps.getProperty("withSigner", "false").equals("true")) {
+ SimpleSigner.runSigner();
+ }
return;
}
url = testProps.getProperty("name.www") + ":" + testProps.getProperty("serverPort.https");
}
+ protected void await(Job j) throws InterruptedException {
+ SimpleSigner.ping();
+ j.waitFor(5000);
+ }
+
public static void purgeDatabase() throws SQLException, IOException {
System.out.print("... resetting Database");
long ms = System.currentTimeMillis();
return d;
}
+ public static org.hamcrest.Matcher<String> hasError() {
+ return CoreMatchers.containsString("<div class='bg-danger error-msgs'>");
+ }
+
+ public static org.hamcrest.Matcher<String> hasNoError() {
+ return CoreMatchers.not(hasError());
+ }
+
public static String fetchStartErrorMessage(String d) throws IOException {
- String formFail = "<div class='formError'>";
+ String formFail = "<div class='bg-danger error-msgs'>";
int idx = d.indexOf(formFail);
if (idx == -1) {
return null;
}
public static void makeAssurer(int uid) {
- try (GigiPreparedStatement ps1 = new GigiPreparedStatement("INSERT INTO `cats_passed` SET `user_id`=?, `variant_id`=?")) {
+ try (GigiPreparedStatement ps1 = new GigiPreparedStatement("INSERT INTO cats_passed SET user_id=?, variant_id=?, language='en_EN', version=1")) {
ps1.setInt(1, uid);
ps1.setInt(2, CATS.ASSURER_CHALLENGE_ID);
ps1.execute();