@Test
public void testReceiveAnomalieEnveloppe() throws IOException, JAXBException {

    given(acteHistoryRepository.findFirstByFileNameContaining(anyString()))
            .willReturn(Optional.of(new ActeHistory("uuid", StatusType.SENT)));
    given(acteRepository.findByUuidAndDraftNull(anyString()))
            .willReturn(Optional.of(acte()));
    Pair<AnomalieEnveloppe, Attachment> parsedData =
            parseClassPathResource("data/ANO_EACT--214400152--20180925-1.xml", AnomalieEnveloppe.class);
    retourPrefectureService.receiveAnomalieEnveloppe(parsedData.getLeft(), parsedData.getRight());
    verify(acteHistoryRepository).findFirstByFileNameContaining("214400152--20180925-1.tar.gz");
    verify(acteRepository).findByUuidAndDraftNull("uuid");
    verify(retourPrefectureService).publishActeHistory(eq("uuid"), eq(StatusType.NACK_RECEIVED),
            eq(parsedData.getRight()),
            eq(Optional.of("ODT-VERIF-17 : La transaction que vous avez envoyé n'est pas reconnu dans l'application ACTES.")),
            eq(Optional.empty()));
}