@Test
public void testRepairProcessingExternalCallsMany() throws Exception {

    ExternalCall[] externalCalls = createAndSaveExternalCalls(119);
    // 3 times to because MAX_MESSAGES_IN_ONE_QUERY=50
    externalCallService.repairProcessingExternalCalls();
    externalCallService.repairProcessingExternalCalls();
    externalCallService.repairProcessingExternalCalls();
    for (ExternalCall externalCall : externalCalls) {
        LOG.info("Verifying external call {}", externalCall);
        ExternalCall found = externalCallDao.getExternalCall(
                externalCall.getOperationName(), externalCall.getEntityId());
        assertThat(found, notNullValue());
        assertThat(found.getState(), is(ExternalCallStateEnum.FAILED));
    }
}