RegexPathMapping extends AbstractPathMapping { @Override public Set<String> paramNames() { return paramNames; } RegexPathMapping(Pattern regex); @Override Set<String> paramNames(); @Override String patternString(); @Override RoutePathType pathType(); @Override List<String> paths(); @Override int hashCode(); @Override boolean equals(@Nullable Object obj); @Override String toString();  }
@Test void pathParams() { final RegexPathMapping regexPathMapping = new RegexPathMapping(Pattern.compile("^/files/(?<fileName>.*)$")); assertThat(regexPathMapping.paramNames()).containsExactly("fileName"); final RoutingResult result = regexPathMapping.apply(create("/files/images/avatar.jpg", "size=512")) .build(); assertThat(result.isPresent()).isTrue(); assertThat(result.path()).isEqualTo("/files/images/avatar.jpg"); assertThat(result.query()).isEqualTo("size=512"); assertThat(result.pathParams()).containsEntry("fileName", "images/avatar.jpg").hasSize(1); }