]> WPIA git - gigi.git/blobdiff - tests/club/wpia/gigi/util/TestNotary.java
Merge "upd: remove 'browser install'"
[gigi.git] / tests / club / wpia / gigi / util / TestNotary.java
index 45217fd8d00fc8d3afd0656a7d257152023c883f..6c6780e98703da1bb66aa3f6d573fb2d37f3532d 100644 (file)
@@ -12,6 +12,7 @@ import club.wpia.gigi.GigiApiException;
 import club.wpia.gigi.database.GigiPreparedStatement;
 import club.wpia.gigi.dbObjects.CATS;
 import club.wpia.gigi.dbObjects.CATS.CATSType;
+import club.wpia.gigi.dbObjects.Contract;
 import club.wpia.gigi.dbObjects.Country;
 import club.wpia.gigi.dbObjects.Country.CountryCodeType;
 import club.wpia.gigi.dbObjects.Group;
@@ -23,6 +24,7 @@ import club.wpia.gigi.dbObjects.User;
 import club.wpia.gigi.dbObjects.Verification.VerificationType;
 import club.wpia.gigi.output.DateSelector;
 import club.wpia.gigi.testUtils.BusinessTest;
+import club.wpia.gigi.testUtils.TestEmailReceiver.TestMail;
 
 public class TestNotary extends BusinessTest {
 
@@ -135,7 +137,7 @@ public class TestNotary extends BusinessTest {
     @Test
     public void testNucleus() throws SQLException, GigiApiException, IOException {
         User agent = User.getById(createVerificationUser("fn", "ln", createUniqueName() + "@example.org", TEST_PASSWORD));
-        agent.grantGroup(getSupporter(), Group.NUCLEUS_ASSURER);
+        agent.grantGroup(getSupporter(), Group.NUCLEUS_AGENT);
         User applicant = User.getById(createVerifiedUser("fn", "ln", createUniqueName() + "@example.org", TEST_PASSWORD));
         Name n1 = applicant.getPreferredName();
         Name n2 = new Name(applicant, new NamePart(NamePartType.FIRST_NAME, "F2"), new NamePart(NamePartType.LAST_NAME, "L2"));
@@ -157,9 +159,9 @@ public class TestNotary extends BusinessTest {
     @Test
     public void testNucleusProcess() throws SQLException, GigiApiException, IOException {
         User agent1 = User.getById(createVerificationUser("fn", "ln", createUniqueName() + "@example.org", TEST_PASSWORD));
-        agent1.grantGroup(getSupporter(), Group.NUCLEUS_ASSURER);
+        agent1.grantGroup(getSupporter(), Group.NUCLEUS_AGENT);
         User agent2 = User.getById(createVerificationUser("fn", "ln", createUniqueName() + "@example.org", TEST_PASSWORD));
-        agent2.grantGroup(getSupporter(), Group.NUCLEUS_ASSURER);
+        agent2.grantGroup(getSupporter(), Group.NUCLEUS_AGENT);
         User applicant = User.getById(createVerifiedUser("fn", "ln", createUniqueName() + "@example.org", TEST_PASSWORD));
         Notary.verify(agent1, applicant, applicant.getPreferredName(), applicant.getDoB(), 50, "test", validVerificationDateString(), VerificationType.NUCLEUS, DE);
         Notary.verify(agent2, applicant, applicant.getPreferredName(), applicant.getDoB(), 50, "test", validVerificationDateString(), VerificationType.NUCLEUS, DE);
@@ -167,6 +169,8 @@ public class TestNotary extends BusinessTest {
         assertEquals(100, applicant.getVerificationPoints());
         assertFalse(applicant.canVerify());
         CATS.enterResult(applicant, CATSType.AGENT_CHALLENGE, new Date(), "de", "1");
+        new Contract(applicant, Contract.ContractType.RA_AGENT_CONTRACT);
+        TestMail rc = getMailReceiver().receive(applicant.getEmail());
         assertTrue(applicant.canVerify());
     }
 }