@Test
public void testContextInitialized() {

    AbstractTilesListener listener = createMockBuilder(AbstractTilesListener.class).createMock();
    ServletContextEvent event = createMock(ServletContextEvent.class);
    ServletContext servletContext = createMock(ServletContext.class);
    TilesInitializer initializer = createMock(TilesInitializer.class);
    expect(event.getServletContext()).andReturn(servletContext);
    expect(listener.createTilesInitializer()).andReturn(initializer);
    initializer.initialize(isA(ServletApplicationContext.class));
    initializer.destroy();
    replay(listener, event, servletContext, initializer);
    listener.contextInitialized(event);
    listener.contextDestroyed(event);
    verify(listener, event, servletContext, initializer);
}