JspExpressionFactoryFactory implements ExpressionFactoryFactory,
        ApplicationContextAware { public ExpressionFactory getExpressionFactory() { return JspFactory.getDefaultFactory().getJspApplicationContext( servletContext).getExpressionFactory(); }  void setApplicationContext(ApplicationContext applicationContext); ExpressionFactory getExpressionFactory();  }
@Test public void testGetExpressionFactory() { ApplicationContext applicationContext = createMock(ApplicationContext.class); ServletContext servletContext = createMock(ServletContext.class); JspFactory jspFactory = createMock(JspFactory.class); JspApplicationContext jspApplicationContext = createMock(JspApplicationContext.class); ExpressionFactory expressionFactory = createMock(ExpressionFactory.class); expect(applicationContext.getContext()).andReturn(servletContext); expect(jspFactory.getJspApplicationContext(servletContext)).andReturn(jspApplicationContext); expect(jspApplicationContext.getExpressionFactory()).andReturn(expressionFactory); replay(applicationContext, servletContext, jspFactory, jspApplicationContext, expressionFactory); JspFactory.setDefaultFactory(jspFactory); JspExpressionFactoryFactory factory = new JspExpressionFactoryFactory(); factory.setApplicationContext(applicationContext); assertEquals(expressionFactory, factory.getExpressionFactory()); verify(applicationContext, servletContext, jspFactory, jspApplicationContext, expressionFactory); }