@Test
public void archiveChildWorkflowWithActiveParentWorks() {

  List<Long> archivableWorkflows = new ArrayList<>();
  long parentId = storeActiveWorkflow(archiveTime1);
  storeActiveChildWorkflow(archiveTime1, parentId);
  archivableWorkflows.add(storePassiveChildWorkflow(archiveTime1, parentId));
  int activeWorkflowCountBefore = getActiveWorkflowCount();
  assertEquals(archivableWorkflows.size(), maintenanceDao.archiveWorkflows(archivableWorkflows));
  int activeWorkflowCountAfter = getActiveWorkflowCount();
  assertActiveWorkflowsRemoved(archivableWorkflows);
  assertArchiveWorkflowsExist(archivableWorkflows);
  assertEquals(archivableWorkflows.size(), getArchivedWorkflowCount());
  assertEquals(activeWorkflowCountAfter, activeWorkflowCountBefore - archivableWorkflows.size());
}