test_class.declarator: retourPrefectureService
test_class.modifier: @SpyBean
      private
test_class.original_string: @SpyBean
      private RetourPrefectureService retourPrefectureService;
test_class.type: RetourPrefectureService
test_class.var_name: retourPrefectureService
test_class.declarator: acteRepository
test_class.modifier: @MockBean
      private
test_class.original_string: @MockBean
      private ActeRepository acteRepository;
test_class.type: ActeRepository
test_class.var_name: acteRepository
test_class.declarator: acteHistoryRepository
test_class.modifier: @MockBean
      private
test_class.original_string: @MockBean
      private ActeHistoryRepository acteHistoryRepository;
test_class.type: ActeHistoryRepository
test_class.var_name: acteHistoryRepository
test_class.declarator: localAuthorityRepository
test_class.modifier: @MockBean
      private
test_class.original_string: @MockBean
      private LocalAuthorityRepository localAuthorityRepository;
test_class.type: LocalAuthorityRepository
test_class.var_name: localAuthorityRepository
test_class.declarator: zipGeneratorUtil
test_class.modifier: @MockBean
      private
test_class.original_string: @MockBean
      private ZipGeneratorUtil zipGeneratorUtil;
test_class.type: ZipGeneratorUtil
test_class.var_name: zipGeneratorUtil
test_class.file: acte-service/src/test/java/fr/sictiam/stela/acteservice/service/RetourPrefectureServiceTest.java
test_class.identifier: RetourPrefectureServiceTest
test_case.body: @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()));
      }
test_case.class_method_signature: RetourPrefectureServiceTest.testReceiveAnomalieActe()
test_case.full_signature: @Test public void testReceiveAnomalieActe()
test_case.identifier: testReceiveAnomalieActe
test_case.invocations: willReturn given findBySiren any of willReturn given findFirstByNumberAndDecisionAndNatureAndLocalAuthority_UuidAndDraftNull any any any any of acte parseClassPathResource parseSingleClassPathResource receiveAnomalieActe getLeft getRight findBySiren verify findFirstByNumberAndDecisionAndNatureAndLocalAuthority_UuidAndDraftNull verify eq eq of eq eq publishActeHistory verify eq eq eq getRight eq of eq empty
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testReceiveAnomalieActe()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(RetourPrefectureService.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(RetourPrefectureService.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: acteRepository
focal_class.modifier: private final
focal_class.original_string: private final ActeRepository acteRepository;
focal_class.type: ActeRepository
focal_class.var_name: acteRepository
focal_class.declarator: acteHistoryRepository
focal_class.modifier: private final
focal_class.original_string: private final ActeHistoryRepository acteHistoryRepository;
focal_class.type: ActeHistoryRepository
focal_class.var_name: acteHistoryRepository
focal_class.declarator: localAuthorityRepository
focal_class.modifier: private final
focal_class.original_string: private final LocalAuthorityRepository localAuthorityRepository;
focal_class.type: LocalAuthorityRepository
focal_class.var_name: localAuthorityRepository
focal_class.declarator: applicationEventPublisher
focal_class.modifier: private final
focal_class.original_string: private final ApplicationEventPublisher applicationEventPublisher;
focal_class.type: ApplicationEventPublisher
focal_class.var_name: applicationEventPublisher
focal_class.declarator: zipGeneratorUtil
focal_class.modifier: private final
focal_class.original_string: private final ZipGeneratorUtil zipGeneratorUtil;
focal_class.type: ZipGeneratorUtil
focal_class.var_name: zipGeneratorUtil
focal_class.file: acte-service/src/main/java/fr/sictiam/stela/acteservice/service/RetourPrefectureService.java
focal_class.identifier: RetourPrefectureService
focal_class.class_method_signature: RetourPrefectureService.RetourPrefectureService(ActeRepository acteRepository, ActeHistoryRepository acteHistoryRepository,
                                     LocalAuthorityRepository localAuthorityRepository, ApplicationEventPublisher applicationEventPublisher, ZipGeneratorUtil zipGeneratorUtil)
focal_class.full_signature: public  RetourPrefectureService(ActeRepository acteRepository, ActeHistoryRepository acteHistoryRepository,
                                     LocalAuthorityRepository localAuthorityRepository, ApplicationEventPublisher applicationEventPublisher, ZipGeneratorUtil zipGeneratorUtil)
focal_class.identifier: RetourPrefectureService
focal_class.modifiers: public
focal_class.parameters: (ActeRepository acteRepository, ActeHistoryRepository acteHistoryRepository,
                                     LocalAuthorityRepository localAuthorityRepository, ApplicationEventPublisher applicationEventPublisher, ZipGeneratorUtil zipGeneratorUtil)
focal_class.signature:  RetourPrefectureService(ActeRepository acteRepository, ActeHistoryRepository acteHistoryRepository,
                                     LocalAuthorityRepository localAuthorityRepository, ApplicationEventPublisher applicationEventPublisher, ZipGeneratorUtil zipGeneratorUtil)
focal_class.class_method_signature: RetourPrefectureService.receiveARActe(ARActe arActe, Attachment attachment)
focal_class.full_signature: public void receiveARActe(ARActe arActe, Attachment attachment)
focal_class.identifier: receiveARActe
focal_class.modifiers: public
focal_class.parameters: (ARActe arActe, Attachment attachment)
focal_class.return: void
focal_class.signature: void receiveARActe(ARActe arActe, Attachment attachment)
focal_class.class_method_signature: RetourPrefectureService.receiveARAnnulation(ARAnnulation arAnnulation, Attachment attachment)
focal_class.full_signature: public void receiveARAnnulation(ARAnnulation arAnnulation, Attachment attachment)
focal_class.identifier: receiveARAnnulation
focal_class.modifiers: public
focal_class.parameters: (ARAnnulation arAnnulation, Attachment attachment)
focal_class.return: void
focal_class.signature: void receiveARAnnulation(ARAnnulation arAnnulation, Attachment attachment)
focal_class.class_method_signature: RetourPrefectureService.receiveAnomalieActe(EnveloppeMISILLCL enveloppeMISILLCL, AnomalieActe anomalieActe, Attachment attachment)
focal_class.full_signature: public void receiveAnomalieActe(EnveloppeMISILLCL enveloppeMISILLCL, AnomalieActe anomalieActe, Attachment attachment)
focal_class.identifier: receiveAnomalieActe
focal_class.modifiers: public
focal_class.parameters: (EnveloppeMISILLCL enveloppeMISILLCL, AnomalieActe anomalieActe, Attachment attachment)
focal_class.return: void
focal_class.signature: void receiveAnomalieActe(EnveloppeMISILLCL enveloppeMISILLCL, AnomalieActe anomalieActe, Attachment attachment)
focal_class.class_method_signature: RetourPrefectureService.receiveAnomalieEnveloppe(AnomalieEnveloppe anomalieEnveloppe, Attachment attachment)
focal_class.full_signature: public void receiveAnomalieEnveloppe(AnomalieEnveloppe anomalieEnveloppe, Attachment attachment)
focal_class.identifier: receiveAnomalieEnveloppe
focal_class.modifiers: public
focal_class.parameters: (AnomalieEnveloppe anomalieEnveloppe, Attachment attachment)
focal_class.return: void
focal_class.signature: void receiveAnomalieEnveloppe(AnomalieEnveloppe anomalieEnveloppe, Attachment attachment)
focal_class.class_method_signature: RetourPrefectureService.receiveCourrierSimple(CourrierSimple courrierSimple, Attachment attachment)
focal_class.full_signature: public void receiveCourrierSimple(CourrierSimple courrierSimple, Attachment attachment)
focal_class.identifier: receiveCourrierSimple
focal_class.modifiers: public
focal_class.parameters: (CourrierSimple courrierSimple, Attachment attachment)
focal_class.return: void
focal_class.signature: void receiveCourrierSimple(CourrierSimple courrierSimple, Attachment attachment)
focal_class.class_method_signature: RetourPrefectureService.receiveDemandePieceComplementaire(DemandePieceComplementaire demandePieceComplementaire, Attachment attachment)
focal_class.full_signature: public void receiveDemandePieceComplementaire(DemandePieceComplementaire demandePieceComplementaire, Attachment attachment)
focal_class.identifier: receiveDemandePieceComplementaire
focal_class.modifiers: public
focal_class.parameters: (DemandePieceComplementaire demandePieceComplementaire, Attachment attachment)
focal_class.return: void
focal_class.signature: void receiveDemandePieceComplementaire(DemandePieceComplementaire demandePieceComplementaire, Attachment attachment)
focal_class.class_method_signature: RetourPrefectureService.receiveLettreObservations(LettreObservations lettreObservations, Attachment attachment)
focal_class.full_signature: public void receiveLettreObservations(LettreObservations lettreObservations, Attachment attachment)
focal_class.identifier: receiveLettreObservations
focal_class.modifiers: public
focal_class.parameters: (LettreObservations lettreObservations, Attachment attachment)
focal_class.return: void
focal_class.signature: void receiveLettreObservations(LettreObservations lettreObservations, Attachment attachment)
focal_class.class_method_signature: RetourPrefectureService.receiveDefere(DefereTA defereTA, List<Attachment> attachments)
focal_class.full_signature: public void receiveDefere(DefereTA defereTA, List<Attachment> attachments)
focal_class.identifier: receiveDefere
focal_class.modifiers: public
focal_class.parameters: (DefereTA defereTA, List<Attachment> attachments)
focal_class.return: void
focal_class.signature: void receiveDefere(DefereTA defereTA, List<Attachment> attachments)
focal_class.class_method_signature: RetourPrefectureService.receiveARPieceComplementaire(ARReponseCL arReponseCL, Attachment attachment)
focal_class.full_signature: public void receiveARPieceComplementaire(ARReponseCL arReponseCL, Attachment attachment)
focal_class.identifier: receiveARPieceComplementaire
focal_class.modifiers: public
focal_class.parameters: (ARReponseCL arReponseCL, Attachment attachment)
focal_class.return: void
focal_class.signature: void receiveARPieceComplementaire(ARReponseCL arReponseCL, Attachment attachment)
focal_class.class_method_signature: RetourPrefectureService.receiveARReponseRejetLettreObservations(ARReponseCL arReponseCL, Attachment attachment)
focal_class.full_signature: public void receiveARReponseRejetLettreObservations(ARReponseCL arReponseCL, Attachment attachment)
focal_class.identifier: receiveARReponseRejetLettreObservations
focal_class.modifiers: public
focal_class.parameters: (ARReponseCL arReponseCL, Attachment attachment)
focal_class.return: void
focal_class.signature: void receiveARReponseRejetLettreObservations(ARReponseCL arReponseCL, Attachment attachment)
focal_class.class_method_signature: RetourPrefectureService.publishActeHistory(String acteUuid, StatusType statusType, Attachment attachment,
                                      Optional<String> message, Optional<Flux> flux)
focal_class.full_signature:  void publishActeHistory(String acteUuid, StatusType statusType, Attachment attachment,
                                      Optional<String> message, Optional<Flux> flux)
focal_class.identifier: publishActeHistory
focal_class.parameters: (String acteUuid, StatusType statusType, Attachment attachment,
                                      Optional<String> message, Optional<Flux> flux)
focal_class.return: void
focal_class.signature: void publishActeHistory(String acteUuid, StatusType statusType, Attachment attachment,
                                      Optional<String> message, Optional<Flux> flux)
focal_class.class_method_signature: RetourPrefectureService.getByMiatId(String miatId)
focal_class.full_signature: private Acte getByMiatId(String miatId)
focal_class.identifier: getByMiatId
focal_class.modifiers: private
focal_class.parameters: (String miatId)
focal_class.return: Acte
focal_class.signature: Acte getByMiatId(String miatId)
focal_method.body: public void receiveAnomalieActe(EnveloppeMISILLCL enveloppeMISILLCL, AnomalieActe anomalieActe, Attachment attachment) {
          LocalAuthority localAuthority = localAuthorityRepository.findBySiren(enveloppeMISILLCL.getDestinataire().getSIREN())
                  .orElseThrow(ActeNotFoundException::new);
          Acte acte = acteRepository.findFirstByNumberAndDecisionAndNatureAndLocalAuthority_UuidAndDraftNull(
                  anomalieActe.getActeRecu().getNumeroInterne(),
                  anomalieActe.getActeRecu().getDate(),
                  ActeNature.code(anomalieActe.getActeRecu().getCodeNatureActe()),
                  localAuthority.getUuid())
                  .orElseThrow(ActeNotFoundException::new);
          publishActeHistory(acte.getUuid(), StatusType.NACK_RECEIVED, attachment,
                  Optional.of(anomalieActe.getDetail()), Optional.empty());
      }
focal_method.class_method_signature: RetourPrefectureService.receiveAnomalieActe(EnveloppeMISILLCL enveloppeMISILLCL, AnomalieActe anomalieActe, Attachment attachment)
focal_method.full_signature: public void receiveAnomalieActe(EnveloppeMISILLCL enveloppeMISILLCL, AnomalieActe anomalieActe, Attachment attachment)
focal_method.identifier: receiveAnomalieActe
focal_method.invocations: orElseThrow findBySiren getSIREN getDestinataire orElseThrow findFirstByNumberAndDecisionAndNatureAndLocalAuthority_UuidAndDraftNull getNumeroInterne getActeRecu getDate getActeRecu code getCodeNatureActe getActeRecu getUuid publishActeHistory getUuid of getDetail empty
focal_method.modifiers: public
focal_method.parameters: (EnveloppeMISILLCL enveloppeMISILLCL, AnomalieActe anomalieActe, Attachment attachment)
focal_method.return: void
focal_method.signature: void receiveAnomalieActe(EnveloppeMISILLCL enveloppeMISILLCL, AnomalieActe anomalieActe, Attachment attachment)