Skip to content

Commit 5888b93

Browse files
authored
Fixed test added anotation and line seperator (#18050)
1 parent f29ddc7 commit 5888b93

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Diff for: text-processing-libraries-modules/pdf/src/test/java/com/baeldung/addheaderfooterpdf/AddHeaderFooterToPDFUnitTest.java

+6
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,21 @@
77
import com.itextpdf.layout.element.Paragraph;
88
import org.apache.pdfbox.pdmodel.PDDocument;
99
import org.apache.pdfbox.text.PDFTextStripper;
10+
import org.junit.jupiter.api.Order;
1011
import org.junit.jupiter.api.Test;
12+
import org.junit.jupiter.api.TestMethodOrder;
13+
import org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
1114

1215
import java.io.File;
1316
import java.io.IOException;
1417

1518
import static org.junit.jupiter.api.Assertions.assertTrue;
1619

20+
@TestMethodOrder(OrderAnnotation.class)
1721
public class AddHeaderFooterToPDFUnitTest {
1822

1923
@Test
24+
@Order(1)
2025
void givenHeaderAndFooter_whenCreatingPDF_thenHeaderFooterAreOnEachPage() throws IOException {
2126
String dest = "documentWithHeaderFooter.pdf";
2227
PdfWriter writer = new PdfWriter(dest);
@@ -31,6 +36,7 @@ void givenHeaderAndFooter_whenCreatingPDF_thenHeaderFooterAreOnEachPage() throws
3136
}
3237

3338
@Test
39+
@Order(2)
3440
void givenHeaderAndFooter_whenTestingPDF_thenHeaderFooterAreVerified() throws IOException {
3541
String dest = "documentWithHeaderFooter.pdf";
3642

Diff for: text-processing-libraries-modules/pdf/src/test/java/com/baeldung/pdfreadertest/ReadPdfFileUnitTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ReadPdfFileUnitTest {
1616

1717
@Test
1818
public void givenSamplePdf_whenUsingApachePdfBox_thenCompareOutput() throws IOException {
19-
String expectedText = "Hello World!\n";
19+
String expectedText = "Hello World!" + System.lineSeparator();
2020

2121
File file = new File("sample.pdf");
2222
PDDocument document = PDDocument.load(file);

0 commit comments

Comments
 (0)