]> WPIA git - gigi.git/commitdiff
upd: terminology in code
authorLucas Werkmeister <mail@lucaswerkmeister.de>
Wed, 22 Feb 2017 20:37:38 +0000 (21:37 +0100)
committerLucas Werkmeister <mail@lucaswerkmeister.de>
Wed, 22 Feb 2017 20:52:07 +0000 (21:52 +0100)
Renames Java types and members and form fields. Anything facing the
database is not touched by this change.

Also fixes a handful of typos.

Change-Id: Id19c3af4627b56ee90a85fe887bd5bcdb6c9f385

51 files changed:
src/club/wpia/gigi/Gigi.java
src/club/wpia/gigi/api/FindAgent.java
src/club/wpia/gigi/dbObjects/CATS.java
src/club/wpia/gigi/dbObjects/CertificateProfile.java
src/club/wpia/gigi/dbObjects/Name.java
src/club/wpia/gigi/dbObjects/Organisation.java
src/club/wpia/gigi/dbObjects/User.java
src/club/wpia/gigi/dbObjects/Verification.java [moved from src/club/wpia/gigi/dbObjects/Assurance.java with 87% similarity]
src/club/wpia/gigi/output/VerificationsDisplay.java [moved from src/club/wpia/gigi/output/AssurancesDisplay.java with 52% similarity]
src/club/wpia/gigi/output/VerificationsDisplay.templ [moved from src/club/wpia/gigi/output/AssurancesDisplay.templ with 93% similarity]
src/club/wpia/gigi/pages/account/MyDetailsForm.java
src/club/wpia/gigi/pages/account/MyDetailsFormVerified.templ [moved from src/club/wpia/gigi/pages/account/MyDetailsFormAssured.templ with 100% similarity]
src/club/wpia/gigi/pages/account/certs/CertificateRequest.java
src/club/wpia/gigi/pages/admin/support/SupportUserDetailsForm.java
src/club/wpia/gigi/pages/admin/support/SupportUserDetailsForm.templ
src/club/wpia/gigi/pages/orga/AffiliationForm.java
src/club/wpia/gigi/pages/orga/CreateOrgPage.java
src/club/wpia/gigi/pages/orga/ViewOrgPage.java
src/club/wpia/gigi/pages/wot/ApplicantSearch.templ [moved from src/club/wpia/gigi/pages/wot/AssureeSearch.templ with 100% similarity]
src/club/wpia/gigi/pages/wot/Points.java
src/club/wpia/gigi/pages/wot/RequestTTPPage.java
src/club/wpia/gigi/pages/wot/VerificationForm.java [moved from src/club/wpia/gigi/pages/wot/AssuranceForm.java with 74% similarity]
src/club/wpia/gigi/pages/wot/VerificationForm.templ [moved from src/club/wpia/gigi/pages/wot/AssuranceForm.templ with 91% similarity]
src/club/wpia/gigi/pages/wot/VerifyPage.java [moved from src/club/wpia/gigi/pages/wot/AssurePage.java with 84% similarity]
src/club/wpia/gigi/util/AuthorizationContext.java
src/club/wpia/gigi/util/Notary.java
tests/club/wpia/gigi/TestOrga.java
tests/club/wpia/gigi/TestSeparateSessionScope.java
tests/club/wpia/gigi/TestUser.java
tests/club/wpia/gigi/api/ImportCATSResult.java
tests/club/wpia/gigi/api/IssueCert.java
tests/club/wpia/gigi/dbObjects/TestAssureName.java [deleted file]
tests/club/wpia/gigi/dbObjects/TestCATS.java
tests/club/wpia/gigi/dbObjects/TestVerification.java [moved from tests/club/wpia/gigi/dbObjects/TestAssurance.java with 67% similarity]
tests/club/wpia/gigi/dbObjects/TestVerificationMail.java [moved from tests/club/wpia/gigi/dbObjects/TestAssuranceMail.java with 85% similarity]
tests/club/wpia/gigi/dbObjects/TestVerifyName.java [new file with mode: 0644]
tests/club/wpia/gigi/pages/account/TestCertificateRequest.java
tests/club/wpia/gigi/pages/account/TestPasswordResetExternal.java
tests/club/wpia/gigi/pages/account/TestTrainings.java
tests/club/wpia/gigi/pages/admin/TestSEAdminPageDetails.java
tests/club/wpia/gigi/pages/orga/TestOrgManagement.java
tests/club/wpia/gigi/pages/wot/TestTTP.java
tests/club/wpia/gigi/pages/wot/TestVerification.java [moved from tests/club/wpia/gigi/pages/wot/TestAssurance.java with 67% similarity]
tests/club/wpia/gigi/testUtils/BusinessTest.java
tests/club/wpia/gigi/testUtils/ConfiguredTest.java
tests/club/wpia/gigi/testUtils/ManagedTest.java
tests/club/wpia/gigi/testUtils/OrgTest.java
tests/club/wpia/gigi/testUtils/RestrictedApiTest.java
tests/club/wpia/gigi/util/TestNotary.java
util-testing/club/wpia/gigi/pages/Manager.java
util-testing/club/wpia/gigi/pages/Manager.templ

index 33db52adb3df5d843adcee8cd2cf884b868c5b88..ebd6471ffd8934dcba1c1b0218db50ff80da2525 100644 (file)
@@ -69,7 +69,7 @@ import club.wpia.gigi.pages.main.RegisterPage;
 import club.wpia.gigi.pages.orga.CreateOrgPage;
 import club.wpia.gigi.pages.orga.ViewOrgPage;
 import club.wpia.gigi.pages.statistics.StatisticsRoles;
 import club.wpia.gigi.pages.orga.CreateOrgPage;
 import club.wpia.gigi.pages.orga.ViewOrgPage;
 import club.wpia.gigi.pages.statistics.StatisticsRoles;
-import club.wpia.gigi.pages.wot.AssurePage;
+import club.wpia.gigi.pages.wot.VerifyPage;
 import club.wpia.gigi.pages.wot.Points;
 import club.wpia.gigi.pages.wot.RequestTTPPage;
 import club.wpia.gigi.ping.PingerDaemon;
 import club.wpia.gigi.pages.wot.Points;
 import club.wpia.gigi.pages.wot.RequestTTPPage;
 import club.wpia.gigi.ping.PingerDaemon;
@@ -151,7 +151,7 @@ public final class Gigi extends HttpServlet {
             putPage(DomainOverview.PATH, new DomainOverview(), "Certificates");
             putPage(EditDomain.PATH + "*", new EditDomain(), null);
 
             putPage(DomainOverview.PATH, new DomainOverview(), "Certificates");
             putPage(EditDomain.PATH + "*", new EditDomain(), null);
 
-            putPage(AssurePage.PATH + "/*", new AssurePage(), "Web of Trust");
+            putPage(VerifyPage.PATH + "/*", new VerifyPage(), "Web of Trust");
             putPage(Points.PATH, new Points(false), "Web of Trust");
             putPage(RequestTTPPage.PATH, new RequestTTPPage(), "Web of Trust");
 
             putPage(Points.PATH, new Points(false), "Web of Trust");
             putPage(RequestTTPPage.PATH, new RequestTTPPage(), "Web of Trust");
 
@@ -190,7 +190,7 @@ public final class Gigi extends HttpServlet {
             }
 
             try {
             }
 
             try {
-                putPage("/wot/rules", new StaticPage("Web of Trust Rules", AssurePage.class.getResourceAsStream("Rules.templ")), "Web of Trust");
+                putPage("/wot/rules", new StaticPage("Web of Trust Rules", VerifyPage.class.getResourceAsStream("Rules.templ")), "Web of Trust");
             } catch (UnsupportedEncodingException e) {
                 throw new ServletException(e);
             }
             } catch (UnsupportedEncodingException e) {
                 throw new ServletException(e);
             }
@@ -274,7 +274,7 @@ public final class Gigi extends HttpServlet {
         try (Link l = DatabaseConnection.newLink(false)) {
             CACertificate.getById(1);
             CertificateProfile.getById(1);
         try (Link l = DatabaseConnection.newLink(false)) {
             CACertificate.getById(1);
             CertificateProfile.getById(1);
-            CATSType.ASSURER_CHALLENGE.getDisplayName();
+            CATSType.AGENT_CHALLENGE.getDisplayName();
         } catch (InterruptedException e) {
             throw new Error(e);
         }
         } catch (InterruptedException e) {
             throw new Error(e);
         }
index 9f00181a07a436fdd42f25b0b6407580ecf761d5..9be80abb18e2851e540872c37569804e1f8728b8 100644 (file)
@@ -89,7 +89,7 @@ public class FindAgent extends APIPoint {
                 jw.value(u1.getId());
 
                 jw.key("canAssure");
                 jw.value(u1.getId());
 
                 jw.key("canAssure");
-                jw.value(u1.canAssure());
+                jw.value(u1.canVerify());
 
                 jw.key("name");
                 jw.value(u1.getPreferredName().toAbbreviatedString());
 
                 jw.key("name");
                 jw.value(u1.getPreferredName().toAbbreviatedString());
index 3ed2c9230b734cb0f8d14a7e255d41f2dd5ef7d0..c9f96d11a55701064bd4548af44528ce4e2949f8 100644 (file)
@@ -11,7 +11,7 @@ import club.wpia.gigi.util.TimeConditions;
 public class CATS {
 
     public enum CATSType {
 public class CATS {
 
     public enum CATSType {
-        ASSURER_CHALLENGE("Agent Qualifying Challenge"),
+        AGENT_CHALLENGE("Agent Qualifying Challenge"),
 
         ORG_AGENT_CHALLENGE("Organisation Agent Qualifying Challenge"),
 
 
         ORG_AGENT_CHALLENGE("Organisation Agent Qualifying Challenge"),
 
index 8940da386a0d949755f831687acf005871a718c5..168744c96fa7c9d3ac16e1d6e34b898a2aef20c3 100644 (file)
@@ -258,11 +258,11 @@ public class CertificateProfile implements IdCachable {
         }
         for (String s : req) {
             if (s.equals("points>=50")) {
         }
         for (String s : req) {
             if (s.equals("points>=50")) {
-                if (actor.getAssurancePoints() < 50) {
+                if (actor.getVerificationPoints() < 50) {
                     return false;
                 }
             } else if (s.equals("points>=100")) {
                     return false;
                 }
             } else if (s.equals("points>=100")) {
-                if (actor.getAssurancePoints() < 100) {
+                if (actor.getVerificationPoints() < 100) {
                     return false;
                 }
             } else if (s.equals("codesign")) {
                     return false;
                 }
             } else if (s.equals("codesign")) {
index f4d002ec427c967772a6e03fa59d123bedfb23c7..4034371894ca5b75915a303545fe2a3d66a0f416 100644 (file)
@@ -384,7 +384,7 @@ public class Name implements Outputable, IdCachable {
         return scheme.toAbbreviatedString();
     }
 
         return scheme.toAbbreviatedString();
     }
 
-    public int getAssurancePoints() {
+    public int getVerificationPoints() {
         try (GigiPreparedStatement query = new GigiPreparedStatement("SELECT SUM(`points`) FROM (SELECT DISTINCT ON (`from`, `method`) `points` FROM `notary` WHERE `to`=? AND `deleted` IS NULL AND (`expire` IS NULL OR `expire` > CURRENT_TIMESTAMP) ORDER BY `from`, `method`, `when` DESC) AS p")) {
             query.setInt(1, getId());
 
         try (GigiPreparedStatement query = new GigiPreparedStatement("SELECT SUM(`points`) FROM (SELECT DISTINCT ON (`from`, `method`) `points` FROM `notary` WHERE `to`=? AND `deleted` IS NULL AND (`expire` IS NULL OR `expire` > CURRENT_TIMESTAMP) ORDER BY `from`, `method`, `when` DESC) AS p")) {
             query.setInt(1, getId());
 
index 6e48185568eee3b8bde60282dba52f68bab0aaea..1e8a38d46f1382df9525405c37995f1d9e5a50dc 100644 (file)
@@ -145,7 +145,7 @@ public class Organisation extends CertificateOwner {
     }
 
     public synchronized void addAdmin(User admin, User actor, boolean master) throws GigiApiException {
     }
 
     public synchronized void addAdmin(User admin, User actor, boolean master) throws GigiApiException {
-        if ( !admin.canAssure()) {
+        if ( !admin.canVerify()) {
             throw new GigiApiException("Cannot add person who is not RA Agent.");
         }
         if ( !actor.isInGroup(Group.ORGASSURER) && !isMaster(actor)) {
             throw new GigiApiException("Cannot add person who is not RA Agent.");
         }
         if ( !actor.isInGroup(Group.ORGASSURER) && !isMaster(actor)) {
index 1172c7e4ad540064f2cbd41c1fe18c9b054cf56a..9703fa8f55722956bd01293cbe51b290ac813d77 100644 (file)
@@ -14,9 +14,9 @@ import java.util.Set;
 import club.wpia.gigi.GigiApiException;
 import club.wpia.gigi.database.GigiPreparedStatement;
 import club.wpia.gigi.database.GigiResultSet;
 import club.wpia.gigi.GigiApiException;
 import club.wpia.gigi.database.GigiPreparedStatement;
 import club.wpia.gigi.database.GigiResultSet;
-import club.wpia.gigi.dbObjects.Assurance.AssuranceType;
 import club.wpia.gigi.dbObjects.CATS.CATSType;
 import club.wpia.gigi.dbObjects.Country.CountryCodeType;
 import club.wpia.gigi.dbObjects.CATS.CATSType;
 import club.wpia.gigi.dbObjects.Country.CountryCodeType;
+import club.wpia.gigi.dbObjects.Verification.VerificationType;
 import club.wpia.gigi.localisation.Language;
 import club.wpia.gigi.output.DateSelector;
 import club.wpia.gigi.pages.PasswordResetPage;
 import club.wpia.gigi.localisation.Language;
 import club.wpia.gigi.output.DateSelector;
 import club.wpia.gigi.pages.PasswordResetPage;
@@ -28,8 +28,8 @@ import club.wpia.gigi.util.PasswordStrengthChecker;
 import club.wpia.gigi.util.TimeConditions;
 
 /**
 import club.wpia.gigi.util.TimeConditions;
 
 /**
- * Represents an acting, assurable, user. Synchronizing on user means: no
- * name-change and no assurance.
+ * Represents an acting, verifiable user. Synchronizing on user means: no
+ * name-change and no verification.
  */
 public class User extends CertificateOwner {
 
  */
 public class User extends CertificateOwner {
 
@@ -39,9 +39,9 @@ public class User extends CertificateOwner {
 
     private String email;
 
 
     private String email;
 
-    private Assurance[] receivedAssurances;
+    private Verification[] receivedVerifications;
 
 
-    private Assurance[] madeAssurances;
+    private Verification[] madeVerifications;
 
     private Locale locale;
 
 
     private Locale locale;
 
@@ -152,7 +152,7 @@ public class User extends CertificateOwner {
 
     public void setDoB(DayDate dob) throws GigiApiException {
         synchronized (Notary.class) {
 
     public void setDoB(DayDate dob) throws GigiApiException {
         synchronized (Notary.class) {
-            if (getReceivedAssurances().length != 0) {
+            if (getReceivedVerifications().length != 0) {
                 throw new GigiApiException("No change after verification allowed.");
             }
 
                 throw new GigiApiException("No change after verification allowed.");
             }
 
@@ -205,7 +205,7 @@ public class User extends CertificateOwner {
         }
     }
 
         }
     }
 
-    public boolean canAssure() {
+    public boolean canVerify() {
         if (POJAM_ENABLED) {
             if ( !CalendarUtil.isOfAge(dob, POJAM_AGE)) { // PoJAM
                 return false;
         if (POJAM_ENABLED) {
             if ( !CalendarUtil.isOfAge(dob, POJAM_AGE)) { // PoJAM
                 return false;
@@ -215,7 +215,7 @@ public class User extends CertificateOwner {
                 return false;
             }
         }
                 return false;
             }
         }
-        if (getAssurancePoints() < 100) {
+        if (getVerificationPoints() < 100) {
             return false;
         }
 
             return false;
         }
 
@@ -226,7 +226,7 @@ public class User extends CertificateOwner {
     public boolean hasPassedCATS() {
         try (GigiPreparedStatement query = new GigiPreparedStatement("SELECT 1 FROM `cats_passed` where `user_id`=? AND `variant_id`=?")) {
             query.setInt(1, getId());
     public boolean hasPassedCATS() {
         try (GigiPreparedStatement query = new GigiPreparedStatement("SELECT 1 FROM `cats_passed` where `user_id`=? AND `variant_id`=?")) {
             query.setInt(1, getId());
-            query.setInt(2, CATSType.ASSURER_CHALLENGE.getId());
+            query.setInt(2, CATSType.AGENT_CHALLENGE.getId());
             try (GigiResultSet rs = query.executeQuery()) {
                 if (rs.next()) {
                     return true;
             try (GigiResultSet rs = query.executeQuery()) {
                 if (rs.next()) {
                     return true;
@@ -237,7 +237,7 @@ public class User extends CertificateOwner {
         }
     }
 
         }
     }
 
-    public int getAssurancePoints() {
+    public int getVerificationPoints() {
         try (GigiPreparedStatement query = new GigiPreparedStatement("SELECT SUM(lastpoints) FROM ( SELECT DISTINCT ON (`from`, `method`) `from`, `points` as lastpoints FROM `notary` INNER JOIN `names` ON `names`.`id`=`to` WHERE `notary`.`deleted` is NULL AND (`expire` IS NULL OR `expire` > CURRENT_TIMESTAMP) AND `names`.`uid` = ? ORDER BY `from`, `method`, `when` DESC) as p")) {
             query.setInt(1, getId());
 
         try (GigiPreparedStatement query = new GigiPreparedStatement("SELECT SUM(lastpoints) FROM ( SELECT DISTINCT ON (`from`, `method`) `from`, `points` as lastpoints FROM `notary` INNER JOIN `names` ON `names`.`id`=`to` WHERE `notary`.`deleted` is NULL AND (`expire` IS NULL OR `expire` > CURRENT_TIMESTAMP) AND `names`.`uid` = ? ORDER BY `from`, `method`, `when` DESC) as p")) {
             query.setInt(1, getId());
 
@@ -255,7 +255,7 @@ public class User extends CertificateOwner {
     public int getExperiencePoints() {
         try (GigiPreparedStatement query = new GigiPreparedStatement("SELECT count(*) FROM ( SELECT `names`.`uid` FROM `notary` INNER JOIN `names` ON `names`.`id` = `to` WHERE `from`=? AND `notary`.`deleted` IS NULL AND `method` = ? ::`notaryType` GROUP BY `names`.`uid`) as p")) {
             query.setInt(1, getId());
     public int getExperiencePoints() {
         try (GigiPreparedStatement query = new GigiPreparedStatement("SELECT count(*) FROM ( SELECT `names`.`uid` FROM `notary` INNER JOIN `names` ON `names`.`id` = `to` WHERE `from`=? AND `notary`.`deleted` IS NULL AND `method` = ? ::`notaryType` GROUP BY `names`.`uid`) as p")) {
             query.setInt(1, getId());
-            query.setEnum(2, AssuranceType.FACE_TO_FACE);
+            query.setEnum(2, VerificationType.FACE_TO_FACE);
 
             GigiResultSet rs = query.executeQuery();
             int points = 0;
 
             GigiResultSet rs = query.executeQuery();
             int points = 0;
@@ -269,13 +269,13 @@ public class User extends CertificateOwner {
     }
 
     /**
     }
 
     /**
-     * Gets the maximum allowed points NOW. Note that an assurance needs to
+     * Gets the maximum allowed points NOW. Note that a verification needs to
      * re-check PoJam as it has taken place in the past.
      * 
      * @return the maximal points @
      */
     @SuppressWarnings("unused")
      * re-check PoJam as it has taken place in the past.
      * 
      * @return the maximal points @
      */
     @SuppressWarnings("unused")
-    public int getMaxAssurePoints() {
+    public int getMaxVerifyPoints() {
         if ( !CalendarUtil.isOfAge(dob, ADULT_AGE) && POJAM_ENABLED) {
             return 10; // PoJAM
         }
         if ( !CalendarUtil.isOfAge(dob, ADULT_AGE) && POJAM_ENABLED) {
             return 10; // PoJAM
         }
@@ -304,7 +304,7 @@ public class User extends CertificateOwner {
 
     public boolean isValidName(String name) {
         for (Name n : getNames()) {
 
     public boolean isValidName(String name) {
         for (Name n : getNames()) {
-            if (n.matches(name) && n.getAssurancePoints() >= 50) {
+            if (n.matches(name) && n.getVerificationPoints() >= 50) {
                 return true;
             }
         }
                 return true;
             }
         }
@@ -349,51 +349,51 @@ public class User extends CertificateOwner {
         throw new GigiApiException("Email not one of user's email addresses.");
     }
 
         throw new GigiApiException("Email not one of user's email addresses.");
     }
 
-    public synchronized Assurance[] getReceivedAssurances() {
-        if (receivedAssurances == null) {
+    public synchronized Verification[] getReceivedVerifications() {
+        if (receivedVerifications == null) {
             try (GigiPreparedStatement query = new GigiPreparedStatement("SELECT * FROM `notary` INNER JOIN `names` ON `names`.`id` = `notary`.`to` WHERE `names`.`uid`=? AND `notary`.`deleted` IS NULL ORDER BY `when` DESC")) {
                 query.setInt(1, getId());
 
                 GigiResultSet res = query.executeQuery();
             try (GigiPreparedStatement query = new GigiPreparedStatement("SELECT * FROM `notary` INNER JOIN `names` ON `names`.`id` = `notary`.`to` WHERE `names`.`uid`=? AND `notary`.`deleted` IS NULL ORDER BY `when` DESC")) {
                 query.setInt(1, getId());
 
                 GigiResultSet res = query.executeQuery();
-                List<Assurance> assurances = new LinkedList<Assurance>();
+                List<Verification> verifications = new LinkedList<Verification>();
 
                 while (res.next()) {
 
                 while (res.next()) {
-                    assurances.add(assuranceByRes(res));
+                    verifications.add(verificationByRes(res));
                 }
 
                 }
 
-                this.receivedAssurances = assurances.toArray(new Assurance[0]);
+                this.receivedVerifications = verifications.toArray(new Verification[0]);
             }
         }
 
             }
         }
 
-        return receivedAssurances;
+        return receivedVerifications;
     }
 
     }
 
-    public synchronized Assurance[] getMadeAssurances() {
-        if (madeAssurances == null) {
+    public synchronized Verification[] getMadeVerifications() {
+        if (madeVerifications == null) {
             try (GigiPreparedStatement query = new GigiPreparedStatement("SELECT * FROM notary WHERE `from`=? AND deleted is NULL ORDER BY `when` DESC")) {
                 query.setInt(1, getId());
 
                 try (GigiResultSet res = query.executeQuery()) {
             try (GigiPreparedStatement query = new GigiPreparedStatement("SELECT * FROM notary WHERE `from`=? AND deleted is NULL ORDER BY `when` DESC")) {
                 query.setInt(1, getId());
 
                 try (GigiResultSet res = query.executeQuery()) {
-                    List<Assurance> assurances = new LinkedList<Assurance>();
+                    List<Verification> verifications = new LinkedList<Verification>();
 
                     while (res.next()) {
 
                     while (res.next()) {
-                        assurances.add(assuranceByRes(res));
+                        verifications.add(verificationByRes(res));
                     }
 
                     }
 
-                    this.madeAssurances = assurances.toArray(new Assurance[0]);
+                    this.madeVerifications = verifications.toArray(new Verification[0]);
                 }
             }
         }
 
                 }
             }
         }
 
-        return madeAssurances;
+        return madeVerifications;
     }
 
     }
 
-    public synchronized void invalidateMadeAssurances() {
-        madeAssurances = null;
+    public synchronized void invalidateMadeVerifications() {
+        madeVerifications = null;
     }
 
     }
 
-    public synchronized void invalidateReceivedAssurances() {
-        receivedAssurances = null;
+    public synchronized void invalidateReceivedVerifications() {
+        receivedVerifications = null;
     }
 
     private void rawUpdateUserData() {
     }
 
     private void rawUpdateUserData() {
@@ -615,9 +615,9 @@ public class User extends CertificateOwner {
         }
     }
 
         }
     }
 
-    private Assurance assuranceByRes(GigiResultSet res) {
+    private Verification verificationByRes(GigiResultSet res) {
         try {
         try {
-            return new Assurance(res.getInt("id"), User.getById(res.getInt("from")), Name.getById(res.getInt("to")), res.getString("location"), res.getString("method"), res.getInt("points"), res.getString("date"), res.getString("country") == null ? null : Country.getCountryByCode(res.getString("country"), CountryCodeType.CODE_2_CHARS), res.getTimestamp("expire"));
+            return new Verification(res.getInt("id"), User.getById(res.getInt("from")), Name.getById(res.getInt("to")), res.getString("location"), res.getString("method"), res.getInt("points"), res.getString("date"), res.getString("country") == null ? null : Country.getCountryByCode(res.getString("country"), CountryCodeType.CODE_2_CHARS), res.getTimestamp("expire"));
         } catch (GigiApiException e) {
             throw new Error(e);
         }
         } catch (GigiApiException e) {
             throw new Error(e);
         }
similarity index 87%
rename from src/club/wpia/gigi/dbObjects/Assurance.java
rename to src/club/wpia/gigi/dbObjects/Verification.java
index 77d8098b7038f3c2603163e037ce6b9fbc1ad4ac..3edaa57070353b715dc3373f17f85893cae19963 100644 (file)
@@ -6,14 +6,14 @@ import club.wpia.gigi.database.DBEnum;
 import club.wpia.gigi.dbObjects.wrappers.DataContainer;
 
 @DataContainer
 import club.wpia.gigi.dbObjects.wrappers.DataContainer;
 
 @DataContainer
-public class Assurance {
+public class Verification {
 
 
-    public enum AssuranceType implements DBEnum {
+    public enum VerificationType implements DBEnum {
         FACE_TO_FACE("Face to Face Meeting"), TOPUP("TOPUP"), TTP_ASSISTED("TTP-Assisted"), NUCLEUS("Nucleus Bonus");
 
         private final String description;
 
         FACE_TO_FACE("Face to Face Meeting"), TOPUP("TOPUP"), TTP_ASSISTED("TTP-Assisted"), NUCLEUS("Nucleus Bonus");
 
         private final String description;
 
-        private AssuranceType(String description) {
+        private VerificationType(String description) {
             this.description = description;
         }
 
             this.description = description;
         }
 
@@ -45,7 +45,7 @@ public class Assurance {
 
     private Date expireDate;
 
 
     private Date expireDate;
 
-    public Assurance(int id, User from, Name to, String location, String method, int points, String date, Country country, Date expireDate) {
+    public Verification(int id, User from, Name to, String location, String method, int points, String date, Country country, Date expireDate) {
         this.id = id;
         this.from = from;
         this.to = to;
         this.id = id;
         this.from = from;
         this.to = to;
similarity index 52%
rename from src/club/wpia/gigi/output/AssurancesDisplay.java
rename to src/club/wpia/gigi/output/VerificationsDisplay.java
index 84822dd61632f045aaacefc09fa9c266347c658c..f3b804489790f3ab666eb301c35b6bca81594671 100644 (file)
@@ -3,33 +3,33 @@ package club.wpia.gigi.output;
 import java.io.PrintWriter;
 import java.util.Map;
 
 import java.io.PrintWriter;
 import java.util.Map;
 
-import club.wpia.gigi.dbObjects.Assurance;
 import club.wpia.gigi.dbObjects.Name;
 import club.wpia.gigi.dbObjects.Name;
+import club.wpia.gigi.dbObjects.Verification;
 import club.wpia.gigi.localisation.Language;
 import club.wpia.gigi.output.template.IterableDataset;
 import club.wpia.gigi.output.template.Outputable;
 import club.wpia.gigi.output.template.Template;
 
 import club.wpia.gigi.localisation.Language;
 import club.wpia.gigi.output.template.IterableDataset;
 import club.wpia.gigi.output.template.Outputable;
 import club.wpia.gigi.output.template.Template;
 
-public class AssurancesDisplay implements Outputable {
+public class VerificationsDisplay implements Outputable {
 
 
-    private static final Template template = new Template(AssurancesDisplay.class.getResource("AssurancesDisplay.templ"));
+    private static final Template template = new Template(VerificationsDisplay.class.getResource("VerificationsDisplay.templ"));
 
 
-    private boolean assurer;
+    private boolean agent;
 
 
-    public String assuranceArray;
+    public String verificationArray;
 
     private boolean support;
 
 
     private boolean support;
 
-    public AssurancesDisplay(String assuranceArray, boolean assurer, boolean support) {
-        this.assuranceArray = assuranceArray;
-        this.assurer = assurer;
+    public VerificationsDisplay(String verificationArray, boolean agent, boolean support) {
+        this.verificationArray = verificationArray;
+        this.agent = agent;
         this.support = support;
     }
 
     @Override
     public void output(PrintWriter out, Language l, Map<String, Object> vars) {
         this.support = support;
     }
 
     @Override
     public void output(PrintWriter out, Language l, Map<String, Object> vars) {
-        final Assurance[] assurances = (Assurance[]) vars.get(assuranceArray);
-        if (assurer) {
+        final Verification[] verifications = (Verification[]) vars.get(verificationArray);
+        if (agent) {
             vars.put("verb", l.getTranslation("To (User Id)"));
             vars.put("info", "");
         } else {
             vars.put("verb", l.getTranslation("To (User Id)"));
             vars.put("info", "");
         } else {
@@ -38,39 +38,39 @@ public class AssurancesDisplay implements Outputable {
             vars.put("info", l.getTranslation("Coloured rows show expired nucleus bonus verifications which are not counted to the total of verification points."));
         }
 
             vars.put("info", l.getTranslation("Coloured rows show expired nucleus bonus verifications which are not counted to the total of verification points."));
         }
 
-        IterableDataset assuranceGroup = new IterableDataset() {
+        IterableDataset verificationsGroup = new IterableDataset() {
 
             private int i = 0;
 
             @Override
             public boolean next(Language l, Map<String, Object> vars) {
 
             private int i = 0;
 
             @Override
             public boolean next(Language l, Map<String, Object> vars) {
-                if (i >= assurances.length) {
+                if (i >= verifications.length) {
                     return false;
                 } else {
                     return false;
                 } else {
-                    Assurance assurance = assurances[i];
+                    Verification verification = verifications[i];
                     vars.put("support", support);
                     vars.put("support", support);
-                    vars.put("id", assurance.getId());
-                    vars.put("method", assurance.getMethod());
-                    Name to = assurance.getTo();
-                    if (assurer) {
+                    vars.put("id", verification.getId());
+                    vars.put("method", verification.getMethod());
+                    Name to = verification.getTo();
+                    if (agent) {
                         vars.put("linkId", to == null ? "" : to.getOwner().getId());
                         vars.put("verbVal", to == null ? l.getTranslation("applicant's name removed") : to.getOwner().getId());
                         vars.put("myName", to == null ? l.getTranslation("applicant's name removed") : to);
                     } else {
                         vars.put("linkId", to == null ? "" : to.getOwner().getId());
                         vars.put("verbVal", to == null ? l.getTranslation("applicant's name removed") : to.getOwner().getId());
                         vars.put("myName", to == null ? l.getTranslation("applicant's name removed") : to);
                     } else {
-                        vars.put("linkId", assurance.getFrom().getId());
-                        vars.put("verbVal", assurance.getFrom().getPreferredName());
+                        vars.put("linkId", verification.getFrom().getId());
+                        vars.put("verbVal", verification.getFrom().getPreferredName());
                         vars.put("myName", to == null ? l.getTranslation("own name removed") : to);
                     }
                         vars.put("myName", to == null ? l.getTranslation("own name removed") : to);
                     }
-                    vars.put("date", assurance.getDate());
-                    vars.put("location", assurance.getLocation() + " (" + (assurance.getCountry() == null ? l.getTranslation("not given") : assurance.getCountry().getName()) + ")");
-                    vars.put("points", assurance.getPoints());
-                    vars.put("expired", assurance.isExpired());
+                    vars.put("date", verification.getDate());
+                    vars.put("location", verification.getLocation() + " (" + (verification.getCountry() == null ? l.getTranslation("not given") : verification.getCountry().getName()) + ")");
+                    vars.put("points", verification.getPoints());
+                    vars.put("expired", verification.isExpired());
                     i++;
                     return true;
                 }
             }
         };
                     i++;
                     return true;
                 }
             }
         };
-        vars.put("assurances", assuranceGroup);
+        vars.put("verifications", verificationsGroup);
         template.output(out, l, vars);
     }
 
         template.output(out, l, vars);
     }
 
similarity index 93%
rename from src/club/wpia/gigi/output/AssurancesDisplay.templ
rename to src/club/wpia/gigi/output/VerificationsDisplay.templ
index 41f9fd871e0bfb7290eedb8613da8ccf1fbc1293..5ab4453264f5bc91e2552a5b1a267bdae5cfa721 100644 (file)
@@ -11,7 +11,7 @@
 <td><?=_Location?></td>
 <td><?=_Method?></td>
 </tr>
 <td><?=_Location?></td>
 <td><?=_Method?></td>
 </tr>
-<? foreach($assurances) {?>
+<? foreach($verifications) {?>
 <tr <? if($expired) { ?> class="info" <? } ?> >
 <? if($support) { ?>
 <td><a href="/support/user/<?=$linkId?>/"><?=$id?></a></td>
 <tr <? if($expired) { ?> class="info" <? } ?> >
 <? if($support) { ?>
 <td><a href="/support/user/<?=$linkId?>/"><?=$id?></a></td>
index 4af7c94aa01ba7ee13d4088d9f6d89a202cdeb4c..e4834a150016d4a309af154efd28ee6a08a575ac 100644 (file)
@@ -22,7 +22,7 @@ import club.wpia.gigi.output.template.Template;
 
 public class MyDetailsForm extends Form {
 
 
 public class MyDetailsForm extends Form {
 
-    private static final Template assured = new Template(MyDetails.class.getResource("MyDetailsFormAssured.templ"));
+    private static final Template verified = new Template(MyDetails.class.getResource("MyDetailsFormVerified.templ"));
 
     private static final Template templ = new Template(MyDetailsForm.class.getResource("MyDetailsForm.templ"));
 
 
     private static final Template templ = new Template(MyDetailsForm.class.getResource("MyDetailsForm.templ"));
 
@@ -140,7 +140,7 @@ public class MyDetailsForm extends Form {
                 }
                 vars.put("name", t);
                 vars.put("id", t.getId());
                 }
                 vars.put("name", t);
                 vars.put("id", t.getId());
-                vars.put("npoints", Integer.toString(t.getAssurancePoints()));
+                vars.put("npoints", Integer.toString(t.getVerificationPoints()));
             }
 
         });
             }
 
         });
@@ -148,12 +148,12 @@ public class MyDetailsForm extends Form {
         names.output(out, l, vars);
 
         vars.put("residenceCountry", cs);
         names.output(out, l, vars);
 
         vars.put("residenceCountry", cs);
-        if (target.getReceivedAssurances().length == 0) {
+        if (target.getReceivedVerifications().length == 0) {
             vars.put("DoB", ds);
             templ.output(out, l, vars);
         } else {
             vars.put("DoB", target.getDoB());
             vars.put("DoB", ds);
             templ.output(out, l, vars);
         } else {
             vars.put("DoB", target.getDoB());
-            assured.output(out, l, vars);
+            verified.output(out, l, vars);
         }
 
         final Set<Group> gr = target.getGroups();
         }
 
         final Set<Group> gr = target.getGroups();
index 2755b18f974870902e1bdde2b8286c03db883d12..912f316e5c0ed1c054fd00c66e35b533726ad0db 100644 (file)
@@ -111,7 +111,7 @@ public class CertificateRequest {
         this.ctx = ctx;
         if (cp != null) {
             profile = cp;
         this.ctx = ctx;
         if (cp != null) {
             profile = cp;
-        } else if (ctx.getActor().getAssurancePoints() > 50) {
+        } else if (ctx.getActor().getVerificationPoints() > 50) {
             profile = CertificateProfile.getByName("client-a");
         }
         byte[] data = PEM.decode("(NEW )?CERTIFICATE REQUEST", csr);
             profile = CertificateProfile.getByName("client-a");
         }
         byte[] data = PEM.decode("(NEW )?CERTIFICATE REQUEST", csr);
@@ -160,7 +160,7 @@ public class CertificateRequest {
                 } else if (c instanceof ExtendedKeyUsageExtension) {
                     ExtendedKeyUsageExtension ekue = (ExtendedKeyUsageExtension) c;
                     String appendix = "";
                 } else if (c instanceof ExtendedKeyUsageExtension) {
                     ExtendedKeyUsageExtension ekue = (ExtendedKeyUsageExtension) c;
                     String appendix = "";
-                    if (ctx.getActor().getAssurancePoints() >= 50) {
+                    if (ctx.getActor().getVerificationPoints() >= 50) {
                         appendix = "-a";
                     }
                     for (String s : ekue.getExtendedKeyUsage()) {
                         appendix = "-a";
                     }
                     for (String s : ekue.getExtendedKeyUsage()) {
index 7439ae67a5a36b76da9ad6e76899e6948f03cddc..a7b1be77b4fbe9332cc834eab9b12ab8ba449d56 100644 (file)
@@ -84,13 +84,13 @@ public class SupportUserDetailsForm extends Form {
             @Override
             public void apply(Name t, Language l, Map<String, Object> vars) {
                 vars.put("name", t);
             @Override
             public void apply(Name t, Language l, Map<String, Object> vars) {
                 vars.put("name", t);
-                vars.put("points", Integer.toString(t.getAssurancePoints()));
+                vars.put("points", Integer.toString(t.getVerificationPoints()));
             }
 
         });
             }
 
         });
-        vars.put("assurer", user.canAssure());
+        vars.put("agent", user.canVerify());
         vars.put("dob", dobSelector);
         vars.put("dob", dobSelector);
-        vars.put("assurancepoints", user.getAssurancePoints());
+        vars.put("verificationPoints", user.getVerificationPoints());
         vars.put("exppoints", user.getExperiencePoints());
         final Set<Group> gr = user.getGroups();
         vars.put("support-groups", new GroupIterator(gr.iterator(), true));
         vars.put("exppoints", user.getExperiencePoints());
         final Set<Group> gr = user.getGroups();
         vars.put("support-groups", new GroupIterator(gr.iterator(), true));
index 03be88e7dddd2bf90494b7973aea0630b5fbefe6..1a75afd7d3c9ddffb86b18da843d2d4a1c319201 100644 (file)
@@ -25,7 +25,7 @@
         <tr>
             <td><?=_Is RA Agent?>:</td>
             <td>
         <tr>
             <td><?=_Is RA Agent?>:</td>
             <td>
-                <? if($assurer) { ?>
+                <? if($agent) { ?>
                 <?=_Yes?>
                 <? } else { ?>
                 <?=_No?>
                 <?=_Yes?>
                 <? } else { ?>
                 <?=_No?>
@@ -34,7 +34,7 @@
         </tr>
         <tr>
             <td><?=_Verification Points?>:</td>
         </tr>
         <tr>
             <td><?=_Verification Points?>:</td>
-            <td><?=$assurancepoints?> (<a href="./points"><?=_Show?></a>)</td>
+            <td><?=$verificationPoints?> (<a href="./points"><?=_Show?></a>)</td>
         </tr>
         <tr>
             <td><?=_Experience Points?>:</td>
         </tr>
         <tr>
             <td><?=_Experience Points?>:</td>
index 5ac524042c78c17c7be30131b1f719fcd11c5f00..58ab93bfecd1a03b257c638674a4f9fd8e688fbc 100644 (file)
@@ -38,7 +38,7 @@ public class AffiliationForm extends Form {
             }
         } else if (req.getParameter("do_affiliate") != null) {
             User byEmail = User.getByEmail(req.getParameter("email"));
             }
         } else if (req.getParameter("do_affiliate") != null) {
             User byEmail = User.getByEmail(req.getParameter("email"));
-            if (byEmail != null && byEmail.canAssure()) {
+            if (byEmail != null && byEmail.canVerify()) {
                 o.addAdmin(byEmail, LoginPage.getUser(req), req.getParameter("master") != null);
                 return new RedirectResult(ViewOrgPage.DEFAULT_PATH + "/" + o.getId());
             } else {
                 o.addAdmin(byEmail, LoginPage.getUser(req), req.getParameter("master") != null);
                 return new RedirectResult(ViewOrgPage.DEFAULT_PATH + "/" + o.getId());
             } else {
index 8c45fef5fb936042aeedfc0573a9a9d4a5c1e769..a4f129a2eed512d871051141514cd17ba6efce10 100644 (file)
@@ -12,7 +12,7 @@ import club.wpia.gigi.util.AuthorizationContext;
 
 public class CreateOrgPage extends ManagedFormPage {
 
 
 public class CreateOrgPage extends ManagedFormPage {
 
-    public static final Group ORG_ASSURER = Group.ORGASSURER;
+    public static final Group ORG_AGENT = Group.ORGASSURER;
 
     public static final String DEFAULT_PATH = "/orga/new";
 
 
     public static final String DEFAULT_PATH = "/orga/new";
 
@@ -22,7 +22,7 @@ public class CreateOrgPage extends ManagedFormPage {
 
     @Override
     public boolean isPermitted(AuthorizationContext ac) {
 
     @Override
     public boolean isPermitted(AuthorizationContext ac) {
-        return ac != null && ac.isInGroup(ORG_ASSURER);
+        return ac != null && ac.isInGroup(ORG_AGENT);
     }
 
     @Override
     }
 
     @Override
index ec4fb365a634c56c06ae9afd7f4bcdd265036ba4..d676c1de567977e9fa08a17b2a41258d5bb91a2c 100644 (file)
@@ -35,7 +35,7 @@ public class ViewOrgPage extends ManagedMultiFormPage {
 
     @Override
     public boolean isPermitted(AuthorizationContext ac) {
 
     @Override
     public boolean isPermitted(AuthorizationContext ac) {
-        return ac != null && (ac.isInGroup(CreateOrgPage.ORG_ASSURER) || ac.getActor().getOrganisations(true).size() != 0);
+        return ac != null && (ac.isInGroup(CreateOrgPage.ORG_AGENT) || ac.getActor().getOrganisations(true).size() != 0);
     }
 
     @Override
     }
 
     @Override
@@ -43,7 +43,7 @@ public class ViewOrgPage extends ManagedMultiFormPage {
         if (req.getParameter("do_affiliate") != null || req.getParameter("del") != null) {
             return Form.getForm(req, AffiliationForm.class);
         } else {
         if (req.getParameter("do_affiliate") != null || req.getParameter("del") != null) {
             return Form.getForm(req, AffiliationForm.class);
         } else {
-            if ( !getUser(req).isInGroup(CreateOrgPage.ORG_ASSURER)) {
+            if ( !getUser(req).isInGroup(CreateOrgPage.ORG_AGENT)) {
                 return null;
             }
 
                 return null;
             }
 
@@ -67,7 +67,7 @@ public class ViewOrgPage extends ManagedMultiFormPage {
             final Organisation[] orgList = Organisation.getOrganisations(0, 30);
             HashMap<String, Object> map = new HashMap<>();
             final List<Organisation> myOrgs = u.getOrganisations(true);
             final Organisation[] orgList = Organisation.getOrganisations(0, 30);
             HashMap<String, Object> map = new HashMap<>();
             final List<Organisation> myOrgs = u.getOrganisations(true);
-            final boolean orgAss = u.isInGroup(CreateOrgPage.ORG_ASSURER);
+            final boolean orgAss = u.isInGroup(CreateOrgPage.ORG_AGENT);
             if (orgAss) {
                 map.put("orgas", makeOrgDataset(orgList));
             } else {
             if (orgAss) {
                 map.put("orgas", makeOrgDataset(orgList));
             } else {
@@ -86,7 +86,7 @@ public class ViewOrgPage extends ManagedMultiFormPage {
             return;
         }
         final List<Organisation> myOrgs = u.getOrganisations();
             return;
         }
         final List<Organisation> myOrgs = u.getOrganisations();
-        final boolean orgAss = u.isInGroup(CreateOrgPage.ORG_ASSURER);
+        final boolean orgAss = u.isInGroup(CreateOrgPage.ORG_AGENT);
         if ( !orgAss && !myOrgs.contains(o)) {
             resp.sendError(404);
             return;
         if ( !orgAss && !myOrgs.contains(o)) {
             resp.sendError(404);
             return;
index 039d39d971f8d110fb7d18f49fc2ca589b0c26ca..c6802cac7e2cde7d5b35cc3ddc5d7487702ef056 100644 (file)
@@ -7,7 +7,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import club.wpia.gigi.dbObjects.User;
 import javax.servlet.http.HttpServletResponse;
 
 import club.wpia.gigi.dbObjects.User;
-import club.wpia.gigi.output.AssurancesDisplay;
+import club.wpia.gigi.output.VerificationsDisplay;
 import club.wpia.gigi.pages.Page;
 import club.wpia.gigi.util.AuthorizationContext;
 
 import club.wpia.gigi.pages.Page;
 import club.wpia.gigi.util.AuthorizationContext;
 
@@ -21,15 +21,15 @@ public class Points extends Page {
 
     private boolean support;
 
 
     private boolean support;
 
-    private AssurancesDisplay myDisplay;
+    private VerificationsDisplay myDisplay;
 
 
-    private AssurancesDisplay toOtherDisplay;
+    private VerificationsDisplay toOtherDisplay;
 
     public Points(boolean support) {
         super(support ? "Support User Points" : "Points");
         this.support = support;
 
     public Points(boolean support) {
         super(support ? "Support User Points" : "Points");
         this.support = support;
-        myDisplay = new AssurancesDisplay("asArr", false, support);
-        toOtherDisplay = new AssurancesDisplay("otherAsArr", true, support);
+        myDisplay = new VerificationsDisplay("asArr", false, support);
+        toOtherDisplay = new VerificationsDisplay("otherAsArr", true, support);
     }
 
     @Override
     }
 
     @Override
@@ -52,12 +52,12 @@ public class Points extends Page {
         vars.put("username", user.getPreferredName().toString());
         vars.put("pointlist", myDisplay);
         vars.put("madelist", toOtherDisplay);
         vars.put("username", user.getPreferredName().toString());
         vars.put("pointlist", myDisplay);
         vars.put("madelist", toOtherDisplay);
-        vars.put("asArr", user.getReceivedAssurances());
-        vars.put("otherAsArr", user.getMadeAssurances());
-        vars.put("assP", user.getAssurancePoints());
-        if (user.canAssure()) {
+        vars.put("asArr", user.getReceivedVerifications());
+        vars.put("otherAsArr", user.getMadeVerifications());
+        vars.put("assP", user.getVerificationPoints());
+        if (user.canVerify()) {
             vars.put("expP", user.getExperiencePoints());
             vars.put("expP", user.getExperiencePoints());
-            vars.put("maxP", user.getMaxAssurePoints());
+            vars.put("maxP", user.getMaxVerifyPoints());
         }
         getDefaultTemplate().output(resp.getWriter(), getLanguage(req), vars);
     }
         }
         getDefaultTemplate().output(resp.getWriter(), getLanguage(req), vars);
     }
index cdabde5ef9ded79e393ed274b9cc42bfc2f6f438..558ba3a5e805833555ce8f06a7b471a99c42e322 100644 (file)
@@ -6,7 +6,7 @@ import java.util.Map;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import club.wpia.gigi.dbObjects.Assurance;
+import club.wpia.gigi.dbObjects.Verification;
 import club.wpia.gigi.dbObjects.User;
 import club.wpia.gigi.output.template.Form;
 import club.wpia.gigi.pages.LoginPage;
 import club.wpia.gigi.dbObjects.User;
 import club.wpia.gigi.output.template.Form;
 import club.wpia.gigi.pages.LoginPage;
@@ -40,10 +40,10 @@ public class RequestTTPPage extends Page {
         if (u.isInGroup(RequestTTPForm.TTP_APPLICANT)) {
             map.put("inProgress", true);
         } else {
         if (u.isInGroup(RequestTTPForm.TTP_APPLICANT)) {
             map.put("inProgress", true);
         } else {
-            if (u.getAssurancePoints() < 100) {
+            if (u.getVerificationPoints() < 100) {
                 int ttpCount = 0;
                 int ttpCount = 0;
-                for (Assurance a : u.getReceivedAssurances()) {
-                    if (a.getMethod().equals(Assurance.AssuranceType.TTP_ASSISTED.getDescription())) {
+                for (Verification a : u.getReceivedVerifications()) {
+                    if (a.getMethod().equals(Verification.VerificationType.TTP_ASSISTED.getDescription())) {
                         ttpCount++;
                     }
                 }
                         ttpCount++;
                     }
                 }
similarity index 74%
rename from src/club/wpia/gigi/pages/wot/AssuranceForm.java
rename to src/club/wpia/gigi/pages/wot/VerificationForm.java
index 7df71a782899a7d877e72b06d813fb2a881d60dd..7a8a558cdf114f36261d284f0727bf7cdfeae534 100644 (file)
@@ -12,9 +12,9 @@ import java.util.Map;
 import javax.servlet.http.HttpServletRequest;
 
 import club.wpia.gigi.GigiApiException;
 import javax.servlet.http.HttpServletRequest;
 
 import club.wpia.gigi.GigiApiException;
-import club.wpia.gigi.dbObjects.Assurance.AssuranceType;
 import club.wpia.gigi.dbObjects.Name;
 import club.wpia.gigi.dbObjects.User;
 import club.wpia.gigi.dbObjects.Name;
 import club.wpia.gigi.dbObjects.User;
+import club.wpia.gigi.dbObjects.Verification.VerificationType;
 import club.wpia.gigi.localisation.Language;
 import club.wpia.gigi.output.ArrayIterable;
 import club.wpia.gigi.output.CountrySelector;
 import club.wpia.gigi.localisation.Language;
 import club.wpia.gigi.output.ArrayIterable;
 import club.wpia.gigi.output.CountrySelector;
@@ -29,7 +29,7 @@ import club.wpia.gigi.pages.PasswordResetPage;
 import club.wpia.gigi.util.DayDate;
 import club.wpia.gigi.util.Notary;
 
 import club.wpia.gigi.util.DayDate;
 import club.wpia.gigi.util.Notary;
 
-public class AssuranceForm extends Form {
+public class VerificationForm extends Form {
 
     public static class ConcatOutputable implements Outputable {
 
 
     public static class ConcatOutputable implements Outputable {
 
@@ -50,9 +50,9 @@ public class AssuranceForm extends Form {
         }
     }
 
         }
     }
 
-    private User assuree;
+    private User applicant;
 
 
-    private Name[] assureeNames;
+    private Name[] applicantNames;
 
     private boolean[] selected;
 
 
     private boolean[] selected;
 
@@ -64,39 +64,39 @@ public class AssuranceForm extends Form {
 
     private String aword;
 
 
     private String aword;
 
-    private User assurer;
+    private User agent;
 
 
-    private AssuranceType type = AssuranceType.FACE_TO_FACE;
+    private VerificationType type = VerificationType.FACE_TO_FACE;
 
 
-    private static final Template templ = new Template(AssuranceForm.class.getResource("AssuranceForm.templ"));
+    private static final Template templ = new Template(VerificationForm.class.getResource("VerificationForm.templ"));
 
     private CountrySelector cs;
 
 
     private CountrySelector cs;
 
-    public AssuranceForm(HttpServletRequest hsr, User assuree) throws GigiApiException {
+    public VerificationForm(HttpServletRequest hsr, User applicant) throws GigiApiException {
         super(hsr);
         super(hsr);
-        assurer = Page.getUser(hsr);
-        this.assuree = assuree;
+        agent = Page.getUser(hsr);
+        this.applicant = applicant;
 
 
-        if (assurer.getId() == assuree.getId()) {
+        if (agent.getId() == applicant.getId()) {
             throw new GigiApiException("You cannot verify yourself.");
         }
             throw new GigiApiException("You cannot verify yourself.");
         }
-        if ( !assurer.canAssure()) {
+        if ( !agent.canVerify()) {
             throw new GigiApiException("You are not a RA-Agent.");
         }
 
             throw new GigiApiException("You are not a RA-Agent.");
         }
 
-        Name[] initialNames = this.assuree.getNonDeprecatedNames();
+        Name[] initialNames = this.applicant.getNonDeprecatedNames();
         LinkedList<Name> names = new LinkedList<>();
         for (Name name : initialNames) {
         LinkedList<Name> names = new LinkedList<>();
         for (Name name : initialNames) {
-            if (Notary.checkAssuranceIsPossible(assurer, name)) {
+            if (Notary.checkVerificationIsPossible(agent, name)) {
                 names.add(name);
             }
         }
         if (names.size() == 0) {
             throw new GigiApiException(SprintfCommand.createSimple("You have already verified all names of this applicant within the last {0} days.", Notary.LIMIT_DAYS_VERIFICATION));
         }
                 names.add(name);
             }
         }
         if (names.size() == 0) {
             throw new GigiApiException(SprintfCommand.createSimple("You have already verified all names of this applicant within the last {0} days.", Notary.LIMIT_DAYS_VERIFICATION));
         }
-        assureeNames = names.toArray(new Name[names.size()]);
-        dob = this.assuree.getDoB();
-        selected = new boolean[assureeNames.length];
+        applicantNames = names.toArray(new Name[names.size()]);
+        dob = this.applicant.getDoB();
+        selected = new boolean[applicantNames.length];
         cs = new CountrySelector("countryCode", false);
     }
 
         cs = new CountrySelector("countryCode", false);
     }
 
@@ -108,7 +108,7 @@ public class AssuranceForm extends Form {
     public void outputContent(PrintWriter out, Language l, Map<String, Object> vars) {
         HashMap<String, Object> res = new HashMap<String, Object>(vars);
         res.putAll(vars);
     public void outputContent(PrintWriter out, Language l, Map<String, Object> vars) {
         HashMap<String, Object> res = new HashMap<String, Object>(vars);
         res.putAll(vars);
-        res.put("names", new ArrayIterable<Name>(assureeNames) {
+        res.put("names", new ArrayIterable<Name>(applicantNames) {
 
             @Override
             public void apply(Name t, Language l, Map<String, Object> vars) {
 
             @Override
             public void apply(Name t, Language l, Map<String, Object> vars) {
@@ -118,33 +118,33 @@ public class AssuranceForm extends Form {
             }
 
         });
             }
 
         });
-        res.put("name", assuree.getPreferredName().toString());
-        res.put("maxpoints", assurer.getMaxAssurePoints());
-        res.put("dob", sdf.format(assuree.getDoB().toDate()));
-        res.put("dobFmt2", sdf2.format(assuree.getDoB().toDate()));
+        res.put("name", applicant.getPreferredName().toString());
+        res.put("maxpoints", agent.getMaxVerifyPoints());
+        res.put("dob", sdf.format(applicant.getDoB().toDate()));
+        res.put("dobFmt2", sdf2.format(applicant.getDoB().toDate()));
         res.put("location", location);
         res.put("date", date);
         res.put("aword", aword);
         res.put("countryCode", cs);
 
         res.put("location", location);
         res.put("date", date);
         res.put("aword", aword);
         res.put("countryCode", cs);
 
-        final LinkedList<AssuranceType> ats = new LinkedList<>();
-        for (AssuranceType at : AssuranceType.values()) {
+        final LinkedList<VerificationType> ats = new LinkedList<>();
+        for (VerificationType at : VerificationType.values()) {
             try {
             try {
-                Notary.may(assurer, assuree, at);
+                Notary.may(agent, applicant, at);
                 ats.add(at);
             } catch (GigiApiException e) {
             }
         }
         res.put("ats", new IterableDataset() {
 
                 ats.add(at);
             } catch (GigiApiException e) {
             }
         }
         res.put("ats", new IterableDataset() {
 
-            Iterator<AssuranceType> t = ats.iterator();
+            Iterator<VerificationType> t = ats.iterator();
 
             @Override
             public boolean next(Language l, Map<String, Object> vars) {
                 if ( !t.hasNext()) {
                     return false;
                 }
 
             @Override
             public boolean next(Language l, Map<String, Object> vars) {
                 if ( !t.hasNext()) {
                     return false;
                 }
-                AssuranceType t1 = t.next();
+                VerificationType t1 = t.next();
                 vars.put("type", t1.getDescription());
                 vars.put("id", t1.toString());
                 vars.put("sel", t1 == type ? " selected" : "");
                 vars.put("type", t1.getDescription());
                 vars.put("id", t1.toString());
                 vars.put("sel", t1 == type ? " selected" : "");
@@ -175,10 +175,10 @@ public class AssuranceForm extends Form {
         } else {
             aword = null;
         }
         } else {
             aword = null;
         }
-        String val = req.getParameter("assuranceType");
+        String val = req.getParameter("verificationType");
         if (val != null) {
             try {
         if (val != null) {
             try {
-                type = AssuranceType.valueOf(val);
+                type = VerificationType.valueOf(val);
             } catch (IllegalArgumentException e) {
                 gae.mergeInto(new GigiApiException("Verification Type wrong."));
             }
             } catch (IllegalArgumentException e) {
                 gae.mergeInto(new GigiApiException("Verification Type wrong."));
             }
@@ -195,10 +195,10 @@ public class AssuranceForm extends Form {
                 gae.mergeInto(new GigiApiException("The points entered were not a number."));
             }
         }
                 gae.mergeInto(new GigiApiException("The points entered were not a number."));
             }
         }
-        String[] parameterValues = req.getParameterValues("assuredName");
+        String[] parameterValues = req.getParameterValues("verifiedName");
         HashSet<String> data = new HashSet<>(Arrays.asList(parameterValues == null ? new String[0] : parameterValues));
         HashSet<String> data = new HashSet<>(Arrays.asList(parameterValues == null ? new String[0] : parameterValues));
-        for (int i = 0; i < assureeNames.length; i++) {
-            selected[i] = data.contains(Integer.toString(assureeNames[i].getId()));
+        for (int i = 0; i < applicantNames.length; i++) {
+            selected[i] = data.contains(Integer.toString(applicantNames[i].getId()));
         }
 
         if ( !gae.isEmpty()) {
         }
 
         if ( !gae.isEmpty()) {
@@ -208,20 +208,20 @@ public class AssuranceForm extends Form {
         LinkedList<Name> toAssure = new LinkedList<Name>();
         for (int i = 0; i < selected.length; i++) {
             if (selected[i]) {
         LinkedList<Name> toAssure = new LinkedList<Name>();
         for (int i = 0; i < selected.length; i++) {
             if (selected[i]) {
-                toAssure.add(assureeNames[i]);
+                toAssure.add(applicantNames[i]);
             }
         }
         if (toAssure.size() == 0) {
             throw new GigiApiException("You must confirm at least one name to verify an account.");
         }
 
             }
         }
         if (toAssure.size() == 0) {
             throw new GigiApiException("You must confirm at least one name to verify an account.");
         }
 
-        Notary.assureAll(assurer, assuree, dob, pointsI, location, req.getParameter("date"), type, toAssure.toArray(new Name[toAssure.size()]), cs.getCountry());
+        Notary.verifyAll(agent, applicant, dob, pointsI, location, req.getParameter("date"), type, toAssure.toArray(new Name[toAssure.size()]), cs.getCountry());
         Outputable result = new TranslateCommand("Verification complete.");
         if (isWithPasswordReset()) {
         Outputable result = new TranslateCommand("Verification complete.");
         if (isWithPasswordReset()) {
-            Language langApplicant = Language.getInstance(assuree.getPreferredLocale());
+            Language langApplicant = Language.getInstance(applicant.getPreferredLocale());
             String method = langApplicant.getTranslation("A password reset was triggered. If you did a password reset by verification, please enter your secret password using this form:");
             String subject = langApplicant.getTranslation("Password reset by verification");
             String method = langApplicant.getTranslation("A password reset was triggered. If you did a password reset by verification, please enter your secret password using this form:");
             String subject = langApplicant.getTranslation("Password reset by verification");
-            PasswordResetPage.initPasswordResetProcess(assuree, req, aword, langApplicant, method, subject);
+            PasswordResetPage.initPasswordResetProcess(applicant, req, aword, langApplicant, method, subject);
             result = new ConcatOutputable(result, new TranslateCommand("Password reset successful."));
         }
         return new SuccessMessageResult(result);
             result = new ConcatOutputable(result, new TranslateCommand("Password reset successful."));
         }
         return new SuccessMessageResult(result);
@@ -231,8 +231,8 @@ public class AssuranceForm extends Form {
         return aword != null && !aword.equals("");
     }
 
         return aword != null && !aword.equals("");
     }
 
-    public User getAssuree() {
-        return assuree;
+    public User getApplicant() {
+        return applicant;
     }
 
 }
     }
 
 }
similarity index 91%
rename from src/club/wpia/gigi/pages/wot/AssuranceForm.templ
rename to src/club/wpia/gigi/pages/wot/VerificationForm.templ
index a4580c6eeac3e60ee52acf976aca4d9b44da5470..540faaae045aca984f7bf511bb6ac55c10294dd2 100644 (file)
@@ -8,7 +8,7 @@
 <? foreach($names) { ?>
        <tr>
                <td><?=_Name?>: </td>
 <? foreach($names) { ?>
        <tr>
                <td><?=_Name?>: </td>
-               <td><input type="checkbox" name="assuredName" value="<?=$nameId?>"<?=$checked?>><span class="accountdetail"><?=$nameExplicit?></span></td>
+               <td><input type="checkbox" name="verifiedName" value="<?=$nameId?>"<?=$checked?>><span class="accountdetail"><?=$nameExplicit?></span></td>
        </tr>
 <? } ?>
        <tr>
        </tr>
 <? } ?>
        <tr>
@@ -55,7 +55,7 @@
        </tr>
        <tr>
                <td><?=_Type?></td>
        </tr>
        <tr>
                <td><?=_Type?></td>
-               <td><select name="assuranceType"><? foreach($ats) { ?><option value="<?=$id?>"<?=$sel?>><?=$type?></option><? } ?></select></td>
+               <td><select name="verificationType"><? foreach($ats) { ?><option value="<?=$id?>"<?=$sel?>><?=$type?></option><? } ?></select></td>
        </tr>
        <tr>
                <td><input type="checkbox" name="passwordReset" value="1" <? if($aword) { ?>checked<? } ?>></td>
        </tr>
        <tr>
                <td><input type="checkbox" name="passwordReset" value="1" <? if($aword) { ?>checked<? } ?>></td>
similarity index 84%
rename from src/club/wpia/gigi/pages/wot/AssurePage.java
rename to src/club/wpia/gigi/pages/wot/VerifyPage.java
index f17aad647471563031c81aa6ac18edc557695d73..e3fdf534d1f930107b0b3c69d6180aacf3aa5df2 100644 (file)
@@ -17,15 +17,15 @@ import club.wpia.gigi.output.template.Template;
 import club.wpia.gigi.pages.Page;
 import club.wpia.gigi.util.AuthorizationContext;
 
 import club.wpia.gigi.pages.Page;
 import club.wpia.gigi.util.AuthorizationContext;
 
-public class AssurePage extends Page {
+public class VerifyPage extends Page {
 
 
-    public static final String PATH = "/wot/assure";
+    public static final String PATH = "/wot/verify";
 
     DateSelector ds = new DateSelector("day", "month", "year");
 
 
     DateSelector ds = new DateSelector("day", "month", "year");
 
-    private static final Template t = new Template(AssuranceForm.class.getResource("AssureeSearch.templ"));
+    private static final Template t = new Template(VerificationForm.class.getResource("ApplicantSearch.templ"));
 
 
-    public AssurePage() {
+    public VerifyPage() {
         super("Verify someone");
 
     }
         super("Verify someone");
 
     }
@@ -41,13 +41,13 @@ public class AssurePage extends Page {
 
     @Override
     public boolean isPermitted(AuthorizationContext ac) {
 
     @Override
     public boolean isPermitted(AuthorizationContext ac) {
-        return ac != null && ac.canAssure();
+        return ac != null && ac.canVerify();
     }
 
     @Override
     public boolean beforePost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
         if (req.getParameter("search") == null) {
     }
 
     @Override
     public boolean beforePost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
         if (req.getParameter("search") == null) {
-            AssuranceForm form = Form.getForm(req, AssuranceForm.class);
+            VerificationForm form = Form.getForm(req, VerificationForm.class);
             return form.submitExceptionProtected(req, resp);
         }
         return super.beforePost(req, resp);
             return form.submitExceptionProtected(req, resp);
         }
         return super.beforePost(req, resp);
@@ -58,7 +58,7 @@ public class AssurePage extends Page {
         PrintWriter out = resp.getWriter();
         if (req.getParameter("search") == null) {
             if (Form.printFormErrors(req, out)) {
         PrintWriter out = resp.getWriter();
         if (req.getParameter("search") == null) {
             if (Form.printFormErrors(req, out)) {
-                AssuranceForm form = Form.getForm(req, AssuranceForm.class);
+                VerificationForm form = Form.getForm(req, VerificationForm.class);
                 form.output(out, getLanguage(req), getDefaultVars(req));
             }
             return;
                 form.output(out, getLanguage(req), getDefaultVars(req));
             }
             return;
@@ -82,9 +82,9 @@ public class AssurePage extends Page {
                     } else if (getUser(req).getId() == id) {
 
                     } else {
                     } else if (getUser(req).getId() == id) {
 
                     } else {
-                        User assuree = User.getById(id);
+                        User applicant = User.getById(id);
                         try {
                         try {
-                            new AssuranceForm(req, assuree).output(out, getLanguage(req), getDefaultVars(req));
+                            new VerificationForm(req, applicant).output(out, getLanguage(req), getDefaultVars(req));
                         } catch (GigiApiException e) {
                             e.format(out, Page.getLanguage(req));
                         }
                         } catch (GigiApiException e) {
                             e.format(out, Page.getLanguage(req));
                         }
index 84f10f741539d043aaec038483c2cf783c6f6e1b..40a63335fe59929f15f3b7c5f8adabb7a844d472 100644 (file)
@@ -95,7 +95,7 @@ public class AuthorizationContext implements Outputable, Serializable {
         }
     }
 
         }
     }
 
-    public boolean canAssure() {
-        return target instanceof User && ((User) target).canAssure();
+    public boolean canVerify() {
+        return target instanceof User && ((User) target).canVerify();
     }
 }
     }
 }
index 3df11763c1b72d1fcbfacbf3241d91baacf3c4ca..a619da53563e3b60f5d0849458ddf17f50b26b0a 100644 (file)
@@ -15,7 +15,7 @@ import club.wpia.gigi.dbObjects.Country;
 import club.wpia.gigi.dbObjects.Group;
 import club.wpia.gigi.dbObjects.Name;
 import club.wpia.gigi.dbObjects.User;
 import club.wpia.gigi.dbObjects.Group;
 import club.wpia.gigi.dbObjects.Name;
 import club.wpia.gigi.dbObjects.User;
-import club.wpia.gigi.dbObjects.Assurance.AssuranceType;
+import club.wpia.gigi.dbObjects.Verification.VerificationType;
 import club.wpia.gigi.localisation.Language;
 import club.wpia.gigi.output.ArrayIterable;
 import club.wpia.gigi.output.DateSelector;
 import club.wpia.gigi.localisation.Language;
 import club.wpia.gigi.output.ArrayIterable;
 import club.wpia.gigi.output.DateSelector;
@@ -44,47 +44,47 @@ public class Notary {
         }
     }
 
         }
     }
 
-    public static boolean checkAssuranceIsPossible(User assurer, Name target) {
+    public static boolean checkVerificationIsPossible(User agent, Name target) {
         try (GigiPreparedStatement ps = new GigiPreparedStatement("SELECT 1 FROM `notary` where `to`=? and `from`=? and `method` = ? ::`notaryType` AND `deleted` IS NULL AND `when` > (now() - interval '1 days' * ?)")) {
             ps.setInt(1, target.getId());
         try (GigiPreparedStatement ps = new GigiPreparedStatement("SELECT 1 FROM `notary` where `to`=? and `from`=? and `method` = ? ::`notaryType` AND `deleted` IS NULL AND `when` > (now() - interval '1 days' * ?)")) {
             ps.setInt(1, target.getId());
-            ps.setInt(2, assurer.getId());
-            ps.setEnum(3, AssuranceType.FACE_TO_FACE);
+            ps.setInt(2, agent.getId());
+            ps.setEnum(3, VerificationType.FACE_TO_FACE);
             ps.setInt(4, LIMIT_DAYS_VERIFICATION);
             GigiResultSet rs = ps.executeQuery();
             return !rs.next();
         }
     }
 
             ps.setInt(4, LIMIT_DAYS_VERIFICATION);
             GigiResultSet rs = ps.executeQuery();
             return !rs.next();
         }
     }
 
-    public static final Group ASSURER_BLOCKED = Group.BLOCKEDASSURER;
+    public static final Group AGENT_BLOCKED = Group.BLOCKEDASSURER;
 
 
-    public static final Group ASSUREE_BLOCKED = Group.BLOCKEDASSUREE;
+    public static final Group APPLICANT_BLOCKED = Group.BLOCKEDASSUREE;
 
     public static final Group VERIFY_NOTIFICATION = Group.VERIFY_NOTIFICATION;
 
     /**
 
     public static final Group VERIFY_NOTIFICATION = Group.VERIFY_NOTIFICATION;
 
     /**
-     * This method assures another user.
+     * This method verifies another user.
      * 
      * 
-     * @see User#canAssure() (for assurer)
-     * @see #checkAssuranceIsPossible(User, User) (for assurer or assuree)
-     * @param assurer
-     *            the person that wants to assure
-     * @param assuree
-     *            the person that should be assured
-     * @param assureeName
+     * @see User#canVerify() (for agent)
+     * @see #checkVerificationIsPossible(User, User) (for agent or applicant)
+     * @param agent
+     *            the person that wants to verify
+     * @param applicant
+     *            the person that should be verified
+     * @param applicantName
      *            the Name that was personally verified
      * @param dob
      *            the Name that was personally verified
      * @param dob
-     *            the Date of birth that the assurer verified
+     *            the Date of birth that the agent verified
      * @param awarded
      *            the points that should be awarded in total
      * @param location
      * @param awarded
      *            the points that should be awarded in total
      * @param location
-     *            the location where the assurance took place
+     *            the location where the verification took place
      * @param date
      * @param date
-     *            the date when the assurance took place
+     *            the date when the verification took place
      * @throws GigiApiException
      * @throws GigiApiException
-     *             if the assurance fails (for various reasons)
+     *             if the verification fails (for various reasons)
      */
      */
-    public synchronized static void assure(User assurer, User assuree, Name assureeName, DayDate dob, int awarded, String location, String date, AssuranceType type, Country country) throws GigiApiException {
-        may(assurer, assuree, AssuranceType.FACE_TO_FACE);
+    public synchronized static void verify(User agent, User applicant, Name applicantName, DayDate dob, int awarded, String location, String date, VerificationType type, Country country) throws GigiApiException {
+        may(agent, applicant, VerificationType.FACE_TO_FACE);
         GigiApiException gae = new GigiApiException();
         if ( !gae.isEmpty()) {
             throw gae;
         GigiApiException gae = new GigiApiException();
         if ( !gae.isEmpty()) {
             throw gae;
@@ -120,34 +120,34 @@ public class Notary {
             gae.mergeInto(new GigiApiException("You failed to enter the country of your meeting."));
         }
 
             gae.mergeInto(new GigiApiException("You failed to enter the country of your meeting."));
         }
 
-        synchronized (assuree) {
-            if (assurer.getId() == assuree.getId()) {
+        synchronized (applicant) {
+            if (agent.getId() == applicant.getId()) {
                 throw new GigiApiException("You cannot verify yourself.");
             }
                 throw new GigiApiException("You cannot verify yourself.");
             }
-            if (assureeName.getOwner() != assuree) {
+            if (applicantName.getOwner() != applicant) {
                 throw new GigiApiException("Internal error, name does not belong to applicant.");
             }
                 throw new GigiApiException("Internal error, name does not belong to applicant.");
             }
-            if ( !assurer.canAssure()) {
+            if ( !agent.canVerify()) {
                 throw new GigiApiException("You are not an RA-Agent.");
             }
 
                 throw new GigiApiException("You are not an RA-Agent.");
             }
 
-            if ( !checkAssuranceIsPossible(assurer, assureeName)) {
+            if ( !checkVerificationIsPossible(agent, applicantName)) {
                 gae.mergeInto(new GigiApiException(SprintfCommand.createSimple("You have already verified this applicant within the last {0} days.", LIMIT_DAYS_VERIFICATION)));
             }
 
                 gae.mergeInto(new GigiApiException(SprintfCommand.createSimple("You have already verified this applicant within the last {0} days.", LIMIT_DAYS_VERIFICATION)));
             }
 
-            if ( !assuree.getDoB().equals(dob)) {
+            if ( !applicant.getDoB().equals(dob)) {
                 gae.mergeInto(new GigiApiException("The person you are verifying changed his personal details."));
             }
 
             if (awarded < 0) {
                 gae.mergeInto(new GigiApiException("The points you are trying to award are out of range."));
             } else {
                 gae.mergeInto(new GigiApiException("The person you are verifying changed his personal details."));
             }
 
             if (awarded < 0) {
                 gae.mergeInto(new GigiApiException("The points you are trying to award are out of range."));
             } else {
-                if (type == AssuranceType.NUCLEUS) {
+                if (type == VerificationType.NUCLEUS) {
                     if (awarded > 50) {
                         gae.mergeInto(new GigiApiException("The points you are trying to award are out of range."));
                     }
                 } else {
                     if (awarded > 50) {
                         gae.mergeInto(new GigiApiException("The points you are trying to award are out of range."));
                     }
                 } else {
-                    if (awarded > assurer.getMaxAssurePoints()) {
+                    if (awarded > agent.getMaxVerifyPoints()) {
                         gae.mergeInto(new GigiApiException("The points you are trying to award are out of range."));
                     }
                 }
                         gae.mergeInto(new GigiApiException("The points you are trying to award are out of range."));
                     }
                 }
@@ -157,24 +157,24 @@ public class Notary {
                 throw gae;
             }
 
                 throw gae;
             }
 
-            if (type == AssuranceType.FACE_TO_FACE) {
-                assureF2F(assurer, assuree, assureeName, awarded, location, date, country);
-            } else if (type == AssuranceType.NUCLEUS) {
-                assureNucleus(assurer, assuree, assureeName, awarded, location, date, country);
-            } else if (type == AssuranceType.TTP_ASSISTED) {
-                assureTTP(assurer, assuree, assureeName, awarded, location, date, country);
+            if (type == VerificationType.FACE_TO_FACE) {
+                verifyF2F(agent, applicant, applicantName, awarded, location, date, country);
+            } else if (type == VerificationType.NUCLEUS) {
+                verifyNucleus(agent, applicant, applicantName, awarded, location, date, country);
+            } else if (type == VerificationType.TTP_ASSISTED) {
+                verifyTTP(agent, applicant, applicantName, awarded, location, date, country);
             } else {
                 throw new GigiApiException(SprintfCommand.createSimple("Unknown Verification type: {0}", type.toString()));
             }
             } else {
                 throw new GigiApiException(SprintfCommand.createSimple("Unknown Verification type: {0}", type.toString()));
             }
-            assurer.invalidateMadeAssurances();
-            assuree.invalidateReceivedAssurances();
+            agent.invalidateMadeVerifications();
+            applicant.invalidateReceivedVerifications();
         }
     }
 
         }
     }
 
-    private static void assureF2F(User assurer, User assuree, Name name, int awarded, String location, String date, Country country) throws GigiApiException {
-        may(assurer, assuree, AssuranceType.FACE_TO_FACE);
+    private static void verifyF2F(User agent, User applicant, Name name, int awarded, String location, String date, Country country) throws GigiApiException {
+        may(agent, applicant, VerificationType.FACE_TO_FACE);
         try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `notary` SET `from`=?, `to`=?, `points`=?, `location`=?, `date`=?, `country`=?")) {
         try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `notary` SET `from`=?, `to`=?, `points`=?, `location`=?, `date`=?, `country`=?")) {
-            ps.setInt(1, assurer.getId());
+            ps.setInt(1, agent.getId());
             ps.setInt(2, name.getId());
             ps.setInt(3, awarded);
             ps.setString(4, location);
             ps.setInt(2, name.getId());
             ps.setInt(3, awarded);
             ps.setString(4, location);
@@ -184,62 +184,62 @@ public class Notary {
         }
     }
 
         }
     }
 
-    private static void assureTTP(User assurer, User assuree, Name name, int awarded, String location, String date, Country country) throws GigiApiException {
-        may(assurer, assuree, AssuranceType.TTP_ASSISTED);
+    private static void verifyTTP(User agent, User applicant, Name name, int awarded, String location, String date, Country country) throws GigiApiException {
+        may(agent, applicant, VerificationType.TTP_ASSISTED);
         try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `notary` SET `from`=?, `to`=?, `points`=?, `location`=?, `date`=?, `country`=?, `method`='TTP-Assisted'")) {
         try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `notary` SET `from`=?, `to`=?, `points`=?, `location`=?, `date`=?, `country`=?, `method`='TTP-Assisted'")) {
-            ps.setInt(1, assurer.getId());
+            ps.setInt(1, agent.getId());
             ps.setInt(2, name.getId());
             ps.setInt(3, awarded);
             ps.setString(4, location);
             ps.setString(5, date);
             ps.setString(6, country.getCode());
             ps.execute();
             ps.setInt(2, name.getId());
             ps.setInt(3, awarded);
             ps.setString(4, location);
             ps.setString(5, date);
             ps.setString(6, country.getCode());
             ps.execute();
-            assuree.revokeGroup(assurer, Group.TTP_APPLICANT);
+            applicant.revokeGroup(agent, Group.TTP_APPLICANT);
         }
     }
 
         }
     }
 
-    public static void may(User assurer, User assuree, AssuranceType t) throws GigiApiException {
-        if (assuree.isInGroup(ASSUREE_BLOCKED)) {
+    public static void may(User agent, User applicant, VerificationType t) throws GigiApiException {
+        if (applicant.isInGroup(APPLICANT_BLOCKED)) {
             throw new GigiApiException("The applicant is blocked.");
         }
             throw new GigiApiException("The applicant is blocked.");
         }
-        if (assurer.isInGroup(ASSURER_BLOCKED)) {
+        if (agent.isInGroup(AGENT_BLOCKED)) {
             throw new GigiApiException("The RA Agent is blocked.");
         }
 
             throw new GigiApiException("The RA Agent is blocked.");
         }
 
-        if (t == AssuranceType.NUCLEUS) {
-            if ( !assurer.isInGroup(Group.NUCLEUS_ASSURER)) {
+        if (t == VerificationType.NUCLEUS) {
+            if ( !agent.isInGroup(Group.NUCLEUS_ASSURER)) {
                 throw new GigiApiException("RA Agent needs to be Nucleus RA Agent.");
             }
             return;
                 throw new GigiApiException("RA Agent needs to be Nucleus RA Agent.");
             }
             return;
-        } else if (t == AssuranceType.TTP_ASSISTED) {
-            if ( !assurer.isInGroup(Group.TTP_ASSURER)) {
+        } else if (t == VerificationType.TTP_ASSISTED) {
+            if ( !agent.isInGroup(Group.TTP_ASSURER)) {
                 throw new GigiApiException("RA Agent needs to be TTP RA Agent.");
             }
                 throw new GigiApiException("RA Agent needs to be TTP RA Agent.");
             }
-            if ( !assuree.isInGroup(Group.TTP_APPLICANT)) {
+            if ( !applicant.isInGroup(Group.TTP_APPLICANT)) {
                 throw new GigiApiException("Applicant needs to be TTP Applicant.");
             }
             return;
                 throw new GigiApiException("Applicant needs to be TTP Applicant.");
             }
             return;
-        } else if (t == AssuranceType.FACE_TO_FACE) {
+        } else if (t == VerificationType.FACE_TO_FACE) {
             return;
         }
         throw new GigiApiException("Verification type not possible.");
     }
 
             return;
         }
         throw new GigiApiException("Verification type not possible.");
     }
 
-    private static void assureNucleus(User assurer, User assuree, Name name, int awarded, String location, String date, Country country) throws GigiApiException {
-        may(assurer, assuree, AssuranceType.NUCLEUS);
+    private static void verifyNucleus(User agent, User applicant, Name name, int awarded, String location, String date, Country country) throws GigiApiException {
+        may(agent, applicant, VerificationType.NUCLEUS);
         // Do up to 35 points as f2f
         // Do up to 35 points as f2f
-        int f2fPoints = Math.min(assurer.getMaxAssurePoints(), awarded);
-        assureF2F(assurer, assuree, name, f2fPoints, location, date, country);
+        int f2fPoints = Math.min(agent.getMaxVerifyPoints(), awarded);
+        verifyF2F(agent, applicant, name, f2fPoints, location, date, country);
 
         awarded -= f2fPoints;
         if (awarded <= 0) {
             return;
         }
 
 
         awarded -= f2fPoints;
         if (awarded <= 0) {
             return;
         }
 
-        // Assure remaining points as "Nucleus Bonus"
+        // Verify remaining points as "Nucleus Bonus"
         // Valid for 4 Weeks = 28 days
         try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `notary` SET `from`=?, `to`=?, `points`=?, `location`=?, `date`=?, `country`=?, `method`='Nucleus Bonus', `expire` = CURRENT_TIMESTAMP + interval '28 days'")) {
         // Valid for 4 Weeks = 28 days
         try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `notary` SET `from`=?, `to`=?, `points`=?, `location`=?, `date`=?, `country`=?, `method`='Nucleus Bonus', `expire` = CURRENT_TIMESTAMP + interval '28 days'")) {
-            ps.setInt(1, assurer.getId());
+            ps.setInt(1, agent.getId());
             ps.setInt(2, name.getId());
             ps.setInt(3, awarded);
             ps.setString(4, location);
             ps.setInt(2, name.getId());
             ps.setInt(3, awarded);
             ps.setString(4, location);
@@ -249,20 +249,20 @@ public class Notary {
         }
     }
 
         }
     }
 
-    public synchronized static void assureAll(User assurer, User assuree, DayDate dob, int awarded, String location, String date, AssuranceType type, Name[] toAssure, Country country) throws GigiApiException {
-        if (toAssure.length == 0) {
+    public synchronized static void verifyAll(User agent, User applicant, DayDate dob, int awarded, String location, String date, VerificationType type, Name[] toVerify, Country country) throws GigiApiException {
+        if (toVerify.length == 0) {
             throw new GigiApiException("You must confirm at least one name to verify an account.");
         }
             throw new GigiApiException("You must confirm at least one name to verify an account.");
         }
-        boolean[] hadLessThan50Points = new boolean[toAssure.length];
-        boolean hadTotalLessThan100 = assuree.getAssurancePoints() < 100;
-        for (int i = 0; i < toAssure.length; i++) {
-            hadLessThan50Points[i] = toAssure[i].getAssurancePoints() < 50;
+        boolean[] hadLessThan50Points = new boolean[toVerify.length];
+        boolean hadTotalLessThan100 = applicant.getVerificationPoints() < 100;
+        for (int i = 0; i < toVerify.length; i++) {
+            hadLessThan50Points[i] = toVerify[i].getVerificationPoints() < 50;
 
 
-            assure(assurer, assuree, toAssure[i], dob, awarded, location, date, type, country);
+            verify(agent, applicant, toVerify[i], dob, awarded, location, date, type, country);
         }
         }
-        sendVerificationNotificationApplicant(assurer, assuree, toAssure, awarded, hadLessThan50Points, hadTotalLessThan100);
-        if (assurer.isInGroup(VERIFY_NOTIFICATION)) {
-            sendVerificationNotificationAgent(assurer, assuree, toAssure, awarded, location, date, country);
+        sendVerificationNotificationApplicant(agent, applicant, toVerify, awarded, hadLessThan50Points, hadTotalLessThan100);
+        if (agent.isInGroup(VERIFY_NOTIFICATION)) {
+            sendVerificationNotificationAgent(agent, applicant, toVerify, awarded, location, date, country);
         }
     }
 
         }
     }
 
@@ -270,14 +270,14 @@ public class Notary {
 
     private static final MailTemplate verificationAgentEntered = new MailTemplate(Notary.class.getResource("VerificationAgentEntered.templ"));
 
 
     private static final MailTemplate verificationAgentEntered = new MailTemplate(Notary.class.getResource("VerificationAgentEntered.templ"));
 
-    private static void sendVerificationNotificationApplicant(User assurer, User assuree, Name[] toAssure, final int awarded, final boolean[] hadLessThan50Points, boolean hadTotalLessThan100) {
+    private static void sendVerificationNotificationApplicant(User agent, User applicant, Name[] toVerify, final int awarded, final boolean[] hadLessThan50Points, boolean hadTotalLessThan100) {
         HashMap<String, Object> mailVars = new HashMap<>();
         HashMap<String, Object> mailVars = new HashMap<>();
-        mailVars.put("agent", assurer.getPreferredName().toString());
-        mailVars.put("names", new ArrayIterable<Name>(toAssure) {
+        mailVars.put("agent", agent.getPreferredName().toString());
+        mailVars.put("names", new ArrayIterable<Name>(toVerify) {
 
             @Override
             public void apply(Name t, Language l, Map<String, Object> vars) {
 
             @Override
             public void apply(Name t, Language l, Map<String, Object> vars) {
-                int totalVP = t.getAssurancePoints();
+                int totalVP = t.getVerificationPoints();
                 vars.put("name", t.toString());
                 vars.put("points", Integer.toString(awarded));
                 vars.put("total", totalVP);
                 vars.put("name", t.toString());
                 vars.put("points", Integer.toString(awarded));
                 vars.put("total", totalVP);
@@ -292,7 +292,7 @@ public class Notary {
 
         });
 
 
         });
 
-        int grandTotalVP = assuree.getAssurancePoints();
+        int grandTotalVP = applicant.getVerificationPoints();
         if (grandTotalVP >= 50 && grandTotalVP < 100) {
             mailVars.put("remAll", (100 - grandTotalVP));
             mailVars.remove("gotGreaterAll");
         if (grandTotalVP >= 50 && grandTotalVP < 100) {
             mailVars.put("remAll", (100 - grandTotalVP));
             mailVars.remove("gotGreaterAll");
@@ -301,7 +301,7 @@ public class Notary {
             mailVars.remove("remAll");
         }
         try {
             mailVars.remove("remAll");
         }
         try {
-            verificationEntered.sendMail(Language.getInstance(assuree.getPreferredLocale()), mailVars, assuree.getEmail());
+            verificationEntered.sendMail(Language.getInstance(applicant.getPreferredLocale()), mailVars, applicant.getEmail());
         } catch (IOException e) {
             e.printStackTrace();
         }
         } catch (IOException e) {
             e.printStackTrace();
         }
index 8a7f7a52b1cf8c5aab48971bc36336232e046ebe..2c08c309807ff22d79ca4efdd0fe94c1b9eb4cc4 100644 (file)
@@ -17,13 +17,13 @@ public class TestOrga extends BusinessTest {
 
     @Test
     public void testAddRm() throws GigiApiException, IOException {
 
     @Test
     public void testAddRm() throws GigiApiException, IOException {
-        User u1 = User.getById(createAssuranceUser("fn", "ln", createUniqueName() + "@email.org", TEST_PASSWORD));
+        User u1 = User.getById(createVerificationUser("fn", "ln", createUniqueName() + "@email.org", TEST_PASSWORD));
         u1.grantGroup(getSupporter(), Group.ORGASSURER);
         u1.grantGroup(getSupporter(), Group.ORGASSURER);
-        User u2 = User.getById(createAssuranceUser("fn", "ln", createUniqueName() + "@email.org", TEST_PASSWORD));
+        User u2 = User.getById(createVerificationUser("fn", "ln", createUniqueName() + "@email.org", TEST_PASSWORD));
         u2.grantGroup(getSupporter(), Group.ORGASSURER);
         u2.grantGroup(getSupporter(), Group.ORGASSURER);
-        User u3 = User.getById(createAssuranceUser("fn", "ln", createUniqueName() + "@email.org", TEST_PASSWORD));
+        User u3 = User.getById(createVerificationUser("fn", "ln", createUniqueName() + "@email.org", TEST_PASSWORD));
         u3.grantGroup(getSupporter(), Group.ORGASSURER);
         u3.grantGroup(getSupporter(), Group.ORGASSURER);
-        User u4 = User.getById(createAssuranceUser("fn", "ln", createUniqueName() + "@email.org", TEST_PASSWORD));
+        User u4 = User.getById(createVerificationUser("fn", "ln", createUniqueName() + "@email.org", TEST_PASSWORD));
         u4.grantGroup(getSupporter(), Group.ORGASSURER);
         Organisation o1 = new Organisation("name", Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS), "prov", "city", "email", "optional name", "postal address", u1);
         assertEquals(0, o1.getAllAdmins().size());
         u4.grantGroup(getSupporter(), Group.ORGASSURER);
         Organisation o1 = new Organisation("name", Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS), "prov", "city", "email", "optional name", "postal address", u1);
         assertEquals(0, o1.getAllAdmins().size());
index c5bb9dceabd40fd8aaa590f42829e44ad30be9cc..e3ad9286c14ad10c1c2796f05e78fcc5a181487f 100644 (file)
@@ -27,7 +27,7 @@ public class TestSeparateSessionScope extends ManagedTest {
     @Test
     public void testSeparateScope() throws IOException, GeneralSecurityException, SQLException, InterruptedException, GigiApiException {
         String mail = "thisgo" + createUniqueName() + "@example.com";
     @Test
     public void testSeparateScope() throws IOException, GeneralSecurityException, SQLException, InterruptedException, GigiApiException {
         String mail = "thisgo" + createUniqueName() + "@example.com";
-        int user = createAssuranceUser("test", "tugo", mail, TEST_PASSWORD);
+        int user = createVerificationUser("test", "tugo", mail, TEST_PASSWORD);
         String cookie = login(mail, TEST_PASSWORD);
         KeyPair kp = generateKeypair();
         String csr = generatePEMCSR(kp, "CN=hans");
         String cookie = login(mail, TEST_PASSWORD);
         KeyPair kp = generateKeypair();
         String csr = generatePEMCSR(kp, "CN=hans");
@@ -49,7 +49,7 @@ public class TestSeparateSessionScope extends ManagedTest {
     @Test
     public void testSerialSteal() throws IOException, GeneralSecurityException, SQLException, InterruptedException, GigiApiException {
         String mail = "thisgo" + createUniqueName() + "@example.com";
     @Test
     public void testSerialSteal() throws IOException, GeneralSecurityException, SQLException, InterruptedException, GigiApiException {
         String mail = "thisgo" + createUniqueName() + "@example.com";
-        int user = createAssuranceUser("test", "tugo", mail, TEST_PASSWORD);
+        int user = createVerificationUser("test", "tugo", mail, TEST_PASSWORD);
         KeyPair kp = generateKeypair();
         String csr = generatePEMCSR(kp, "CN=hans");
         User u = User.getById(user);
         KeyPair kp = generateKeypair();
         String csr = generatePEMCSR(kp, "CN=hans");
         User u = User.getById(user);
index 8f5dbd33ca31297f2db18ae5212ad8ccc9e6209e..7ad3f49df4f3799ca6c769584f617dd8f0a139d9 100644 (file)
@@ -10,8 +10,8 @@ import java.util.Locale;
 import org.hamcrest.CoreMatchers;
 import org.junit.Test;
 
 import org.hamcrest.CoreMatchers;
 import org.junit.Test;
 
-import club.wpia.gigi.dbObjects.Assurance;
-import club.wpia.gigi.dbObjects.Assurance.AssuranceType;
+import club.wpia.gigi.dbObjects.Verification;
+import club.wpia.gigi.dbObjects.Verification.VerificationType;
 import club.wpia.gigi.dbObjects.Country;
 import club.wpia.gigi.dbObjects.Country.CountryCodeType;
 import club.wpia.gigi.dbObjects.Domain;
 import club.wpia.gigi.dbObjects.Country;
 import club.wpia.gigi.dbObjects.Country.CountryCodeType;
 import club.wpia.gigi.dbObjects.Domain;
@@ -50,17 +50,17 @@ public class TestUser extends BusinessTest {
     }
 
     @Test
     }
 
     @Test
-    public void testAssurerUtilMethods() throws SQLException, GigiApiException {
-        int id = createAssuranceUser("aä", "b", createUniqueName() + "a@email.org", TEST_PASSWORD);
+    public void testAgentUtilMethods() throws SQLException, GigiApiException {
+        int id = createVerificationUser("aä", "b", createUniqueName() + "a@email.org", TEST_PASSWORD);
 
         User u = User.getById(id);
 
         User u = User.getById(id);
-        assertTrue(u.canAssure());
-        int assurancePoints = u.getAssurancePoints();
+        assertTrue(u.canVerify());
+        int verificationPoints = u.getVerificationPoints();
         int expPoints = u.getExperiencePoints();
         int expPoints = u.getExperiencePoints();
-        assertEquals(100, assurancePoints);
+        assertEquals(100, verificationPoints);
         assertEquals(User.EXPERIENCE_POINTS, expPoints);
         assertTrue(u.hasPassedCATS());
         assertEquals(User.EXPERIENCE_POINTS, expPoints);
         assertTrue(u.hasPassedCATS());
-        assertEquals(10, u.getMaxAssurePoints());
+        assertEquals(10, u.getMaxVerifyPoints());
     }
 
     @Test
     }
 
     @Test
@@ -111,8 +111,8 @@ public class TestUser extends BusinessTest {
 
         User[] us = new User[5];
         for (int i = 0; i < us.length; i++) {
 
         User[] us = new User[5];
         for (int i = 0; i < us.length; i++) {
-            us[i] = User.getById(createAssuranceUser("f", "l", createUniqueName() + "@email.com", TEST_PASSWORD));
-            Notary.assure(us[i], u, u.getPreferredName(), u.getDoB(), 10, "here", validVerificationDateString(), AssuranceType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
+            us[i] = User.getById(createVerificationUser("f", "l", createUniqueName() + "@email.com", TEST_PASSWORD));
+            Notary.verify(us[i], u, u.getPreferredName(), u.getDoB(), 10, "here", validVerificationDateString(), VerificationType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
         }
 
         assertTrue(u.isValidName("aä b"));
         }
 
         assertTrue(u.isValidName("aä b"));
@@ -126,10 +126,10 @@ public class TestUser extends BusinessTest {
         long d = System.currentTimeMillis();
         d -= d % DayDate.MILLI_DAY;
         User u = createUser("f", "l", createUniqueName() + "@example.org", TEST_PASSWORD);
         long d = System.currentTimeMillis();
         d -= d % DayDate.MILLI_DAY;
         User u = createUser("f", "l", createUniqueName() + "@example.org", TEST_PASSWORD);
-        Assurance[] ma = u.getMadeAssurances();
-        Assurance[] ma2 = u.getMadeAssurances();
-        Assurance[] ra = u.getReceivedAssurances();
-        Assurance[] ra2 = u.getReceivedAssurances();
+        Verification[] ma = u.getMadeVerifications();
+        Verification[] ma2 = u.getMadeVerifications();
+        Verification[] ra = u.getReceivedVerifications();
+        Verification[] ra2 = u.getReceivedVerifications();
         assertEquals(0, u.getCertificates(false).length);
         assertEquals(0, ma.length);
         assertEquals(0, ma2.length);
         assertEquals(0, u.getCertificates(false).length);
         assertEquals(0, ma.length);
         assertEquals(0, ma2.length);
index 1d392500ee756f759ef2d0261f47248d998bd91b..18f1ae90538626f1b953c4b7ed56c40a8f21d9ef 100644 (file)
@@ -57,7 +57,7 @@ public class ImportCATSResult extends RestrictedApiTest {
         apiImport(u2, "Test Training");
         assertEquals(1, u2.getTrainings().length);
         assertFalse(u2.hasPassedCATS());
         apiImport(u2, "Test Training");
         assertEquals(1, u2.getTrainings().length);
         assertFalse(u2.hasPassedCATS());
-        apiImport(u2, CATSType.ASSURER_CHALLENGE.getDisplayName());
+        apiImport(u2, CATSType.AGENT_CHALLENGE.getDisplayName());
         assertEquals(2, u2.getTrainings().length);
         assertTrue(u2.hasPassedCATS());
 
         assertEquals(2, u2.getTrainings().length);
         assertTrue(u2.hasPassedCATS());
 
index d5302f9263f429d0e4e064d7687fbf9adae4771c..757e50a77a28f6295ca91413cfb6e753c59d489d 100644 (file)
@@ -73,8 +73,8 @@ public class IssueCert extends ClientTest {
     }
 
     @Test
     }
 
     @Test
-    public void testIssueCertAssured() throws Exception {
-        makeAssurer(id);
+    public void testIssueCertVerified() throws Exception {
+        makeAgent(id);
 
         String intendedName = "a b";
         String cert = issueCert(generatePEMCSR(kp, "EMAIL=" + email + ",CN=" + intendedName), "profile=client-a");
 
         String intendedName = "a b";
         String cert = issueCert(generatePEMCSR(kp, "EMAIL=" + email + ",CN=" + intendedName), "profile=client-a");
@@ -87,7 +87,7 @@ public class IssueCert extends ClientTest {
 
     @Test
     public void testIssueOrgCert() throws Exception {
 
     @Test
     public void testIssueOrgCert() throws Exception {
-        makeAssurer(id);
+        makeAgent(id);
         u.grantGroup(getSupporter(), Group.ORGASSURER);
 
         Organisation o1 = new Organisation("name", Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS), "pr", "st", "test@mail", "", "", u);
         u.grantGroup(getSupporter(), Group.ORGASSURER);
 
         Organisation o1 = new Organisation("name", Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS), "pr", "st", "test@mail", "", "", u);
diff --git a/tests/club/wpia/gigi/dbObjects/TestAssureName.java b/tests/club/wpia/gigi/dbObjects/TestAssureName.java
deleted file mode 100644 (file)
index 4d90250..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-package club.wpia.gigi.dbObjects;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-
-import club.wpia.gigi.GigiApiException;
-import club.wpia.gigi.dbObjects.Country;
-import club.wpia.gigi.dbObjects.Name;
-import club.wpia.gigi.dbObjects.NamePart;
-import club.wpia.gigi.dbObjects.User;
-import club.wpia.gigi.dbObjects.Assurance.AssuranceType;
-import club.wpia.gigi.dbObjects.Country.CountryCodeType;
-import club.wpia.gigi.dbObjects.NamePart.NamePartType;
-import club.wpia.gigi.testUtils.ClientBusinessTest;
-import club.wpia.gigi.util.Notary;
-
-public class TestAssureName extends ClientBusinessTest {
-
-    @Test
-    public void testIt() throws GigiApiException {
-        User u0 = User.getById(createAssuranceUser("f", "l", createUniqueName() + "@email.com", TEST_PASSWORD));
-        Name n2 = new Name(u, new NamePart(NamePartType.SINGLE_NAME, "Testiaa"));
-        Name n3 = new Name(u, new NamePart(NamePartType.SINGLE_NAME, "Testiaa"));
-        Name n4 = new Name(u, new NamePart(NamePartType.SINGLE_NAME, "Testiaac"));
-
-        assertEquals(0, n0.getAssurancePoints());
-        Notary.assure(u0, u, n0, u.getDoB(), 10, "test mgr", validVerificationDateString(), AssuranceType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
-        assertEquals(10, n0.getAssurancePoints());
-        Notary.assure(u0, u, n2, u.getDoB(), 10, "test mgr", validVerificationDateString(), AssuranceType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
-        assertEquals(10, n2.getAssurancePoints());
-        Notary.assure(u0, u, n3, u.getDoB(), 10, "test mgr", validVerificationDateString(), AssuranceType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
-        assertEquals(10, n3.getAssurancePoints());
-        Notary.assure(u0, u, n4, u.getDoB(), 10, "test mgr", validVerificationDateString(), AssuranceType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
-        assertEquals(10, n4.getAssurancePoints());
-        assertEquals(10, u.getMaxAssurePoints());
-    }
-}
index 87513e14b01114810eaf577dcfc2fb95a277a810..404618ae07e37d2adfa42531ec8ece0341abaf80 100644 (file)
@@ -30,10 +30,10 @@ public class TestCATS extends ClientBusinessTest {
 
     @Test
     public void testRAChallenge() throws IOException, GeneralSecurityException {
 
     @Test
     public void testRAChallenge() throws IOException, GeneralSecurityException {
-        CATS.enterResult(u, CATSType.ASSURER_CHALLENGE, min12month, "en_US", "1");
-        assertFalse(CATS.isInCatsLimit(id, CATSType.ASSURER_CHALLENGE.getId()));
-        CATS.enterResult(u, CATSType.ASSURER_CHALLENGE, min11month, "en_US", "1");
-        assertTrue(CATS.isInCatsLimit(id, CATSType.ASSURER_CHALLENGE.getId()));
+        CATS.enterResult(u, CATSType.AGENT_CHALLENGE, min12month, "en_US", "1");
+        assertFalse(CATS.isInCatsLimit(id, CATSType.AGENT_CHALLENGE.getId()));
+        CATS.enterResult(u, CATSType.AGENT_CHALLENGE, min11month, "en_US", "1");
+        assertTrue(CATS.isInCatsLimit(id, CATSType.AGENT_CHALLENGE.getId()));
     }
 
     @Test
     }
 
     @Test
similarity index 67%
rename from tests/club/wpia/gigi/dbObjects/TestAssurance.java
rename to tests/club/wpia/gigi/dbObjects/TestVerification.java
index 3906e601f597e6517c545a280d61e1e6dc7d85e7..a20f4cefa75aa22f2659d4004e89f71368f13ffc 100644 (file)
@@ -15,7 +15,7 @@ import club.wpia.gigi.testUtils.BusinessTest;
 import club.wpia.gigi.util.DayDate;
 import club.wpia.gigi.util.Notary;
 
 import club.wpia.gigi.util.DayDate;
 import club.wpia.gigi.util.Notary;
 
-public class TestAssurance extends BusinessTest {
+public class TestVerification extends BusinessTest {
 
     private final Timestamp yesterday = new Timestamp(System.currentTimeMillis() - DayDate.MILLI_DAY);
 
 
     private final Timestamp yesterday = new Timestamp(System.currentTimeMillis() - DayDate.MILLI_DAY);
 
@@ -45,12 +45,12 @@ public class TestAssurance extends BusinessTest {
 
     private int applicantMultID;
 
 
     private int applicantMultID;
 
-    public TestAssurance() throws GigiApiException {
+    public TestVerification() throws GigiApiException {
 
     }
 
     // test for verification in 39 month period
 
     }
 
     // test for verification in 39 month period
-    private void enterAssurance(int agentID, int applicantID) {
+    private void enterVerification(int agentID, int applicantID) {
         try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `notary` SET `from`=?, `to`=?, `points`=?, `location`=?, `date`=?")) {
             ps.setInt(1, agentID);
             ps.setInt(2, applicantID);
         try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `notary` SET `from`=?, `to`=?, `points`=?, `location`=?, `date`=?")) {
             ps.setInt(1, agentID);
             ps.setInt(2, applicantID);
@@ -62,7 +62,7 @@ public class TestAssurance extends BusinessTest {
         }
     }
 
         }
     }
 
-    private void enterAssuranceExpired(int agentID, int applicantID, Timestamp expired) {
+    private void enterVerificationExpired(int agentID, int applicantID, Timestamp expired) {
         try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `notary` SET `from`=?, `to`=?, `points`=?, `location`=?, `date`=?, `expire`=? ")) {
             ps.setInt(1, agentID);
             ps.setInt(2, applicantID);
         try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `notary` SET `from`=?, `to`=?, `points`=?, `location`=?, `date`=?, `expire`=? ")) {
             ps.setInt(1, agentID);
             ps.setInt(2, applicantID);
@@ -74,7 +74,7 @@ public class TestAssurance extends BusinessTest {
         }
     }
 
         }
     }
 
-    private void enterAssuranceWhen(int agentID, int applicantID, Timestamp when) {
+    private void enterVerificationWhen(int agentID, int applicantID, Timestamp when) {
         try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `notary` SET `from`=?, `to`=?, `points`=?, `location`=?, `date`=?, `when`=? ")) {
             ps.setInt(1, agentID);
             ps.setInt(2, applicantID);
         try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `notary` SET `from`=?, `to`=?, `points`=?, `location`=?, `date`=?, `when`=? ")) {
             ps.setInt(1, agentID);
             ps.setInt(2, applicantID);
@@ -86,7 +86,7 @@ public class TestAssurance extends BusinessTest {
         }
     }
 
         }
     }
 
-    private void enterAssuranceWhen(int agentID, int applicantID, Timestamp when, int points) {
+    private void enterVericationWhen(int agentID, int applicantID, Timestamp when, int points) {
         try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `notary` SET `from`=?, `to`=?, `points`=?, `location`=?, `date`=?, `when`=? ")) {
             ps.setInt(1, agentID);
             ps.setInt(2, applicantID);
         try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `notary` SET `from`=?, `to`=?, `points`=?, `location`=?, `date`=?, `when`=? ")) {
             ps.setInt(1, agentID);
             ps.setInt(2, applicantID);
@@ -98,7 +98,7 @@ public class TestAssurance extends BusinessTest {
         }
     }
 
         }
     }
 
-    private void enterAssuranceDeleted(int agentID, int applicantID, Timestamp deleted) {
+    private void enterVerificationDeleted(int agentID, int applicantID, Timestamp deleted) {
         try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `notary` SET `from`=?, `to`=?, `points`=?, `location`=?, `date`=?, `deleted`=? ")) {
             ps.setInt(1, agentID);
             ps.setInt(2, applicantID);
         try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `notary` SET `from`=?, `to`=?, `points`=?, `location`=?, `date`=?, `deleted`=? ")) {
             ps.setInt(1, agentID);
             ps.setInt(2, applicantID);
@@ -112,8 +112,8 @@ public class TestAssurance extends BusinessTest {
 
     @Before
     public void initTest() throws GigiApiException {
 
     @Before
     public void initTest() throws GigiApiException {
-        agentID = createAssuranceUser("a", "b", createUniqueName() + "@example.com", TEST_PASSWORD);
-        agent2ID = createAssuranceUser("a", "d", createUniqueName() + "@example.com", TEST_PASSWORD);
+        agentID = createVerificationUser("a", "b", createUniqueName() + "@example.com", TEST_PASSWORD);
+        agent2ID = createVerificationUser("a", "d", createUniqueName() + "@example.com", TEST_PASSWORD);
         applicantID = createVerifiedUser("a", "c", createUniqueName() + "@example.com", TEST_PASSWORD);
         applicant = User.getById(applicantID);
         applicantNameID = User.getById(applicantID).getPreferredName().getId();
         applicantID = createVerifiedUser("a", "c", createUniqueName() + "@example.com", TEST_PASSWORD);
         applicant = User.getById(applicantID);
         applicantNameID = User.getById(applicantID).getPreferredName().getId();
@@ -122,112 +122,112 @@ public class TestAssurance extends BusinessTest {
 
     @Test
     public void testVerificationYesterday() throws IOException {
 
     @Test
     public void testVerificationYesterday() throws IOException {
-        enterAssuranceWhen(agentID, applicantNameID, yesterday);
+        enterVerificationWhen(agentID, applicantNameID, yesterday);
         assertTrue(applicant.isInVerificationLimit());
     }
 
     @Test
     public void testApprox24MonthAgo() throws IOException {
         assertTrue(applicant.isInVerificationLimit());
     }
 
     @Test
     public void testApprox24MonthAgo() throws IOException {
-        enterAssuranceWhen(agentID, applicantNameID, min24month);
+        enterVerificationWhen(agentID, applicantNameID, min24month);
         assertTrue(applicant.isInVerificationLimit());
     }
 
     @Test
     public void testApprox39MonthAgo() throws IOException {
         assertTrue(applicant.isInVerificationLimit());
     }
 
     @Test
     public void testApprox39MonthAgo() throws IOException {
-        enterAssuranceWhen(agentID, applicantNameID, min39month);
+        enterVerificationWhen(agentID, applicantNameID, min39month);
         assertFalse(applicant.isInVerificationLimit());
     }
 
     @Test
     public void testTomorrowExpired() throws IOException {
         assertFalse(applicant.isInVerificationLimit());
     }
 
     @Test
     public void testTomorrowExpired() throws IOException {
-        enterAssuranceExpired(agentID, applicantNameID, tomorrow);
+        enterVerificationExpired(agentID, applicantNameID, tomorrow);
         assertTrue(applicant.isInVerificationLimit());
     }
 
     @Test
     public void testYesterdayExpired() throws IOException {
         assertTrue(applicant.isInVerificationLimit());
     }
 
     @Test
     public void testYesterdayExpired() throws IOException {
-        enterAssuranceExpired(agentID, applicantNameID, yesterday);
+        enterVerificationExpired(agentID, applicantNameID, yesterday);
         assertFalse(applicant.isInVerificationLimit());
     }
 
     @Test
     public void testNormal() throws IOException {
         assertFalse(applicant.isInVerificationLimit());
     }
 
     @Test
     public void testNormal() throws IOException {
-        enterAssurance(agentID, applicantNameID);
+        enterVerification(agentID, applicantNameID);
         assertTrue(applicant.isInVerificationLimit());
     }
 
     @Test
     public void testDeletedYesterday() throws IOException {
         assertTrue(applicant.isInVerificationLimit());
     }
 
     @Test
     public void testDeletedYesterday() throws IOException {
-        enterAssuranceDeleted(agentID, applicantNameID, yesterday);
+        enterVerificationDeleted(agentID, applicantNameID, yesterday);
         assertFalse(applicant.isInVerificationLimit());
     }
 
     @Test
         assertFalse(applicant.isInVerificationLimit());
     }
 
     @Test
-    public void testMultipleAssurancePossible() throws IOException {
+    public void testMultipleVerificationPossible() throws IOException {
         User agent = User.getById(agentID);
         User applicantMult = User.getById(applicantMultID);
 
         User agent = User.getById(agentID);
         User applicantMult = User.getById(applicantMultID);
 
-        enterAssuranceWhen(agentID, applicantMult.getPreferredName().getId(), min39month);
+        enterVerificationWhen(agentID, applicantMult.getPreferredName().getId(), min39month);
 
         // test that new entry would be possible
 
         // test that new entry would be possible
-        assertTrue(Notary.checkAssuranceIsPossible(agent, applicantMult.getPreferredName()));
+        assertTrue(Notary.checkVerificationIsPossible(agent, applicantMult.getPreferredName()));
 
         // enter new entry
 
         // enter new entry
-        enterAssuranceWhen(agentID, applicantMult.getPreferredName().getId(), yesterday);
+        enterVerificationWhen(agentID, applicantMult.getPreferredName().getId(), yesterday);
 
         // test that new entry is not possible
 
         // test that new entry is not possible
-        assertFalse(Notary.checkAssuranceIsPossible(agent, applicantMult.getPreferredName()));
+        assertFalse(Notary.checkVerificationIsPossible(agent, applicantMult.getPreferredName()));
 
     }
 
     @Test
 
     }
 
     @Test
-    public void testMultipleAssurancePointsCalculation() throws IOException {
+    public void testMultipleVerificationPointsCalculation() throws IOException {
 
         User agent = User.getById(agentID);
         User applicantMult = User.getById(applicantMultID);
 
 
         User agent = User.getById(agentID);
         User applicantMult = User.getById(applicantMultID);
 
-        enterAssuranceWhen(agentID, applicantMult.getPreferredName().getId(), min39month);
+        enterVerificationWhen(agentID, applicantMult.getPreferredName().getId(), min39month);
         int xPoints = agent.getExperiencePoints();
 
         // test that VP after first entry
 
         int xPoints = agent.getExperiencePoints();
 
         // test that VP after first entry
 
-        assertEquals(applicantMult.getAssurancePoints(), 10);
+        assertEquals(applicantMult.getVerificationPoints(), 10);
 
         // enter second entry to check correct calculation with larger points
 
         // enter second entry to check correct calculation with larger points
-        enterAssuranceWhen(agentID, applicantMult.getPreferredName().getId(), min24month, 20);
-        assertEquals(applicantMult.getAssurancePoints(), 20);
+        enterVericationWhen(agentID, applicantMult.getPreferredName().getId(), min24month, 20);
+        assertEquals(applicantMult.getVerificationPoints(), 20);
 
         // test correct XP calculation
         assertEquals(agent.getExperiencePoints(), xPoints);
 
         // enter third entry to check correct calculation with less points
 
         // test correct XP calculation
         assertEquals(agent.getExperiencePoints(), xPoints);
 
         // enter third entry to check correct calculation with less points
-        enterAssuranceWhen(agentID, applicantMult.getPreferredName().getId(), yesterday, 15);
-        assertEquals(applicantMult.getAssurancePoints(), 15);
+        enterVericationWhen(agentID, applicantMult.getPreferredName().getId(), yesterday, 15);
+        assertEquals(applicantMult.getVerificationPoints(), 15);
 
         // test correct XP calculation
         assertEquals(agent.getExperiencePoints(), xPoints);
 
         // enter expired entry
 
         // test correct XP calculation
         assertEquals(agent.getExperiencePoints(), xPoints);
 
         // enter expired entry
-        enterAssuranceExpired(agentID, applicantMult.getPreferredName().getId(), yesterday);
-        assertEquals(applicantMult.getAssurancePoints(), 15);
+        enterVerificationExpired(agentID, applicantMult.getPreferredName().getId(), yesterday);
+        assertEquals(applicantMult.getVerificationPoints(), 15);
 
         // enter deleted entry same agent
 
         // enter deleted entry same agent
-        enterAssuranceDeleted(agentID, applicantMult.getPreferredName().getId(), yesterday);
-        assertEquals(applicantMult.getAssurancePoints(), 15);
+        enterVerificationDeleted(agentID, applicantMult.getPreferredName().getId(), yesterday);
+        assertEquals(applicantMult.getVerificationPoints(), 15);
 
         // enter expired entry future
 
         // enter expired entry future
-        enterAssuranceExpired(agentID, applicantMult.getPreferredName().getId(), tomorrow);
-        assertEquals(applicantMult.getAssurancePoints(), 10);
+        enterVerificationExpired(agentID, applicantMult.getPreferredName().getId(), tomorrow);
+        assertEquals(applicantMult.getVerificationPoints(), 10);
 
         // test correct XP calculation
         assertEquals(agent.getExperiencePoints(), xPoints);
 
         // enter entry from different agent
 
         // test correct XP calculation
         assertEquals(agent.getExperiencePoints(), xPoints);
 
         // enter entry from different agent
-        enterAssuranceWhen(agent2ID, applicantMult.getPreferredName().getId(), yesterday);
-        assertEquals(applicantMult.getAssurancePoints(), 20);
+        enterVerificationWhen(agent2ID, applicantMult.getPreferredName().getId(), yesterday);
+        assertEquals(applicantMult.getVerificationPoints(), 20);
 
         // enter entry for second applicant
 
         // enter entry for second applicant
-        enterAssuranceWhen(agentID, applicant.getPreferredName().getId(), yesterday);
+        enterVerificationWhen(agentID, applicant.getPreferredName().getId(), yesterday);
 
         assertEquals(agent.getExperiencePoints(), xPoints + User.EXPERIENCE_POINTS);
     }
 
         assertEquals(agent.getExperiencePoints(), xPoints + User.EXPERIENCE_POINTS);
     }
similarity index 85%
rename from tests/club/wpia/gigi/dbObjects/TestAssuranceMail.java
rename to tests/club/wpia/gigi/dbObjects/TestVerificationMail.java
index 5efc69e88d319420a448ce57d4d86c71ca37a180..43efda4a70fc1b5b3c0b3f5fc204fc0f9b9c4339 100644 (file)
@@ -13,14 +13,14 @@ import club.wpia.gigi.dbObjects.Country;
 import club.wpia.gigi.dbObjects.Name;
 import club.wpia.gigi.dbObjects.NamePart;
 import club.wpia.gigi.dbObjects.User;
 import club.wpia.gigi.dbObjects.Name;
 import club.wpia.gigi.dbObjects.NamePart;
 import club.wpia.gigi.dbObjects.User;
-import club.wpia.gigi.dbObjects.Assurance.AssuranceType;
+import club.wpia.gigi.dbObjects.Verification.VerificationType;
 import club.wpia.gigi.dbObjects.Country.CountryCodeType;
 import club.wpia.gigi.dbObjects.NamePart.NamePartType;
 import club.wpia.gigi.testUtils.BusinessTest;
 import club.wpia.gigi.util.DayDate;
 import club.wpia.gigi.util.Notary;
 
 import club.wpia.gigi.dbObjects.Country.CountryCodeType;
 import club.wpia.gigi.dbObjects.NamePart.NamePartType;
 import club.wpia.gigi.testUtils.BusinessTest;
 import club.wpia.gigi.util.DayDate;
 import club.wpia.gigi.util.Notary;
 
-public class TestAssuranceMail extends BusinessTest {
+public class TestVerificationMail extends BusinessTest {
 
     private User agent;
 
 
     private User agent;
 
@@ -35,7 +35,7 @@ public class TestAssuranceMail extends BusinessTest {
     private String message;
 
     private void newAgent() throws GigiApiException {
     private String message;
 
     private void newAgent() throws GigiApiException {
-        agent = User.getById(createAssuranceUser("Marianne", "Mustermann", createUniqueName() + "@example.com", TEST_PASSWORD));
+        agent = User.getById(createVerificationUser("Marianne", "Mustermann", createUniqueName() + "@example.com", TEST_PASSWORD));
     }
 
     private void newApplicant() throws GigiApiException {
     }
 
     private void newApplicant() throws GigiApiException {
@@ -51,7 +51,7 @@ public class TestAssuranceMail extends BusinessTest {
             int applicantId = createVerifiedUser("John", "Doe", applicantT, TEST_PASSWORD);
             User applicantXP = User.getById(applicantId);
             applicantXP = User.getById(applicantId);
             int applicantId = createVerifiedUser("John", "Doe", applicantT, TEST_PASSWORD);
             User applicantXP = User.getById(applicantId);
             applicantXP = User.getById(applicantId);
-            Notary.assure(agentXP, applicantXP, applicantXP.getNames()[0], applicantXP.getDoB(), 10, "Test location", validVerificationDateString(), AssuranceType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
+            Notary.verify(agentXP, applicantXP, applicantXP.getNames()[0], applicantXP.getDoB(), 10, "Test location", validVerificationDateString(), VerificationType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
         }
     }
 
         }
     }
 
@@ -60,7 +60,7 @@ public class TestAssuranceMail extends BusinessTest {
     }
 
     private void enterVerification(int points, Name... names) throws GigiApiException {
     }
 
     private void enterVerification(int points, Name... names) throws GigiApiException {
-        Notary.assureAll(agent, applicant, applicant.getDoB(), points, createUniqueName(), validVerificationDateString(), AssuranceType.FACE_TO_FACE, names, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
+        Notary.verifyAll(agent, applicant, applicant.getDoB(), points, createUniqueName(), validVerificationDateString(), VerificationType.FACE_TO_FACE, names, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
     }
 
     private void enterVerificationInPast(int points, Name name) {
     }
 
     private void enterVerificationInPast(int points, Name name) {
@@ -278,20 +278,20 @@ public class TestAssuranceMail extends BusinessTest {
 
         // verify with 35 VP
         newAgent();
 
         // verify with 35 VP
         newAgent();
-        Notary.assure(agent, applicant, applicant.getNames()[0], applicant.getDoB(), 10, "Test location", validVerificationDateString(), AssuranceType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
-        Notary.assure(agent, applicant, applicant.getNames()[1], applicant.getDoB(), 10, "Test location", validVerificationDateString(), AssuranceType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
+        Notary.verify(agent, applicant, applicant.getNames()[0], applicant.getDoB(), 10, "Test location", validVerificationDateString(), VerificationType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
+        Notary.verify(agent, applicant, applicant.getNames()[1], applicant.getDoB(), 10, "Test location", validVerificationDateString(), VerificationType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
 
         newAgent();
 
         newAgent();
-        Notary.assure(agent, applicant, applicant.getNames()[0], applicant.getDoB(), 10, "Test location", validVerificationDateString(), AssuranceType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
-        Notary.assure(agent, applicant, applicant.getNames()[1], applicant.getDoB(), 10, "Test location", validVerificationDateString(), AssuranceType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
+        Notary.verify(agent, applicant, applicant.getNames()[0], applicant.getDoB(), 10, "Test location", validVerificationDateString(), VerificationType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
+        Notary.verify(agent, applicant, applicant.getNames()[1], applicant.getDoB(), 10, "Test location", validVerificationDateString(), VerificationType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
 
         newAgent();
 
         newAgent();
-        Notary.assure(agent, applicant, applicant.getNames()[0], applicant.getDoB(), 10, "Test location", validVerificationDateString(), AssuranceType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
-        Notary.assure(agent, applicant, applicant.getNames()[1], applicant.getDoB(), 10, "Test location", validVerificationDateString(), AssuranceType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
+        Notary.verify(agent, applicant, applicant.getNames()[0], applicant.getDoB(), 10, "Test location", validVerificationDateString(), VerificationType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
+        Notary.verify(agent, applicant, applicant.getNames()[1], applicant.getDoB(), 10, "Test location", validVerificationDateString(), VerificationType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
 
         newAgent();
 
         newAgent();
-        Notary.assure(agent, applicant, applicant.getNames()[0], applicant.getDoB(), 5, "Test location", validVerificationDateString(), AssuranceType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
-        Notary.assure(agent, applicant, applicant.getNames()[1], applicant.getDoB(), 5, "Test location", validVerificationDateString(), AssuranceType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
+        Notary.verify(agent, applicant, applicant.getNames()[0], applicant.getDoB(), 5, "Test location", validVerificationDateString(), VerificationType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
+        Notary.verify(agent, applicant, applicant.getNames()[1], applicant.getDoB(), 5, "Test location", validVerificationDateString(), VerificationType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
 
         // add first Verification in the past result first name 45 VP
         newAgent();
 
         // add first Verification in the past result first name 45 VP
         newAgent();
@@ -307,16 +307,16 @@ public class TestAssuranceMail extends BusinessTest {
 
         // verify first name to 85 VP
         newAgent();
 
         // verify first name to 85 VP
         newAgent();
-        Notary.assure(agent, applicant, applicant.getNames()[0], applicant.getDoB(), 10, "Test location", validVerificationDateString(), AssuranceType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
+        Notary.verify(agent, applicant, applicant.getNames()[0], applicant.getDoB(), 10, "Test location", validVerificationDateString(), VerificationType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
 
         newAgent();
 
         newAgent();
-        Notary.assure(agent, applicant, applicant.getNames()[0], applicant.getDoB(), 10, "Test location", validVerificationDateString(), AssuranceType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
+        Notary.verify(agent, applicant, applicant.getNames()[0], applicant.getDoB(), 10, "Test location", validVerificationDateString(), VerificationType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
 
         newAgent();
 
         newAgent();
-        Notary.assure(agent, applicant, applicant.getNames()[0], applicant.getDoB(), 10, "Test location", validVerificationDateString(), AssuranceType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
+        Notary.verify(agent, applicant, applicant.getNames()[0], applicant.getDoB(), 10, "Test location", validVerificationDateString(), VerificationType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
 
         newAgent();
 
         newAgent();
-        Notary.assure(agent, applicant, applicant.getNames()[0], applicant.getDoB(), 5, "Test location", validVerificationDateString(), AssuranceType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
+        Notary.verify(agent, applicant, applicant.getNames()[0], applicant.getDoB(), 5, "Test location", validVerificationDateString(), VerificationType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
 
         // add first Verification in the past result first name 95 VP
         newAgent();
 
         // add first Verification in the past result first name 95 VP
         newAgent();
diff --git a/tests/club/wpia/gigi/dbObjects/TestVerifyName.java b/tests/club/wpia/gigi/dbObjects/TestVerifyName.java
new file mode 100644 (file)
index 0000000..7f3af26
--- /dev/null
@@ -0,0 +1,38 @@
+package club.wpia.gigi.dbObjects;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+import club.wpia.gigi.GigiApiException;
+import club.wpia.gigi.dbObjects.Country;
+import club.wpia.gigi.dbObjects.Name;
+import club.wpia.gigi.dbObjects.NamePart;
+import club.wpia.gigi.dbObjects.User;
+import club.wpia.gigi.dbObjects.Verification.VerificationType;
+import club.wpia.gigi.dbObjects.Country.CountryCodeType;
+import club.wpia.gigi.dbObjects.NamePart.NamePartType;
+import club.wpia.gigi.testUtils.ClientBusinessTest;
+import club.wpia.gigi.util.Notary;
+
+public class TestVerifyName extends ClientBusinessTest {
+
+    @Test
+    public void testIt() throws GigiApiException {
+        User u0 = User.getById(createVerificationUser("f", "l", createUniqueName() + "@email.com", TEST_PASSWORD));
+        Name n2 = new Name(u, new NamePart(NamePartType.SINGLE_NAME, "Testiaa"));
+        Name n3 = new Name(u, new NamePart(NamePartType.SINGLE_NAME, "Testiaa"));
+        Name n4 = new Name(u, new NamePart(NamePartType.SINGLE_NAME, "Testiaac"));
+
+        assertEquals(0, n0.getVerificationPoints());
+        Notary.verify(u0, u, n0, u.getDoB(), 10, "test mgr", validVerificationDateString(), VerificationType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
+        assertEquals(10, n0.getVerificationPoints());
+        Notary.verify(u0, u, n2, u.getDoB(), 10, "test mgr", validVerificationDateString(), VerificationType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
+        assertEquals(10, n2.getVerificationPoints());
+        Notary.verify(u0, u, n3, u.getDoB(), 10, "test mgr", validVerificationDateString(), VerificationType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
+        assertEquals(10, n3.getVerificationPoints());
+        Notary.verify(u0, u, n4, u.getDoB(), 10, "test mgr", validVerificationDateString(), VerificationType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
+        assertEquals(10, n4.getVerificationPoints());
+        assertEquals(10, u.getMaxVerifyPoints());
+    }
+}
index 52938183d0f7acea4165c17d99a21892dc07542f..79edd9327ad207e4ea981d362a3e131248190e0a 100644 (file)
@@ -23,7 +23,7 @@ public class TestCertificateRequest extends ClientTest {
 
     public TestCertificateRequest() throws GeneralSecurityException, IOException, GigiApiException {
         ac = new AuthorizationContext(u, u);
 
     public TestCertificateRequest() throws GeneralSecurityException, IOException, GigiApiException {
         ac = new AuthorizationContext(u, u);
-        makeAssurer(u.getId());
+        makeAgent(u.getId());
     }
 
     @Test
     }
 
     @Test
index 872fc7467fca4b7f45ecc8f91a94f0a1f5cb665a..35c482d87c98849d0f2335eb32683690aaf07d84 100644 (file)
@@ -16,7 +16,7 @@ import org.junit.Test;
 
 import club.wpia.gigi.dbObjects.User;
 import club.wpia.gigi.pages.PasswordResetPage;
 
 import club.wpia.gigi.dbObjects.User;
 import club.wpia.gigi.pages.PasswordResetPage;
-import club.wpia.gigi.pages.wot.TestAssurance;
+import club.wpia.gigi.pages.wot.TestVerification;
 import club.wpia.gigi.testUtils.ClientTest;
 import club.wpia.gigi.testUtils.IOUtils;
 import club.wpia.gigi.testUtils.TestEmailReceiver.TestMail;
 import club.wpia.gigi.testUtils.ClientTest;
 import club.wpia.gigi.testUtils.IOUtils;
 import club.wpia.gigi.testUtils.TestEmailReceiver.TestMail;
@@ -25,12 +25,12 @@ import club.wpia.gigi.util.RandomToken;
 public class TestPasswordResetExternal extends ClientTest {
 
     @Test
 public class TestPasswordResetExternal extends ClientTest {
 
     @Test
-    public void testByAssurance() throws IOException {
-        User u = User.getById(createAssuranceUser("fn", "ln", createUniqueName() + "@example.com", TEST_PASSWORD));
+    public void testByVerification() throws IOException {
+        User u = User.getById(createVerificationUser("fn", "ln", createUniqueName() + "@example.com", TEST_PASSWORD));
         String cookie2 = login(u.getEmail(), TEST_PASSWORD);
         String cookie2 = login(u.getEmail(), TEST_PASSWORD);
-        URLConnection uc = TestAssurance.buildupAssureFormConnection(cookie2, email, true);
+        URLConnection uc = TestVerification.buildupVerifyFormConnection(cookie2, email, true);
         String avalue = RandomToken.generateToken(32);
         String avalue = RandomToken.generateToken(32);
-        uc.getOutputStream().write(("assuredName=" + this.u.getPreferredName().getId() + "&date=" + TestAssurance.validVerificationDateString() + "&location=testcase&countryCode=DE&certify=1&rules=1&assertion=1&points=10&passwordReset=1&passwordResetValue=" + URLEncoder.encode(avalue, "UTF-8")).getBytes("UTF-8"));
+        uc.getOutputStream().write(("verifiedName=" + this.u.getPreferredName().getId() + "&date=" + TestVerification.validVerificationDateString() + "&location=testcase&countryCode=DE&certify=1&rules=1&assertion=1&points=10&passwordReset=1&passwordResetValue=" + URLEncoder.encode(avalue, "UTF-8")).getBytes("UTF-8"));
         uc.getOutputStream().flush();
         String error = fetchStartErrorMessage(IOUtils.readURL(uc));
         assertNull(error);
         uc.getOutputStream().flush();
         String error = fetchStartErrorMessage(IOUtils.readURL(uc));
         assertNull(error);
index 1c559574a24f566ae75be5c81194cf36e62c5660..f5b81797715641dc3b5b95f6dd3f92da6910f2d0 100644 (file)
@@ -22,11 +22,11 @@ public class TestTrainings extends ClientTest {
 
     @Test
     public void testShow() throws IOException, GeneralSecurityException {
 
     @Test
     public void testShow() throws IOException, GeneralSecurityException {
-        CATS.enterResult(u, CATSType.ASSURER_CHALLENGE, new Date(System.currentTimeMillis()), "en_US", "1");
+        CATS.enterResult(u, CATSType.AGENT_CHALLENGE, new Date(System.currentTimeMillis()), "en_US", "1");
         CATS.enterResult(u, "Special Case Test", new Date(System.currentTimeMillis()), "spLan", "v23");
         String res = IOUtils.readURL(get(UserTrainings.PATH));
         assertThat(res, containsString("Special Case Test"));
         CATS.enterResult(u, "Special Case Test", new Date(System.currentTimeMillis()), "spLan", "v23");
         String res = IOUtils.readURL(get(UserTrainings.PATH));
         assertThat(res, containsString("Special Case Test"));
-        assertThat(res, containsString(HTMLEncoder.encodeHTML(CATSType.ASSURER_CHALLENGE.getDisplayName())));
+        assertThat(res, containsString(HTMLEncoder.encodeHTML(CATSType.AGENT_CHALLENGE.getDisplayName())));
         assertThat(res, containsString("en_US, 1"));
         assertThat(res, containsString("v23"));
         assertThat(res, containsString("spLan"));
         assertThat(res, containsString("en_US, 1"));
         assertThat(res, containsString("v23"));
         assertThat(res, containsString("spLan"));
index 5a458a2814e5ea222969ed3941d32ec221e38ed1..909dd0387427220b721b10b8e6a767deba1ac835 100644 (file)
@@ -125,7 +125,7 @@ public class TestSEAdminPageDetails extends ClientTest {
 
         // enter verification and open mypoints as supporter
 
 
         // enter verification and open mypoints as supporter
 
-        makeAssurer(this.id);
+        makeAgent(this.id);
         String location = createUniqueName();
         try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `notary` SET `from`=?, `to`=?, `points`=?, `location`=?, `date`=?, `when`=? ")) {
             ps.setInt(1, this.id);
         String location = createUniqueName();
         try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `notary` SET `from`=?, `to`=?, `points`=?, `location`=?, `date`=?, `when`=? ")) {
             ps.setInt(1, this.id);
index a6cd57540306e06f6eaf11218f2aafbe1bd8a2ef..8837abc62bbe1ed8fafb8c4eecfa5ff36ba46114 100644 (file)
@@ -53,7 +53,7 @@ public class TestOrgManagement extends OrgTest {
         assertEquals("opname", orgs[0].getOptionalName());
         assertEquals("postaladdress", orgs[0].getPostalAddress());
 
         assertEquals("opname", orgs[0].getOptionalName());
         assertEquals("postaladdress", orgs[0].getPostalAddress());
 
-        User u2 = User.getById(createAssuranceUser("testworker", "testname", createUniqueName() + "@testdom.com", TEST_PASSWORD));
+        User u2 = User.getById(createVerificationUser("testworker", "testname", createUniqueName() + "@testdom.com", TEST_PASSWORD));
         assertNull(executeBasicWebInteraction(cookie, ViewOrgPage.DEFAULT_PATH + "/" + orgs[0].getId(), "email=" + URLEncoder.encode(u2.getEmail(), "UTF-8") + "&do_affiliate=y&master=y", 1));
         List<Affiliation> allAdmins = orgs[0].getAllAdmins();
         assertEquals(1, allAdmins.size());
         assertNull(executeBasicWebInteraction(cookie, ViewOrgPage.DEFAULT_PATH + "/" + orgs[0].getId(), "email=" + URLEncoder.encode(u2.getEmail(), "UTF-8") + "&do_affiliate=y&master=y", 1));
         List<Affiliation> allAdmins = orgs[0].getAllAdmins();
         assertEquals(1, allAdmins.size());
@@ -84,8 +84,8 @@ public class TestOrgManagement extends OrgTest {
     }
 
     @Test
     }
 
     @Test
-    public void testNonAssurerSeeOnlyOwn() throws IOException, GigiApiException {
-        User u2 = User.getById(createAssuranceUser("testworker", "testname", createUniqueName() + "@testdom.com", TEST_PASSWORD));
+    public void testNonAgentSeeOnlyOwn() throws IOException, GigiApiException {
+        User u2 = User.getById(createVerificationUser("testworker", "testname", createUniqueName() + "@testdom.com", TEST_PASSWORD));
         Organisation o1 = createUniqueOrg();
         Organisation o2 = createUniqueOrg();
         o1.addAdmin(u2, u, false);
         Organisation o1 = createUniqueOrg();
         Organisation o2 = createUniqueOrg();
         o1.addAdmin(u2, u, false);
@@ -117,8 +117,8 @@ public class TestOrgManagement extends OrgTest {
 
     @Test
     public void testAffiliationRights() throws IOException, GigiApiException {
 
     @Test
     public void testAffiliationRights() throws IOException, GigiApiException {
-        User u2 = User.getById(createAssuranceUser("testworker", "testname", createUniqueName() + "@testdom.com", TEST_PASSWORD));
-        User u3 = User.getById(createAssuranceUser("testmaster", "testname", createUniqueName() + "@testdom.com", TEST_PASSWORD));
+        User u2 = User.getById(createVerificationUser("testworker", "testname", createUniqueName() + "@testdom.com", TEST_PASSWORD));
+        User u3 = User.getById(createVerificationUser("testmaster", "testname", createUniqueName() + "@testdom.com", TEST_PASSWORD));
         User u4_dummy = User.getById(createVerifiedUser("testmaster", "testname", createUniqueName() + "@testdom.com", TEST_PASSWORD));
         Organisation o1 = createUniqueOrg();
         o1.addAdmin(u3, u, true);
         User u4_dummy = User.getById(createVerifiedUser("testmaster", "testname", createUniqueName() + "@testdom.com", TEST_PASSWORD));
         Organisation o1 = createUniqueOrg();
         o1.addAdmin(u3, u, true);
index c0a966fca5c91892c5f876607498544884234a85..b694db76aa35ac094613d0886211f95dccb3a369 100644 (file)
@@ -34,7 +34,7 @@ public class TestTTP extends ClientTest {
 
     @Test
     public void testTTPEnoughPoints() throws IOException, GigiApiException {
 
     @Test
     public void testTTPEnoughPoints() throws IOException, GigiApiException {
-        User u = User.getById(createAssuranceUser("fn", "ln", createUniqueName() + "@example.org", TEST_PASSWORD));
+        User u = User.getById(createVerificationUser("fn", "ln", createUniqueName() + "@example.org", TEST_PASSWORD));
         cookie = login(u.getEmail(), TEST_PASSWORD);
 
         String ttp = IOUtils.readURL(get(RequestTTPPage.PATH));
         cookie = login(u.getEmail(), TEST_PASSWORD);
 
         String ttp = IOUtils.readURL(get(RequestTTPPage.PATH));
similarity index 67%
rename from tests/club/wpia/gigi/pages/wot/TestAssurance.java
rename to tests/club/wpia/gigi/pages/wot/TestVerification.java
index 20ebe100587054e7e02f74d00c6b4559ddc02ff0..ef37f5980b518ba607be58bec097b744164900d9 100644 (file)
@@ -26,71 +26,69 @@ import club.wpia.gigi.dbObjects.Country;
 import club.wpia.gigi.dbObjects.Group;
 import club.wpia.gigi.dbObjects.User;
 import club.wpia.gigi.pages.account.MyDetails;
 import club.wpia.gigi.dbObjects.Group;
 import club.wpia.gigi.dbObjects.User;
 import club.wpia.gigi.pages.account.MyDetails;
-import club.wpia.gigi.pages.wot.AssurePage;
-import club.wpia.gigi.pages.wot.Points;
 import club.wpia.gigi.testUtils.IOUtils;
 import club.wpia.gigi.testUtils.ManagedTest;
 import club.wpia.gigi.testUtils.TestEmailReceiver.TestMail;
 import club.wpia.gigi.util.DayDate;
 import club.wpia.gigi.util.Notary;
 
 import club.wpia.gigi.testUtils.IOUtils;
 import club.wpia.gigi.testUtils.ManagedTest;
 import club.wpia.gigi.testUtils.TestEmailReceiver.TestMail;
 import club.wpia.gigi.util.DayDate;
 import club.wpia.gigi.util.Notary;
 
-public class TestAssurance extends ManagedTest {
+public class TestVerification extends ManagedTest {
 
 
-    private String assurerM;
+    private String agentM;
 
 
-    private String assureeM;
+    private String applicantM;
 
 
-    private int assureeName;
+    private int applicantName;
 
     private String cookie;
 
     @Before
     public void setup() throws IOException {
         clearCaches();
 
     private String cookie;
 
     @Before
     public void setup() throws IOException {
         clearCaches();
-        assurerM = createUniqueName() + "@example.org";
-        assureeM = createUniqueName() + "@example.org";
+        agentM = createUniqueName() + "@example.org";
+        applicantM = createUniqueName() + "@example.org";
 
 
-        createAssuranceUser("a", "b", assurerM, TEST_PASSWORD);
-        int assureeId = createVerifiedUser("a", "c", assureeM, TEST_PASSWORD);
-        assureeName = User.getById(assureeId).getPreferredName().getId();
+        createVerificationUser("a", "b", agentM, TEST_PASSWORD);
+        int applicantId = createVerifiedUser("a", "c", applicantM, TEST_PASSWORD);
+        applicantName = User.getById(applicantId).getPreferredName().getId();
 
 
-        cookie = login(assurerM, TEST_PASSWORD);
+        cookie = login(agentM, TEST_PASSWORD);
     }
 
     }
 
-    private Matcher<String> isAssuranceForm() {
-        return containsString("<select name=\"assuranceType\">");
+    private Matcher<String> isVerificationForm() {
+        return containsString("<select name=\"verificationType\">");
     }
 
     @Test
     }
 
     @Test
-    public void testAssureSearch() throws IOException {
-        String loc = search("email=" + URLEncoder.encode(assureeM, "UTF-8") + "&day=1&month=1&year=1910");
-        assertThat(loc, isAssuranceForm());
+    public void testVerifySearch() throws IOException {
+        String loc = search("email=" + URLEncoder.encode(applicantM, "UTF-8") + "&day=1&month=1&year=1910");
+        assertThat(loc, isVerificationForm());
     }
 
     @Test
     }
 
     @Test
-    public void testAssureSearchEmail() throws IOException {
-        String loc = search("email=1" + URLEncoder.encode(assureeM, "UTF-8") + "&day=1&month=1&year=1910");
-        assertThat(loc, not(isAssuranceForm()));
+    public void testVerifySearchEmail() throws IOException {
+        String loc = search("email=1" + URLEncoder.encode(applicantM, "UTF-8") + "&day=1&month=1&year=1910");
+        assertThat(loc, not(isVerificationForm()));
     }
 
     @Test
     }
 
     @Test
-    public void testAssureSearchDobInvalid() throws IOException {
-        String loc = search("email=" + URLEncoder.encode(assureeM, "UTF-8") + "&day=1&month=1&year=mal");
-        assertThat(loc, not(isAssuranceForm()));
+    public void testVerifySearchDobInvalid() throws IOException {
+        String loc = search("email=" + URLEncoder.encode(applicantM, "UTF-8") + "&day=1&month=1&year=mal");
+        assertThat(loc, not(isVerificationForm()));
     }
 
     @Test
     }
 
     @Test
-    public void testAssureSearchDob() throws IOException {
-        String loc = search("email=" + URLEncoder.encode(assureeM, "UTF-8") + "&day=2&month=1&year=1910");
-        assertThat(loc, not(isAssuranceForm()));
-        loc = search("email=" + URLEncoder.encode(assureeM, "UTF-8") + "&day=1&month=2&year=1910");
-        assertThat(loc, not(isAssuranceForm()));
-        loc = search("email=" + URLEncoder.encode(assureeM, "UTF-8") + "&day=1&month=1&year=1911");
-        assertThat(loc, not(isAssuranceForm()));
+    public void testVerifySearchDob() throws IOException {
+        String loc = search("email=" + URLEncoder.encode(applicantM, "UTF-8") + "&day=2&month=1&year=1910");
+        assertThat(loc, not(isVerificationForm()));
+        loc = search("email=" + URLEncoder.encode(applicantM, "UTF-8") + "&day=1&month=2&year=1910");
+        assertThat(loc, not(isVerificationForm()));
+        loc = search("email=" + URLEncoder.encode(applicantM, "UTF-8") + "&day=1&month=1&year=1911");
+        assertThat(loc, not(isVerificationForm()));
     }
 
     private String search(String query) throws MalformedURLException, IOException, UnsupportedEncodingException {
     }
 
     private String search(String query) throws MalformedURLException, IOException, UnsupportedEncodingException {
-        URLConnection uc = get(cookie, AssurePage.PATH);
+        URLConnection uc = get(cookie, VerifyPage.PATH);
         uc.setDoOutput(true);
         uc.getOutputStream().write(("search&" + query).getBytes("UTF-8"));
         uc.getOutputStream().flush();
         uc.setDoOutput(true);
         uc.getOutputStream().write(("search&" + query).getBytes("UTF-8"));
         uc.getOutputStream().flush();
@@ -99,13 +97,13 @@ public class TestAssurance extends ManagedTest {
     }
 
     @Test
     }
 
     @Test
-    public void testAssureForm() throws IOException {
+    public void testVerifyForm() throws IOException {
         executeSuccess("date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&certify=1&rules=1&assertion=1&points=10");
     }
 
     @Test
         executeSuccess("date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&certify=1&rules=1&assertion=1&points=10");
     }
 
     @Test
-    public void testAssureFormEmpty() throws IOException {
-        URLConnection uc = buildupAssureFormConnection(true);
+    public void testVerifyFormEmpty() throws IOException {
+        URLConnection uc = buildupVerifyFormConnection(true);
         uc.getOutputStream().write(("date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&rules=1&assertion=1&points=10").getBytes("UTF-8"));
         uc.getOutputStream().flush();
         String data = IOUtils.readURL(uc);
         uc.getOutputStream().write(("date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&rules=1&assertion=1&points=10").getBytes("UTF-8"));
         uc.getOutputStream().flush();
         String data = IOUtils.readURL(uc);
@@ -113,9 +111,9 @@ public class TestAssurance extends ManagedTest {
     }
 
     @Test
     }
 
     @Test
-    public void testAssureFormContanisData() throws IOException {
-        URLConnection uc = buildupAssureFormConnection(true);
-        uc.getOutputStream().write(("assuredName=" + assureeName + "&date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&rules=1&assertion=1&points=10").getBytes("UTF-8"));
+    public void testVerifyFormContainsData() throws IOException {
+        URLConnection uc = buildupVerifyFormConnection(true);
+        uc.getOutputStream().write(("verifiedName=" + applicantName + "&date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&rules=1&assertion=1&points=10").getBytes("UTF-8"));
         uc.getOutputStream().flush();
         String data = IOUtils.readURL(uc);
         assertThat(data, containsString(validVerificationDateString()));
         uc.getOutputStream().flush();
         String data = IOUtils.readURL(uc);
         assertThat(data, containsString(validVerificationDateString()));
@@ -123,42 +121,42 @@ public class TestAssurance extends ManagedTest {
     }
 
     @Test
     }
 
     @Test
-    public void testAssureFormNoCSRF() throws IOException {
+    public void testVerifyFormNoCSRF() throws IOException {
         // override csrf
         // override csrf
-        HttpURLConnection uc = (HttpURLConnection) buildupAssureFormConnection(false);
+        HttpURLConnection uc = (HttpURLConnection) buildupVerifyFormConnection(false);
         uc.getOutputStream().write(("date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&certify=1&rules=1&assertion=1&points=10").getBytes("UTF-8"));
         uc.getOutputStream().flush();
         assertEquals(500, uc.getResponseCode());
     }
 
     @Test
         uc.getOutputStream().write(("date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&certify=1&rules=1&assertion=1&points=10").getBytes("UTF-8"));
         uc.getOutputStream().flush();
         assertEquals(500, uc.getResponseCode());
     }
 
     @Test
-    public void testAssureFormWrongCSRF() throws IOException {
+    public void testVerifyFormWrongCSRF() throws IOException {
         // override csrf
         // override csrf
-        HttpURLConnection uc = (HttpURLConnection) buildupAssureFormConnection(false);
+        HttpURLConnection uc = (HttpURLConnection) buildupVerifyFormConnection(false);
         uc.getOutputStream().write(("date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&certify=1&rules=1&assertion=1&points=10&csrf=aragc").getBytes("UTF-8"));
         uc.getOutputStream().flush();
         assertEquals(500, uc.getResponseCode());
     }
 
     @Test
         uc.getOutputStream().write(("date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&certify=1&rules=1&assertion=1&points=10&csrf=aragc").getBytes("UTF-8"));
         uc.getOutputStream().flush();
         assertEquals(500, uc.getResponseCode());
     }
 
     @Test
-    public void testAssureFormRaceDoB() throws IOException, SQLException {
-        testAssureFormRace(false);
+    public void testVerifyFormRaceDoB() throws IOException, SQLException {
+        testVerifyFormRace(false);
     }
 
     @Test
     }
 
     @Test
-    public void testAssureFormRaceDoBBlind() throws IOException, SQLException {
-        testAssureFormRace(true);
+    public void testVerifyFormRaceDoBBlind() throws IOException, SQLException {
+        testVerifyFormRace(true);
     }
 
     }
 
-    public void testAssureFormRace(boolean succeed) throws IOException, SQLException {
-        URLConnection uc = buildupAssureFormConnection(true);
+    public void testVerifyFormRace(boolean succeed) throws IOException, SQLException {
+        URLConnection uc = buildupVerifyFormConnection(true);
 
 
-        String assureeCookie = login(assureeM, TEST_PASSWORD);
+        String applicantCookie = login(applicantM, TEST_PASSWORD);
         String newDob = "day=1&month=1&year=" + ( !succeed ? 1911 : 1910);
 
         String newDob = "day=1&month=1&year=" + ( !succeed ? 1911 : 1910);
 
-        assertNull(executeBasicWebInteraction(assureeCookie, MyDetails.PATH, newDob + "&action=updateDoB", 0));
+        assertNull(executeBasicWebInteraction(applicantCookie, MyDetails.PATH, newDob + "&action=updateDoB", 0));
 
 
-        uc.getOutputStream().write(("assuredName=" + assureeName + "&date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&certify=1&rules=1&assertion=1&points=10").getBytes("UTF-8"));
+        uc.getOutputStream().write(("verifiedName=" + applicantName + "&date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&certify=1&rules=1&assertion=1&points=10").getBytes("UTF-8"));
         uc.getOutputStream().flush();
         String error = fetchStartErrorMessage(IOUtils.readURL(uc));
         if (succeed) {
         uc.getOutputStream().flush();
         String error = fetchStartErrorMessage(IOUtils.readURL(uc));
         if (succeed) {
@@ -170,14 +168,14 @@ public class TestAssurance extends ManagedTest {
     }
 
     @Test
     }
 
     @Test
-    public void testAssureFormFuture() throws IOException {
+    public void testVerifyFormFuture() throws IOException {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
         int year = Integer.parseInt(sdf.format(new Date(System.currentTimeMillis()))) + 2;
         executeFails("date=" + year + "-01-01&location=testcase&countryCode=DE&certify=1&rules=1&assertion=1&points=10");
     }
 
     @Test
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
         int year = Integer.parseInt(sdf.format(new Date(System.currentTimeMillis()))) + 2;
         executeFails("date=" + year + "-01-01&location=testcase&countryCode=DE&certify=1&rules=1&assertion=1&points=10");
     }
 
     @Test
-    public void testAssureFormFutureOK() throws IOException {
+    public void testVerifyFormFutureOK() throws IOException {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         Calendar c = Calendar.getInstance();
         c.setTimeInMillis(System.currentTimeMillis());
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         Calendar c = Calendar.getInstance();
         c.setTimeInMillis(System.currentTimeMillis());
@@ -187,12 +185,12 @@ public class TestAssurance extends ManagedTest {
     }
 
     @Test
     }
 
     @Test
-    public void testAssureFormPastInRange() throws IOException {
+    public void testVerifyFormPastInRange() throws IOException {
         executeSuccess("date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&certify=1&rules=1&assertion=1&points=10");
     }
 
     @Test
         executeSuccess("date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&certify=1&rules=1&assertion=1&points=10");
     }
 
     @Test
-    public void testAssureFormPastOnLimit() throws IOException {
+    public void testVerifyFormPastOnLimit() throws IOException {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         Calendar c = Calendar.getInstance();
         c.setTimeInMillis(System.currentTimeMillis());
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         Calendar c = Calendar.getInstance();
         c.setTimeInMillis(System.currentTimeMillis());
@@ -203,7 +201,7 @@ public class TestAssurance extends ManagedTest {
     }
 
     @Test
     }
 
     @Test
-    public void testAssureFormPastOutOfRange() throws IOException {
+    public void testVerifyFormPastOutOfRange() throws IOException {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         Calendar c = Calendar.getInstance();
         c.setTimeInMillis(System.currentTimeMillis());
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         Calendar c = Calendar.getInstance();
         c.setTimeInMillis(System.currentTimeMillis());
@@ -213,30 +211,30 @@ public class TestAssurance extends ManagedTest {
     }
 
     @Test
     }
 
     @Test
-    public void testAssureFormNoLoc() throws IOException {
+    public void testVerifyFormNoLoc() throws IOException {
         executeFails("date=" + validVerificationDateString() + "&location=a&countryCode=DE&certify=1&rules=1&assertion=1&points=10");
         executeFails("date=" + validVerificationDateString() + "&location=&countryCode=DE&certify=1&rules=1&assertion=1&points=10");
     }
 
     @Test
         executeFails("date=" + validVerificationDateString() + "&location=a&countryCode=DE&certify=1&rules=1&assertion=1&points=10");
         executeFails("date=" + validVerificationDateString() + "&location=&countryCode=DE&certify=1&rules=1&assertion=1&points=10");
     }
 
     @Test
-    public void testAssureFormInvalDate() throws IOException {
+    public void testVerifyFormInvalDate() throws IOException {
         executeFails("date=20000101&location=testcase&countryCode=DE&certify=1&rules=1&assertion=1&points=10");
         executeFails("date=&location=testcase&countryCode=DE&certify=1&rules=1&assertion=1&points=10");
     }
 
     @Test
         executeFails("date=20000101&location=testcase&countryCode=DE&certify=1&rules=1&assertion=1&points=10");
         executeFails("date=&location=testcase&countryCode=DE&certify=1&rules=1&assertion=1&points=10");
     }
 
     @Test
-    public void testAssureFormBoxes() throws IOException {
+    public void testVerifyFormBoxes() throws IOException {
         executeFails("date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&certify=0&rules=1&assertion=1&points=10");
         executeFails("date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&certify=1&rules=&assertion=1&points=10");
         executeFails("date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&certify=1&rules=1&assertion=z&points=10");
     }
 
     @Test
         executeFails("date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&certify=0&rules=1&assertion=1&points=10");
         executeFails("date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&certify=1&rules=&assertion=1&points=10");
         executeFails("date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&certify=1&rules=1&assertion=z&points=10");
     }
 
     @Test
-    public void testAssureListingValid() throws IOException, GigiApiException {
+    public void testVerifyListingValid() throws IOException, GigiApiException {
         String uniqueLoc = createUniqueName();
         execute("date=" + validVerificationDateString() + "&location=" + uniqueLoc + "&countryCode=DE&certify=1&rules=1&assertion=1&points=10");
 
         String uniqueLoc = createUniqueName();
         execute("date=" + validVerificationDateString() + "&location=" + uniqueLoc + "&countryCode=DE&certify=1&rules=1&assertion=1&points=10");
 
-        String cookie = login(assureeM, TEST_PASSWORD);
+        String cookie = login(applicantM, TEST_PASSWORD);
         URLConnection url = get(cookie, Points.PATH);
         String resp = IOUtils.readURL(url);
         resp = resp.split(Pattern.quote("</table>"))[1];
         URLConnection url = get(cookie, Points.PATH);
         String resp = IOUtils.readURL(url);
         resp = resp.split(Pattern.quote("</table>"))[1];
@@ -245,10 +243,10 @@ public class TestAssurance extends ManagedTest {
     }
 
     @Test
     }
 
     @Test
-    public void testAssurerListingValid() throws IOException, GigiApiException {
+    public void testAgentListingValid() throws IOException, GigiApiException {
         String uniqueLoc = createUniqueName();
         executeSuccess("date=" + validVerificationDateString() + "&location=" + uniqueLoc + "&countryCode=DE&certify=1&rules=1&assertion=1&points=10");
         String uniqueLoc = createUniqueName();
         executeSuccess("date=" + validVerificationDateString() + "&location=" + uniqueLoc + "&countryCode=DE&certify=1&rules=1&assertion=1&points=10");
-        String cookie = login(assurerM, TEST_PASSWORD);
+        String cookie = login(agentM, TEST_PASSWORD);
         URLConnection url = get(cookie, Points.PATH);
         String resp = IOUtils.readURL(url);
         resp = resp.split(Pattern.quote("</table>"))[2];
         URLConnection url = get(cookie, Points.PATH);
         String resp = IOUtils.readURL(url);
         resp = resp.split(Pattern.quote("</table>"))[2];
@@ -267,23 +265,23 @@ public class TestAssurance extends ManagedTest {
     }
 
     private String execute(String query) throws MalformedURLException, IOException {
     }
 
     private String execute(String query) throws MalformedURLException, IOException {
-        URLConnection uc = buildupAssureFormConnection(true);
-        uc.getOutputStream().write(("assuredName=" + assureeName + "&" + query).getBytes("UTF-8"));
+        URLConnection uc = buildupVerifyFormConnection(true);
+        uc.getOutputStream().write(("verifiedName=" + applicantName + "&" + query).getBytes("UTF-8"));
         uc.getOutputStream().flush();
         return IOUtils.readURL(uc);
     }
 
         uc.getOutputStream().flush();
         return IOUtils.readURL(uc);
     }
 
-    private URLConnection buildupAssureFormConnection(boolean doCSRF) throws MalformedURLException, IOException {
-        return buildupAssureFormConnection(cookie, assureeM, doCSRF);
+    private URLConnection buildupVerifyFormConnection(boolean doCSRF) throws MalformedURLException, IOException {
+        return buildupVerifyFormConnection(cookie, applicantM, doCSRF);
     }
 
     }
 
-    public static URLConnection buildupAssureFormConnection(String cookie, String email, boolean doCSRF) throws MalformedURLException, IOException {
-        URLConnection uc = get(cookie, AssurePage.PATH);
+    public static URLConnection buildupVerifyFormConnection(String cookie, String email, boolean doCSRF) throws MalformedURLException, IOException {
+        URLConnection uc = get(cookie, VerifyPage.PATH);
         uc.setDoOutput(true);
         uc.getOutputStream().write(("email=" + URLEncoder.encode(email, "UTF-8") + "&day=1&month=1&year=1910&search").getBytes("UTF-8"));
 
         String csrf = getCSRF(uc);
         uc.setDoOutput(true);
         uc.getOutputStream().write(("email=" + URLEncoder.encode(email, "UTF-8") + "&day=1&month=1&year=1910&search").getBytes("UTF-8"));
 
         String csrf = getCSRF(uc);
-        uc = get(cookie, AssurePage.PATH);
+        uc = get(cookie, VerifyPage.PATH);
         uc.setDoOutput(true);
         if (doCSRF) {
             uc.getOutputStream().write(("csrf=" + csrf + "&").getBytes("UTF-8"));
         uc.setDoOutput(true);
         if (doCSRF) {
             uc.getOutputStream().write(("csrf=" + csrf + "&").getBytes("UTF-8"));
@@ -292,12 +290,12 @@ public class TestAssurance extends ManagedTest {
     }
 
     @Test
     }
 
     @Test
-    public void testMultipleAssurance() throws IOException {
+    public void testMultipleVerification() throws IOException {
 
 
-        User users[] = User.findByEmail(assurerM);
+        User users[] = User.findByEmail(agentM);
         int agentID = users[0].getId();
 
         int agentID = users[0].getId();
 
-        users = User.findByEmail(assureeM);
+        users = User.findByEmail(applicantM);
         int applicantID = users[0].getId();
 
         // enter first entry 200 days in the past
         int applicantID = users[0].getId();
 
         // enter first entry 200 days in the past
@@ -316,15 +314,15 @@ public class TestAssurance extends ManagedTest {
         executeSuccess("date=" + validVerificationDateString() + "&location=" + uniqueLoc + "&countryCode=DE&certify=1&rules=1&assertion=1&points=10");
 
         // enter third entry on the same day
         executeSuccess("date=" + validVerificationDateString() + "&location=" + uniqueLoc + "&countryCode=DE&certify=1&rules=1&assertion=1&points=10");
 
         // enter third entry on the same day
-        URLConnection uc = get(cookie, AssurePage.PATH);
+        URLConnection uc = get(cookie, VerifyPage.PATH);
         uc.setDoOutput(true);
         uc.setDoOutput(true);
-        uc.getOutputStream().write(("email=" + URLEncoder.encode(assureeM, "UTF-8") + "&day=1&month=1&year=1910&search").getBytes("UTF-8"));
+        uc.getOutputStream().write(("email=" + URLEncoder.encode(applicantM, "UTF-8") + "&day=1&month=1&year=1910&search").getBytes("UTF-8"));
         assertThat(IOUtils.readURL(uc), hasError());
 
     }
 
     @Test
         assertThat(IOUtils.readURL(uc), hasError());
 
     }
 
     @Test
-    public void testAssureFormNoCountry() throws IOException {
+    public void testVerifyFormNoCountry() throws IOException {
         executeFails("date=" + validVerificationDateString() + "&location=testcase&countryCode=&certify=1&rules=1&assertion=1&points=10");
     }
 
         executeFails("date=" + validVerificationDateString() + "&location=testcase&countryCode=&certify=1&rules=1&assertion=1&points=10");
     }
 
@@ -332,13 +330,13 @@ public class TestAssurance extends ManagedTest {
     public void testRANotificationSet() throws IOException, GigiApiException {
         getMailReceiver().clearMails();
 
     public void testRANotificationSet() throws IOException, GigiApiException {
         getMailReceiver().clearMails();
 
-        User users[] = User.findByEmail(assurerM);
+        User users[] = User.findByEmail(agentM);
         assertTrue("user RA Agent not found", users != null && users.length > 0);
 
         User u = users[0];
         u.grantGroup(u, Group.VERIFY_NOTIFICATION);
         clearCaches();
         assertTrue("user RA Agent not found", users != null && users.length > 0);
 
         User u = users[0];
         u.grantGroup(u, Group.VERIFY_NOTIFICATION);
         clearCaches();
-        cookie = login(assurerM, TEST_PASSWORD);
+        cookie = login(agentM, TEST_PASSWORD);
 
         String targetMail = u.getEmail();
 
 
         String targetMail = u.getEmail();
 
@@ -350,7 +348,7 @@ public class TestAssurance extends ManagedTest {
         do {
             tm = getMailReceiver().receive();
         } while ( !tm.getTo().equals(targetMail));
         do {
             tm = getMailReceiver().receive();
         } while ( !tm.getTo().equals(targetMail));
-        assertThat(tm.getMessage(), containsString("You entered a verification for the account with email address " + assureeM));
+        assertThat(tm.getMessage(), containsString("You entered a verification for the account with email address " + applicantM));
 
     }
 
 
     }
 
@@ -358,13 +356,13 @@ public class TestAssurance extends ManagedTest {
     public void testRANotificationNotSet() throws IOException, GigiApiException {
         getMailReceiver().clearMails();
 
     public void testRANotificationNotSet() throws IOException, GigiApiException {
         getMailReceiver().clearMails();
 
-        User users[] = User.findByEmail(assurerM);
+        User users[] = User.findByEmail(agentM);
         assertTrue("user RA Agent not found", users != null && users.length > 0);
 
         User u = users[0];
         u.revokeGroup(u, Group.VERIFY_NOTIFICATION);
         clearCaches();
         assertTrue("user RA Agent not found", users != null && users.length > 0);
 
         User u = users[0];
         u.revokeGroup(u, Group.VERIFY_NOTIFICATION);
         clearCaches();
-        cookie = login(assurerM, TEST_PASSWORD);
+        cookie = login(agentM, TEST_PASSWORD);
 
         // enter verification
         String uniqueLoc = createUniqueName();
 
         // enter verification
         String uniqueLoc = createUniqueName();
@@ -373,7 +371,7 @@ public class TestAssurance extends ManagedTest {
         TestMail tm;
 
         tm = getMailReceiver().receive();
         TestMail tm;
 
         tm = getMailReceiver().receive();
-        assertThat(tm.getMessage(), not(containsString("You entered a verification for the account with email address " + assureeM)));
+        assertThat(tm.getMessage(), not(containsString("You entered a verification for the account with email address " + applicantM)));
 
     }
 }
 
     }
 }
index d62713a6026c6e2e333344fd05a28b1b2f3f60f6..31d3b09408caedb6cc9712db04580d39b0599715 100644 (file)
@@ -148,9 +148,9 @@ public abstract class BusinessTest extends ConfiguredTest {
         return u;
     }
 
         return u;
     }
 
-    public static int createAssuranceUser(String f, String l, String mail, String pw) throws GigiApiException {
+    public static int createVerificationUser(String f, String l, String mail, String pw) throws GigiApiException {
         int u = createVerifiedUser(f, l, mail, pw);
         int u = createVerifiedUser(f, l, mail, pw);
-        makeAssurer(u);
+        makeAgent(u);
         return u;
     }
 
         return u;
     }
 
index bf50d6112af53ce1565eadf1b0c8cc7dd3266f0e..e4c41b671f53e833263797ffec800712faa62860 100644 (file)
@@ -209,10 +209,10 @@ public abstract class ConfiguredTest {
         return i;
     }
 
         return i;
     }
 
-    public static void makeAssurer(int uid) {
+    public static void makeAgent(int uid) {
         try (GigiPreparedStatement ps1 = new GigiPreparedStatement("INSERT INTO cats_passed SET user_id=?, variant_id=?, language='en_EN', version='1'")) {
             ps1.setInt(1, uid);
         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, CATSType.ASSURER_CHALLENGE.getId());
+            ps1.setInt(2, CATSType.AGENT_CHALLENGE.getId());
             ps1.execute();
         }
 
             ps1.execute();
         }
 
index 2574922196c28d5262ba3778070ab6941dc42839..f4ad8522899d4bc34c4c559658db86ecfe41a94e 100644 (file)
@@ -315,10 +315,10 @@ public class ManagedTest extends ConfiguredTest {
      *            the password
      * @return a new userid.
      */
      *            the password
      * @return a new userid.
      */
-    public static int createAssuranceUser(String firstName, String lastName, String email, String password) {
+    public static int createVerificationUser(String firstName, String lastName, String email, String password) {
         int uid = createVerifiedUser(firstName, lastName, email, password);
 
         int uid = createVerifiedUser(firstName, lastName, email, password);
 
-        makeAssurer(uid);
+        makeAgent(uid);
 
         return uid;
     }
 
         return uid;
     }
index e7360fe2a5c2ae6e55652dd27ecbff1203ee9beb..949bd2d1ebc8cc98c1754d91b80a45a9bcbf43a4 100644 (file)
@@ -11,7 +11,7 @@ import club.wpia.gigi.dbObjects.Country.CountryCodeType;
 public class OrgTest extends ClientTest {
 
     public OrgTest() throws IOException, GigiApiException {
 public class OrgTest extends ClientTest {
 
     public OrgTest() throws IOException, GigiApiException {
-        makeAssurer(u.getId());
+        makeAgent(u.getId());
         u.grantGroup(getSupporter(), Group.ORGASSURER);
         clearCaches();
         cookie = login(email, TEST_PASSWORD);
         u.grantGroup(getSupporter(), Group.ORGASSURER);
         clearCaches();
         cookie = login(email, TEST_PASSWORD);
index a96414fa55fc2e8d2f9878489c310799378cd1cb..3a0f45157cb3e501bb48bec0e6973850a6a9705e 100644 (file)
@@ -35,14 +35,14 @@ public class RestrictedApiTest extends ClientTest {
     protected static Organisation selfOrg;
 
     public RestrictedApiTest() {
     protected static Organisation selfOrg;
 
     public RestrictedApiTest() {
-        makeAssurer(id);
+        makeAgent(id);
     }
 
     @BeforeClass
     public static void initCert() {
         initEnvironment();
         try {
     }
 
     @BeforeClass
     public static void initCert() {
         initEnvironment();
         try {
-            User u = User.getById(createAssuranceUser("f", "l", createUniqueName() + "@email.com", TEST_PASSWORD));
+            User u = User.getById(createVerificationUser("f", "l", createUniqueName() + "@email.com", TEST_PASSWORD));
             grant(u, Group.ORGASSURER);
             clearCaches();
             u = User.getById(u.getId());
             grant(u, Group.ORGASSURER);
             clearCaches();
             u = User.getById(u.getId());
index 6733dd63f5c8bfb6752201e5f63ff4c85084abc8..45217fd8d00fc8d3afd0656a7d257152023c883f 100644 (file)
@@ -11,19 +11,18 @@ import org.junit.Test;
 import club.wpia.gigi.GigiApiException;
 import club.wpia.gigi.database.GigiPreparedStatement;
 import club.wpia.gigi.dbObjects.CATS;
 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.Country;
 import club.wpia.gigi.dbObjects.Country;
+import club.wpia.gigi.dbObjects.Country.CountryCodeType;
 import club.wpia.gigi.dbObjects.Group;
 import club.wpia.gigi.dbObjects.Name;
 import club.wpia.gigi.dbObjects.NamePart;
 import club.wpia.gigi.dbObjects.Group;
 import club.wpia.gigi.dbObjects.Name;
 import club.wpia.gigi.dbObjects.NamePart;
+import club.wpia.gigi.dbObjects.NamePart.NamePartType;
 import club.wpia.gigi.dbObjects.ObjectCache;
 import club.wpia.gigi.dbObjects.User;
 import club.wpia.gigi.dbObjects.ObjectCache;
 import club.wpia.gigi.dbObjects.User;
-import club.wpia.gigi.dbObjects.Assurance.AssuranceType;
-import club.wpia.gigi.dbObjects.CATS.CATSType;
-import club.wpia.gigi.dbObjects.Country.CountryCodeType;
-import club.wpia.gigi.dbObjects.NamePart.NamePartType;
+import club.wpia.gigi.dbObjects.Verification.VerificationType;
 import club.wpia.gigi.output.DateSelector;
 import club.wpia.gigi.testUtils.BusinessTest;
 import club.wpia.gigi.output.DateSelector;
 import club.wpia.gigi.testUtils.BusinessTest;
-import club.wpia.gigi.util.Notary;
 
 public class TestNotary extends BusinessTest {
 
 
 public class TestNotary extends BusinessTest {
 
@@ -32,40 +31,40 @@ public class TestNotary extends BusinessTest {
     public TestNotary() throws GigiApiException {}
 
     @Test
     public TestNotary() throws GigiApiException {}
 
     @Test
-    public void testNormalAssurance() throws SQLException, GigiApiException {
+    public void testNormalVerification() throws SQLException, GigiApiException {
         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);
             users[i] = User.getById(id);
         }
         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);
             users[i] = User.getById(id);
         }
-        User assurer = User.getById(createAssuranceUser("fn", "ln", createUniqueName() + "@email.org", TEST_PASSWORD));
+        User agent = User.getById(createVerificationUser("fn", "ln", createUniqueName() + "@email.org", TEST_PASSWORD));
         int[] result = new int[] {
                 10, 10, 10, 10, 15, 15, 15, 15, 15, 20, 20, 20, 20, 20, 25, 25, 25, 25, 25, 30, 30, 30, 30, 30, 35, 35, 35, 35, 35, 35
         };
 
         try {
         int[] result = new int[] {
                 10, 10, 10, 10, 15, 15, 15, 15, 15, 20, 20, 20, 20, 20, 25, 25, 25, 25, 25, 30, 30, 30, 30, 30, 35, 35, 35, 35, 35, 35
         };
 
         try {
-            Notary.assure(assurer, users[0], users[0].getPreferredName(), users[0].getDoB(), -1, "test-notary", validVerificationDateString(), AssuranceType.FACE_TO_FACE, DE);
+            Notary.verify(agent, users[0], users[0].getPreferredName(), users[0].getDoB(), -1, "test-notary", validVerificationDateString(), VerificationType.FACE_TO_FACE, DE);
             fail("This shouldn't have passed");
         } catch (GigiApiException e) {
             // expected
         }
         for (int i = 0; i < result.length; i++) {
             fail("This shouldn't have passed");
         } catch (GigiApiException e) {
             // expected
         }
         for (int i = 0; i < result.length; i++) {
-            assertEquals(result[i], assurer.getMaxAssurePoints());
+            assertEquals(result[i], agent.getMaxVerifyPoints());
 
 
-            assuranceFail(assurer, users[i], result[i] + 1, "test-notary", validVerificationDateString());
-            Notary.assure(assurer, users[i], users[i].getPreferredName(), users[i].getDoB(), result[i], "test-notary", validVerificationDateString(), AssuranceType.FACE_TO_FACE, DE);
-            assuranceFail(assurer, users[i], result[i], "test-notary", validVerificationDateString());
+            verificationFail(agent, users[i], result[i] + 1, "test-notary", validVerificationDateString());
+            Notary.verify(agent, users[i], users[i].getPreferredName(), users[i].getDoB(), result[i], "test-notary", validVerificationDateString(), VerificationType.FACE_TO_FACE, DE);
+            verificationFail(agent, users[i], result[i], "test-notary", validVerificationDateString());
         }
 
         }
 
-        assertEquals(35, assurer.getMaxAssurePoints());
+        assertEquals(35, agent.getMaxVerifyPoints());
 
 
-        assertEquals(User.EXPERIENCE_POINTS + (30 * User.EXPERIENCE_POINTS), assurer.getExperiencePoints());
+        assertEquals(User.EXPERIENCE_POINTS + (30 * User.EXPERIENCE_POINTS), agent.getExperiencePoints());
 
     }
 
 
     }
 
-    private void assuranceFail(User assurer, User user, int i, String location, String date) throws SQLException {
+    private void verificationFail(User agent, User applicant, int i, String location, String date) throws SQLException {
         try {
         try {
-            Notary.assure(assurer, user, user.getPreferredName(), user.getDoB(), i, location, date, AssuranceType.FACE_TO_FACE, DE);
+            Notary.verify(agent, applicant, applicant.getPreferredName(), applicant.getDoB(), i, location, date, VerificationType.FACE_TO_FACE, DE);
             fail("This shouldn't have passed");
         } catch (GigiApiException e) {
             // expected
             fail("This shouldn't have passed");
         } catch (GigiApiException e) {
             // expected
@@ -79,95 +78,95 @@ public class TestNotary extends BusinessTest {
             int id = createVerifiedUser("fn" + i, "ln" + i, createUniqueName() + "@email.org", TEST_PASSWORD);
             users[i] = User.getById(id);
         }
             int id = createVerifiedUser("fn" + i, "ln" + i, createUniqueName() + "@email.org", TEST_PASSWORD);
             users[i] = User.getById(id);
         }
-        int id = createAssuranceUser("fn", "ln", createUniqueName() + "@email.org", TEST_PASSWORD);
+        int id = createVerificationUser("fn", "ln", createUniqueName() + "@email.org", TEST_PASSWORD);
         try (GigiPreparedStatement ps = new GigiPreparedStatement("UPDATE `users` SET dob=NOW() - interval '15 years' WHERE id=?")) {
             ps.setInt(1, id);
             ps.execute();
         }
         ObjectCache.clearAllCaches(); // reload values from db
         try (GigiPreparedStatement ps = new GigiPreparedStatement("UPDATE `users` SET dob=NOW() - interval '15 years' WHERE id=?")) {
             ps.setInt(1, id);
             ps.execute();
         }
         ObjectCache.clearAllCaches(); // reload values from db
-        User assurer = User.getById(id);
+        User agent = User.getById(id);
         for (int i = 0; i < users.length; i++) {
         for (int i = 0; i < users.length; i++) {
-            assuranceFail(assurer, users[i], -1, "test-notary", validVerificationDateString());
-            assuranceFail(assurer, users[i], 11, "test-notary", validVerificationDateString());
+            verificationFail(agent, users[i], -1, "test-notary", validVerificationDateString());
+            verificationFail(agent, users[i], 11, "test-notary", validVerificationDateString());
             if (User.POJAM_ENABLED) {
             if (User.POJAM_ENABLED) {
-                Notary.assure(assurer, users[i], users[i].getPreferredName(), users[i].getDoB(), 10, "test-notary", validVerificationDateString(), AssuranceType.FACE_TO_FACE, DE);
+                Notary.verify(agent, users[i], users[i].getPreferredName(), users[i].getDoB(), 10, "test-notary", validVerificationDateString(), VerificationType.FACE_TO_FACE, DE);
             }
             }
-            assuranceFail(assurer, users[i], 10, "test-notary", validVerificationDateString());
+            verificationFail(agent, users[i], 10, "test-notary", validVerificationDateString());
         }
     }
 
     @Test
     public void testFail() throws SQLException, GigiApiException {
         }
     }
 
     @Test
     public void testFail() throws SQLException, GigiApiException {
-        User assuranceUser = User.getById(createAssuranceUser("fn", "ln", createUniqueName() + "@example.org", TEST_PASSWORD));
-        User assuree = User.getById(createVerifiedUser("fn", "ln", createUniqueName() + "@example.org", TEST_PASSWORD));
+        User agent = User.getById(createVerificationUser("fn", "ln", createUniqueName() + "@example.org", TEST_PASSWORD));
+        User applicant = User.getById(createVerifiedUser("fn", "ln", createUniqueName() + "@example.org", TEST_PASSWORD));
 
         // invalid date format
 
         // invalid date format
-        assuranceFail(assuranceUser, assuree, 10, "notary-junit-test", "2014-01-blah");
+        verificationFail(agent, applicant, 10, "notary-junit-test", "2014-01-blah");
         // empty date
         // empty date
-        assuranceFail(assuranceUser, assuree, 10, "notary-junit-test", "");
+        verificationFail(agent, applicant, 10, "notary-junit-test", "");
         // null date
         // null date
-        assuranceFail(assuranceUser, assuree, 10, "notary-junit-test", null);
+        verificationFail(agent, applicant, 10, "notary-junit-test", null);
         // null location
         // null location
-        assuranceFail(assuranceUser, assuree, 10, null, validVerificationDateString());
+        verificationFail(agent, applicant, 10, null, validVerificationDateString());
         // empty location
         // empty location
-        assuranceFail(assuranceUser, assuree, 10, "", validVerificationDateString());
+        verificationFail(agent, applicant, 10, "", validVerificationDateString());
         // date in the future
         // date in the future
-        assuranceFail(assuranceUser, assuree, 10, "notary-junit-test", DateSelector.getDateFormat().format(new Date(System.currentTimeMillis() + 2 * 24 * 60 * 60 * 1000)));
+        verificationFail(agent, applicant, 10, "notary-junit-test", DateSelector.getDateFormat().format(new Date(System.currentTimeMillis() + 2 * 24 * 60 * 60 * 1000)));
         // location too short
         // location too short
-        assuranceFail(assuranceUser, assuree, 10, "n", validVerificationDateString());
+        verificationFail(agent, applicant, 10, "n", validVerificationDateString());
         // points too low
         // points too low
-        assuranceFail(assuranceUser, assuree, -1, "notary-junit-test", validVerificationDateString());
+        verificationFail(agent, applicant, -1, "notary-junit-test", validVerificationDateString());
         // points too high
         // points too high
-        assuranceFail(assuranceUser, assuree, 11, "notary-junit-test", validVerificationDateString());
+        verificationFail(agent, applicant, 11, "notary-junit-test", validVerificationDateString());
 
         // verify oneself
 
         // verify oneself
-        assuranceFail(assuranceUser, assuranceUser, 10, "notary-junit-test", validVerificationDateString());
-        // not an assurer
-        assuranceFail(assuree, assuranceUser, 10, "notary-junit-test", validVerificationDateString());
+        verificationFail(agent, agent, 10, "notary-junit-test", validVerificationDateString());
+        // not an agent
+        verificationFail(applicant, agent, 10, "notary-junit-test", validVerificationDateString());
 
         // valid
 
         // valid
-        Notary.assure(assuranceUser, assuree, assuree.getPreferredName(), assuree.getDoB(), 10, "notary-junit-test", validVerificationDateString(), AssuranceType.FACE_TO_FACE, DE);
+        Notary.verify(agent, applicant, applicant.getPreferredName(), applicant.getDoB(), 10, "notary-junit-test", validVerificationDateString(), VerificationType.FACE_TO_FACE, DE);
 
         // verify double
 
         // verify double
-        assuranceFail(assuranceUser, assuree, 10, "notary-junit-test", validVerificationDateString());
+        verificationFail(agent, applicant, 10, "notary-junit-test", validVerificationDateString());
 
     }
 
     @Test
     public void testNucleus() throws SQLException, GigiApiException, IOException {
 
     }
 
     @Test
     public void testNucleus() throws SQLException, GigiApiException, IOException {
-        User assuranceUser = User.getById(createAssuranceUser("fn", "ln", createUniqueName() + "@example.org", TEST_PASSWORD));
-        assuranceUser.grantGroup(getSupporter(), Group.NUCLEUS_ASSURER);
-        User assuree = User.getById(createVerifiedUser("fn", "ln", createUniqueName() + "@example.org", TEST_PASSWORD));
-        Name n1 = assuree.getPreferredName();
-        Name n2 = new Name(assuree, new NamePart(NamePartType.FIRST_NAME, "F2"), new NamePart(NamePartType.LAST_NAME, "L2"));
-
-        assertEquals(0, assuree.getExperiencePoints());
-        assertEquals(User.EXPERIENCE_POINTS, assuranceUser.getExperiencePoints());
-        assertEquals(0, assuree.getAssurancePoints());
-        assertEquals(0, n2.getAssurancePoints());
-        Notary.assureAll(assuranceUser, assuree, assuree.getDoB(), 50, "notary-junit-test", validVerificationDateString(), AssuranceType.NUCLEUS, new Name[] {
+        User agent = User.getById(createVerificationUser("fn", "ln", createUniqueName() + "@example.org", TEST_PASSWORD));
+        agent.grantGroup(getSupporter(), Group.NUCLEUS_ASSURER);
+        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"));
+
+        assertEquals(0, applicant.getExperiencePoints());
+        assertEquals(User.EXPERIENCE_POINTS, agent.getExperiencePoints());
+        assertEquals(0, applicant.getVerificationPoints());
+        assertEquals(0, n2.getVerificationPoints());
+        Notary.verifyAll(agent, applicant, applicant.getDoB(), 50, "notary-junit-test", validVerificationDateString(), VerificationType.NUCLEUS, new Name[] {
                 n1, n2
         }, DE);
                 n1, n2
         }, DE);
-        assertEquals(0, assuree.getExperiencePoints());
-        assertEquals(2 * User.EXPERIENCE_POINTS, assuranceUser.getExperiencePoints());
-        assertEquals(50, assuree.getAssurancePoints());
-        assertEquals(50, n1.getAssurancePoints());
-        assertEquals(50, n2.getAssurancePoints());
+        assertEquals(0, applicant.getExperiencePoints());
+        assertEquals(2 * User.EXPERIENCE_POINTS, agent.getExperiencePoints());
+        assertEquals(50, applicant.getVerificationPoints());
+        assertEquals(50, n1.getVerificationPoints());
+        assertEquals(50, n2.getVerificationPoints());
     }
 
     @Test
     public void testNucleusProcess() throws SQLException, GigiApiException, IOException {
     }
 
     @Test
     public void testNucleusProcess() throws SQLException, GigiApiException, IOException {
-        User assuranceUser = User.getById(createAssuranceUser("fn", "ln", createUniqueName() + "@example.org", TEST_PASSWORD));
-        assuranceUser.grantGroup(getSupporter(), Group.NUCLEUS_ASSURER);
-        User assuranceUser2 = User.getById(createAssuranceUser("fn", "ln", createUniqueName() + "@example.org", TEST_PASSWORD));
-        assuranceUser2.grantGroup(getSupporter(), Group.NUCLEUS_ASSURER);
-        User assuree = User.getById(createVerifiedUser("fn", "ln", createUniqueName() + "@example.org", TEST_PASSWORD));
-        Notary.assure(assuranceUser, assuree, assuree.getPreferredName(), assuree.getDoB(), 50, "test", validVerificationDateString(), AssuranceType.NUCLEUS, DE);
-        Notary.assure(assuranceUser2, assuree, assuree.getPreferredName(), assuree.getDoB(), 50, "test", validVerificationDateString(), AssuranceType.NUCLEUS, DE);
-
-        assertEquals(100, assuree.getAssurancePoints());
-        assertFalse(assuree.canAssure());
-        CATS.enterResult(assuree, CATSType.ASSURER_CHALLENGE, new Date(), "de", "1");
-        assertTrue(assuree.canAssure());
+        User agent1 = User.getById(createVerificationUser("fn", "ln", createUniqueName() + "@example.org", TEST_PASSWORD));
+        agent1.grantGroup(getSupporter(), Group.NUCLEUS_ASSURER);
+        User agent2 = User.getById(createVerificationUser("fn", "ln", createUniqueName() + "@example.org", TEST_PASSWORD));
+        agent2.grantGroup(getSupporter(), Group.NUCLEUS_ASSURER);
+        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);
+
+        assertEquals(100, applicant.getVerificationPoints());
+        assertFalse(applicant.canVerify());
+        CATS.enterResult(applicant, CATSType.AGENT_CHALLENGE, new Date(), "de", "1");
+        assertTrue(applicant.canVerify());
     }
 }
     }
 }
index f74739897908c72f2cbfa07408eaf0dcaf53602e..7cecac2328dd1e11d4e972cb899277afefaffa71 100644 (file)
@@ -27,12 +27,10 @@ import java.util.regex.Pattern;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import sun.security.x509.X509Key;
 import club.wpia.gigi.Gigi;
 import club.wpia.gigi.GigiApiException;
 import club.wpia.gigi.crypto.SPKAC;
 import club.wpia.gigi.database.GigiPreparedStatement;
 import club.wpia.gigi.Gigi;
 import club.wpia.gigi.GigiApiException;
 import club.wpia.gigi.crypto.SPKAC;
 import club.wpia.gigi.database.GigiPreparedStatement;
-import club.wpia.gigi.dbObjects.Assurance.AssuranceType;
 import club.wpia.gigi.dbObjects.CATS;
 import club.wpia.gigi.dbObjects.CATS.CATSType;
 import club.wpia.gigi.dbObjects.Certificate;
 import club.wpia.gigi.dbObjects.CATS;
 import club.wpia.gigi.dbObjects.CATS.CATSType;
 import club.wpia.gigi.dbObjects.Certificate;
@@ -47,6 +45,7 @@ import club.wpia.gigi.dbObjects.Group;
 import club.wpia.gigi.dbObjects.NamePart;
 import club.wpia.gigi.dbObjects.NamePart.NamePartType;
 import club.wpia.gigi.dbObjects.User;
 import club.wpia.gigi.dbObjects.NamePart;
 import club.wpia.gigi.dbObjects.NamePart.NamePartType;
 import club.wpia.gigi.dbObjects.User;
+import club.wpia.gigi.dbObjects.Verification.VerificationType;
 import club.wpia.gigi.email.DelegateMailProvider;
 import club.wpia.gigi.localisation.Language;
 import club.wpia.gigi.output.template.IterableDataset;
 import club.wpia.gigi.email.DelegateMailProvider;
 import club.wpia.gigi.localisation.Language;
 import club.wpia.gigi.output.template.IterableDataset;
@@ -59,6 +58,7 @@ import club.wpia.gigi.util.DayDate;
 import club.wpia.gigi.util.HTMLEncoder;
 import club.wpia.gigi.util.Notary;
 import club.wpia.gigi.util.TimeConditions;
 import club.wpia.gigi.util.HTMLEncoder;
 import club.wpia.gigi.util.Notary;
 import club.wpia.gigi.util.TimeConditions;
+import sun.security.x509.X509Key;
 
 public class Manager extends Page {
 
 
 public class Manager extends Page {
 
@@ -110,7 +110,7 @@ public class Manager extends Page {
             return supporter;
         }
         try {
             return supporter;
         }
         try {
-            User u = createAssurer( -1);
+            User u = createAgent( -1);
             if ( !u.isInGroup(Group.SUPPORTER)) {
                 try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `user_groups` SET `user`=?, `permission`=?::`userGroup`, `grantedby`=?")) {
                     ps.setInt(1, u.getId());
             if ( !u.isInGroup(Group.SUPPORTER)) {
                 try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `user_groups` SET `user`=?, `permission`=?::`userGroup`, `grantedby`=?")) {
                     ps.setInt(1, u.getId());
@@ -127,29 +127,29 @@ public class Manager extends Page {
         return supporter;
     }
 
         return supporter;
     }
 
-    public User getAssurer(int i) {
-        if (assurers[i] != null) {
-            return assurers[i];
+    public User getAgent(int i) {
+        if (agents[i] != null) {
+            return agents[i];
         }
         try {
         }
         try {
-            User u = createAssurer(i);
-            assurers[i] = u;
+            User u = createAgent(i);
+            agents[i] = u;
 
         } catch (ReflectiveOperationException | GigiApiException e) {
             e.printStackTrace();
         }
 
         } catch (ReflectiveOperationException | GigiApiException e) {
             e.printStackTrace();
         }
-        return assurers[i];
+        return agents[i];
     }
 
     }
 
-    private User createAssurer(int i) throws GigiApiException, IllegalAccessException {
+    private User createAgent(int i) throws GigiApiException, IllegalAccessException {
         try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `notary` SET `from`=?, `to`=?, `points`=?, `location`=?, `date`=?, `country`=?")) {
         try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `notary` SET `from`=?, `to`=?, `points`=?, `location`=?, `date`=?, `country`=?")) {
-            String mail = "test-assurer" + i + "@example.com";
+            String mail = "test-agent" + i + "@example.com";
             User u = User.getByEmail(mail);
             if (u == null) {
                 System.out.println("Creating RA-Agent");
                 createUser(mail);
                 u = User.getByEmail(mail);
             User u = User.getByEmail(mail);
             if (u == null) {
                 System.out.println("Creating RA-Agent");
                 createUser(mail);
                 u = User.getByEmail(mail);
-                passCATS(u, CATSType.ASSURER_CHALLENGE);
+                passCATS(u, CATSType.AGENT_CHALLENGE);
                 ps.setInt(1, u.getId());
                 ps.setInt(2, u.getPreferredName().getId());
                 ps.setInt(3, 100);
                 ps.setInt(1, u.getId());
                 ps.setInt(2, u.getPreferredName().getId());
                 ps.setInt(3, 100);
@@ -290,7 +290,7 @@ public class Manager extends Page {
         // ea.verify(hash);
     }
 
         // ea.verify(hash);
     }
 
-    User[] assurers = new User[25];
+    User[] agents = new User[25];
 
     User supporter;
 
 
     User supporter;
 
@@ -334,8 +334,8 @@ public class Manager extends Page {
             CATSType test = CATSType.values()[Integer.parseInt(testId)];
             passCATS(byEmail, test);
             resp.getWriter().println("Test '" + test.getDisplayName() + "' was added to user account.");
             CATSType test = CATSType.values()[Integer.parseInt(testId)];
             passCATS(byEmail, test);
             resp.getWriter().println("Test '" + test.getDisplayName() + "' was added to user account.");
-        } else if (req.getParameter("assure") != null) {
-            String mail = req.getParameter("assureEmail");
+        } else if (req.getParameter("verify") != null) {
+            String mail = req.getParameter("verifyEmail");
             String verificationPoints = req.getParameter("verificationPoints");
             User byEmail = User.getByEmail(mail);
 
             String verificationPoints = req.getParameter("verificationPoints");
             User byEmail = User.getByEmail(mail);
 
@@ -363,7 +363,7 @@ public class Manager extends Page {
                     if (vp < 10) {
                         currentVP = vp;
                     }
                     if (vp < 10) {
                         currentVP = vp;
                     }
-                    Notary.assure(getAssurer(agentNumber), byEmail, byEmail.getPreferredName(), byEmail.getDoB(), currentVP, "Testmanager Verify up code", validVerificationDateString(), AssuranceType.FACE_TO_FACE, getRandomCountry());
+                    Notary.verify(getAgent(agentNumber), byEmail, byEmail.getPreferredName(), byEmail.getDoB(), currentVP, "Testmanager Verify up code", validVerificationDateString(), VerificationType.FACE_TO_FACE, getRandomCountry());
                     agentNumber += 1;
                     vp -= currentVP;
                 }
                     agentNumber += 1;
                     vp -= currentVP;
                 }
@@ -372,15 +372,15 @@ public class Manager extends Page {
                 throw new Error(e);
             }
 
                 throw new Error(e);
             }
 
-            resp.getWriter().println("User has been assured " + agentNumber + " times.");
+            resp.getWriter().println("User has been verified " + agentNumber + " times.");
 
 
-        } else if (req.getParameter("letassure") != null) {
-            String mail = req.getParameter("letassureEmail");
+        } else if (req.getParameter("letverify") != null) {
+            String mail = req.getParameter("letverifyEmail");
             User byEmail = User.getByEmail(mail);
             try {
                 for (int i = 0; i < 25; i++) {
             User byEmail = User.getByEmail(mail);
             try {
                 for (int i = 0; i < 25; i++) {
-                    User a = getAssurer(i);
-                    Notary.assure(byEmail, a, a.getNames()[0], a.getDoB(), 10, "Testmanager exp up code", validVerificationDateString(), AssuranceType.FACE_TO_FACE, getRandomCountry());
+                    User a = getAgent(i);
+                    Notary.verify(byEmail, a, a.getNames()[0], a.getDoB(), 10, "Testmanager exp up code", validVerificationDateString(), VerificationType.FACE_TO_FACE, getRandomCountry());
                 }
             } catch (GigiApiException e) {
                 throw new Error(e);
                 }
             } catch (GigiApiException e) {
                 throw new Error(e);
index 11cbb3da17581926495b83f11977ee0ab356661d..7cef16083e47f69c90ba76645deefd887ad247fb 100644 (file)
@@ -55,19 +55,19 @@ Email: <input type="text" name="catsEmail"/>
 <tr><td>
 Add 100 Verification Points:
 </td><td>
 <tr><td>
 Add 100 Verification Points:
 </td><td>
-Email: <input type="text" name="assureEmail"/>
+Email: <input type="text" name="verifyEmail"/>
 </td><td>
 Verification Points to issue to preferred name: </br>
 </td><td>
 Verification Points to issue to preferred name: </br>
-<input type="text" name="verificationPoints" value="100"/> <input type="submit" value="Add Points" name="assure"/>
+<input type="text" name="verificationPoints" value="100"/> <input type="submit" value="Add Points" name="verify"/>
 
 </td></tr>
 
 <tr><td>
 Verify 25 others (get 25 Experience Points)    :
 </td><td>
 
 </td></tr>
 
 <tr><td>
 Verify 25 others (get 25 Experience Points)    :
 </td><td>
-Email: <input type="text" name="letassureEmail"/>
+Email: <input type="text" name="letverifyEmail"/>
 </td><td>
 </td><td>
-<input type="submit" value="Add 25 Experience Points" name="letassure"/>
+<input type="submit" value="Add 25 Experience Points" name="letverify"/>
 </td></tr>
 
 <tr><td>
 </td></tr>
 
 <tr><td>