@Test void testGetGetCountFailedShards() { Index index = Index.create("index"); when(client.prepareSearch("index")).thenReturn(searchRequestBuilder); when(searchRequestBuilder.get()).thenReturn(searchResponse); when(searchResponse.getFailedShards()).thenReturn(1); when(searchResponse.getShardFailures()).thenReturn(singleShardSearchFailure); Exception exception = assertThrows(IndexException.class, () -> clientFacade.getCount(index)); assertThat(exception.getMessage()) .containsPattern("Error counting docs in index\\(es\\) 'index'\\."); }
public long getCount(Index index) { return getCount(singletonList(index)); }
ClientFacade implements Closeable { public long getCount(Index index) { return getCount(singletonList(index)); } }
ClientFacade implements Closeable { public long getCount(Index index) { return getCount(singletonList(index)); } ClientFacade(Client client); }
ClientFacade implements Closeable { public long getCount(Index index) { return getCount(singletonList(index)); } ClientFacade(Client client); void createIndex(Index index, IndexSettings indexSettings, Stream<Mapping> mappingStream); boolean indexesExist(Index index); void deleteIndex(Index index); void refreshIndexes(); long getCount(Index index); long getCount(QueryBuilder query, Index index); SearchHits search(QueryBuilder query, int from, int size, List<Index> indexes); SearchHits search(QueryBuilder query, int from, int size, Sort sort, Index index); Aggregations aggregate(
      List<AggregationBuilder> aggregations, QueryBuilder query, Index index); Explanation explain(SearchHit searchHit, QueryBuilder query); void index(Index index, Document document); void deleteById(Index index, Document document); void processDocumentActions(Stream<DocumentAction> documentActions); @Override void close(); }
ClientFacade implements Closeable { public long getCount(Index index) { return getCount(singletonList(index)); } ClientFacade(Client client); void createIndex(Index index, IndexSettings indexSettings, Stream<Mapping> mappingStream); boolean indexesExist(Index index); void deleteIndex(Index index); void refreshIndexes(); long getCount(Index index); long getCount(QueryBuilder query, Index index); SearchHits search(QueryBuilder query, int from, int size, List<Index> indexes); SearchHits search(QueryBuilder query, int from, int size, Sort sort, Index index); Aggregations aggregate(
      List<AggregationBuilder> aggregations, QueryBuilder query, Index index); Explanation explain(SearchHit searchHit, QueryBuilder query); void index(Index index, Document document); void deleteById(Index index, Document document); void processDocumentActions(Stream<DocumentAction> documentActions); @Override void close();  }