use of com.sun.faces.mock.MockBeanManager in project mojarra by eclipse-ee4j.
the class ELUtilsTest method setUp.
@Before
public void setUp() {
MockServletContext mockServletContext = new MockServletContext() {
@Override
public URL getResource(String path) {
return null;
}
};
mockServletContext.addInitParameter("appParamName", "appParamValue");
mockServletContext.setAttribute("appScopeName", "appScopeValue");
ExternalContextImpl externalContext = new ExternalContextImpl(mockServletContext, new MockHttpServletRequest(), new MockHttpServletResponse());
FactoryFinder.setFactory(FactoryFinder.RENDER_KIT_FACTORY, "com.sun.faces.mock.MockRenderKitFactory");
new FacesContextImpl(externalContext, new LifecycleImpl());
new ApplicationImpl();
applicationAssociate = (ApplicationAssociate) externalContext.getApplicationMap().get(RIConstants.FACES_PREFIX + "ApplicationAssociate");
FacesContext.getCurrentInstance().getAttributes().put(RIConstants.CDI_BEAN_MANAGER, new MockBeanManager());
}
Aggregations