upd: use self-org name for CATS-API-test
authorFelix Dörre <felix@dogcraft.de>
Thu, 12 May 2016 10:37:23 +0000 (12:37 +0200)
committerFelix Dörre <felix@dogcraft.de>
Thu, 12 May 2016 10:37:23 +0000 (12:37 +0200)
src/org/cacert/gigi/dbObjects/Organisation.java
tests/org/cacert/gigi/api/ImportCATSResult.java

index 66de62d9500d12a4e5c8b00fd5cdb59ed47dcf8f..5da2506855d0c16a764bd26eb6a37b87a43f366c 100644 (file)
@@ -218,7 +218,9 @@ public class Organisation extends CertificateOwner {
         return isValidDomain(email.split("@", 2)[1]);
     }
 
+    public static final String SELF_ORG_NAME = "CAcert";
+
     public boolean isSelfOrganisation() {
-        return "CAcert".equals(getName());
+        return SELF_ORG_NAME.equals(getName());
     }
 }
index f8adbff83d2f313250bb5d5156de92b35a563958..be02a7b672d84f459164ab94e48ca117598470f9 100644 (file)
@@ -40,7 +40,8 @@ public class ImportCATSResult extends ClientTest {
         grant(u.getEmail(), Group.ORGASSURER);
         clearCaches();
         u = User.getById(u.getId());
-        Organisation o = new Organisation("CAcert", "NA", "NA", "NA", "contact@cacert.org", u);
+        Organisation o = new Organisation(Organisation.SELF_ORG_NAME, "NA", "NA", "NA", "contact@cacert.org", u);
+        assertTrue(o.isSelfOrganisation());
         KeyPair kp = generateKeypair();
         String key1 = generatePEMCSR(kp, "EMAIL=cats@cacert.org");
         Certificate c = new Certificate(o, u, Certificate.buildDN("EMAIL", "cats@cacert.org"), Digest.SHA256, key1, CSRType.CSR, CertificateProfile.getByName("client-orga"), new Certificate.SubjectAlternateName(SANType.EMAIL, "cats@cacert.org"));