IMocksControl mockControl = EasyMock.createControl();
ELContext elctx = mockControl.createMock(ELContext.class);
MockFacesContext12 facesctx = new MockFacesContext12();
Application app = mockControl.createMock(Application.class);
facesctx.setApplication(app);
ELContextEvent event = mockControl.createMock(ELContextEvent.class);
expect(event.getELContext()).andReturn(elctx);
elctx.putContext(eq(FacesContext.class), same(facesctx));
ELContextListener elctxListener = mockControl.createMock(ELContextListener.class);
expect(app.getELContextListeners()).andReturn(new ELContextListener[] { elctxListener });
elctxListener.contextCreated(same(event));
mockControl.replay();