* Tests {@link VelocityTilesRequestContextFactory#createRequestContext(TilesApplicationContext, Object...)}.
*/
@Test
public void testCreateRequestContext() {
StringWriter writer = new StringWriter();
TilesRequestContextFactory parentFactory = createMock(TilesRequestContextFactory.class);
TilesApplicationContext applicationContext = createMock(TilesApplicationContext.class);
Context velocityContext = createMock(Context.class);
HttpServletRequest request = createMock(HttpServletRequest.class);
HttpServletResponse response = createMock(HttpServletResponse.class);
TilesRequestContext enclosedRequest = createMock(TilesRequestContext.class);
expect(enclosedRequest.getRequestObjects()).andReturn(new Object[] {request, response});
expect(parentFactory.createRequestContext(applicationContext, request, response)).andReturn(enclosedRequest);
replay(parentFactory, enclosedRequest, applicationContext, velocityContext, request, response);
factory = new VelocityTilesRequestContextFactory();
factory.setRequestContextFactory(parentFactory);
VelocityTilesRequestContext context = (VelocityTilesRequestContext) factory
.createRequestContext(applicationContext, velocityContext,