From ea37dde406b1c7fc35f72216882b7732d6ee5445 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 3 Jan 2016 11:57:51 +0000 Subject: Make body readers using make-it-easy in tests --- .../java/org/zwobble/mammoth/tests/docx/NotesXmlReaderTests.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/test/java/org/zwobble/mammoth/tests/docx/NotesXmlReaderTests.java') diff --git a/src/test/java/org/zwobble/mammoth/tests/docx/NotesXmlReaderTests.java b/src/test/java/org/zwobble/mammoth/tests/docx/NotesXmlReaderTests.java index e1f65ab..f434927 100644 --- a/src/test/java/org/zwobble/mammoth/tests/docx/NotesXmlReaderTests.java +++ b/src/test/java/org/zwobble/mammoth/tests/docx/NotesXmlReaderTests.java @@ -12,18 +12,22 @@ import org.zwobble.mammoth.xml.XmlElement; import java.util.List; import java.util.Optional; +import static com.natpryce.makeiteasy.MakeItEasy.a; +import static com.natpryce.makeiteasy.MakeItEasy.make; import static org.hamcrest.MatcherAssert.assertThat; import static org.zwobble.mammoth.tests.DeepReflectionMatcher.deepEquals; import static org.zwobble.mammoth.xml.XmlNodes.element; public class NotesXmlReaderTests { + private static final BodyXmlReader bodyReader = make(a(BodyXmlReaderMakers.bodyReader)); + @Test public void idAndBodyOfFootnoteAreRead() { XmlElement element = element("w:footnotes", ImmutableList.of( element("w:footnote", ImmutableMap.of("w:id", "1"), ImmutableList.of( element("w:p"))))); - NotesXmlReader reader = new NotesXmlReader(new BodyXmlReader(null), "footnote"); + NotesXmlReader reader = new NotesXmlReader(bodyReader, "footnote"); List notes = reader.readElement(element); assertThat( @@ -46,7 +50,7 @@ public class NotesXmlReaderTests { element("w:footnote", ImmutableMap.of("w:id", "1", "w:type", noteType), ImmutableList.of( element("w:p"))))); - NotesXmlReader reader = new NotesXmlReader(new BodyXmlReader(null), "footnote"); + NotesXmlReader reader = new NotesXmlReader(bodyReader, "footnote"); List notes = reader.readElement(element); assertThat(notes, deepEquals(ImmutableList.of())); -- cgit v1.2.3