final IPortalRequestUtils portalRequestUtils = createMock(IPortalRequestUtils.class);
expect(portalRequestUtils.getOriginalPortletAdaptorRequest(request)).andReturn(request);
portletUrlSyntaxProvider.setPortalRequestUtils(portalRequestUtils);
final IPortletEntityId portletEntityId1 = new MockPortletEntityId("eId1");
final IPortletWindowId portletWindowId1 = new MockPortletWindowId("wId1");
final IPortletWindow portletWindow1 = new MockPortletWindow(portletWindowId1, portletEntityId1, "portletAppA", "portletNameA");
final IPortletEntityId portletEntityId2 = new MockPortletEntityId("eId2");
final IPortletWindowId portletWindowId2 = new MockPortletWindowId("wId2");
final MockPortletWindow portletWindow2 = new MockPortletWindow(portletWindowId2, portletEntityId2, "portletAppB", "portletNameB");
final IPortletEntityId portletEntityId3 = new MockPortletEntityId("eId3");
final IPortletWindowId portletWindowId3 = new MockPortletWindowId("wId3");
final MockPortletWindow portletWindow3 = new MockPortletWindow(portletWindowId3, portletEntityId3, "portletAppC", "portletNameC");
final ChannelRuntimeData channelRuntimeData = new ChannelRuntimeData();
channelRuntimeData.setBaseActionURL("base/action.url");
request.setAttribute(IPortletAdaptor.ATTRIBUTE__RUNTIME_DATA, channelRuntimeData);
final MockPortletEntity portletEntity1 = new MockPortletEntity();
portletEntity1.setPortletEntityId(portletEntityId1);
portletEntity1.setChannelSubscribeId(portletEntityId1.getStringId());
final MockPortletEntity portletEntity2 = new MockPortletEntity();
portletEntity2.setPortletEntityId(portletEntityId2);
portletEntity2.setChannelSubscribeId(portletEntityId2.getStringId());
final MockPortletEntity portletEntity3 = new MockPortletEntity();
portletEntity3.setPortletEntityId(portletEntityId3);
portletEntity3.setChannelSubscribeId(portletEntityId3.getStringId());
final IPortletWindowRegistry portletWindowRegistry = createMock(IPortletWindowRegistry.class);
expect(portletWindowRegistry.getParentPortletEntity(request, portletWindowId1))
.andReturn(portletEntity1)
.anyTimes();