final HttpServletRequest request = EasyMock.createMock(HttpServletRequest.class);
final HttpSession session = EasyMock.createMock(HttpSession.class);
final IPortletWindowId sourcePortletWindowId = EasyMock.createMock(IPortletWindowId.class);
final IPortletWindow sourcePortletWindow = EasyMock.createMock(IPortletWindow.class);
final IPortletEntityId portletEntityId = EasyMock.createMock(IPortletEntityId.class);
final IPortletEntityRegistry portletEntityRegistry = EasyMock.createMock(IPortletEntityRegistry.class);
final IPortletDefinitionRegistry portletDefinitionRegistry = EasyMock.createMock(IPortletDefinitionRegistry.class);
final IPortletDefinition portletDefinition = EasyMock.createMock(IPortletDefinition.class);
final IPortletEntity portletEntity = EasyMock.createMock(IPortletEntity.class);
final ConcurrentHashMap<Object, Object> transientPortletWindowMap = new ConcurrentHashMap<Object, Object>();
final ConcurrentHashMap<Object, Object> portletWindowMap = new ConcurrentHashMap<Object, Object>();
portletWindowMap.put(sourcePortletWindowId, sourcePortletWindow);
EasyMock.expect(sourcePortletWindowId.getStringId()).andReturn("pwid1");
EasyMock.expect(request.getSession(false)).andReturn(session);
EasyMock.expect(session.getAttribute(WebUtils.SESSION_MUTEX_ATTRIBUTE)).andReturn(session);
EasyMock.expect(session.getAttribute(PortletWindowRegistryImpl.PORTLET_WINDOW_MAP_ATTRIBUTE)).andReturn(portletWindowMap);
EasyMock.expect(sourcePortletWindow.getPortletEntityId()).andReturn(portletEntityId);
EasyMock.expect(request.getAttribute(PortalWebUtils.REQUEST_MUTEX_ATTRIBUTE)).andReturn(request).times(2);
EasyMock.expect(request.getAttribute(TransientPortletWindowRegistryImpl.TRANSIENT_PORTLET_WINDOW_MAP_ATTRIBUTE)).andReturn(transientPortletWindowMap).times(2);
EasyMock.expect(portletEntityId.getStringId()).andReturn("peid1").times(2);
EasyMock.expect(portletEntityRegistry.getParentPortletDefinition(portletEntityId)).andReturn(portletDefinition);
EasyMock.expect(portletDefinitionRegistry.getPortletDescriptorKeys(portletDefinition)).andReturn(new Tuple<String, String>("pdk1.k", "pdk1.v"));
EasyMock.expect(portletEntityRegistry.getPortletEntity("peid1")).andReturn(portletEntity);
EasyMock.expect(portletEntity.getPortletEntityId()).andReturn(portletEntityId);