From 87018d44aedd2f215c1598aec8c782c01d38adbb Mon Sep 17 00:00:00 2001 From: panos-kakos Date: Sat, 11 Nov 2023 06:55:11 +0200 Subject: [PATCH] [JAVA-26715] Upgraded pdfbox to latest version --- pdf-2/pom.xml | 2 +- .../pdfinfo/PdfInfoITextUnitTest.java | 22 ++++++++++--------- .../pdfinfo/PdfInfoPdfBoxUnitTest.java | 22 ++++++++++--------- pdf/pom.xml | 2 +- 4 files changed, 26 insertions(+), 22 deletions(-) diff --git a/pdf-2/pom.xml b/pdf-2/pom.xml index ccbb5c9693..2079ff70e5 100644 --- a/pdf-2/pom.xml +++ b/pdf-2/pom.xml @@ -51,7 +51,7 @@ 5.5.13.3 7.2.3 3.0.1 - 3.0.0-RC1 + 3.0.0 \ No newline at end of file diff --git a/pdf-2/src/test/java/com/baeldung/pdfinfo/PdfInfoITextUnitTest.java b/pdf-2/src/test/java/com/baeldung/pdfinfo/PdfInfoITextUnitTest.java index 422858d659..f54405a533 100644 --- a/pdf-2/src/test/java/com/baeldung/pdfinfo/PdfInfoITextUnitTest.java +++ b/pdf-2/src/test/java/com/baeldung/pdfinfo/PdfInfoITextUnitTest.java @@ -1,29 +1,31 @@ package com.baeldung.pdfinfo; -import org.junit.Assert; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; import java.io.IOException; import java.util.Map; -public class PdfInfoITextUnitTest { +import org.junit.jupiter.api.Test; + +class PdfInfoITextUnitTest { private static final String PDF_FILE = "src/test/resources/input.pdf"; @Test - public void givenPdf_whenGetNumberOfPages_thenOK() throws IOException { - Assert.assertEquals(4, PdfInfoIText.getNumberOfPages(PDF_FILE)); + void givenPdf_whenGetNumberOfPages_thenOK() throws IOException { + assertEquals(4, PdfInfoIText.getNumberOfPages(PDF_FILE)); } @Test - public void givenPdf_whenIsPasswordRequired_thenOK() throws IOException { - Assert.assertFalse(PdfInfoIText.isPasswordRequired(PDF_FILE)); + void givenPdf_whenIsPasswordRequired_thenOK() throws IOException { + assertFalse(PdfInfoIText.isPasswordRequired(PDF_FILE)); } @Test - public void givenPdf_whenGetInfo_thenOK() throws IOException { + void givenPdf_whenGetInfo_thenOK() throws IOException { Map info = PdfInfoIText.getInfo(PDF_FILE); - Assert.assertEquals("LibreOffice 4.2", info.get("Producer")); - Assert.assertEquals("Writer", info.get("Creator")); + assertEquals("LibreOffice 4.2", info.get("Producer")); + assertEquals("Writer", info.get("Creator")); } } diff --git a/pdf-2/src/test/java/com/baeldung/pdfinfo/PdfInfoPdfBoxUnitTest.java b/pdf-2/src/test/java/com/baeldung/pdfinfo/PdfInfoPdfBoxUnitTest.java index 0fcbc7ee3c..5c4e5fc30d 100644 --- a/pdf-2/src/test/java/com/baeldung/pdfinfo/PdfInfoPdfBoxUnitTest.java +++ b/pdf-2/src/test/java/com/baeldung/pdfinfo/PdfInfoPdfBoxUnitTest.java @@ -1,29 +1,31 @@ package com.baeldung.pdfinfo; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; + import org.apache.pdfbox.pdmodel.PDDocumentInformation; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; -public class PdfInfoPdfBoxUnitTest { +class PdfInfoPdfBoxUnitTest { private static final String PDF_FILE = "src/test/resources/input.pdf"; @Test - public void givenPdf_whenGetNumberOfPages_thenOK() throws IOException { - Assert.assertEquals(4, PdfInfoPdfBox.getNumberOfPages(PDF_FILE)); + void givenPdf_whenGetNumberOfPages_thenOK() throws IOException { + assertEquals(4, PdfInfoPdfBox.getNumberOfPages(PDF_FILE)); } @Test - public void givenPdf_whenIsPasswordRequired_thenOK() throws IOException { - Assert.assertFalse(PdfInfoPdfBox.isPasswordRequired(PDF_FILE)); + void givenPdf_whenIsPasswordRequired_thenOK() throws IOException { + assertFalse(PdfInfoPdfBox.isPasswordRequired(PDF_FILE)); } @Test - public void givenPdf_whenGetInfo_thenOK() throws IOException { + void givenPdf_whenGetInfo_thenOK() throws IOException { PDDocumentInformation info = PdfInfoPdfBox.getInfo(PDF_FILE); - Assert.assertEquals("LibreOffice 4.2", info.getProducer()); - Assert.assertEquals("Writer", info.getCreator()); + assertEquals("LibreOffice 4.2", info.getProducer()); + assertEquals("Writer", info.getCreator()); } } diff --git a/pdf/pom.xml b/pdf/pom.xml index cead1b2ded..0fe90b6eb5 100644 --- a/pdf/pom.xml +++ b/pdf/pom.xml @@ -104,7 +104,7 @@ - 2.0.25 + 3.0.0 2.0.1 5.5.13.3 5.5.10