@Test
public void testGetApplicationContext() {

    ServletContext servletContext = createMock(ServletContext.class);
    ApplicationContext applicationContext = createMock(ApplicationContext.class);
    expect(servletContext.getAttribute(ApplicationAccess
            .APPLICATION_CONTEXT_ATTRIBUTE)).andReturn(applicationContext);
    replay(servletContext, applicationContext);
    assertEquals(applicationContext, ServletUtil.getApplicationContext(servletContext));
    verify(servletContext, applicationContext);
}