Skip to content
Snippets Groups Projects
Commit b182416a authored by OZGCloud's avatar OZGCloud
Browse files

OZG-2966 OZG-3171 rename *Nachrichten* -> *Nachricht*

parent e21d93db
Branches
Tags
No related merge requests found
......@@ -51,7 +51,7 @@ class PostfachMailService {
private Boolean isPostfachConfigured = null;
@Autowired
private PostfachNachrichtenPdfService pdfService;
private PostfachNachrichtPdfService pdfService;
@Autowired
private PostfachMailRemoteService remoteService;
......
......@@ -40,7 +40,7 @@ import lombok.NoArgsConstructor;
@Builder
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor(access = AccessLevel.PACKAGE)
class PostfachNachrichtenPdfModel {
class PostfachNachrichtPdfModel {
@XmlElement
private String vorgangName;
......
......@@ -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()))
......
......@@ -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>
......
......@@ -62,7 +62,7 @@ class PostfachMailServiceTest {
@InjectMocks // NOSONAR
private PostfachMailService service;
@Mock
private PostfachNachrichtenPdfService pdfService;
private PostfachNachrichtPdfService pdfService;
@Mock
private PostfachMailRemoteService remoteService;
@Mock
......
......@@ -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;
......
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment