@Test
public void toDocumentTest() throws IOException, Docx4JException {

	WordTemplate<String> wordTemplate = createWordTemplate("org/wte4j/impl/simpleTemplate.docx");
	when(templateContext.resolveValue("value")).thenReturn("test123");
	File generatedDocument = File.createTempFile("generated", "docx");
	try (OutputStream out = new FileOutputStream(generatedDocument)) {
		wordTemplate.toDocument("gugus", out);
		WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage
				.load(generatedDocument);
		String content = XmlUtils.marshaltoString(wordMLPackage
				.getMainDocumentPart().getContents(), true);
		assertTrue(content.contains("test123"));
	} finally {
		generatedDocument.deleteOnExit();
	}
}