From dbcfeb8f4f35be2b3651b9479b8bef59c886718f Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 18 Oct 2022 23:04:44 +0200 Subject: [PATCH] Aligned with PathMatchingResourcePatternResolverTests on main See gh-29333 --- .../PathMatchingResourcePatternResolverTests.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/spring-core/src/test/java/org/springframework/core/io/support/PathMatchingResourcePatternResolverTests.java b/spring-core/src/test/java/org/springframework/core/io/support/PathMatchingResourcePatternResolverTests.java index e18452d4044..369b6932dcd 100644 --- a/spring-core/src/test/java/org/springframework/core/io/support/PathMatchingResourcePatternResolverTests.java +++ b/spring-core/src/test/java/org/springframework/core/io/support/PathMatchingResourcePatternResolverTests.java @@ -146,15 +146,14 @@ class PathMatchingResourcePatternResolverTests { } @Test - void usingClasspathStarProtocolWithWildcardInPatternAndEndingWithSlashStarStar() throws Exception { - String pattern = "classpath*:org/springframework/core/io/sup*/**"; + void usingClasspathStarProtocolWithWildcardInPatternAndEndingWithSuffixPattern() throws Exception { + String pattern = "classpath*:org/springframework/core/io/sup*/*.txt"; String pathPrefix = ".+org/springframework/core/io/"; List actualSubPaths = getSubPathsIgnoringClassFiles(pattern, pathPrefix); - // We DO find "support" if the pattern ENDS with "/**". assertThat(actualSubPaths) - .containsExactlyInAnyOrder("support", "support/resource#test1.txt", "support/resource#test2.txt"); + .containsExactlyInAnyOrder("support/resource#test1.txt", "support/resource#test2.txt"); } private List getSubPathsIgnoringClassFiles(String pattern, String pathPrefix) throws IOException { @@ -167,7 +166,7 @@ class PathMatchingResourcePatternResolverTests { } @Test - void usingFileProtocolWithoutWildcardInPatternAndEndingInSlashStarStar() throws Exception { + void usingFileProtocolWithoutWildcardInPatternAndEndingInSlashStarStar() { Path testResourcesDir = Paths.get("src/test/resources").toAbsolutePath(); String pattern = String.format("file:%s/scanned-resources/**", testResourcesDir); String pathPrefix = ".+?resources/"; @@ -179,7 +178,7 @@ class PathMatchingResourcePatternResolverTests { } @Test - void usingFileProtocolWithWildcardInPatternAndEndingInSlashStarStar() throws Exception { + void usingFileProtocolWithWildcardInPatternAndEndingInSlashStarStar() { Path testResourcesDir = Paths.get("src/test/resources").toAbsolutePath(); String pattern = String.format("file:%s/scanned*resources/**", testResourcesDir); String pathPrefix = ".+?resources/";