![JAR search and dependency download from the Maven repository](/logo.png)
com.codeborne.pdftest.assertj.PdfAssert Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pdf-test Show documentation
Show all versions of pdf-test Show documentation
PDF Test: PDF testing library
The newest version!
package com.codeborne.pdftest.assertj;
import com.codeborne.pdftest.PDF;
import com.codeborne.pdftest.matchers.ContainsExactText;
import com.codeborne.pdftest.matchers.ContainsText;
import com.codeborne.pdftest.matchers.ContainsTextCaseInsensitive;
import com.codeborne.pdftest.matchers.DoesNotContainExactText;
import com.codeborne.pdftest.matchers.DoesNotContainText;
import com.codeborne.pdftest.matchers.MatchesText;
import org.assertj.core.api.AbstractAssert;
import java.util.regex.Pattern;
import static org.hamcrest.MatcherAssert.assertThat;
public class PdfAssert extends AbstractAssert {
public PdfAssert(PDF actual) {
super(actual, PdfAssert.class);
}
public PdfAssert containsText(String text, String... texts) {
isNotNull();
assertThat(actual, new ContainsText(text, texts));
return this;
}
public PdfAssert doesNotContainText(String text, String... texts) {
isNotNull();
assertThat(actual, new DoesNotContainText(text, texts));
return this;
}
public PdfAssert containsExactText(String substring) {
isNotNull();
assertThat(actual, new ContainsExactText(substring));
return this;
}
public PdfAssert doesNotContainExactText(String substring) {
isNotNull();
assertThat(actual, new DoesNotContainExactText(substring));
return this;
}
public PdfAssert containsTextCaseInsensitive(String substring) {
isNotNull();
assertThat(actual, new ContainsTextCaseInsensitive(substring));
return this;
}
public PdfAssert matchesText(String regex) {
return matchesText(Pattern.compile(regex));
}
public PdfAssert matchesText(Pattern regex) {
isNotNull();
assertThat(actual, new MatchesText(regex));
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy