@Test(expected = PortalException.class)
public void testFileEntryGetFileVersionFails() throws Exception {

	AMImageConfigurationEntry amImageConfigurationEntry =
		new AMImageConfigurationEntryImpl(
			RandomTestUtil.randomString(), RandomTestUtil.randomString(),
			new HashMap<>());
	AMImageQueryBuilder.ConfigurationStatus enabledConfigurationStatus =
		AMImageQueryBuilder.ConfigurationStatus.ENABLED;
	Mockito.when(
		_amImageConfigurationHelper.getAMImageConfigurationEntries(
			_fileEntry.getCompanyId(),
			enabledConfigurationStatus.getPredicate())
	).thenReturn(
		Collections.singleton(amImageConfigurationEntry)
	);
	Mockito.when(
		_fileEntry.getFileVersion()
	).thenThrow(
		PortalException.class
	);
	Mockito.when(
		_amImageMimeTypeProvider.isMimeTypeSupported(Mockito.anyString())
	).thenReturn(
		true
	);
	Stream<AdaptiveMedia<AMImageProcessor>> adaptiveMediaStream =
		_amImageFinderImpl.getAdaptiveMediaStream(
			amImageQueryBuilder -> amImageQueryBuilder.forFileEntry(
				_fileEntry
			).done());
	adaptiveMediaStream.count();
}