From 3e9c2b84b68687952989d555e03ecd624ca37245 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Sat, 18 Nov 2017 09:53:45 +0100 Subject: [PATCH] Fix default ReactiveWebApplicationContext class Closes gh-11074 --- .../java/org/springframework/boot/SpringApplication.java | 2 +- .../org/springframework/boot/SpringApplicationTests.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java index 671e240c35..5011f1b082 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java @@ -175,7 +175,7 @@ public class SpringApplication { * environments. */ public static final String DEFAULT_REACTIVE_WEB_CONTEXT_CLASS = "org.springframework." - + "boot.web.reactive.context.ReactiveWebServerApplicationContext"; + + "boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext"; private static final String REACTIVE_WEB_ENVIRONMENT_CLASS = "org.springframework." + "web.reactive.DispatcherHandler"; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java index 6d4b5913cd..57c5c33c1b 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java @@ -57,8 +57,8 @@ import org.springframework.boot.context.event.ApplicationStartingEvent; import org.springframework.boot.testsupport.rule.OutputCapture; import org.springframework.boot.web.embedded.netty.NettyReactiveWebServerFactory; import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; +import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; import org.springframework.boot.web.reactive.context.ReactiveWebApplicationContext; -import org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext; import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; @@ -405,12 +405,13 @@ public class SpringApplicationTests { } @Test - public void defaultApplicationContextForReactiveWeb() throws Exception { + public void defaultApplicationContextForReactiveWeb() { SpringApplication application = new SpringApplication( ExampleReactiveWebConfig.class); application.setWebApplicationType(WebApplicationType.REACTIVE); this.context = application.run(); - assertThat(this.context).isInstanceOf(ReactiveWebServerApplicationContext.class); + assertThat(this.context).isInstanceOf( + AnnotationConfigReactiveWebServerApplicationContext.class); } @Test