@SuppressWarnings({"rawtypes", "unchecked"}) @Test public void testHandleDirectories() throws MetadataException { Metadata metadata = Mockito.mock(Metadata.class); ImageMetadataExtractor.DirectoryHandler handler1 = Mockito.mock(ImageMetadataExtractor.DirectoryHandler.class); ImageMetadataExtractor e = new ImageMetadataExtractor(metadata, handler1); Directory directory = new JpegCommentDirectory(); Iterator directories = Mockito.mock(Iterator.class); Mockito.when(directories.hasNext()).thenReturn(true, false); Mockito.when(directories.next()).thenReturn(directory); Mockito.when(handler1.supports(JpegCommentDirectory.class)).thenReturn(true); e.handle(directories); Mockito.verify(handler1).supports(JpegCommentDirectory.class); Mockito.verify(handler1).handle(directory, metadata); }
protected void handle(com.drew.metadata.Metadata metadataExtractor) throws MetadataException { handle(metadataExtractor.getDirectories().iterator()); }
ImageMetadataExtractor { protected void handle(com.drew.metadata.Metadata metadataExtractor) throws MetadataException { handle(metadataExtractor.getDirectories().iterator()); } }
ImageMetadataExtractor { protected void handle(com.drew.metadata.Metadata metadataExtractor) throws MetadataException { handle(metadataExtractor.getDirectories().iterator()); } ImageMetadataExtractor(Metadata metadata);  ImageMetadataExtractor(Metadata metadata, DirectoryHandler... handlers); }
ImageMetadataExtractor { protected void handle(com.drew.metadata.Metadata metadataExtractor) throws MetadataException { handle(metadataExtractor.getDirectories().iterator()); } ImageMetadataExtractor(Metadata metadata);  ImageMetadataExtractor(Metadata metadata, DirectoryHandler... handlers); void parseJpeg(File file); void parseTiff(File file); void parseWebP(File file); void parseHeif(InputStream is); void parseRawExif(InputStream stream, int length, boolean needsExifHeader); void parseRawExif(byte[] exifData); void parseRawXMP(byte[] xmpData); }
ImageMetadataExtractor { protected void handle(com.drew.metadata.Metadata metadataExtractor) throws MetadataException { handle(metadataExtractor.getDirectories().iterator()); } ImageMetadataExtractor(Metadata metadata);  ImageMetadataExtractor(Metadata metadata, DirectoryHandler... handlers); void parseJpeg(File file); void parseTiff(File file); void parseWebP(File file); void parseHeif(InputStream is); void parseRawExif(InputStream stream, int length, boolean needsExifHeader); void parseRawExif(byte[] exifData); void parseRawXMP(byte[] xmpData);  }