Skip to content

Commit

Permalink
InsightsUrlBuilder switch to isBlank
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicarod7 committed Jan 17, 2025
1 parent 43fab7b commit 99ad7b7
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,21 @@ public Optional<String> buildInventoryUrl(JsonObject data) {

// A provided host url does not need to be modified
String host_url = context.getString("host_url", "");
if (!host_url.isEmpty()) {
if (!host_url.isBlank()) {
return Optional.of(host_url);
}

String environmentUrl = environment.url();
String inventoryId = context.getString("inventory_id", "");
String displayName = context.getString("display_name", "");

if (!displayName.isEmpty()) {
if (!displayName.isBlank()) {
if (data.getString("bundle", "").equals("openshift")
&& data.getString("application", "").equals("advisor")) {
path = String.format("/openshift/insights/advisor/clusters/%s", displayName);
} else {
path = "/insights/inventory/";
if (!inventoryId.isEmpty()) {
if (!inventoryId.isBlank()) {
path += inventoryId;
} else {
queryParamParts.add(String.format("hostname_or_id=%s", displayName));
Expand Down

0 comments on commit 99ad7b7

Please sign in to comment.