blob: 013deae5319c9b02d37ad904d02caf298e1d5256 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
package org.zwobble.mammoth.tests;
import org.junit.Test;
import org.zwobble.mammoth.Mammoth;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
import lombok.val;
public class MammothTests {
@Test
public void emptyParagraphsAreIgnoredByDefault() {
assertThat(convertToHtml("empty.docx"), is(""));
}
@Test
public void docxContainingOneParagraphIsConvertedToSingleParagraphElement() {
assertThat(
convertToHtml("single-paragraph.docx"),
is("<p>Walking on imported air</p>"));
}
private String convertToHtml(String name) {
val file = TestData.file(name);
return Mammoth.convertToHtml(file);
}
}
|