use of org.opensearch.client.opensearch.indices.GetIndicesSettingsRequest in project opensearch-java by opensearch-project.
the class IndicesClientIT method testGetSettingsNonExistentIndex.
public void testGetSettingsNonExistentIndex() throws IOException {
String nonExistentIndex = "index_that_doesnt_exist";
GetIndicesSettingsRequest getIndicesSettingsRequest = new GetIndicesSettingsRequest.Builder().index(nonExistentIndex).build();
try {
highLevelClient().indices().getSettings(getIndicesSettingsRequest);
fail();
} catch (OpenSearchException ex) {
assertNotNull(ex);
assertEquals(ex.status(), 404);
assertEquals(ex.getMessage(), "Request failed: [index_not_found_exception] " + "no such index [index_that_doesnt_exist]");
}
}
Aggregations