@Test
public void testSearchArchivableWorkflows() throws IOException {

    String workflowId = "search-workflow-id";
    Long time = DateTime.now(DateTimeZone.UTC).minusDays(7).toDate().getTime();
    workflow.setWorkflowId(workflowId);
    workflow.setStatus(Workflow.WorkflowStatus.COMPLETED);
    workflow.setCreateTime(time);
    workflow.setUpdateTime(time);
    workflow.setEndTime(time);
    indexDAO.indexWorkflow(workflow);
    assertTrue(indexExists("conductor"));
    await()
            .atMost(5, TimeUnit.SECONDS)
            .untilAsserted(
                    () -> {
                        List<String> searchIds = indexDAO.searchArchivableWorkflows("conductor",6);
                        assertEquals(1, searchIds.size());
                        assertEquals(workflowId, searchIds.get(0));
                    }
            );
}