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
7ff2cb5d
Commit
7ff2cb5d
authored
Nov 18, 2017
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
3e9c2b84
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
12 deletions
+13
-12
ReactiveManagementContextFactory.java
...figure/web/reactive/ReactiveManagementContextFactory.java
+4
-6
ReactiveManagementContextFactoryTests.java
...e/web/reactive/ReactiveManagementContextFactoryTests.java
+7
-4
SpringApplicationTests.java
...java/org/springframework/boot/SpringApplicationTests.java
+2
-2
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/reactive/ReactiveManagementContextFactory.java
View file @
7ff2cb5d
...
@@ -17,9 +17,6 @@
...
@@ -17,9 +17,6 @@
package
org
.
springframework
.
boot
.
actuate
.
autoconfigure
.
web
.
reactive
;
package
org
.
springframework
.
boot
.
actuate
.
autoconfigure
.
web
.
reactive
;
import
java.lang.reflect.Modifier
;
import
java.lang.reflect.Modifier
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
org.springframework.beans.FatalBeanException
;
import
org.springframework.beans.FatalBeanException
;
import
org.springframework.beans.factory.NoSuchBeanDefinitionException
;
import
org.springframework.beans.factory.NoSuchBeanDefinitionException
;
...
@@ -32,6 +29,7 @@ import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWeb
...
@@ -32,6 +29,7 @@ import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWeb
import
org.springframework.boot.web.reactive.server.ReactiveWebServerFactory
;
import
org.springframework.boot.web.reactive.server.ReactiveWebServerFactory
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.util.ObjectUtils
;
/**
/**
* A {@link ManagementContextFactory} for reactive web applications.
* A {@link ManagementContextFactory} for reactive web applications.
...
@@ -45,9 +43,9 @@ class ReactiveManagementContextFactory implements ManagementContextFactory {
...
@@ -45,9 +43,9 @@ class ReactiveManagementContextFactory implements ManagementContextFactory {
ApplicationContext
parent
,
Class
<?>...
configClasses
)
{
ApplicationContext
parent
,
Class
<?>...
configClasses
)
{
AnnotationConfigReactiveWebServerApplicationContext
child
=
new
AnnotationConfigReactiveWebServerApplicationContext
();
AnnotationConfigReactiveWebServerApplicationContext
child
=
new
AnnotationConfigReactiveWebServerApplicationContext
();
child
.
setParent
(
parent
);
child
.
setParent
(
parent
);
List
<
Class
<?>>
combinedClasses
=
new
ArrayList
<>(
Arrays
.
asList
(
configClasses
));
Class
<?>[]
combinedClasses
=
ObjectUtils
.
addObjectToArray
(
configClasses
,
combinedClasses
.
add
(
ReactiveWebServerAutoConfiguration
.
class
);
ReactiveWebServerAutoConfiguration
.
class
);
child
.
register
(
combinedClasses
.
toArray
(
new
Class
<?>[
combinedClasses
.
size
()])
);
child
.
register
(
combinedClasses
);
registerReactiveWebServerFactory
(
parent
,
child
);
registerReactiveWebServerFactory
(
parent
,
child
);
return
child
;
return
child
;
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/reactive/ReactiveManagementContextFactoryTests.java
View file @
7ff2cb5d
...
@@ -41,15 +41,18 @@ public class ReactiveManagementContextFactoryTests {
...
@@ -41,15 +41,18 @@ public class ReactiveManagementContextFactoryTests {
private
AnnotationConfigReactiveWebServerApplicationContext
parent
=
new
AnnotationConfigReactiveWebServerApplicationContext
();
private
AnnotationConfigReactiveWebServerApplicationContext
parent
=
new
AnnotationConfigReactiveWebServerApplicationContext
();
@Test
@Test
public
void
createManagementContextShouldCreateChildContextWithConfigClasses
()
throws
Exception
{
public
void
createManagementContextShouldCreateChildContextWithConfigClasses
()
throws
Exception
{
this
.
parent
.
register
(
ParentConfiguration
.
class
);
this
.
parent
.
register
(
ParentConfiguration
.
class
);
this
.
parent
.
refresh
();
this
.
parent
.
refresh
();
AnnotationConfigReactiveWebServerApplicationContext
childContext
=
(
AnnotationConfigReactiveWebServerApplicationContext
)
this
.
factory
.
createManagementContext
(
this
.
parent
,
AnnotationConfigReactiveWebServerApplicationContext
childContext
=
(
AnnotationConfigReactiveWebServerApplicationContext
)
this
.
factory
TestConfiguration1
.
class
,
TestConfiguration2
.
class
);
.
createManagementContext
(
this
.
parent
,
TestConfiguration1
.
class
,
TestConfiguration2
.
class
);
childContext
.
refresh
();
childContext
.
refresh
();
assertThat
(
childContext
.
getBean
(
TestConfiguration1
.
class
)).
isNotNull
();
assertThat
(
childContext
.
getBean
(
TestConfiguration1
.
class
)).
isNotNull
();
assertThat
(
childContext
.
getBean
(
TestConfiguration2
.
class
)).
isNotNull
();
assertThat
(
childContext
.
getBean
(
TestConfiguration2
.
class
)).
isNotNull
();
assertThat
(
childContext
.
getBean
(
ReactiveWebServerAutoConfiguration
.
class
)).
isNotNull
();
assertThat
(
childContext
.
getBean
(
ReactiveWebServerAutoConfiguration
.
class
))
.
isNotNull
();
}
}
@Configuration
@Configuration
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java
View file @
7ff2cb5d
...
@@ -410,8 +410,8 @@ public class SpringApplicationTests {
...
@@ -410,8 +410,8 @@ public class SpringApplicationTests {
ExampleReactiveWebConfig
.
class
);
ExampleReactiveWebConfig
.
class
);
application
.
setWebApplicationType
(
WebApplicationType
.
REACTIVE
);
application
.
setWebApplicationType
(
WebApplicationType
.
REACTIVE
);
this
.
context
=
application
.
run
();
this
.
context
=
application
.
run
();
assertThat
(
this
.
context
)
.
isInstanceOf
(
assertThat
(
this
.
context
)
AnnotationConfigReactiveWebServerApplicationContext
.
class
);
.
isInstanceOf
(
AnnotationConfigReactiveWebServerApplicationContext
.
class
);
}
}
@Test
@Test
...
...
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