Fix default ReactiveWebApplicationContext class

Closes gh-11074
This commit is contained in:
Stephane Nicoll
2017-11-18 09:53:45 +01:00
parent 382267d6ef
commit 3e9c2b84b6
2 changed files with 5 additions and 4 deletions

View File

@@ -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";

View File

@@ -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