diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-01-03 14:29:59 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-01-03 14:29:59 +0000 |
| commit | 07685b4a361f8827728513f9d7360bd91dc1a246 (patch) | |
| tree | e5bc1bc4571624603ad88c952e2f63a143a0327a /src/test/java | |
| parent | 5f2f968ea2e9245dcdffd80d5271742f939fc5fc (diff) | |
Tidy up makers
Diffstat (limited to 'src/test/java')
| -rw-r--r-- | src/test/java/org/zwobble/mammoth/tests/documents/DocumentElementMakers.java | 13 | ||||
| -rw-r--r-- | src/test/java/org/zwobble/mammoth/tests/docx/BodyXmlReaderMakers.java | 11 |
2 files changed, 6 insertions, 18 deletions
diff --git a/src/test/java/org/zwobble/mammoth/tests/documents/DocumentElementMakers.java b/src/test/java/org/zwobble/mammoth/tests/documents/DocumentElementMakers.java index f2d5317..0d83882 100644 --- a/src/test/java/org/zwobble/mammoth/tests/documents/DocumentElementMakers.java +++ b/src/test/java/org/zwobble/mammoth/tests/documents/DocumentElementMakers.java @@ -3,7 +3,6 @@ package org.zwobble.mammoth.tests.documents; import com.google.common.collect.ImmutableList; import com.natpryce.makeiteasy.Instantiator; import com.natpryce.makeiteasy.Property; -import com.natpryce.makeiteasy.PropertyLookup; import org.zwobble.mammoth.documents.DocumentElement; import org.zwobble.mammoth.documents.HasChildren; import org.zwobble.mammoth.documents.Paragraph; @@ -16,12 +15,8 @@ import static com.natpryce.makeiteasy.Property.newProperty; public class DocumentElementMakers { public static final Property<HasChildren, List<DocumentElement>> CHILDREN = newProperty(); - public static final Instantiator<Paragraph> PARAGRAPH = new Instantiator<Paragraph>() { - @Override - public Paragraph instantiate(PropertyLookup<Paragraph> propertyLookup) { - return new Paragraph( - Optional.empty(), - propertyLookup.valueOf(CHILDREN, ImmutableList.of())); - } - }; + public static final Instantiator<Paragraph> PARAGRAPH = + propertyLookup -> new Paragraph( + Optional.empty(), + propertyLookup.valueOf(CHILDREN, ImmutableList.of())); } diff --git a/src/test/java/org/zwobble/mammoth/tests/docx/BodyXmlReaderMakers.java b/src/test/java/org/zwobble/mammoth/tests/docx/BodyXmlReaderMakers.java index a0748b9..6dafdee 100644 --- a/src/test/java/org/zwobble/mammoth/tests/docx/BodyXmlReaderMakers.java +++ b/src/test/java/org/zwobble/mammoth/tests/docx/BodyXmlReaderMakers.java @@ -1,9 +1,7 @@ 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; @@ -12,11 +10,6 @@ import static com.natpryce.makeiteasy.Property.newProperty; public class BodyXmlReaderMakers { public static final Property<BodyXmlReader, Styles> STYLES = newProperty(); - public static final Instantiator<BodyXmlReader> bodyReader = new Instantiator<BodyXmlReader>() { - @Override - public BodyXmlReader instantiate(PropertyLookup<BodyXmlReader> propertyLookup) { - return new BodyXmlReader( - propertyLookup.valueOf(STYLES, new Styles(ImmutableMap.of(), ImmutableMap.of()))); - } - }; + public static final Instantiator<BodyXmlReader> bodyReader = + propertyLookup -> new BodyXmlReader(propertyLookup.valueOf(STYLES, Styles.EMPTY)); } |
