Expose mvcPatternParser bean in WebMvcConfigurationSupport

See gh-26427
This commit is contained in:
Rossen Stoyanchev
2021-01-22 17:30:45 +00:00
parent 5c1cbb769c
commit 5a640bb635
3 changed files with 34 additions and 5 deletions

View File

@@ -274,7 +274,6 @@ public class DelegatingWebMvcConfigurationTests {
@Test
public void configurePathPatternParser() {
PathPatternParser patternParser = new PathPatternParser();
PathMatcher pathMatcher = mock(PathMatcher.class);
UrlPathHelper pathHelper = mock(UrlPathHelper.class);
@@ -313,7 +312,9 @@ public class DelegatingWebMvcConfigurationTests {
webMvcConfig.mvcResourceUrlProvider());
assertThat(annotationsMapping).isNotNull();
assertThat(annotationsMapping.getPatternParser()).isSameAs(patternParser);
assertThat(annotationsMapping.getPatternParser())
.isSameAs(patternParser)
.isSameAs(webMvcConfig.mvcPatternParser());
configAssertion.accept(annotationsMapping.getUrlPathHelper(), annotationsMapping.getPathMatcher());
SimpleUrlHandlerMapping mapping = (SimpleUrlHandlerMapping) webMvcConfig.viewControllerHandlerMapping(
@@ -344,4 +345,5 @@ public class DelegatingWebMvcConfigurationTests {
assertThat(webMvcConfig.mvcResourceUrlProvider().getUrlPathHelper()).isSameAs(pathHelper);
assertThat(webMvcConfig.mvcResourceUrlProvider().getPathMatcher()).isSameAs(pathMatcher);
}
}