Adapt to PathMatchingResourcePatternResolver now matching root dir

See spring-projects/spring-framework#29163
pull/32551/head
Andy Wilkinson 2 years ago committed by Brian Clozel
parent a0735eb3fb
commit 7eb8abbda8

@ -92,9 +92,9 @@ class ClassLoaderFilesResourcePatternResolverTests {
@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
@ -102,7 +102,7 @@ class ClassLoaderFilesResourcePatternResolverTests {
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

Loading…
Cancel
Save