expect(portletWindowRegistry.getPortletWindow(request, portletWindowId2))
.andReturn(portletWindow2)
.anyTimes();
final IPortletDelegationManager portletDelegationManager = createMock(IPortletDelegationManager.class);
final PortletUrl portletUrl1 = new PortletUrl(portletWindowId1);
final Map<String, List<String>> urlParameters1 = new LinkedHashMap<String, List<String>>();
urlParameters1.put("newKey1", Arrays.asList(new String[] { "newValue1.1", "newValue1.2" }) );
urlParameters1.put("newKey2", Arrays.asList(new String[] { "newValue2.1" }) );
urlParameters1.put("newKey3", Arrays.asList(new String[] { "" }) );
portletUrl1.setParameters(urlParameters1);
expect(portletDelegationManager.getParentPortletUrl(request, portletWindowId1))
.andReturn(portletUrl1);
final PortletUrl portletUrl2 = new PortletUrl(portletWindowId2);
final Map<String, List<String>> urlParameters2 = new LinkedHashMap<String, List<String>>();
urlParameters2.put("newKeyA", Arrays.asList(new String[] { "newValueA.A", "newValueA.B" }) );
urlParameters2.put("newKeyB", Arrays.asList(new String[] { "newValueB.A" }) );
portletUrl2.setParameters(urlParameters2);
portletUrl2.setPortletMode(PortletMode.VIEW);
expect(portletDelegationManager.getParentPortletUrl(request, portletWindowId2))
.andReturn(portletUrl2);
replay(portletDelegationManager, portalRequestUtils, portletWindowRegistry);
portletUrlSyntaxProvider.setPortletWindowRegistry(portletWindowRegistry);