From 9b60eef0e2e02c5ebbb2d33db3e7dbb1809a1b03 Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Mon, 16 Jul 2018 10:19:38 +0200 Subject: [PATCH] Fix build after SPR-17034 in Spring Framework Since SPR-17034, the core container now behaves a bit differently when dealing with `null` beans. Given a `null` `HandlerMapping` bean named "resourceHandlerMapping": * `context.getBean("resourceHandlerMapping", HandlerMapping.class)` still returns a `NullBean` * `ListableBeanFactory.getBeansOfType` will return a Map of all existing beans, not including the `null` ones as values of the map. Closes gh-13760 --- .../autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 afed1b4409a..62676060869 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 @@ -138,7 +138,7 @@ public class WebMvcAutoConfigurationTests { @Test public void handlerMappingsCreated() { this.contextRunner.run((context) -> assertThat(context) - .getBeans(HandlerMapping.class).hasSize(7)); + .getBeans(HandlerMapping.class).hasSize(5)); } @Test