Skip to content

Commit

Permalink
Fix compile
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Farr <[email protected]>
  • Loading branch information
Xtansia committed Dec 23, 2024
1 parent 6f9934b commit f9f77ef
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
}
}

0 comments on commit f9f77ef

Please sign in to comment.