WildcardsPdfFileSourceAdapter { public List<PdfFileSource> getPdfFileSources() { return sources; } WildcardsPdfFileSourceAdapter(String path); List<PdfFileSource> getPdfFileSources();  }
@Test public void testPositive() throws IOException { WildcardsPdfFileSourceAdapter victim = new WildcardsPdfFileSourceAdapter( setUpFiles().getAbsolutePath() + "/*.pdf"); assertEquals(3, victim.getPdfFileSources().size()); }
@Test public void testPositiveCaseInsensitive() throws IOException { WildcardsPdfFileSourceAdapter victim = new WildcardsPdfFileSourceAdapter( setUpFiles().getAbsolutePath() + "/*.PdF"); assertEquals(3, victim.getPdfFileSources().size()); }
@Test public void testPositiveFilePath() throws IOException { WildcardsPdfFileSourceAdapter victim = new WildcardsPdfFileSourceAdapter( setUpFiles().getAbsolutePath() + "/test_file.pdf"); assertEquals(1, victim.getPdfFileSources().size()); }
@Test public void testOrder() throws IOException { folder.newFile("7.pdf"); folder.newFile("44.pdf"); folder.newFile("14.pdf"); WildcardsPdfFileSourceAdapter victim = new WildcardsPdfFileSourceAdapter( folder.getRoot().getAbsolutePath() + "/*.pdf"); assertEquals(3, victim.getPdfFileSources().size()); assertEquals("7.pdf", victim.getPdfFileSources().get(0).getName()); assertEquals("14.pdf", victim.getPdfFileSources().get(1).getName()); assertEquals("44.pdf", victim.getPdfFileSources().get(2).getName()); }