@Test public void indexExistsReturnsFalse_whenIndexNotAvailable() throws Exception { mockServerClient.when(request().withPath("/" + INDEX_NAME)) .respond(response().withStatusCode(404)); assertThat(connector.indexExists(INDEX_NAME)).isFalse(); }
@Override public boolean indexExists(String index) throws IOException { return client.indices().exists(new GetIndexRequest(index), RequestOptions.DEFAULT); }
IndexOnlyElasticsearchConnector implements ElasticsearchConnector { @Override public boolean indexExists(String index) throws IOException { return client.indices().exists(new GetIndexRequest(index), RequestOptions.DEFAULT); } }
IndexOnlyElasticsearchConnector implements ElasticsearchConnector { @Override public boolean indexExists(String index) throws IOException { return client.indices().exists(new GetIndexRequest(index), RequestOptions.DEFAULT); } IndexOnlyElasticsearchConnector(RestHighLevelClient client); }
IndexOnlyElasticsearchConnector implements ElasticsearchConnector { @Override public boolean indexExists(String index) throws IOException { return client.indices().exists(new GetIndexRequest(index), RequestOptions.DEFAULT); } IndexOnlyElasticsearchConnector(RestHighLevelClient client); @Override boolean isAvailable(); @Override boolean indexExists(String index); @Override boolean createIndex(String index); @Override void storeItems(String index, Collection<QueryVersionReport> reports); @Override void close(); }
IndexOnlyElasticsearchConnector implements ElasticsearchConnector { @Override public boolean indexExists(String index) throws IOException { return client.indices().exists(new GetIndexRequest(index), RequestOptions.DEFAULT); } IndexOnlyElasticsearchConnector(RestHighLevelClient client); @Override boolean isAvailable(); @Override boolean indexExists(String index); @Override boolean createIndex(String index); @Override void storeItems(String index, Collection<QueryVersionReport> reports); @Override void close();  }