Skip to content

Commit

Permalink
Adapt to PathMatchingResourcePatternResolver now matching root dir
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkinsona authored and bclozel committed Sep 29, 2022
1 parent a0735eb commit 7eb8abb
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,17 @@ void getResourceWhenDeletedShouldReturnDeletedResource(@TempDir File directory)

@Test
void getResourcesShouldReturnResources(@TempDir File directory) throws Exception {
createFile(directory, "name.class");
File file = createFile(directory, "name.class");
Resource[] resources = this.resolver.getResources("file:" + directory.getAbsolutePath() + "/**");
assertThat(resources).isNotEmpty();
assertThat(resources).extracting(Resource::getFile).containsExactly(directory, file);
}

@Test
void getResourcesWhenDeletedShouldFilterDeleted(@TempDir File directory) throws Exception {
createFile(directory, "name.class");
this.files.addFile(directory.getName(), "name.class", new ClassLoaderFile(Kind.DELETED, null));
Resource[] resources = this.resolver.getResources("file:" + directory.getAbsolutePath() + "/**");
assertThat(resources).isEmpty();
assertThat(resources).extracting(Resource::getFile).containsExactly(directory);
}

@Test
Expand Down

0 comments on commit 7eb8abb

Please sign in to comment.