aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/zwobble/mammoth/tests/docx/BodyXmlTests.java
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-02-24 21:56:31 +0000
committerMichael Williamson <mike@zwobble.org>2016-02-24 23:24:20 +0000
commit56dad2617a86aeb83cf4f7f56519af621979851d (patch)
tree618e572381fa70f868a03e020c61b38fee4b8028 /src/test/java/org/zwobble/mammoth/tests/docx/BodyXmlTests.java
parentcc66aa555d68eb33dfceb052e5dc37284e5080bd (diff)
Use Set instead of List for warnings
Diffstat (limited to 'src/test/java/org/zwobble/mammoth/tests/docx/BodyXmlTests.java')
-rw-r--r--src/test/java/org/zwobble/mammoth/tests/docx/BodyXmlTests.java16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/test/java/org/zwobble/mammoth/tests/docx/BodyXmlTests.java b/src/test/java/org/zwobble/mammoth/tests/docx/BodyXmlTests.java
index 049db81..3141620 100644
--- a/src/test/java/org/zwobble/mammoth/tests/docx/BodyXmlTests.java
+++ b/src/test/java/org/zwobble/mammoth/tests/docx/BodyXmlTests.java
@@ -23,12 +23,12 @@ import java.util.function.Function;
import static com.natpryce.makeiteasy.MakeItEasy.*;
import static java.util.Arrays.asList;
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.allOf;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.hasProperty;
+import static org.hamcrest.Matchers.*;
import static org.zwobble.mammoth.internal.documents.NoteReference.endnoteReference;
import static org.zwobble.mammoth.internal.documents.NoteReference.footnoteReference;
import static org.zwobble.mammoth.tests.DeepReflectionMatcher.deepEquals;
+import static org.zwobble.mammoth.tests.ResultMatchers.hasWarnings;
+import static org.zwobble.mammoth.tests.ResultMatchers.isResult;
import static org.zwobble.mammoth.tests.documents.DocumentElementMakers.*;
import static org.zwobble.mammoth.tests.docx.BodyXmlReaderMakers.*;
import static org.zwobble.mammoth.tests.docx.BodyXmlReaderMakers.NUMBERING;
@@ -475,7 +475,7 @@ public class BodyXmlTests {
assertThat(
result,
- hasProperty("warnings", deepEquals(list("Image of type image/x-emf is unlikely to display in web browsers"))));
+ hasWarnings(list("Image of type image/x-emf is unlikely to display in web browsers")));
}
@Test
@@ -594,7 +594,7 @@ public class BodyXmlTests {
private static DocumentElement readSuccess(Maker<BodyXmlReader> reader, XmlElement element) {
InternalResult<DocumentElement> result = read(reader, element);
- assertThat(result.getWarnings(), deepEquals(list()));
+ assertThat(result.getWarnings(), emptyIterable());
return result.getValue();
}
@@ -652,12 +652,6 @@ public class BodyXmlTests {
return hasProperty("numbering", deepEquals(expected));
}
- private <T> Matcher<InternalResult<? extends T>> isResult(Matcher<T> valueMatcher, List<String> warnings) {
- return Matchers.allOf(
- hasProperty("value", valueMatcher),
- hasProperty("warnings", deepEquals(warnings)));
- }
-
private Run run(DocumentElement... children) {
return make(a(RUN, with(CHILDREN, asList(children))));
}