AMImageHTMLExportImportContentProcessor implements ExportImportContentProcessor<String> { @Override public String replaceImportContentReferences( PortletDataContext portletDataContext, StagedModel stagedModel, String content) throws Exception { AMEmbeddedReferenceSet amEmbeddedReferenceSet = _amEmbeddedReferenceSetFactory.create( portletDataContext, stagedModel); return _replace(content, amEmbeddedReferenceSet); }  @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 testImportContentIgnoresInvalidReferences() throws Exception { Mockito.doThrow( PortalException.class ).when( _dlAppLocalService ).getFileEntry( _FILE_ENTRY_ID_1 ); String content = "<img export-import-path=\"PATH_" + _FILE_ENTRY_ID_1 + "\" />"; Assert.assertEquals( content, _amImageHTMLExportImportContentProcessor. replaceImportContentReferences( _portletDataContext, _stagedModel, content)); }
@Test public void testImportContentIgnoresInvalidStaticReferences() throws Exception { String content = "<picture export-import-path=\"#@¢∞\"></picture>"; Assert.assertEquals( content, _amImageHTMLExportImportContentProcessor. replaceImportContentReferences( _portletDataContext, _stagedModel, content)); }
@Test public void testImportContentIgnoresReferencesWithMissingPaths() throws Exception { String content = "<img export-import-path=\"#@¢∞\" />"; Assert.assertEquals( content, _amImageHTMLExportImportContentProcessor. replaceImportContentReferences( _portletDataContext, _stagedModel, content)); }