|
|
@ -58,6 +58,14 @@ class WebMvcTagsTests {
|
|
|
|
assertThat(tag.getValue()).isEqualTo("/spring/");
|
|
|
|
assertThat(tag.getValue()).isEqualTo("/spring/");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
void uriTagValueIsRootWhenBestMatchingPatternIsEmpty() {
|
|
|
|
|
|
|
|
this.request.setAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE, "");
|
|
|
|
|
|
|
|
this.response.setStatus(301);
|
|
|
|
|
|
|
|
Tag tag = WebMvcTags.uri(this.request, this.response);
|
|
|
|
|
|
|
|
assertThat(tag.getValue()).isEqualTo("root");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
void uriTagValueWithBestMatchingPatternAndIgnoreTrailingSlashRemoveTrailingSlash() {
|
|
|
|
void uriTagValueWithBestMatchingPatternAndIgnoreTrailingSlashRemoveTrailingSlash() {
|
|
|
|
this.request.setAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE, "/spring/");
|
|
|
|
this.request.setAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE, "/spring/");
|
|
|
|