Search in sources :

Example 1 with MockPortletEntityId

use of org.apereo.portal.mock.portlet.om.MockPortletEntityId in project uPortal by Jasig.

the class SingleTabUrlNodeSyntaxHelperTest method getPortletForFolderNameFanmeIdTest.

@Test
public void getPortletForFolderNameFanmeIdTest() {
    final MockHttpServletRequest request = new MockHttpServletRequest();
    final String folder = "fname.id";
    final MockPortletEntityId portletEntityId = new MockPortletEntityId("eid");
    final MockPortletWindowId portletWindowId = new MockPortletWindowId("wid");
    when(this.userInstanceManager.getUserInstance(request)).thenReturn(this.userInstance);
    when(this.portletEntityRegistry.getOrCreatePortletEntity(request, userInstance, "id")).thenReturn(portletEntity);
    when(this.portletEntity.getPortletDefinition()).thenReturn(portletDefinition);
    when(this.portletDefinition.getFName()).thenReturn("fname");
    when(this.portletEntity.getPortletEntityId()).thenReturn(portletEntityId);
    when(this.portletWindowRegistry.getOrCreateDefaultPortletWindow(request, portletEntityId)).thenReturn(portletWindow);
    when(portletWindow.getPortletWindowId()).thenReturn(portletWindowId);
    final IPortletWindowId parsedPortletWindowId = this.urlNodeSyntaxHelper.getPortletForFolderName(request, null, folder);
    assertNotNull(parsedPortletWindowId);
    assertEquals(portletWindowId, parsedPortletWindowId);
}
Also used : MockHttpServletRequest(org.springframework.mock.web.MockHttpServletRequest) MockPortletWindowId(org.apereo.portal.mock.portlet.om.MockPortletWindowId) MockPortletEntityId(org.apereo.portal.mock.portlet.om.MockPortletEntityId) IPortletWindowId(org.apereo.portal.portlet.om.IPortletWindowId) Test(org.junit.Test)

Aggregations

MockPortletEntityId (org.apereo.portal.mock.portlet.om.MockPortletEntityId)1 MockPortletWindowId (org.apereo.portal.mock.portlet.om.MockPortletWindowId)1 IPortletWindowId (org.apereo.portal.portlet.om.IPortletWindowId)1 Test (org.junit.Test)1 MockHttpServletRequest (org.springframework.mock.web.MockHttpServletRequest)1