use of org.hisp.dhis.actions.UserActions in project dhis2-core by dhis2.
the class MetadataSetupExtension method setupUsers.
private void setupUsers() {
logger.info("Adding users to the TA user group");
UserActions userActions = new UserActions();
String[] users = { TestConfiguration.get().superUserUsername(), TestConfiguration.get().defaultUserUsername(), TestConfiguration.get().adminUserUsername() };
String userGroupId = Constants.USER_GROUP_ID;
for (String user : users) {
String userId = userActions.get(String.format("?filter=username:eq:%s", user)).extractString("users.id[0]");
if (userId == null) {
return;
}
userActions.addUserToUserGroup(userId, userGroupId);
TestRunStorage.removeEntity("users", userId);
}
}
Aggregations