JspUtil { public static ApplicationContext getApplicationContext(JspContext jspContext) { return (ApplicationContext) jspContext.getAttribute( ApplicationAccess.APPLICATION_CONTEXT_ATTRIBUTE, PageContext.APPLICATION_SCOPE); } private  JspUtil(); static ApplicationContext getApplicationContext(JspContext jspContext);  }
@Test public void testGetApplicationContext() { ApplicationContext applicationContext = createMock(ApplicationContext.class); JspContext jspContext = createMock(JspContext.class); expect(jspContext.getAttribute(ApplicationAccess .APPLICATION_CONTEXT_ATTRIBUTE, PageContext.APPLICATION_SCOPE)) .andReturn(applicationContext); replay(applicationContext, jspContext); assertEquals(applicationContext, JspUtil.getApplicationContext(jspContext)); verify(applicationContext, jspContext); }