@Test
public void testAckKoWithSimpleErreur() throws Exception {

    PesAller pesAller = gimmePesAller();
    given(pesAllerService.getByFileName("PesDepense-12-2018-209-2092019012917666666"))
            .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_A0000SEN_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() == 1 &&
                            errors.stream().allMatch(pesHistoryError -> pesHistoryError.getTitle().equals("ERREUR_DOUBLON_PJ")
                                    && pesHistoryError.getSource().equals("TI00064567")
                                    && pesHistoryError.getMessage().startsWith("1984"))));
}