Skip to content

Repository files navigation

Build StatusMaven CentralCoverage Status

PDF Test

PDF testing library

Be sure that your code generates correct PDF!

How to use (Hamcrest)

importcom.codeborne.pdftest.PDF;
importstaticcom.codeborne.pdftest.PDF.*;
importstaticorg.hamcrest.MatcherAssert.assertThat;
publicclassPDFContainsTextTest {
@TestpublicvoidcanAssertThatPdfContainsText() {
PDFpdf = newPDF(newFile("src/test/resources/50quickideas.pdf"));
assertThat(pdf, containsText("50 Quick Ideas to Improve your User Stories"));
}
}

How to use (AssertJ)

importcom.codeborne.pdftest.PDF;
importstaticcom.codeborne.pdftest.assertj.Assertions.assertThat;
publicclassPDFContainsTextTest {
@TestpublicvoidcanAssertThatPdfContainsText() {
PDFpdf = newPDF(newFile("src/test/resources/50quickideas.pdf"));
assertThat(pdf).containsExactText("50 Quick Ideas to Improve your User Stories");
}
}

How to start

If you use Maven, add the following dependency to pom.xml:

 <dependency>
<groupId>com.codeborne</groupId>
<artifactId>pdf-test</artifactId>
<version>1.6.1</version>
</dependency>

If you use Gradle, add the following dependency to build.gradle:

 testCompile 'com.codeborne:pdf-test:1.6.1'

How to contribute

You are welcome to suggest your features and fixes!

Just fork the pdf-test and create pull request. Any contribution is important!

** Become part of open-source community! **

Thanks

Many thanks to these incredible tools that help us creating open-source software:

Intellij IDEA

YourKit Java profiler

License

pdf-test is open-source project and distributed under MIT license

About

PDF Test

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages