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

    given(localAuthorityRepository.findBySiren(any()))
            .willReturn(Optional.of(new LocalAuthority("uuid", "name", "siren", "name")));
    given(acteRepository.findFirstByNumberAndDecisionAndNatureAndLocalAuthority_UuidAndDraftNull(any(), any(), any(), any()))
            .willReturn(Optional.of(acte()));
    Pair<AnomalieActe, Attachment> parsedData =
            parseClassPathResource("data/044-214400152----1-3_1.xml", AnomalieActe.class);
    EnveloppeMISILLCL enveloppeMISILLCL =
            parseSingleClassPathResource("data/EACT--SPREF0441-214400152-20181012-9.xml",
                    EnveloppeMISILLCL.class);
    retourPrefectureService.receiveAnomalieActe(enveloppeMISILLCL, parsedData.getLeft(), parsedData.getRight());
    verify(localAuthorityRepository).findBySiren("214400152");
    verify(acteRepository).findFirstByNumberAndDecisionAndNatureAndLocalAuthority_UuidAndDraftNull(
            eq("123456"), eq(LocalDate.of(2018, 10, 1)), eq(ActeNature.DELIBERATIONS),
            eq("uuid"));
    verify(retourPrefectureService).publishActeHistory(eq("uuid"), eq(StatusType.NACK_RECEIVED),
            eq(parsedData.getRight()),
            eq(Optional.of("ODT-VERIF-01 : Votre acte a été transmis avec une date de classification qui n'est pas à jour")),
            eq(Optional.empty()));
}