public void testGetFacesContextPortlet() {
FacesContextFactoryImpl factory = new FacesContextFactoryImpl(facesContextFactory);
MockPortletContext portletContext = new MockPortletContext(servletContext);
MockActionRequest portletRequest = new MockActionRequest(portletContext);
MockActionResponse portletResponse = new MockActionResponse();
RequestScopeManager portletStateHolder = RequestScopeManager.getInstance(facesContext);
BridgeRequestScope portletState = new BridgeRequestScope();
portletStateHolder.saveRequestScope(STATE_ID, portletState);
PortletBridgeContext bridgeContext = new PortletBridgeContext(getBridgeConfig());
portletRequest.setAttribute(PortletBridgeContext.REQUEST_PARAMETER_NAME, bridgeContext);
portletRequest.setAttribute(Bridge.PORTLET_LIFECYCLE_PHASE, Bridge.PortletPhase.ACTION_PHASE);
FacesContext context = factory.getFacesContext(portletContext,
portletRequest, portletResponse, lifecycle);