Added test which can be useful for future fixes

This commit is contained in:
Luca Frosini 2021-11-03 16:08:53 +01:00
parent eb27d67845
commit 7d822e07cb
1 changed files with 15 additions and 1 deletions

View File

@ -109,7 +109,7 @@ public class CKANGroupTest extends ContextTest {
// @Test // @Test
public void createGRSFGroups() throws ObjectNotFound, Exception { public void createGRSFGroups() throws ObjectNotFound, Exception {
// Setting GRSF ADMIN token of grsf.publisher user to read groups // Set grsf.publisher user
ContextTest.setContext(""); ContextTest.setContext("");
String key = CKANUtility.getSysAdminAPI(); String key = CKANUtility.getSysAdminAPI();
List<String> groupNames = listGroup(); List<String> groupNames = listGroup();
@ -131,4 +131,18 @@ public class CKANGroupTest extends ContextTest {
} }
} }
// @Test
public void associateUserToAllCKANGroups() throws ObjectNotFound, Exception {
// Set grsf.publisher user
ContextTest.setContext("");
String sysAdminAPI = CKANUtility.getSysAdminAPI();
List<String> groupNames = listGroup();
for(String groupName : groupNames) {
CKANUser ckanUser = new CKANUser();
ckanUser.setApiKey(sysAdminAPI);
ckanUser.setName("grsf_publisher");
ckanUser.addToGroup(CKANGroup.getCKANGroupName(groupName));
}
}
} }