HttpServletResponse httpResponse = EasyMock
.createMock(HttpServletResponse.class);
EasyMock.expect(pageContext.getRequest()).andReturn(httpRequest);
EasyMock.expect(pageContext.getResponse()).andReturn(httpResponse);
TilesRequestContextFactory parent = EasyMock
.createMock(TilesRequestContextFactory.class);
TilesRequestContext enclosedRequest = EasyMock
.createMock(TilesRequestContext.class);
EasyMock.expect(parent.createRequestContext(context, httpRequest,
httpResponse)).andReturn(enclosedRequest);
factory.setRequestContextFactory(parent);
EasyMock.replay(context, pageContext, httpRequest, httpResponse, parent);
JspTilesRequestContext request = (JspTilesRequestContext) factory