@Test
public void archiveWorkflowsWorks() {

  List<Long> workflowIds = new ArrayList<>();
  storeActiveWorkflow(archiveTime1);
  storeActiveWorkflow(prodTime1);
  storePassiveWorkflow(prodTime1);
  workflowIds.add(storePassiveWorkflow(archiveTime1));
  workflowIds.add(storePassiveWorkflow(archiveTime2));
  int workflowCountBefore = getActiveWorkflowCount();
  assertEquals(workflowIds.size(), maintenanceDao.archiveWorkflows(workflowIds));
  int workflowCountAfter = getActiveWorkflowCount();
  assertActiveWorkflowsRemoved(workflowIds);
  assertArchiveWorkflowsExist(workflowIds);
  assertEquals(workflowIds.size(), getArchivedWorkflowCount());
  assertEquals(workflowCountAfter, workflowCountBefore - workflowIds.size());
}