@Test
public void testSearchArchivableWorkflows() {

	String workflowId = "search-workflow-id";
	workflow.setWorkflowId(workflowId);
	workflow.setStatus(Workflow.WorkflowStatus.COMPLETED);
	workflow.setCreateTime((new Date(System.currentTimeMillis() - TimeUnit.DAYS.toMillis(4))).getTime());
	workflow.setUpdateTime((new Date(System.currentTimeMillis() - TimeUnit.DAYS.toMillis(4))).getTime());
	workflow.setEndTime((new Date(System.currentTimeMillis() - TimeUnit.DAYS.toMillis(4))).getTime());
	indexDAO.indexWorkflow(workflow);
	await()
			.atMost(3, TimeUnit.SECONDS)
			.untilAsserted(
					() -> {
						List<String> searchIds = indexDAO.searchArchivableWorkflows("conductor",3);
						assertEquals(1, searchIds.size());
						assertEquals(workflowId, searchIds.get(0));
					}
			);
}