RetourPrefectureService { public void receiveARAnnulation(ARAnnulation arAnnulation, Attachment attachment) { Acte acte = getByMiatId(arAnnulation.getIDActe()); publishActeHistory(acte.getUuid(), StatusType.CANCELLED, attachment, Optional.empty(), Optional.empty()); } RetourPrefectureService(ActeRepository acteRepository, ActeHistoryRepository acteHistoryRepository,
                                   LocalAuthorityRepository localAuthorityRepository, ApplicationEventPublisher applicationEventPublisher, ZipGeneratorUtil zipGeneratorUtil); void receiveARActe(ARActe arActe, Attachment attachment); void receiveARAnnulation(ARAnnulation arAnnulation, Attachment attachment); void receiveAnomalieActe(EnveloppeMISILLCL enveloppeMISILLCL, AnomalieActe anomalieActe, Attachment attachment); void receiveAnomalieEnveloppe(AnomalieEnveloppe anomalieEnveloppe, Attachment attachment); void receiveCourrierSimple(CourrierSimple courrierSimple, Attachment attachment); void receiveDemandePieceComplementaire(DemandePieceComplementaire demandePieceComplementaire, Attachment attachment); void receiveLettreObservations(LettreObservations lettreObservations, Attachment attachment); void receiveDefere(DefereTA defereTA, List<Attachment> attachments); void receiveARPieceComplementaire(ARReponseCL arReponseCL, Attachment attachment); void receiveARReponseRejetLettreObservations(ARReponseCL arReponseCL, Attachment attachment);  }
@Test public void testReceiveARAnnulation() throws IOException, JAXBException { given(acteRepository.findByMiatId(anyString())) .willReturn(Optional.of(acte())); Pair<ARAnnulation, Attachment> parsedData = parseClassPathResource("data/044-214400152-20181106-TEST_DGCL_4-DE-6-2_10.xml", ARAnnulation.class); retourPrefectureService.receiveARAnnulation(parsedData.getLeft(), parsedData.getRight()); verify(acteRepository).findByMiatId("044-214400152-20181106-TEST_DGCL_4-DE"); verify(retourPrefectureService).publishActeHistory(eq("uuid"), eq(StatusType.CANCELLED), eq(parsedData.getRight()), eq(Optional.empty()), eq(Optional.empty())); }