diff --git a/goofy-server/src/main/java/de/itvsh/goofy/postfach/PostfachMailService.java b/goofy-server/src/main/java/de/itvsh/goofy/postfach/PostfachMailService.java index f4af9f46eca2d195d2b694d1dfa2af0cea119cbd..af17ed4d8f494189440dac4198720bc7d980b0d4 100644 --- a/goofy-server/src/main/java/de/itvsh/goofy/postfach/PostfachMailService.java +++ b/goofy-server/src/main/java/de/itvsh/goofy/postfach/PostfachMailService.java @@ -51,7 +51,7 @@ class PostfachMailService { private Boolean isPostfachConfigured = null; @Autowired - private PostfachNachrichtenPdfService pdfService; + private PostfachNachrichtPdfService pdfService; @Autowired private PostfachMailRemoteService remoteService; diff --git a/goofy-server/src/main/java/de/itvsh/goofy/postfach/PostfachNachrichtenPdfModel.java b/goofy-server/src/main/java/de/itvsh/goofy/postfach/PostfachNachrichtPdfModel.java similarity index 98% rename from goofy-server/src/main/java/de/itvsh/goofy/postfach/PostfachNachrichtenPdfModel.java rename to goofy-server/src/main/java/de/itvsh/goofy/postfach/PostfachNachrichtPdfModel.java index ec0afaf293184f1ae687c05ec9c936edd31d5f5c..5db38b383707939caaddb23dd55d66f74fa3acc5 100644 --- a/goofy-server/src/main/java/de/itvsh/goofy/postfach/PostfachNachrichtenPdfModel.java +++ b/goofy-server/src/main/java/de/itvsh/goofy/postfach/PostfachNachrichtPdfModel.java @@ -40,7 +40,7 @@ import lombok.NoArgsConstructor; @Builder @AllArgsConstructor(access = AccessLevel.PRIVATE) @NoArgsConstructor(access = AccessLevel.PACKAGE) -class PostfachNachrichtenPdfModel { +class PostfachNachrichtPdfModel { @XmlElement private String vorgangName; diff --git a/goofy-server/src/main/java/de/itvsh/goofy/postfach/PostfachNachrichtenPdfService.java b/goofy-server/src/main/java/de/itvsh/goofy/postfach/PostfachNachrichtPdfService.java similarity index 85% rename from goofy-server/src/main/java/de/itvsh/goofy/postfach/PostfachNachrichtenPdfService.java rename to goofy-server/src/main/java/de/itvsh/goofy/postfach/PostfachNachrichtPdfService.java index 653b6eb072f294477cb14e8c3fa9e25979743aaa..a9c12631da0083fef955b12a0af257411bae1080 100644 --- a/goofy-server/src/main/java/de/itvsh/goofy/postfach/PostfachNachrichtenPdfService.java +++ b/goofy-server/src/main/java/de/itvsh/goofy/postfach/PostfachNachrichtPdfService.java @@ -42,7 +42,7 @@ import de.itvsh.kop.common.errorhandling.TechnicalException; import de.itvsh.kop.common.pdf.PdfService; @Service -class PostfachNachrichtenPdfService { +class PostfachNachrichtPdfService { static final String PDF_TEMPLATE_PATH = "classpath:fop/postfach-nachrichten.xsl"; @@ -54,7 +54,7 @@ class PostfachNachrichtenPdfService { @Autowired private PdfService pdfService; - @Value(PostfachNachrichtenPdfService.PDF_TEMPLATE_PATH) + @Value(PostfachNachrichtPdfService.PDF_TEMPLATE_PATH) private Resource pdfTemplate; public OutputStream getAllAsPdf(VorgangWithEingang vorgang, Stream<PostfachNachrichtPdfData> postfachNachrichten, OutputStream out) { @@ -69,8 +69,8 @@ class PostfachNachrichtenPdfService { } } - PostfachNachrichtenPdfModel buildModel(VorgangWithEingang vorgang, Stream<PostfachNachrichtPdfData> postfachNachrichten) { - var pdfModelBuilder = PostfachNachrichtenPdfModel.builder().vorgangNummer(vorgang.getNummer()).vorgangName(vorgang.getName()); + PostfachNachrichtPdfModel buildModel(VorgangWithEingang vorgang, Stream<PostfachNachrichtPdfData> postfachNachrichten) { + var pdfModelBuilder = PostfachNachrichtPdfModel.builder().vorgangNummer(vorgang.getNummer()).vorgangName(vorgang.getName()); Optional.ofNullable(vorgang.getEingang().getAntragsteller()).ifPresent(antragsteller -> mapAntragsteller(pdfModelBuilder, antragsteller)); pdfModelBuilder.nachrichten(postfachNachrichten.map(this::mapPostfachNachricht).toList()); @@ -78,7 +78,7 @@ class PostfachNachrichtenPdfService { return pdfModelBuilder.build(); } - void mapAntragsteller(PostfachNachrichtenPdfModel.PostfachNachrichtenPdfModelBuilder modelBuilder, Antragsteller antragsteller) { + void mapAntragsteller(PostfachNachrichtPdfModel.PostfachNachrichtPdfModelBuilder modelBuilder, Antragsteller antragsteller) { modelBuilder.antragstellerAnrede(antragsteller.getAnrede()) .antragstellerVorname(antragsteller.getVorname()) .antragstellerNachname(antragsteller.getNachname()) @@ -88,8 +88,8 @@ class PostfachNachrichtenPdfService { .antragstellerOrt(antragsteller.getOrt()); } - PostfachNachrichtenPdfModel.Nachricht mapPostfachNachricht(PostfachNachrichtPdfData postfachmail) { - return PostfachNachrichtenPdfModel.Nachricht.builder() + PostfachNachrichtPdfModel.Nachricht mapPostfachNachricht(PostfachNachrichtPdfData postfachmail) { + return PostfachNachrichtPdfModel.Nachricht.builder() .subject(postfachmail.getSubject()) .mailBody(postfachmail.getMailBody()) .createdAt(CREATED_AT_FORMATTER.format(postfachmail.getCreatedAt())) diff --git a/goofy-server/src/main/resources/fop/postfach-nachrichten.xsl b/goofy-server/src/main/resources/fop/postfach-nachrichten.xsl index cd067b4411a760e0ec088d4a38027e1b310c25b9..a91697e90d3e731108f897fee60ebdedc0295400 100644 --- a/goofy-server/src/main/resources/fop/postfach-nachrichten.xsl +++ b/goofy-server/src/main/resources/fop/postfach-nachrichten.xsl @@ -13,7 +13,7 @@ <fo:block>Vorgangsname</fo:block> </fo:table-cell> <fo:table-cell> - <fo:block><xsl:value-of select="postfachNachrichtenPdfModel/vorgangName" /></fo:block> + <fo:block><xsl:value-of select="postfachNachrichtPdfModel/vorgangName" /></fo:block> </fo:table-cell> </fo:table-row> @@ -22,7 +22,7 @@ <fo:block>Vorgangsnummer</fo:block> </fo:table-cell> <fo:table-cell> - <fo:block><xsl:value-of select="postfachNachrichtenPdfModel/vorgangNummer" /></fo:block> + <fo:block><xsl:value-of select="postfachNachrichtPdfModel/vorgangNummer" /></fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> @@ -40,21 +40,21 @@ </fo:table-cell> <fo:table-cell> <fo:block> - <xsl:value-of select="postfachNachrichtenPdfModel/antragstellerAnrede" /> + <xsl:value-of select="postfachNachrichtPdfModel/antragstellerAnrede" /> <xsl:text> </xsl:text> - <xsl:value-of select="postfachNachrichtenPdfModel/antragstellerVorname" /> + <xsl:value-of select="postfachNachrichtPdfModel/antragstellerVorname" /> <xsl:text> </xsl:text> - <xsl:value-of select="postfachNachrichtenPdfModel/antragstellerNachname" /> + <xsl:value-of select="postfachNachrichtPdfModel/antragstellerNachname" /> </fo:block> <fo:block> - <xsl:value-of select="postfachNachrichtenPdfModel/antragstellerStrasse" /> + <xsl:value-of select="postfachNachrichtPdfModel/antragstellerStrasse" /> <xsl:text> </xsl:text> - <xsl:value-of select="postfachNachrichtenPdfModel/antragstellerHausnummer" /> + <xsl:value-of select="postfachNachrichtPdfModel/antragstellerHausnummer" /> </fo:block> <fo:block> - <xsl:value-of select="postfachNachrichtenPdfModel/antragstellerPlz" /> + <xsl:value-of select="postfachNachrichtPdfModel/antragstellerPlz" /> <xsl:text> </xsl:text> - <xsl:value-of select="postfachNachrichtenPdfModel/antragstellerOrt" /> + <xsl:value-of select="postfachNachrichtPdfModel/antragstellerOrt" /> </fo:block> </fo:table-cell> </fo:table-row> @@ -66,7 +66,7 @@ <fo:block-container font-size="11pt" margin-top="1cm"> <fo:block font-size="14pt" margin-bottom="3mm">Nachrichten</fo:block> - <xsl:for-each select="postfachNachrichtenPdfModel/nachrichten/nachricht"> + <xsl:for-each select="postfachNachrichtPdfModel/nachrichten/nachricht"> <xsl:call-template name="nachricht"/> </xsl:for-each> </fo:block-container> diff --git a/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachMailServiceTest.java b/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachMailServiceTest.java index 70e2f333a6e2658b93776876f73fd40f94f2b56f..055882237d987758dc7079e52c1afa973b9f5eba 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachMailServiceTest.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachMailServiceTest.java @@ -62,7 +62,7 @@ class PostfachMailServiceTest { @InjectMocks // NOSONAR private PostfachMailService service; @Mock - private PostfachNachrichtenPdfService pdfService; + private PostfachNachrichtPdfService pdfService; @Mock private PostfachMailRemoteService remoteService; @Mock diff --git a/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachNachrichtenPdfServiceITCase.java b/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachNachrichtPdfServiceITCase.java similarity index 97% rename from goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachNachrichtenPdfServiceITCase.java rename to goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachNachrichtPdfServiceITCase.java index 50370c2643e8f6cfde192cce6545851544469b81..a4ada1e59fa75268a52d42cef5e90924d605d3c3 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachNachrichtenPdfServiceITCase.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachNachrichtPdfServiceITCase.java @@ -51,10 +51,10 @@ import de.itvsh.goofy.vorgang.VorgangWithEingangTestFactory; import lombok.SneakyThrows; @SpringBootTest -class PostfachNachrichtenPdfServiceITCase { +class PostfachNachrichtPdfServiceITCase { @Autowired - private PostfachNachrichtenPdfService service; + private PostfachNachrichtPdfService service; @MockBean private UserRemoteService userRemoteService; diff --git a/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachNachrichtenPdfServiceTest.java b/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachNachrichtPdfServiceTest.java similarity index 93% rename from goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachNachrichtenPdfServiceTest.java rename to goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachNachrichtPdfServiceTest.java index 18ab6b290a0dd6138e94afd691fd5a0964be9ab6..d221b35f24018fb3eee8d60c3b6bc717149b5343 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachNachrichtenPdfServiceTest.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachNachrichtPdfServiceTest.java @@ -44,7 +44,7 @@ import org.springframework.util.ReflectionUtils; import de.itvsh.goofy.common.binaryfile.BinaryFileTestFactory; import de.itvsh.goofy.common.user.UserProfileTestFactory; -import de.itvsh.goofy.postfach.PostfachNachrichtenPdfModel.Nachricht; +import de.itvsh.goofy.postfach.PostfachNachrichtPdfModel.Nachricht; import de.itvsh.goofy.vorgang.AntragstellerTestFactory; import de.itvsh.goofy.vorgang.VorgangHeaderTestFactory; import de.itvsh.goofy.vorgang.VorgangWithEingangTestFactory; @@ -52,11 +52,11 @@ import de.itvsh.kop.common.errorhandling.TechnicalException; import de.itvsh.kop.common.pdf.PdfService; import lombok.SneakyThrows; -class PostfachNachrichtenPdfServiceTest { +class PostfachNachrichtPdfServiceTest { @Spy @InjectMocks - private PostfachNachrichtenPdfService service; + private PostfachNachrichtPdfService service; @Mock private PdfService pdfService; @@ -76,7 +76,7 @@ class PostfachNachrichtenPdfServiceTest { @BeforeEach void mockPdfTemplate() { - var field = ReflectionUtils.findField(PostfachNachrichtenPdfService.class, "pdfTemplate"); + var field = ReflectionUtils.findField(PostfachNachrichtPdfService.class, "pdfTemplate"); field.setAccessible(true); ReflectionUtils.setField(field, service, pdfTemplate); } @@ -187,8 +187,8 @@ class PostfachNachrichtenPdfServiceTest { assertThat(modelBuilder.build().getAntragstellerOrt()).isEqualTo(AntragstellerTestFactory.ORT); } - private PostfachNachrichtenPdfModel.PostfachNachrichtenPdfModelBuilder mapAntragsteller() { - var modelBuilder = PostfachNachrichtenPdfModel.builder(); + private PostfachNachrichtPdfModel.PostfachNachrichtPdfModelBuilder mapAntragsteller() { + var modelBuilder = PostfachNachrichtPdfModel.builder(); service.mapAntragsteller(modelBuilder, AntragstellerTestFactory.create()); @@ -247,7 +247,7 @@ class PostfachNachrichtenPdfServiceTest { service.getAllAsPdf(VorgangWithEingangTestFactory.create(), Stream.of(PostfachNachrichtPdfDataTestFactory.create()), output); - verify(pdfService).createPdf(any(InputStream.class), eq(output), any(PostfachNachrichtenPdfModel.class)); + verify(pdfService).createPdf(any(InputStream.class), eq(output), any(PostfachNachrichtPdfModel.class)); } } } \ No newline at end of file