final IPortletDefinitionId portDef1 = new MockPortletDefinitionId("portDef1");
final IPortletDefinition portletDefinition = createMock(IPortletDefinition.class);
expect(portletDefinition.getPortletDefinitionId()).andReturn(portDef1);
final IPortletDefinitionRegistry portletDefinitionRegistry = createMock(IPortletDefinitionRegistry.class);
expect(portletDefinitionRegistry.getPortletDefinition(1)).andReturn(portletDefinition);
final IPortletEntity portletEntity = createMock(IPortletEntity.class);
final IPortletEntityRegistry portletEntityRegistry = createMock(IPortletEntityRegistry.class);
expect(portletEntityRegistry.getOrCreatePortletEntity(portDef1, "sub1", 1)).andReturn(portletEntity);