]> WPIA git - gigi.git/blobdiff - tests/club/wpia/gigi/testUtils/OrgTest.java
add: ensure that for Org Agent actions certificate login is used
[gigi.git] / tests / club / wpia / gigi / testUtils / OrgTest.java
index 6a0c4d1c68cf70330b6ae4404656e6fe6e5d7b6f..6c3ba7c4621651952aa12dcdc04b737481a6ef66 100644 (file)
@@ -4,9 +4,10 @@ import java.io.IOException;
 
 import club.wpia.gigi.GigiApiException;
 import club.wpia.gigi.dbObjects.Country;
+import club.wpia.gigi.dbObjects.Country.CountryCodeType;
 import club.wpia.gigi.dbObjects.Group;
 import club.wpia.gigi.dbObjects.Organisation;
-import club.wpia.gigi.dbObjects.Country.CountryCodeType;
+import club.wpia.gigi.dbObjects.User;
 
 public class OrgTest extends ClientTest {
 
@@ -14,11 +15,17 @@ public class OrgTest extends ClientTest {
         makeAgent(u.getId());
         u.grantGroup(getSupporter(), Group.ORG_AGENT);
         clearCaches();
-        cookie = login(email, TEST_PASSWORD);
+        cookie = cookieWithCertificateLogin(u);
     }
 
     public Organisation createUniqueOrg() throws GigiApiException {
         Organisation o1 = new Organisation(createUniqueName(), Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS), "pr", "city", "test@example.com", "", "", u);
         return o1;
     }
+
+    public User createOrgAdmin(Organisation o) throws GigiApiException {
+        User ua = User.getById(createVerificationUser("testworker", "testname", createUniqueName() + "@testdom.com", TEST_PASSWORD));
+        o.addAdmin(ua, u, true);
+        return ua;
+    }
 }