From 05ff9e63fb5ab95e20ebe403755ebfb1f8780c25 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Wed, 24 Feb 2016 08:32:15 +0000 Subject: Turn Mammoth into a non-static class --- .../org/zwobble/mammoth/tests/DocumentConverterTests.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/test/java/org/zwobble/mammoth/tests/DocumentConverterTests.java') diff --git a/src/test/java/org/zwobble/mammoth/tests/DocumentConverterTests.java b/src/test/java/org/zwobble/mammoth/tests/DocumentConverterTests.java index 40b6d99..4c40800 100644 --- a/src/test/java/org/zwobble/mammoth/tests/DocumentConverterTests.java +++ b/src/test/java/org/zwobble/mammoth/tests/DocumentConverterTests.java @@ -2,6 +2,7 @@ package org.zwobble.mammoth.tests; import org.junit.Test; import org.zwobble.mammoth.internal.DocumentConverter; +import org.zwobble.mammoth.internal.DocumentToHtmlOptions; import org.zwobble.mammoth.internal.documents.*; import org.zwobble.mammoth.internal.html.Html; import org.zwobble.mammoth.internal.html.HtmlNode; @@ -39,8 +40,9 @@ public class DocumentConverterTests { @Test public void forceWriteIsInsertedIntoParagraphIfEmptyParagraphsShouldBePreserved() { + DocumentToHtmlOptions options = DocumentToHtmlOptions.DEFAULT.preserveEmptyParagraphs(); assertThat( - DocumentConverter.convertToHtml("", true, StyleMap.EMPTY, make(a(PARAGRAPH))), + DocumentConverter.convertToHtml(make(a(PARAGRAPH)), options), deepEquals(success(list(Html.element("p", list(Html.FORCE_WRITE)))))); } @@ -286,7 +288,9 @@ public class DocumentConverterTests { } private List convertToHtml(Document document) { - Result> result = DocumentConverter.convertToHtml("doc-42-", false, StyleMap.EMPTY, document); + DocumentToHtmlOptions options = DocumentToHtmlOptions.DEFAULT + .idPrefix("doc-42-"); + Result> result = DocumentConverter.convertToHtml(document, options); assertThat(result.getWarnings(), hasSize(0)); return result.getValue(); } @@ -306,6 +310,9 @@ public class DocumentConverterTests { } private Result> convertToHtmlResult(DocumentElement element, StyleMap styleMap) { - return DocumentConverter.convertToHtml("doc-42-", false, styleMap, element); + DocumentToHtmlOptions options = DocumentToHtmlOptions.DEFAULT + .idPrefix("doc-42-") + .styleMap(styleMap); + return DocumentConverter.convertToHtml(element, options); } } -- cgit v1.2.3