new ImageMetadataExtractor.ExifHandler().handle(exif, metadata);
assertEquals("Should be ISO date without time zone", "2000-01-01T00:00:00", metadata.get(DublinCore.DATE));
}
public void testExifHandlerParseDateFallback() throws MetadataException {
ExifDirectory exif = mock(ExifDirectory.class);
when(exif.containsTag(ExifDirectory.TAG_DATETIME)).thenReturn(true);
when(exif.getDate(ExifDirectory.TAG_DATETIME)).thenReturn(
new GregorianCalendar(1999, 0, 1, 0, 0, 0).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", metadata.get(DublinCore.DATE));