diff --git a/org.springframework.web.servlet/src/test/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupportTests.java b/org.springframework.web.servlet/src/test/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupportTests.java index 8dc615c4af..80c30112ed 100644 --- a/org.springframework.web.servlet/src/test/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupportTests.java +++ b/org.springframework.web.servlet/src/test/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupportTests.java @@ -83,6 +83,7 @@ public class WebMvcConfigurationSupportTests { assertEquals(0, handlerMapping.getOrder()); handlerMapping.setApplicationContext(cxt); + handlerMapping.afterPropertiesSet(); HandlerExecutionChain chain = handlerMapping.getHandler(new MockHttpServletRequest("GET", "/")); assertNotNull(chain.getInterceptors()); assertEquals(ConversionServiceExposingInterceptor.class, chain.getInterceptors()[0].getClass()); @@ -167,7 +168,6 @@ public class WebMvcConfigurationSupportTests { @Test public void webMvcConfigurerExtensionHooks() throws Exception { - StaticWebApplicationContext appCxt = new StaticWebApplicationContext(); appCxt.setServletContext(new MockServletContext(new FileSystemResourceLoader())); appCxt.registerSingleton("controller", TestController.class); @@ -204,6 +204,7 @@ public class WebMvcConfigurationSupportTests { RequestMappingHandlerMapping rmHandlerMapping = webConfig.requestMappingHandlerMapping(); rmHandlerMapping.setApplicationContext(appCxt); + rmHandlerMapping.afterPropertiesSet(); HandlerExecutionChain chain = rmHandlerMapping.getHandler(new MockHttpServletRequest("GET", "/")); assertNotNull(chain.getInterceptors()); assertEquals(2, chain.getInterceptors().length);