]> WPIA git - gigi.git/blobdiff - tests/club/wpia/gigi/testUtils/OrgTest.java
add: make sure org admin cannot delete domain from org account
[gigi.git] / tests / club / wpia / gigi / testUtils / OrgTest.java
index e7360fe2a5c2ae6e55652dd27ecbff1203ee9beb..2d79c5a497b0e15d289ff38e699599e8cabe414d 100644 (file)
@@ -4,15 +4,16 @@ 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 {
 
     public OrgTest() throws IOException, GigiApiException {
-        makeAssurer(u.getId());
-        u.grantGroup(getSupporter(), Group.ORGASSURER);
+        makeAgent(u.getId());
+        u.grantGroup(getSupporter(), Group.ORG_AGENT);
         clearCaches();
         cookie = login(email, TEST_PASSWORD);
     }
@@ -21,4 +22,10 @@ public class OrgTest extends ClientTest {
         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;
+    }
 }