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 --- .../mammoth/tests/docx/BodyXmlReaderMakers.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/test/java/org/zwobble/mammoth/tests/docx/BodyXmlReaderMakers.java (limited to 'src/test/java/org/zwobble/mammoth/tests/docx/BodyXmlReaderMakers.java') diff --git a/src/test/java/org/zwobble/mammoth/tests/docx/BodyXmlReaderMakers.java b/src/test/java/org/zwobble/mammoth/tests/docx/BodyXmlReaderMakers.java new file mode 100644 index 0000000..a0748b9 --- /dev/null +++ b/src/test/java/org/zwobble/mammoth/tests/docx/BodyXmlReaderMakers.java @@ -0,0 +1,22 @@ +package org.zwobble.mammoth.tests.docx; + +import com.google.common.collect.ImmutableMap; +import com.natpryce.makeiteasy.Instantiator; +import com.natpryce.makeiteasy.Property; +import com.natpryce.makeiteasy.PropertyLookup; +import org.zwobble.mammoth.docx.BodyXmlReader; +import org.zwobble.mammoth.docx.Styles; + +import static com.natpryce.makeiteasy.Property.newProperty; + +public class BodyXmlReaderMakers { + public static final Property STYLES = newProperty(); + + public static final Instantiator bodyReader = new Instantiator() { + @Override + public BodyXmlReader instantiate(PropertyLookup propertyLookup) { + return new BodyXmlReader( + propertyLookup.valueOf(STYLES, new Styles(ImmutableMap.of(), ImmutableMap.of()))); + } + }; +} -- cgit v1.2.3