Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
e1774672
Commit
e1774672
authored
Jun 20, 2018
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prefer servlet to reactive when Jersey and WebFlux are both available
Closes gh-13521
parent
814e9080
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
SpringBootTestContextBootstrapper.java
.../boot/test/context/SpringBootTestContextBootstrapper.java
+4
-1
SpringApplication.java
...main/java/org/springframework/boot/SpringApplication.java
+4
-1
No files found.
spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTestContextBootstrapper.java
View file @
e1774672
...
...
@@ -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
)
{
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java
View file @
e1774672
...
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment