diff --git a/apitest-commons/src/main/java/io/mosip/testrig/apirig/utils/ConfigManager.java b/apitest-commons/src/main/java/io/mosip/testrig/apirig/utils/ConfigManager.java index c0d48eda8d..30b85f2bf4 100644 --- a/apitest-commons/src/main/java/io/mosip/testrig/apirig/utils/ConfigManager.java +++ b/apitest-commons/src/main/java/io/mosip/testrig/apirig/utils/ConfigManager.java @@ -119,6 +119,10 @@ public static String getproperty(String key) { public static String getRolesForUser(String userId) { return getproperty("roles." + userId); } + + public static String getRolesForUser() { + return getproperty("roles"); + } public static String getServerErrorsToMonitor() { return getproperty("serverErrorsToMonitor"); } public static String getEnableDebug() { return getproperty("enableDebug"); } diff --git a/apitest-commons/src/main/java/io/mosip/testrig/apirig/utils/KeycloakUserManager.java b/apitest-commons/src/main/java/io/mosip/testrig/apirig/utils/KeycloakUserManager.java index 0cc0957f6c..9f710f75ac 100644 --- a/apitest-commons/src/main/java/io/mosip/testrig/apirig/utils/KeycloakUserManager.java +++ b/apitest-commons/src/main/java/io/mosip/testrig/apirig/utils/KeycloakUserManager.java @@ -303,7 +303,7 @@ public static void createUsers(String userid, String pwd, String rolenum, Map allRoles = realmResource.roles().list(); List availableRoles = new ArrayList<>(); - List toBeAssignedRoles = List.of(propsKernel.getProperty(rolenum).split(",")); + List toBeAssignedRoles = List.of(ConfigManager.getRolesForUser().split(",")); for (String role : toBeAssignedRoles) { if (allRoles.stream().anyMatch((r -> r.getName().equalsIgnoreCase(role)))) { if (allRoles.stream().filter(r->r.getName().equals(role)).findFirst().isPresent())