From f9f77ef2d947d7d83ba282e64335ebb83dcceb58 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 24 Dec 2024 10:46:32 +1300 Subject: [PATCH] Fix compile Signed-off-by: Thomas Farr --- .../integTest/AbstractClusterClientIT.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractClusterClientIT.java b/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractClusterClientIT.java index f5f0c682de..541f6048b3 100644 --- a/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractClusterClientIT.java +++ b/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractClusterClientIT.java @@ -30,6 +30,7 @@ import org.opensearch.client.opensearch.cluster.HealthResponse; import org.opensearch.client.opensearch.cluster.PutClusterSettingsRequest; import org.opensearch.client.opensearch.cluster.PutClusterSettingsResponse; +import org.opensearch.client.opensearch.cluster.health.ClusterHealthLevel; import org.opensearch.client.opensearch.cluster.health.IndexHealthStats; import org.opensearch.client.opensearch.cluster.health.ShardHealthStats; import org.opensearch.cluster.routing.allocation.decider.EnableAllocationDecider; @@ -201,7 +202,7 @@ public void testClusterHealthYellowIndicesLevel() throws IOException { } HealthRequest request = new HealthRequest.Builder().index(firstIndex, secondIndex) .timeout(t -> t.time("5s")) - .level(Level.Indices) + .level(ClusterHealthLevel.Indices) .build(); HealthResponse response = openSearchClient.cluster().health(request); assertYellowShards(response); @@ -228,7 +229,7 @@ public void testClusterHealthYellowSpecificIndex() throws IOException { OpenSearchClient openSearchClient = javaClient(); createIndex("index", Settings.EMPTY); createIndex("index2", Settings.EMPTY); - HealthRequest request = new HealthRequest.Builder().index("index").timeout(t -> t.time("5s")).level(Level.Shards).build(); + HealthRequest request = new HealthRequest.Builder().index("index").timeout(t -> t.time("5s")).level(ClusterHealthLevel.Shards).build(); HealthResponse response = openSearchClient.cluster().health(request); assertNotNull(response); @@ -290,7 +291,7 @@ public void testClusterHealthNotFoundIndex() throws IOException { createIndex("index", Settings.EMPTY); HealthRequest request = new HealthRequest.Builder().index("notexisted-index") .timeout(t -> t.time("5s")) - .level(Level.Indices) + .level(ClusterHealthLevel.Indices) .build(); try { HealthResponse response = openSearchClient.cluster().health(request); @@ -310,7 +311,9 @@ public void testClusterStats() throws IOException { ClusterStatsResponse response = openSearchClient.cluster().stats(request); assertNotNull(response); assertNotNull(response.clusterName()); - assertNotEquals(response.nodes().count().total(), 0); - assertNotEquals(response.indices().count(), 0); + assertNotEquals(0, response.nodes().count().total()); + Long indexCount = response.indices().count(); + assertNotNull(indexCount); + assertNotEquals(0, (long) indexCount); } }