when(engine.getRuntimeService()).thenReturn(runtimeService);
when(runtimeService.createProcessInstanceQuery()).thenReturn(processInstanceQuery);
when(processInstanceQuery.variableValueEquals(CoreProcessVariables.POOL_BUSINESS_KEY, BUSINESS_KEY))
.thenReturn(processInstanceQuery);
when(processInstanceQuery.orderByProcessInstanceId()).thenReturn(processInstanceQuery);
when(processInstanceQuery.desc()).thenReturn(processInstanceQuery);
when(processInstanceQuery.list()).thenReturn(processes);
return engine;
}