use of org.icij.datashare.web.IndexWaiterFilter in project datashare by ICIJ.
the class IndexWaiterFilterTest method test_wait_for_index.
@Test
public void test_wait_for_index() throws Exception {
IndexWaiterFilter indexWaiterFilter = new IndexWaiterFilter(esClient).waitForIndexAsync();
Payload payload = indexWaiterFilter.apply("/", context, nextFilter);
assertThat(payload.rawContentType()).isEqualTo("text/html");
assertThat((String) payload.rawContent()).contains("waiting for Datashare to be up...");
indexWaiterFilter.executor.awaitTermination(2, SECONDS);
assertThat(indexWaiterFilter.apply("/", context, nextFilter)).isSameAs(next);
}
Aggregations