From 2e5f0c28738d4d4ea4cbf42de19321da09127a8a Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Thu, 12 Jul 2018 10:04:45 +0200 Subject: [PATCH] Fix WebMvc auto-conf tests after Framework change This commit adapts to a recent Spring Framework change (a40d25a) that turns no-op Spring MVC beans (infrastructure components that, given their configuration, won't contribute anything to the application) into `NullBean` instances. --- .../web/servlet/WebMvcAutoConfigurationTests.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java index 986fedc20a..2b8f5b50c2 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java @@ -191,9 +191,7 @@ public class WebMvcAutoConfigurationTests { public void resourceHandlerMappingDisabled() { this.contextRunner.withPropertyValues("spring.resources.add-mappings:false") .run((context) -> { - Map> locations = getResourceMappingLocations( - context); - assertThat(locations).isEmpty(); + assertThat(context.getBean("resourceHandlerMapping")).isEqualTo(null); }); }