VelocityModelBody extends AbstractModelBody { @Override public void evaluate(Writer writer) throws IOException { body.render(context, writer); } VelocityModelBody(InternalContextAdapter context, ASTBlock body, Writer defaultWriter); @Override void evaluate(Writer writer);  }
@Test public void testEvaluateWriter() throws IOException { InternalContextAdapter internalContextAdapter = createMock(InternalContextAdapter.class); ASTBlock body = createMock(ASTBlock.class); Writer writer = createMock(Writer.class); expect(body.render(internalContextAdapter, writer)).andReturn(true); replay(internalContextAdapter, body, writer); VelocityModelBody modelBody = createMockBuilder(VelocityModelBody.class) .withConstructor(internalContextAdapter, body, writer) .createMock(); replay(modelBody); modelBody.evaluate(writer); verify(internalContextAdapter, body, writer, modelBody); }