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);
}
Aggregations