Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Farr <tsfarr@amazon.com>
  • Loading branch information
Xtansia committed Jan 7, 2025
1 parent f099a51 commit 7489a35
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.opensearch.client.opensearch.cat.AllocationResponse;
import org.opensearch.client.opensearch.cat.IndicesResponse;
import org.opensearch.client.opensearch.cat.NodesResponse;
import org.opensearch.client.opensearch.cat.PitSegmentsResponse;
import org.opensearch.client.opensearch.cat.PluginsResponse;
import org.opensearch.client.opensearch.cat.RecoveryResponse;
import org.opensearch.client.opensearch.cat.SegmentsResponse;
Expand Down Expand Up @@ -252,14 +253,14 @@ public void testCatPitSegments() throws Exception {

createPit("cat-pit-segments-test-index");

SegmentsResponse PitSegmentsResponse = javaClient().cat().pitSegments(r -> r.headers("index,shard,id,segment,size"));
PitSegmentsResponse pitSegmentsResponse = javaClient().cat().pitSegments(r -> r.headers("index,shard,id,segment,size"));

assertNotNull("PitSegmentsResponse.segments() is null", PitSegmentsResponse.valueBody());
assertNotNull("pitSegmentsResponse.segments() is null", pitSegmentsResponse.valueBody());

if (version.onOrAfter(Version.V_2_10_0)) {
assertTrue("PitSegmentsResponse.segments().size() == 0", PitSegmentsResponse.valueBody().isEmpty());
assertTrue("pitSegmentsResponse.segments().size() == 0", pitSegmentsResponse.valueBody().isEmpty());
} else {
assertTrue("PitSegmentsResponse.segments().size() == 0", PitSegmentsResponse.valueBody().size() > 0);
assertTrue("pitSegmentsResponse.segments().size() > 0", pitSegmentsResponse.valueBody().size() > 0);
}
}

Expand All @@ -276,5 +277,4 @@ private void createPit(String indexName) throws Exception {
assertNotNull(createPitResponse);
assertNotNull(createPitResponse.pitId());
}

}

0 comments on commit 7489a35

Please sign in to comment.