IMocksControl control = EasyMock.createControl();
JspFactory jspFactory = control.createMock(JspFactory.class);
initializer.setJspFactory(jspFactory);
RuntimeConfig runtimeConfig = control.createMock(RuntimeConfig.class);
ServletContext context = control.createMock(ServletContext.class);
ExpressionFactory expressionFactory = control.createMock(ExpressionFactory.class);
runtimeConfig.setExpressionFactory(expressionFactory);
runtimeConfig.setPropertyResolverChainHead(isA(DefaultPropertyResolver.class));
runtimeConfig.setVariableResolverChainHead(isA(VariableResolverImpl.class));
expect(context.getAttribute(eq(RuntimeConfig.class.getName()))).andReturn(runtimeConfig).anyTimes();
expect(context.getInitParameter(eq(FacesServlet.CONFIG_FILES_ATTR))).andReturn(null);
expect(context.getResourceAsStream(eq("/WEB-INF/faces-config.xml"))).andReturn(null);