private UserRepresentation getUserRepresentation()

in src/main/java/com/epam/digital/data/platform/integration/idm/service/KeycloakIdmService.java [171:179]


  private UserRepresentation getUserRepresentation(RealmResource realmResource, String userName) {
    var users = client.getUsersRepresentationByUsername(realmResource, userName);

    if (users.size() != 1) {
      throw new KeycloakException(
          String.format("Found %d users with name %s, but expect one", users.size(), userName));
    }
    return users.get(0);
  }