File tree 2 files changed +7
-1
lines changed
text-processing-libraries-modules/pdf/src/test/java/com/baeldung
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 7
7
import com .itextpdf .layout .element .Paragraph ;
8
8
import org .apache .pdfbox .pdmodel .PDDocument ;
9
9
import org .apache .pdfbox .text .PDFTextStripper ;
10
+ import org .junit .jupiter .api .Order ;
10
11
import org .junit .jupiter .api .Test ;
12
+ import org .junit .jupiter .api .TestMethodOrder ;
13
+ import org .junit .jupiter .api .MethodOrderer .OrderAnnotation ;
11
14
12
15
import java .io .File ;
13
16
import java .io .IOException ;
14
17
15
18
import static org .junit .jupiter .api .Assertions .assertTrue ;
16
19
20
+ @ TestMethodOrder (OrderAnnotation .class )
17
21
public class AddHeaderFooterToPDFUnitTest {
18
22
19
23
@ Test
24
+ @ Order (1 )
20
25
void givenHeaderAndFooter_whenCreatingPDF_thenHeaderFooterAreOnEachPage () throws IOException {
21
26
String dest = "documentWithHeaderFooter.pdf" ;
22
27
PdfWriter writer = new PdfWriter (dest );
@@ -31,6 +36,7 @@ void givenHeaderAndFooter_whenCreatingPDF_thenHeaderFooterAreOnEachPage() throws
31
36
}
32
37
33
38
@ Test
39
+ @ Order (2 )
34
40
void givenHeaderAndFooter_whenTestingPDF_thenHeaderFooterAreVerified () throws IOException {
35
41
String dest = "documentWithHeaderFooter.pdf" ;
36
42
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ class ReadPdfFileUnitTest {
16
16
17
17
@ Test
18
18
public void givenSamplePdf_whenUsingApachePdfBox_thenCompareOutput () throws IOException {
19
- String expectedText = "Hello World!\n " ;
19
+ String expectedText = "Hello World!" + System . lineSeparator () ;
20
20
21
21
File file = new File ("sample.pdf" );
22
22
PDDocument document = PDDocument .load (file );
You can’t perform that action at this time.
0 commit comments