@Test
public void testUserPortraitFromResultButTagsAndURLDownloadFromRoot()
	throws Exception {

	long userId = RandomTestUtil.randomInt(2, Integer.MAX_VALUE);
	AssetEntry assetEntry = createAssetEntry(userId);
	long rootUserId = userId - 1;
	AssetEntry rootAssetEntry = createAssetEntryWithTagsPresent(rootUserId);
	String className = RandomTestUtil.randomString();
	long entryClassPK = RandomTestUtil.randomInt(2, Integer.MAX_VALUE);
	long rootEntryClassPK = entryClassPK - 1;
	whenAssetEntryLocalServiceFetchEntry(
		className, entryClassPK, assetEntry);
	whenAssetEntryLocalServiceFetchEntry(
		className, rootEntryClassPK, rootAssetEntry);
	whenAssetRendererFactoryGetAssetRenderer(entryClassPK, assetRenderer);
	AssetRenderer<?> rootAssetRenderer = Mockito.mock(AssetRenderer.class);
	whenAssetRendererFactoryGetAssetRenderer(
		rootEntryClassPK, rootAssetRenderer);
	whenAssetRendererFactoryLookupGetAssetRendererFactoryByClassName(
		className);
	String rootURLDownload = RandomTestUtil.randomString();
	whenAssetRendererGetURLDownload(rootAssetRenderer, rootURLDownload);
	whenIndexerRegistryGetIndexer(className, createIndexer());
	Document document = createDocument(className, entryClassPK);
	document.addKeyword(Field.ROOT_ENTRY_CLASS_PK, rootEntryClassPK);
	SearchResultSummaryDisplayContext searchResultSummaryDisplayContext =
		build(document);
	assertAssetRendererURLDownloadVisible(
		rootURLDownload, searchResultSummaryDisplayContext);
	assertTagsVisible(rootEntryClassPK, searchResultSummaryDisplayContext);
	assertUserPortraitVisible(userId, searchResultSummaryDisplayContext);
}