AMBlogsEntryExportImportContentProcessor implements ExportImportContentProcessor<String> { @Override public void validateContentReferences(long groupId, String content) throws PortalException { _blogsEntryExportImportContentProcessor.validateContentReferences( groupId, content); _htmlExportImportContentProcessor.validateContentReferences( groupId, content); }  @Override String replaceExportContentReferences(
			PortletDataContext portletDataContext, StagedModel stagedModel,
			String content, boolean exportReferencedContent,
			boolean escapeContent); @Override String replaceImportContentReferences(
			PortletDataContext portletDataContext, StagedModel stagedModel,
			String content); @Override void validateContentReferences(long groupId, String content);  }
@Test(expected = PortalException.class) public void testValidateContentFailsWhenBlogsEntryExportImportContentProcessorProcessorFails() throws Exception { String content = RandomTestUtil.randomString(); Mockito.doThrow( PortalException.class ).when( _blogsEntryExportImportContentProcessor ).validateContentReferences( Mockito.anyLong(), Mockito.anyString() ); _amBlogsEntryExportImportContentProcessor.validateContentReferences( RandomTestUtil.randomLong(), content); }
@Test(expected = PortalException.class) public void testValidateContentFailsWhenHTMLExportImportContentProcessorFails() throws Exception { String content = RandomTestUtil.randomString(); Mockito.doThrow( PortalException.class ).when( _htmlExportImportContentProcessor ).validateContentReferences( Mockito.anyLong(), Mockito.anyString() ); _amBlogsEntryExportImportContentProcessor.validateContentReferences( RandomTestUtil.randomLong(), content); }
@Test public void testValidateContentSucceedsWhenBothExportImportContentProcessorsSucceed() throws Exception { _amBlogsEntryExportImportContentProcessor.validateContentReferences( RandomTestUtil.randomLong(), RandomTestUtil.randomString()); }