public void testIsPermitted() {
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);
EasyMock.expect(requestContext.isUserInRole("first")).andReturn(
Boolean.TRUE).anyTimes();
EasyMock.expect(requestContext.isUserInRole("second")).andReturn(
Boolean.FALSE).anyTimes();
EasyMock.replay(applicationContext, contextFactory, requestContext);
renderer.setApplicationContext(applicationContext);
renderer.setRequestContextFactory(contextFactory);
Set<String> roles = new HashSet<String>();