use of org.opensearch.client.opensearch.cat.NodesResponse in project opensearch-java by opensearch-project.
the class RequestTest method testCatRequest.
@Test
public void testCatRequest() throws IOException {
// Cat requests should have the "format=json" added by the transport
NodesResponse nodes = highLevelClient().cat().nodes(_0 -> _0);
System.out.println(ModelTestCase.toJson(nodes, highLevelClient()._transport().jsonpMapper()));
assertEquals(1, nodes.valueBody().size());
assertEquals("*", nodes.valueBody().get(0).master());
}
use of org.opensearch.client.opensearch.cat.NodesResponse in project opensearch-java by opensearch-project.
the class SerializationTest method testArrayValueBody.
@Test
public void testArrayValueBody() {
NodesResponse nr = NodesResponse.of(_0 -> _0.valueBody(_1 -> _1.bulkTotalOperations("1")).valueBody(_1 -> _1.bulkTotalOperations("2")));
checkJsonRoundtrip(nr, "[{\"bulk.total_operations\":\"1\"},{\"bulk.total_operations\":\"2\"}]");
assertEquals(2, nr.valueBody().size());
assertEquals("1", nr.valueBody().get(0).bulkTotalOperations());
assertEquals("2", nr.valueBody().get(1).bulkTotalOperations());
}
Aggregations