diff --git a/sejda-console/src/test/java/org/sejda/cli/MergeTaskTest.java b/sejda-console/src/test/java/org/sejda/cli/MergeTaskTest.java index 284fd0a35..8c3628eb2 100644 --- a/sejda-console/src/test/java/org/sejda/cli/MergeTaskTest.java +++ b/sejda-console/src/test/java/org/sejda/cli/MergeTaskTest.java @@ -16,7 +16,6 @@ */ package org.sejda.cli; -import static org.hamcrest.CoreMatchers.either; import static org.hamcrest.CoreMatchers.hasItem; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -34,6 +33,7 @@ import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.hamcrest.Matcher; +import org.hamcrest.core.CombinableMatcher; import org.junit.Before; import org.junit.Test; import org.sejda.model.input.PdfFileSource; @@ -164,7 +164,7 @@ private static List>> filesList(String... filenam for (String current : filenames) { String filename = current.toString(); if (FilenameUtils.getPrefixLength(filename) > 0) { - result.add(either(hasItem(new File(filename))).or( + result.add(CombinableMatcher.> either(hasItem(new File(filename))).or( hasItem(new File(FilenameUtils.separatorsToWindows("C:" + filename))))); } result.add(hasItem(new File(filename))); diff --git a/sejda-conversion/src/test/java/org/sejda/conversion/PdfFileSourceAdapterTest.java b/sejda-conversion/src/test/java/org/sejda/conversion/PdfFileSourceAdapterTest.java index 3062ef05e..4d1f68709 100644 --- a/sejda-conversion/src/test/java/org/sejda/conversion/PdfFileSourceAdapterTest.java +++ b/sejda-conversion/src/test/java/org/sejda/conversion/PdfFileSourceAdapterTest.java @@ -17,7 +17,6 @@ package org.sejda.conversion; import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.CoreMatchers.either; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertThat; @@ -27,6 +26,7 @@ import java.io.InputStream; import org.apache.commons.io.FileUtils; +import org.hamcrest.core.CombinableMatcher; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -67,7 +67,8 @@ public void windowsFileWithPassword() { PdfFileSource result = new PdfFileSourceAdapter("/tmp/inputFile1.pdf:secret123").getPdfFileSource(); assertThat(result.getPassword(), is("secret123")); assertThat(result.getSource(), - either(is(new File("/tmp/inputFile1.pdf"))).or(is(new File("c:\\tmp\\inputFile1.pdf")))); + CombinableMatcher. either(is(new File("/tmp/inputFile1.pdf"))).or( + is(new File("c:\\tmp\\inputFile1.pdf")))); } @Test @@ -75,7 +76,8 @@ public void windowsFileNoPassword() { PdfFileSource result = new PdfFileSourceAdapter("/tmp/inputFile1.pdf").getPdfFileSource(); assertNull(result.getPassword()); assertThat(result.getSource(), - either(is(new File("/tmp/inputFile1.pdf"))).or(is(new File("c:\\tmp\\inputFile1.pdf")))); + CombinableMatcher. either(is(new File("/tmp/inputFile1.pdf"))).or( + is(new File("c:\\tmp\\inputFile1.pdf")))); } @Test @@ -83,7 +85,8 @@ public void protectedFileWithPasswordContainingSeparator() { PdfFileSource result = new PdfFileSourceAdapter("/tmp/inputFile1.pdf:secret.pdf:password").getPdfFileSource(); assertThat(result.getPassword(), is("secret.pdf:password")); assertThat(result.getSource(), - either(is(new File("/tmp/inputFile1.pdf"))).or(is(new File("c:\\tmp\\inputFile1.pdf")))); + CombinableMatcher. either(is(new File("/tmp/inputFile1.pdf"))).or( + is(new File("c:\\tmp\\inputFile1.pdf")))); } @Test diff --git a/sejda-conversion/src/test/java/org/sejda/conversion/XmlFileSourceListParserTest.java b/sejda-conversion/src/test/java/org/sejda/conversion/XmlFileSourceListParserTest.java index 6aa81986d..8ea9289df 100644 --- a/sejda-conversion/src/test/java/org/sejda/conversion/XmlFileSourceListParserTest.java +++ b/sejda-conversion/src/test/java/org/sejda/conversion/XmlFileSourceListParserTest.java @@ -16,13 +16,13 @@ */ package org.sejda.conversion; -import static org.hamcrest.CoreMatchers.either; import static org.hamcrest.CoreMatchers.hasItem; import static org.junit.Assert.assertThat; import java.util.List; import org.apache.commons.io.FilenameUtils; +import org.hamcrest.core.CombinableMatcher; import org.junit.Test; import org.sejda.conversion.exception.ConversionException; @@ -41,8 +41,13 @@ public void parseFileNames() { List result = victim.parseFileNames(xmlFile); assertThat(result, hasItem("/tmp/pdf/inputFile.pdf")); assertThat(result, hasItem("/tmp/pdf/inputFile2.pdf:test")); - assertThat(result, either(hasItem("/tmp/inputFile1.pdf")).or(hasItem("C:\\tmp\\inputFile1.pdf"))); - assertThat(result, either(hasItem("/tmp/inputFile2.pdf")).or(hasItem("C:\\tmp\\inputFile2.pdf"))); + assertThat(result, + org.hamcrest.core.CombinableMatcher.> either(hasItem("/tmp/inputFile1.pdf")) + .or(hasItem("C:\\tmp\\inputFile1.pdf"))); + assertThat( + result, + CombinableMatcher.> either(hasItem("/tmp/inputFile2.pdf")).or( + hasItem("C:\\tmp\\inputFile2.pdf"))); assertThat(result, hasItem(FilenameUtils.separatorsToSystem("/tmp/subdir/inputFile1.pdf"))); assertThat(result, hasItem(FilenameUtils.separatorsToSystem("/tmp/subdir3/inputFile2.pdf"))); // its defined in absolute path mode in the file assertThat(result, hasItem(FilenameUtils.separatorsToSystem("/tmp/subdir2/inputFile1.pdf")));