PdfFileSource extends AbstractPdfSource<File> { public static PdfFileSource newInstanceNoPassword(File file) { return PdfFileSource.newInstanceWithPassword(file, null); } private  PdfFileSource(File file, String password); @Override File getSource(); @Override T open(PdfSourceOpener<T> opener); static PdfFileSource newInstanceNoPassword(File file); static PdfFileSource newInstanceWithPassword(File file, String password); @Override String toString();  }
@Test(expected = IllegalArgumentException.class) public void testNullFile() { PdfFileSource.newInstanceNoPassword(null); }
@Test(expected = IllegalArgumentException.class) public void testDirectory() { File file = mock(File.class); when(file.isFile()).thenReturn(Boolean.FALSE); PdfFileSource.newInstanceNoPassword(file); }
@Test public void testValidFile() { File file = mock(File.class); when(file.getName()).thenReturn("name"); when(file.isFile()).thenReturn(Boolean.TRUE); PdfFileSource.newInstanceNoPassword(file); }