AMImageHTMLExportImportContentProcessor implements ExportImportContentProcessor<String> { @Override public String replaceExportContentReferences( PortletDataContext portletDataContext, StagedModel stagedModel, String content, boolean exportReferencedContent, boolean escapeContent) { AMReferenceExporter amReferenceExporter = new AMReferenceExporter( portletDataContext, stagedModel, exportReferencedContent); return _replace(content, amReferenceExporter); }  @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 public void testExportContentWithNoReferencesDoesNotEscape() throws Exception { String content = StringPool.AMPERSAND; Assert.assertEquals( _amImageHTMLExportImportContentProcessor. replaceExportContentReferences( _portletDataContext, _stagedModel, content, false, false), _amImageHTMLExportImportContentProcessor. replaceExportContentReferences( _portletDataContext, Mockito.mock(StagedModel.class), content, false, true)); }
@Test public void testExportContentWithReferenceDoesNotEscape() throws Exception { StringBundler sb = new StringBundler(5); sb.append("&<img data-fileentryid=\""); sb.append(_FILE_ENTRY_ID_1); sb.append("\" src=\""); sb.append(RandomTestUtil.randomString()); sb.append("\" />&"); Assert.assertEquals( _amImageHTMLExportImportContentProcessor. replaceExportContentReferences( _portletDataContext, _stagedModel, sb.toString(), false, false), _amImageHTMLExportImportContentProcessor. replaceExportContentReferences( _portletDataContext, _stagedModel, sb.toString(), false, true)); }
@Test public void testExportContentWithStaticReferenceDoesNotEscape() throws Exception { String content = "&<picture data-fileentryid=\"" + _FILE_ENTRY_ID_1 + "\"></picture>&"; Assert.assertEquals( _amImageHTMLExportImportContentProcessor. replaceExportContentReferences( _portletDataContext, _stagedModel, content, false, false), _amImageHTMLExportImportContentProcessor. replaceExportContentReferences( _portletDataContext, _stagedModel, content, false, true)); }