Search in sources :

Example 1 with IndexWaiterFilter

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);
}
Also used : Payload(net.codestory.http.payload.Payload) IndexWaiterFilter(org.icij.datashare.web.IndexWaiterFilter) Test(org.junit.Test)

Aggregations

Payload (net.codestory.http.payload.Payload)1 IndexWaiterFilter (org.icij.datashare.web.IndexWaiterFilter)1 Test (org.junit.Test)1