@Test
public void getAllChildWorkflowsQueriesAllChildWorkflows() {

  List<WorkflowInstance> result = singletonList(mock(WorkflowInstance.class));
  when(workflowDao.queryWorkflowInstances(queryCaptor.capture())).thenReturn(result);
  assertThat(execution.getAllChildWorkflows(), is(result));
  QueryWorkflowInstances actualQuery = queryCaptor.getValue();
  assertThat(actualQuery.parentWorkflowId, is(99L));
  assertThat(actualQuery.types, emptyCollectionOf(String.class));
  assertThat(actualQuery.businessKey, is(nullValue()));
  assertThat(actualQuery.includeCurrentStateVariables, is(false));
}