File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
spring-test-mvc/src/main/java/org/springframework/test/web/servlet/setup Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -318,7 +318,9 @@ private void registerMvcSingletons(StubWebApplicationContext cxt) {
318
318
319
319
StandaloneConfiguration config = new StandaloneConfiguration ();
320
320
321
- StaticRequestMappingHandlerMapping hm = config .getHandlerMapping (cxt );
321
+ StaticRequestMappingHandlerMapping hm = config .getHandlerMapping ();
322
+ hm .setServletContext (cxt .getServletContext ());
323
+ hm .setApplicationContext (cxt );
322
324
hm .registerHandlers (controllers );
323
325
cxt .addBean ("requestMappingHandlerMapping" , hm );
324
326
@@ -358,11 +360,8 @@ private List<ViewResolver> initViewResolvers(WebApplicationContext wac) {
358
360
private class StandaloneConfiguration extends WebMvcConfigurationSupport {
359
361
360
362
361
- public StaticRequestMappingHandlerMapping getHandlerMapping (StubWebApplicationContext cxt ) {
362
-
363
+ public StaticRequestMappingHandlerMapping getHandlerMapping () {
363
364
StaticRequestMappingHandlerMapping handlerMapping = new StaticRequestMappingHandlerMapping ();
364
- handlerMapping .setServletContext (cxt .getServletContext ());
365
- handlerMapping .setApplicationContext (cxt );
366
365
handlerMapping .setEmbeddedValueResolver (new StaticStringValueResolver (placeHolderValues ));
367
366
handlerMapping .setUseSuffixPatternMatch (useSuffixPatternMatch );
368
367
handlerMapping .setUseTrailingSlashMatch (useTrailingSlashPatternMatch );
You can’t perform that action at this time.
0 commit comments