List of usage examples for com.liferay.portal.kernel.util Portal getHttpServletRequest
public HttpServletRequest getHttpServletRequest(PortletRequest portletRequest);
From source file:com.liferay.blogs.web.internal.portlet.action.TrackbackMVCActionCommandTest.java
License:Open Source License
protected void setUpPortalUtil() throws Exception { PortalUtil portalUtil = new PortalUtil(); Portal portal = mock(Portal.class); when(portal.getOriginalServletRequest((HttpServletRequest) Matchers.any())) .thenReturn(_mockOriginalServletRequest); when(portal.getHttpServletRequest((PortletRequest) Matchers.any())).thenReturn(_mockHttpServletRequest); when(portal.getHttpServletResponse((PortletResponse) Matchers.any())).thenReturn(_mockHttpServletResponse); portalUtil.setPortal(portal);//from w ww . j a va2 s .com }
From source file:com.liferay.dynamic.data.lists.form.web.internal.display.context.DDLFormAdminDisplayContextTest.java
License:Open Source License
protected void setUpPortalUtil() { PortalUtil portalUtil = new PortalUtil(); Portal portal = mock(Portal.class); HttpServletRequest request = mockHttpServletRequest(); when(portal.getHttpServletRequest(Matchers.any(PortletRequest.class))).thenReturn(request); portalUtil.setPortal(portal);//ww w . jav a2s. com }