metadata.get(TikaCoreProperties.CREATED));
}
@Test
public void testExifHandlerParseDateFallback() throws MetadataException {
ExifIFD0Directory exif = mock(ExifIFD0Directory.class);
when(exif.containsTag(ExifIFD0Directory.TAG_DATETIME)).thenReturn(true);
GregorianCalendar calendar = new GregorianCalendar(TimeZone.getDefault(), Locale.ROOT);
calendar.setTimeInMillis(0);
calendar.set(1999, 0, 1, 0, 0, 0);
when(exif.getDate(ExifIFD0Directory.TAG_DATETIME)).thenReturn(
calendar.getTime()); // jvm default timezone as in Metadata Extractor
Metadata metadata = new Metadata();
new ImageMetadataExtractor.ExifHandler().handle(exif, metadata);
assertEquals("Should try EXIF Date/Time if Original is not set", "1999-01-01T00:00:00",