ForwardingTemplateSource extends AbstractTemplateSource { @Override public String content(final Charset charset) throws IOException { return source.content(charset); } ForwardingTemplateSource(final TemplateSource source); @Override String content(final Charset charset); @Override String filename(); @Override long lastModified();  }
@Test public void content() throws IOException { TemplateSource source = createMock(TemplateSource.class); expect(source.content(StandardCharsets.UTF_8)).andReturn("abc"); replay(source); assertEquals("abc", new ForwardingTemplateSource(source).content(StandardCharsets.UTF_8)); verify(source); }