use of org.opensearch.action.main.MainRequest in project OpenSearch by opensearch-project.
the class CustomRestHighLevelClientTests method testCustomEndpointAsync.
public void testCustomEndpointAsync() throws Exception {
final MainRequest request = new MainRequest();
String nodeName = randomAlphaOfLengthBetween(1, 10);
PlainActionFuture<MainResponse> future = PlainActionFuture.newFuture();
restHighLevelClient.customAsync(request, optionsForNodeName(nodeName), future);
assertEquals(nodeName, future.get().getNodeName());
future = PlainActionFuture.newFuture();
restHighLevelClient.customAndParseAsync(request, optionsForNodeName(nodeName), future);
assertEquals(nodeName, future.get().getNodeName());
}
use of org.opensearch.action.main.MainRequest in project OpenSearch by opensearch-project.
the class CustomRestHighLevelClientTests method testCustomEndpoint.
public void testCustomEndpoint() throws IOException {
final MainRequest request = new MainRequest();
String nodeName = randomAlphaOfLengthBetween(1, 10);
MainResponse response = restHighLevelClient.custom(request, optionsForNodeName(nodeName));
assertEquals(nodeName, response.getNodeName());
response = restHighLevelClient.customAndParse(request, optionsForNodeName(nodeName));
assertEquals(nodeName, response.getNodeName());
}
Aggregations