}
@Test
public void testCopyUnknownFieldsHandler() throws MetadataException {
Directory d = mock(Directory.class);
Tag t1 = mock(Tag.class);
when(t1.getTagName()).thenReturn("Image Description");
when(t1.getDescription()).thenReturn("t1");
Tag t2 = mock(Tag.class);
when(t2.getTagName()).thenReturn(Metadata.KEYWORDS);
when(t2.getDescription()).thenReturn("known");
Tag t3 = mock(Tag.class);
when(t3.getTagName()).thenReturn(TikaCoreProperties.DESCRIPTION.getName());
when(t3.getDescription()).thenReturn("known");
List<Tag> tags = Arrays.asList(t1, t2, t3);
when(d.getTags()).thenReturn(tags);
Metadata metadata = new Metadata();
new ImageMetadataExtractor.CopyUnknownFieldsHandler().handle(d, metadata);
assertEquals("t1", metadata.get("Image Description"));