Fixed test

This commit is contained in:
Luca Frosini 2022-04-27 16:21:55 +02:00
parent 14be0342cf
commit ce4eb099f6
1 changed files with 6 additions and 8 deletions

View File

@ -89,20 +89,18 @@ public class GRSFUtilities extends ContextTest {
}
public static String getGroupNameOnCkan(String origName){
if(origName == null)
if(origName == null) {
throw new IllegalArgumentException("origName cannot be null");
}
String modified = origName.replaceAll("\\(", "");
modified = modified.replaceAll("\\)", "");
modified = modified.trim().toLowerCase().replaceAll("[^A-Za-z0-9-]", "-");
if(modified.startsWith("-"))
if(modified.startsWith("-")) {
modified = modified.substring(1);
if(modified.endsWith("-"))
}
if(modified.endsWith("-")) {
modified = modified.substring(0, modified.length() -1);
logger.info("Group name generated is " + modified);
}
return modified;
}