InternalContextAdapter internalContextAdapter = createMock(InternalContextAdapter.class);
StringWriter writer = new StringWriter();
expect(request.getAttribute(ServletUtil.CURRENT_CONTAINER_ATTRIBUTE_NAME))
.andReturn(container);
container.render("myDefinition", velocityContext, request, response, writer);
replay(velocityContext, request, response, servletContext, container, internalContextAdapter);
initializeTool();
Renderable renderable = tool.renderDefinition("myDefinition");
renderable.render(internalContextAdapter, writer);