X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=tests%2Forg%2Fcacert%2Fgigi%2Futil%2FTestNotary.java;h=22f75b2362789c0f84c92d5608343c483ab50806;hb=f39e1a18e4ceed8ad6edb7fc4b7e4d1879703dd5;hp=6fd69d7cfcc7d7292eca1f00bd440e6497efb4b2;hpb=d1080ab12183cad2bab5d1f94bafe67960fbf4c8;p=gigi.git diff --git a/tests/org/cacert/gigi/util/TestNotary.java b/tests/org/cacert/gigi/util/TestNotary.java index 6fd69d7c..22f75b23 100644 --- a/tests/org/cacert/gigi/util/TestNotary.java +++ b/tests/org/cacert/gigi/util/TestNotary.java @@ -2,6 +2,7 @@ package org.cacert.gigi.util; import static org.junit.Assert.*; +import java.io.IOException; import java.sql.SQLException; import java.util.Date; @@ -15,8 +16,15 @@ import org.junit.Test; public class TestNotary extends ManagedTest { + // These tests create a lot of users and therefore require resetting of the + // registering-rate-limit. @Test public void testNormalAssurance() throws SQLException, GigiApiException { + try { + clearCaches(); + } catch (IOException e) { + throw new Error(e); + } User[] users = new User[30]; for (int i = 0; i < users.length; i++) { int id = createVerifiedUser("fn" + i, "ln" + i, createUniqueName() + "@email.org", TEST_PASSWORD); @@ -58,6 +66,11 @@ public class TestNotary extends ManagedTest { @Test public void testPoJam() throws SQLException, GigiApiException { + try { + clearCaches(); + } catch (IOException e) { + throw new Error(e); + } User[] users = new User[30]; for (int i = 0; i < users.length; i++) { int id = createVerifiedUser("fn" + i, "ln" + i, createUniqueName() + "@email.org", TEST_PASSWORD); @@ -72,7 +85,9 @@ public class TestNotary extends ManagedTest { for (int i = 0; i < users.length; i++) { assuranceFail(assurer, users[i], -1, "test-notary", "2014-01-01"); assuranceFail(assurer, users[i], 11, "test-notary", "2014-01-01"); - Notary.assure(assurer, users[i], users[i].getName(), users[i].getDoB(), 10, "test-notary", "2014-01-01", AssuranceType.FACE_TO_FACE); + if (User.POJAM_ENABLED) { + Notary.assure(assurer, users[i], users[i].getName(), users[i].getDoB(), 10, "test-notary", "2014-01-01", AssuranceType.FACE_TO_FACE); + } assuranceFail(assurer, users[i], 10, "test-notary", "2014-01-01"); } }