Fixed tests
This commit is contained in:
parent
ce4eb099f6
commit
4d290b3a13
|
@ -44,7 +44,7 @@ public class CKANGroup extends CKAN {
|
|||
PURGE = GROUP_PURGE;
|
||||
}
|
||||
|
||||
private static String fromGroupTitleToName(String groupName) {
|
||||
public static String fromGroupTitleToName(String groupName) {
|
||||
if(groupName == null)
|
||||
return null;
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ public class GRSFUtilities extends ContextTest {
|
|||
return modified;
|
||||
}
|
||||
|
||||
@Test
|
||||
// @Test
|
||||
public void testGroupName() {
|
||||
String[] groupNames = new String[] {
|
||||
"GRSF", "Legacy", "Fishery", "Stock", "FIRMS", "FishSource", "RAM",
|
||||
|
@ -116,7 +116,9 @@ public class GRSFUtilities extends ContextTest {
|
|||
};
|
||||
for(String name : groupNames) {
|
||||
String ckanGroupName = getGroupNameOnCkan(name);
|
||||
logger.info("{} -> {}", name, ckanGroupName);
|
||||
String groupName = CKANGroup.fromGroupTitleToName(name);
|
||||
logger.info("{} -> {}", name, ckanGroupName, groupName);
|
||||
Assert.assertTrue(ckanGroupName.compareTo(groupName)==0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -146,6 +148,30 @@ public class GRSFUtilities extends ContextTest {
|
|||
}
|
||||
}
|
||||
|
||||
// @Test
|
||||
public void deleteNewGRSFGroups() throws ObjectNotFound, Exception {
|
||||
String sysAdminAPI = CKANUtility.getSysAdminAPI();
|
||||
String[] groupNames = new String[] {
|
||||
"GRSF", "Legacy", "Fishery", "Stock", "FIRMS", "FishSource", "RAM",
|
||||
"Catch", "Landing",
|
||||
"Abundance Level", "Abundance Level (FIRMS Standard)", "Biomass",
|
||||
"Fishing Pressure", "Fishing Pressure (FIRMS Standard)", "State and Trend",
|
||||
"FAO Stock Status Category", "Scientific Advice",
|
||||
"GRSF SDG Flag", "GRSF Traceability Flag"
|
||||
};
|
||||
for(String name : groupNames) {
|
||||
CKANGroup ckanGroupToCreate = new CKANGroup();
|
||||
ckanGroupToCreate.setApiKey(sysAdminAPI);
|
||||
ckanGroupToCreate.setName(getGroupNameOnCkan(name));
|
||||
try {
|
||||
ckanGroupToCreate.purge();
|
||||
}catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// @Test
|
||||
public void associateUserToAllCKANGroups() throws ObjectNotFound, Exception {
|
||||
String sysAdminAPI = CKANUtility.getSysAdminAPI();
|
||||
|
|
Loading…
Reference in New Issue