@Test
public void testGetWriter() {

    DispatchRequest enclosedRequest = createMock(DispatchRequest.class);
    expect(enclosedRequest.getAvailableScopes()).andReturn(Collections.singletonList("parent"));
    replay(velocityContext, enclosedRequest);
    context = new VelocityRequest(enclosedRequest, velocityContext, writer);
    assertEquals(writer, context.getWriter());
    verify(velocityContext, enclosedRequest);
}