@Test
public void testAckKoWithInnerDetailLigne() throws Exception {

    PesAller pesAller = gimmePesAller();
    given(pesAllerService.getByFileName("PesDepense-02-2019-5-11112222333344445"))
            .willReturn(Optional.of(pesAller));
    doNothing().when(pesAllerService).updateStatus(anyString(), any(), any(), anyString(), anyList());
    InputStream pesFile = new ClassPathResource("data/pes-ack-ko/006111_190130123456-ACK-A3020100_A0000IDL_KO.xml")
            .getInputStream();
    receiverTask.readACK(IOUtils.toByteArray(pesFile), "ackName");
    verify(pesAllerService).updateStatus(eq(pesAller.getUuid()), eq(StatusType.NACK_RECEIVED),
            any(), eq("ackName"), argThat(errors ->
                    errors.size() == 6 &&
                            errors.stream().allMatch(pesHistoryError -> pesHistoryError.getTitle().equals("ERREUR_AUTRE")) &&
                            errors.stream().filter(pesHistoryError -> pesHistoryError.getMessage().startsWith("1971")).count() == 5 &&
                            errors.stream().noneMatch(pesHistoryError -> pesHistoryError.getSource().isEmpty())));
}