diff --git a/src/main/java/io/apicurio/registry/systemtests/framework/KeycloakUtils.java b/src/main/java/io/apicurio/registry/systemtests/framework/KeycloakUtils.java index 0421ba282..f06383d7a 100644 --- a/src/main/java/io/apicurio/registry/systemtests/framework/KeycloakUtils.java +++ b/src/main/java/io/apicurio/registry/systemtests/framework/KeycloakUtils.java @@ -250,7 +250,7 @@ private static HttpRequest.BodyPublisher ofFormData(Map data) { StringBuilder stringBuilder = new StringBuilder(); for (Map.Entry entry : data.entrySet()) { - if (stringBuilder.length() > 0) { + if (!stringBuilder.isEmpty()) { stringBuilder.append("&"); } diff --git a/src/main/java/io/apicurio/registry/systemtests/framework/OperatorUtils.java b/src/main/java/io/apicurio/registry/systemtests/framework/OperatorUtils.java index cf30a367e..bce2365d0 100644 --- a/src/main/java/io/apicurio/registry/systemtests/framework/OperatorUtils.java +++ b/src/main/java/io/apicurio/registry/systemtests/framework/OperatorUtils.java @@ -58,7 +58,7 @@ public static void downloadFile(String source, Path destination) throws Exceptio public static boolean waitPodsExist(String namespace, String labelKey, String labelValue, TimeoutBudget timeout) { while (!timeout.timeoutExpired()) { - if (Kubernetes.getPods(namespace, labelKey, labelValue).getItems().size() > 0) { + if (!Kubernetes.getPods(namespace, labelKey, labelValue).getItems().isEmpty()) { return true; } @@ -71,7 +71,7 @@ public static boolean waitPodsExist(String namespace, String labelKey, String la } } - if (Kubernetes.getPods(namespace, labelKey, labelValue).getItems().size() == 0) { + if (Kubernetes.getPods(namespace, labelKey, labelValue).getItems().isEmpty()) { LOGGER.error( "Pod(s) of catalog source in namespace {} with label {}={} failed creation check.", namespace, labelKey, labelValue @@ -88,7 +88,7 @@ public static boolean waitPodsExist(String namespace, String labelKey, String la } private static boolean collectPodsReadiness(PodList podList) { - if (podList.getItems().size() > 0) { + if (!podList.getItems().isEmpty()) { boolean allPodsReady = true; for (Pod p : podList.getItems()) { @@ -97,7 +97,7 @@ private static boolean collectPodsReadiness(PodList podList) { if ( p.getStatus() != null && p.getStatus().getContainerStatuses() != null - && p.getStatus().getContainerStatuses().size() > 0 + && !p.getStatus().getContainerStatuses().isEmpty() ) { podReady = p.getStatus().getContainerStatuses().get(0).getReady(); } diff --git a/src/main/java/io/apicurio/registry/systemtests/platform/Kubernetes.java b/src/main/java/io/apicurio/registry/systemtests/platform/Kubernetes.java index 6ccf7ab22..e8ad22cb0 100644 --- a/src/main/java/io/apicurio/registry/systemtests/platform/Kubernetes.java +++ b/src/main/java/io/apicurio/registry/systemtests/platform/Kubernetes.java @@ -284,10 +284,9 @@ public static boolean isRouteReady(String namespace, String name) { return false; } - return route + return !route .getStatus() - .getIngress() - .size() > 0; + .getIngress().isEmpty(); } public static PodList getPods(String namespace, String labelKey, String labelValue) { @@ -570,13 +569,12 @@ public static void deleteService(String namespace, String name) { } public static boolean isServiceReady(String namespace, Map selector) { - return getClient() + return !getClient() .pods() .inNamespace(namespace) .withLabels(selector) .list() - .getItems() - .size() > 0; + .getItems().isEmpty(); } public static PersistentVolumeClaim getPersistentVolumeClaim(String namespace, String name) { diff --git a/src/main/java/io/apicurio/registry/systemtests/registryinfra/resources/PersistenceKind.java b/src/main/java/io/apicurio/registry/systemtests/registryinfra/resources/PersistenceKind.java index 3710ad077..28e31db2b 100644 --- a/src/main/java/io/apicurio/registry/systemtests/registryinfra/resources/PersistenceKind.java +++ b/src/main/java/io/apicurio/registry/systemtests/registryinfra/resources/PersistenceKind.java @@ -3,5 +3,5 @@ public enum PersistenceKind { MEM, SQL, - KAFKA_SQL; + KAFKA_SQL }