|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2020 the original author or authors. |
| 2 | + * Copyright 2002-2021 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
38 | 38 | import org.springframework.web.method.support.HandlerMethodArgumentResolver;
|
39 | 39 | import org.springframework.web.method.support.HandlerMethodReturnValueHandler;
|
40 | 40 | import org.springframework.web.servlet.HandlerExceptionResolver;
|
| 41 | +import org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping; |
41 | 42 | import org.springframework.web.servlet.handler.HandlerExceptionResolverComposite;
|
42 | 43 | import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping;
|
43 | 44 | import org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver;
|
@@ -332,6 +333,14 @@ public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
332 | 333 | assertThat(mapping.getPatternParser()).isSameAs(patternParser);
|
333 | 334 | configAssertion.accept(mapping.getUrlPathHelper(), mapping.getPathMatcher());
|
334 | 335 |
|
| 336 | + BeanNameUrlHandlerMapping beanNameMapping = webMvcConfig.beanNameHandlerMapping( |
| 337 | + webMvcConfig.mvcConversionService(), |
| 338 | + webMvcConfig.mvcResourceUrlProvider()); |
| 339 | + |
| 340 | + assertThat(beanNameMapping).isNotNull(); |
| 341 | + assertThat(beanNameMapping.getPatternParser()).isSameAs(patternParser); |
| 342 | + configAssertion.accept(beanNameMapping.getUrlPathHelper(), mapping.getPathMatcher()); |
| 343 | + |
335 | 344 | assertThat(webMvcConfig.mvcResourceUrlProvider().getUrlPathHelper()).isSameAs(pathHelper);
|
336 | 345 | assertThat(webMvcConfig.mvcResourceUrlProvider().getPathMatcher()).isSameAs(pathMatcher);
|
337 | 346 | }
|
|
0 commit comments