Hi all,
I am using JSFMock in my junit test in the following way:
environment = MockFacesEnvironment.createEnvironment();
facesContext = environment.getFacesContext();
externalContext = environment.createMock(ExternalContext.class);
expect(facesContext.getExternalContext()).andReturn(externalContext);
System.out.println(facesContext.getExternalContext());
but the output on console is null. I am using JSF 2.0. I have put following jars in my classpath: junit-4.8.1.jar, jsf-mock-1.0.0.jar, easymock-2.5.2.jar, and el-api-2.2.jar. Is there something I am missing? Is there a way in which I can get a MockFacesContext object which contains externalContext already?