diff --git a/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/IuclidFunctionService.java b/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/IuclidFunctionService.java index 952bb51..979db75 100644 --- a/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/IuclidFunctionService.java +++ b/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/IuclidFunctionService.java @@ -35,7 +35,7 @@ public class IuclidFunctionService { while (iterator.hasNext()) { ReportRedactionEntry entry = iterator.next(); s.append("P").append(entry.getPage()).append(" "); - if (StringUtils.isBlank(entry.getValue()) || entry.getValue().equalsIgnoreCase("Rectangle")) { + if (StringUtils.isBlank(entry.getValue()) || entry.getValue().equalsIgnoreCase("Rectangle") || entry.getValue().startsWith("Image:")) { s.append(entry.getEntityDisplayName()).append(" - non-readable content"); } else { s.append(entry.getValue().replaceAll("\n", " ").replaceAll(" ", " ")); diff --git a/redaction-report-service-v1/redaction-report-service-server-v1/src/test/java/com/iqser/red/service/redaction/report/v1/server/RedactionReportIntegrationTest.java b/redaction-report-service-v1/redaction-report-service-server-v1/src/test/java/com/iqser/red/service/redaction/report/v1/server/RedactionReportIntegrationTest.java index c1bc93e..0293d6c 100644 --- a/redaction-report-service-v1/redaction-report-service-server-v1/src/test/java/com/iqser/red/service/redaction/report/v1/server/RedactionReportIntegrationTest.java +++ b/redaction-report-service-v1/redaction-report-service-server-v1/src/test/java/com/iqser/red/service/redaction/report/v1/server/RedactionReportIntegrationTest.java @@ -276,7 +276,7 @@ public class RedactionReportIntegrationTest { EntityLog entityLog = objectMapper.readValue(new ClassPathResource("files/entityLog.json").getInputStream(), EntityLog.class); List legalBasisMapping = objectMapper.readValue(new ClassPathResource("files/legalBasisMapping.json").getInputStream(), new TypeReference<>() { }); - List reportEntries = entityLogConverterService.convertAndSort(DOSSIER_ID, FILE_ID, entityLog, legalBasisMapping, new HashMap<>()); + List reportEntries = entityLogConverterService.convertAndSort(DOSSIER_ID, FILE_ID, entityLog, legalBasisMapping, Map.of("signature", "Signature", "logo", "Logo")); ClassPathResource templateResource = new ClassPathResource("templates/IUCLID_Template.docx"); XWPFDocument doc = new XWPFDocument(templateResource.getInputStream()); diff --git a/redaction-report-service-v1/redaction-report-service-server-v1/src/test/resources/expected/iuclid.txt b/redaction-report-service-v1/redaction-report-service-server-v1/src/test/resources/expected/iuclid.txt index 5f77f10..20a8736 100644 --- a/redaction-report-service-v1/redaction-report-service-server-v1/src/test/resources/expected/iuclid.txt +++ b/redaction-report-service-v1/redaction-report-service-server-v1/src/test/resources/expected/iuclid.txt @@ -8,4 +8,4 @@ relates to: P5 +49 2113 2311 563, P5 +49 2113 2311 560, P5 +81 764770164, P5 +81 Article 39(e)(3) of Regulation (EC) No 178/2002 -relates to: P1 Image:Logo, P1 Doe J., P2 Michael N., P2 Funnarie B., P2 Feuer A., P3 Desiree, P3 Melanie, P4 library@outlook.com, P4 gordonjcp@msn.com, P4 dinther@comcast.net, P4 kawasaki@me.com, P5 Central Research Industry, P5 Maximiliam Schmitt, P5 +274 1432 8991, P5 493 1223 4592, P5 European Central Institute, P5 Emilia Lockhart, P6 This is a special case, everything between this and the next keyword should be redacted, P6 Central Research Industry, P6 Maximiliam Schmitt, P6 +274 1432 8991, P6 493 1223 4592, P6 European Central Institute, P6 Emilia Lockhart, P7 Dr. Alan Grant, P7 Dr. Alan Grant, P9 Image:Signature, P9 Image:Signature, P9 Müller, P9 Image:Logo \ No newline at end of file +relates to: P1 Logo - non-readable content, P1 Doe J., P2 Michael N., P2 Funnarie B., P2 Feuer A., P3 Desiree, P3 Melanie, P4 library@outlook.com, P4 gordonjcp@msn.com, P4 dinther@comcast.net, P4 kawasaki@me.com, P5 Central Research Industry, P5 Maximiliam Schmitt, P5 +274 1432 8991, P5 493 1223 4592, P5 European Central Institute, P5 Emilia Lockhart, P6 This is a special case, everything between this and the next keyword should be redacted, P6 Central Research Industry, P6 Maximiliam Schmitt, P6 +274 1432 8991, P6 493 1223 4592, P6 European Central Institute, P6 Emilia Lockhart, P7 Dr. Alan Grant, P7 Dr. Alan Grant, P9 Signature - non-readable content, P9 Signature - non-readable content, P9 Müller, P9 Logo - non-readable content \ No newline at end of file