@Test
public void testSaveDocuments() throws Exception {

    List<Document> documents = new ArrayList<Document>();
    String id1 = UUID.randomUUID()
            .toString();
    Document document1 = new Document(id1, System.currentTimeMillis(), getMapper().getNodeFactory()
            .objectNode()
            .put("D", "data"));
    String id2 = UUID.randomUUID()
            .toString();
    Document document2 = new Document(id2, System.currentTimeMillis(), getMapper().getNodeFactory()
            .objectNode()
            .put("D", "data"));
    documents.add(document1);
    documents.add(document2);
    Entity<List<Document>> listEntity = Entity.json(documents);
    resources.client()
            .target(String.format("/v1/document/%s/bulk", TestUtils.TEST_TABLE_NAME))
            .request()
            .post(listEntity);
    getElasticsearchConnection().refresh(ElasticsearchUtils.getIndices(TestUtils.TEST_TABLE_NAME));
    compare(document1, getQueryStore().get(TestUtils.TEST_TABLE_NAME, id1));
    compare(document2, getQueryStore().get(TestUtils.TEST_TABLE_NAME, id2));
}