private void assertHeader(final File file) throws Exception { final HtmlLayout layout = HtmlLayout.createDefaultLayout(); final String header = new String(layout.getHeader(), Charset.defaultCharset()); final String withoutTimestamp = header.substring(0, 435); final String contents = new String(slurp(file), Charset.defaultCharset()); final String contentsInitialChunk = contents.substring(0, 435); assertEquals(file.getName(), withoutTimestamp, contentsInitialChunk); }
private void assertFooter(final File file) throws Exception { final HtmlLayout layout = HtmlLayout.createDefaultLayout(); final String footer = new String(layout.getFooter(), Charset.defaultCharset()); final String contents = new String(slurp(file), Charset.defaultCharset()); assertTrue(file.getName(), contents.endsWith(footer)); }
@Test public void testDefaultCharset() { final HtmlLayout layout = HtmlLayout.createDefaultLayout(); assertEquals(StandardCharsets.UTF_8, layout.getCharset()); }
@Test public void testDefaultContentType() { final HtmlLayout layout = HtmlLayout.createDefaultLayout(); assertEquals("text/html; charset=UTF-8", layout.getContentType()); }
layout = HtmlLayout.createDefaultLayout();