mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Prefer servlet to reactive when Jersey and WebFlux are both available
Closes gh-13521
This commit is contained in:
parent
814e90805e
commit
e1774672af
@ -86,6 +86,8 @@ public class SpringBootTestContextBootstrapper extends DefaultTestContextBootstr
|
||||
private static final String MVC_WEB_ENVIRONMENT_CLASS = "org.springframework."
|
||||
+ "web.servlet.DispatcherServlet";
|
||||
|
||||
private static final String JERSEY_WEB_ENVIRONMENT_CLASS = "org.glassfish.jersey.server.ResourceConfig";
|
||||
|
||||
private static final String ACTIVATE_SERVLET_LISTENER = "org.springframework.test."
|
||||
+ "context.web.ServletTestExecutionListener.activateListener";
|
||||
|
||||
@ -192,7 +194,8 @@ public class SpringBootTestContextBootstrapper extends DefaultTestContextBootstr
|
||||
|
||||
private WebApplicationType deduceWebApplicationType() {
|
||||
if (ClassUtils.isPresent(REACTIVE_WEB_ENVIRONMENT_CLASS, null)
|
||||
&& !ClassUtils.isPresent(MVC_WEB_ENVIRONMENT_CLASS, null)) {
|
||||
&& !ClassUtils.isPresent(MVC_WEB_ENVIRONMENT_CLASS, null)
|
||||
&& !ClassUtils.isPresent(JERSEY_WEB_ENVIRONMENT_CLASS, null)) {
|
||||
return WebApplicationType.REACTIVE;
|
||||
}
|
||||
for (String className : WEB_ENVIRONMENT_CLASSES) {
|
||||
|
@ -183,6 +183,8 @@ public class SpringApplication {
|
||||
private static final String MVC_WEB_ENVIRONMENT_CLASS = "org.springframework."
|
||||
+ "web.servlet.DispatcherServlet";
|
||||
|
||||
private static final String JERSEY_WEB_ENVIRONMENT_CLASS = "org.glassfish.jersey.server.ResourceConfig";
|
||||
|
||||
/**
|
||||
* Default banner location.
|
||||
*/
|
||||
@ -271,7 +273,8 @@ public class SpringApplication {
|
||||
|
||||
private WebApplicationType deduceWebApplicationType() {
|
||||
if (ClassUtils.isPresent(REACTIVE_WEB_ENVIRONMENT_CLASS, null)
|
||||
&& !ClassUtils.isPresent(MVC_WEB_ENVIRONMENT_CLASS, null)) {
|
||||
&& !ClassUtils.isPresent(MVC_WEB_ENVIRONMENT_CLASS, null)
|
||||
&& !ClassUtils.isPresent(JERSEY_WEB_ENVIRONMENT_CLASS, null)) {
|
||||
return WebApplicationType.REACTIVE;
|
||||
}
|
||||
for (String className : WEB_ENVIRONMENT_CLASSES) {
|
||||
|
Loading…
Reference in New Issue
Block a user