@Test @SuppressWarnings("unchecked") public void delete() throws Exception { store.delete(DataCategory.EXTERNAL, 0L); Mockito.verify(CLIENT, Mockito.atLeastOnce()).executeAsync( Mockito.any(DeleteByQuery.class), Mockito.any(JestResultHandler.class)); }
void delete(final DataCategory category, long timestamp) { checkNotNull(category); checkState(isRunning(), "The service is not running"); String query = String.format( ElasticSearchStore.ELK_QUERY, category, 0, Math.min(timestamp - 1, 9999999999999L)); executeAsync(new DeleteByQuery.Builder(query).addIndex(INDEX).build()); }
ElasticSearchStore extends AbstractScheduledService implements AutoCloseable { void delete(final DataCategory category, long timestamp) { checkNotNull(category); checkState(isRunning(), "The service is not running"); String query = String.format( ElasticSearchStore.ELK_QUERY, category, 0, Math.min(timestamp - 1, 9999999999999L)); executeAsync(new DeleteByQuery.Builder(query).addIndex(INDEX).build()); } }
ElasticSearchStore extends AbstractScheduledService implements AutoCloseable { void delete(final DataCategory category, long timestamp) { checkNotNull(category); checkState(isRunning(), "The service is not running"); String query = String.format( ElasticSearchStore.ELK_QUERY, category, 0, Math.min(timestamp - 1, 9999999999999L)); executeAsync(new DeleteByQuery.Builder(query).addIndex(INDEX).build()); } @Inject  ElasticSearchStore(); @VisibleForTesting  ElasticSearchStore(Map<String, String> properties, JestClient client); }
ElasticSearchStore extends AbstractScheduledService implements AutoCloseable { void delete(final DataCategory category, long timestamp) { checkNotNull(category); checkState(isRunning(), "The service is not running"); String query = String.format( ElasticSearchStore.ELK_QUERY, category, 0, Math.min(timestamp - 1, 9999999999999L)); executeAsync(new DeleteByQuery.Builder(query).addIndex(INDEX).build()); } @Inject  ElasticSearchStore(); @VisibleForTesting  ElasticSearchStore(Map<String, String> properties, JestClient client); @PostConstruct void init(); @Override @PreDestroy void close(); }
ElasticSearchStore extends AbstractScheduledService implements AutoCloseable { void delete(final DataCategory category, long timestamp) { checkNotNull(category); checkState(isRunning(), "The service is not running"); String query = String.format( ElasticSearchStore.ELK_QUERY, category, 0, Math.min(timestamp - 1, 9999999999999L)); executeAsync(new DeleteByQuery.Builder(query).addIndex(INDEX).build()); } @Inject  ElasticSearchStore(); @VisibleForTesting  ElasticSearchStore(Map<String, String> properties, JestClient client); @PostConstruct void init(); @Override @PreDestroy void close();  }