mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-23 22:59:03 +00:00
SPR-5812 - Custom regex matching for @PathVariable
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@1369 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
+14
@@ -334,6 +334,20 @@ public class AntPathMatcherTests {
|
||||
assertEquals(expected, result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void extractUriTemplateVariablesCustomRegex() {
|
||||
Map<String, String> result = pathMatcher
|
||||
.extractUriTemplateVariables("{symbolicName:[\\w\\.]+}-{version:[\\w\\.]+}.jar",
|
||||
"com.example-1.0.0.jar");
|
||||
assertEquals("com.example", result.get("symbolicName"));
|
||||
assertEquals("1.0.0", result.get("version"));
|
||||
|
||||
result = pathMatcher.extractUriTemplateVariables("{symbolicName:[\\w\\.]+}-sources-{version:[\\w\\.]+}.jar",
|
||||
"com.example-sources-1.0.0.jar");
|
||||
assertEquals("com.example", result.get("symbolicName"));
|
||||
assertEquals("1.0.0", result.get("version"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void combine() {
|
||||
assertEquals("", pathMatcher.combine(null, null));
|
||||
|
||||
Reference in New Issue
Block a user