TilesApplicationContext applicationContext = EasyMock
.createMock(TilesApplicationContext.class);
TilesRequestContextFactory contextFactory = EasyMock
.createMock(TilesRequestContextFactory.class);
TilesContainer container = EasyMock.createMock(TilesContainer.class);
TilesRequestContext requestContext = EasyMock
.createMock(TilesRequestContext.class);
Object[] requestObjects = new Object[0];
EasyMock.expect(requestContext.getRequestObjects()).andReturn(requestObjects);
EasyMock.expect(contextFactory.createRequestContext(applicationContext))
.andReturn(requestContext);
EasyMock.expect(container.isValidDefinition("my.definition"))
.andReturn(Boolean.TRUE);
EasyMock.expect(requestContext.getWriter()).andReturn(writer);
EasyMock.replay(applicationContext, contextFactory, requestContext);
renderer.setApplicationContext(applicationContext);
renderer.setRequestContextFactory(contextFactory);
renderer.setContainer(container);
renderer.render(attribute, requestContext);