@Test
public void createBasicTemplate() throws Exception {

	Map<String, Class<?>> elements = new HashMap<String, Class<?>>();
	elements.put("string", String.class);
	WteModelService service = mock(WteModelService.class);
	Map<String, String> properties = anyMapOf(String.class, String.class);
	Class<?> inputType = any(Class.class);
	when(service.listModelElements(inputType, properties)).thenReturn(
			elements);
	TemplateContextFactory contextFactory = mock(TemplateContextFactory.class);
	WordTemplateBuilder<String> builder = new WordTemplateBuilder<String>(
			contextFactory, service, String.class);
	byte[] templateContent = builder.createBasicTemplate();
	File templateFile = File.createTempFile("generated", "docx");
	try {
		FileUtils.writeByteArrayToFile(templateFile, templateContent);
		ZipFile zipFile = new ZipFile(templateFile);
		ZipEntry entry = zipFile.getEntry("word/document.xml");
		InputStream documentIn = zipFile.getInputStream(entry);
		String doucmentXml = IOUtils.toString(documentIn);
		doucmentXml = doucmentXml.replaceAll("\\n\\s+", "");
		String expected = "<w:sdt>"
				+ "<w:sdtPr>"//
				+ /*  */"<w:tag w:val=\"string\"/>"//
				+ /*  */"<w:text/>"//
				+ /*  */"<w:showingPlcHdr/>"//
				+ /*  */"<w15:appearance w15:val=\"tags\"/>"//
				+ /*  */"<w:alias w:val=\"string\"/>"//
				+ "</w:sdtPr>"//
				+ "<w:sdtContent>"//
				+ /*  */"<w:p><w:r>"
				+ /*       */"<w:rPr><w:rStyle w:val=\"PlaceholderText\"/></w:rPr>"
				+ /*       */"<w:t>string</w:t>"//
				+ /*  */"</w:r></w:p>" //
				+ "</w:sdtContent>"//
				+ "</w:sdt>";
		assertTrue(doucmentXml.contains(expected));
	} finally {
		templateFile.delete();
	}
}