SPR-5812 - Custom regex matching for @PathVariable
This commit is contained in:
@@ -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