@Test public void testFindResource() throws Exception { File dir = new File("src/test/files/bytecode/bin/"); FileSystemLoader loader = new FileSystemLoader(dir); assertThat(loader.findResource("notfound")).isNull(); assertThat(loader.findResource("tags")) .as("existing directories should not be used - only files") .isNull(); URL url = loader.findResource("tags/TagName.class"); assertThat(url).isNotNull(); assertThat(url.toString()).startsWith("file:"); assertThat(url.toString()).endsWith("TagName.class"); loader.close(); thrown.expect(IllegalStateException.class); thrown.expectMessage("Loader closed"); loader.findResource("tags/TagName.class"); }