Skip to content

Commit 7eb8abb

Browse files
wilkinsonabclozel
authored andcommitted
Adapt to PathMatchingResourcePatternResolver now matching root dir
See spring-projects/spring-framework#29163
1 parent a0735eb commit 7eb8abb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/ClassLoaderFilesResourcePatternResolverTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,17 @@ void getResourceWhenDeletedShouldReturnDeletedResource(@TempDir File directory)
9292

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

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

108108
@Test

0 commit comments

Comments
 (0)