Skip to content

Commit 3e9c2b8

Browse files
committed
Fix default ReactiveWebApplicationContext class
Closes gh-11074
1 parent 382267d commit 3e9c2b8

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public class SpringApplication {
175175
* environments.
176176
*/
177177
public static final String DEFAULT_REACTIVE_WEB_CONTEXT_CLASS = "org.springframework."
178-
+ "boot.web.reactive.context.ReactiveWebServerApplicationContext";
178+
+ "boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext";
179179

180180
private static final String REACTIVE_WEB_ENVIRONMENT_CLASS = "org.springframework."
181181
+ "web.reactive.DispatcherHandler";

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
import org.springframework.boot.testsupport.rule.OutputCapture;
5858
import org.springframework.boot.web.embedded.netty.NettyReactiveWebServerFactory;
5959
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
60+
import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext;
6061
import org.springframework.boot.web.reactive.context.ReactiveWebApplicationContext;
61-
import org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext;
6262
import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext;
6363
import org.springframework.context.ApplicationContext;
6464
import org.springframework.context.ApplicationContextAware;
@@ -405,12 +405,13 @@ public void defaultApplicationContextForWeb() throws Exception {
405405
}
406406

407407
@Test
408-
public void defaultApplicationContextForReactiveWeb() throws Exception {
408+
public void defaultApplicationContextForReactiveWeb() {
409409
SpringApplication application = new SpringApplication(
410410
ExampleReactiveWebConfig.class);
411411
application.setWebApplicationType(WebApplicationType.REACTIVE);
412412
this.context = application.run();
413-
assertThat(this.context).isInstanceOf(ReactiveWebServerApplicationContext.class);
413+
assertThat(this.context).isInstanceOf(
414+
AnnotationConfigReactiveWebServerApplicationContext.class);
414415
}
415416

416417
@Test

0 commit comments

Comments
 (0)