Attribute attribute = new Attribute("/myTemplate.jsp", null, "template");
TilesApplicationContext applicationContext = EasyMock
.createMock(TilesApplicationContext.class);
TilesRequestContextFactory contextFactory = EasyMock
.createMock(TilesRequestContextFactory.class);
TilesRequestContext requestContext = EasyMock
.createMock(TilesRequestContext.class);
EasyMock.expect(contextFactory.createRequestContext(applicationContext))
.andReturn(requestContext);
requestContext.dispatch("/myTemplate.jsp");
EasyMock.replay(applicationContext, contextFactory, requestContext);
renderer.setApplicationContext(applicationContext);
renderer.setRequestContextFactory(contextFactory);
renderer.render(attribute, writer);
writer.close();