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
6a291777
Commit
6a291777
authored
Jun 07, 2016
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6066 from izeye:polish-20160530
* pr/6066: Polish
parents
0fa4d2e2
8704e486
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
30 deletions
+2
-30
EndpointWebMvcAutoConfigurationTests.java
...e/autoconfigure/EndpointWebMvcAutoConfigurationTests.java
+2
-30
No files found.
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfigurationTests.java
View file @
6a291777
...
@@ -122,8 +122,9 @@ public class EndpointWebMvcAutoConfigurationTests {
...
@@ -122,8 +122,9 @@ public class EndpointWebMvcAutoConfigurationTests {
}
}
@After
@After
public
void
cl
ose
()
{
public
void
cl
eanUp
()
throws
Exception
{
this
.
applicationContext
.
close
();
this
.
applicationContext
.
close
();
assertAllClosed
();
}
}
@Test
@Test
...
@@ -140,8 +141,6 @@ public class EndpointWebMvcAutoConfigurationTests {
...
@@ -140,8 +141,6 @@ public class EndpointWebMvcAutoConfigurationTests {
.
isTrue
();
.
isTrue
();
assertThat
(
this
.
applicationContext
.
containsBean
(
"applicationContextIdFilter"
))
assertThat
(
this
.
applicationContext
.
containsBean
(
"applicationContextIdFilter"
))
.
isTrue
();
.
isTrue
();
this
.
applicationContext
.
close
();
assertAllClosed
();
}
}
@Test
@Test
...
@@ -156,8 +155,6 @@ public class EndpointWebMvcAutoConfigurationTests {
...
@@ -156,8 +155,6 @@ public class EndpointWebMvcAutoConfigurationTests {
.
isFalse
();
.
isFalse
();
assertThat
(
this
.
applicationContext
.
containsBean
(
"applicationContextIdFilter"
))
assertThat
(
this
.
applicationContext
.
containsBean
(
"applicationContextIdFilter"
))
.
isFalse
();
.
isFalse
();
this
.
applicationContext
.
close
();
assertAllClosed
();
}
}
@Test
@Test
...
@@ -176,8 +173,6 @@ public class EndpointWebMvcAutoConfigurationTests {
...
@@ -176,8 +173,6 @@ public class EndpointWebMvcAutoConfigurationTests {
List
<?>
interceptors
=
(
List
<?>)
ReflectionTestUtils
.
getField
(
List
<?>
interceptors
=
(
List
<?>)
ReflectionTestUtils
.
getField
(
managementContext
.
getBean
(
EndpointHandlerMapping
.
class
),
"interceptors"
);
managementContext
.
getBean
(
EndpointHandlerMapping
.
class
),
"interceptors"
);
assertThat
(
interceptors
).
hasSize
(
1
);
assertThat
(
interceptors
).
hasSize
(
1
);
this
.
applicationContext
.
close
();
assertAllClosed
();
}
}
@Test
@Test
...
@@ -219,8 +214,6 @@ public class EndpointWebMvcAutoConfigurationTests {
...
@@ -219,8 +214,6 @@ public class EndpointWebMvcAutoConfigurationTests {
assertContent
(
"/controller"
,
ports
.
get
().
server
,
"controlleroutput"
);
assertContent
(
"/controller"
,
ports
.
get
().
server
,
"controlleroutput"
);
assertContent
(
"/admin/endpoint"
,
ports
.
get
().
management
,
"endpointoutput"
);
assertContent
(
"/admin/endpoint"
,
ports
.
get
().
management
,
"endpointoutput"
);
assertContent
(
"/error"
,
ports
.
get
().
management
,
startsWith
(
"{"
));
assertContent
(
"/error"
,
ports
.
get
().
management
,
startsWith
(
"{"
));
this
.
applicationContext
.
close
();
assertAllClosed
();
}
}
@Test
@Test
...
@@ -234,8 +227,6 @@ public class EndpointWebMvcAutoConfigurationTests {
...
@@ -234,8 +227,6 @@ public class EndpointWebMvcAutoConfigurationTests {
assertContent
(
"/spring/controller"
,
ports
.
get
().
server
,
"controlleroutput"
);
assertContent
(
"/spring/controller"
,
ports
.
get
().
server
,
"controlleroutput"
);
assertContent
(
"/admin/endpoint"
,
ports
.
get
().
management
,
"endpointoutput"
);
assertContent
(
"/admin/endpoint"
,
ports
.
get
().
management
,
"endpointoutput"
);
assertContent
(
"/error"
,
ports
.
get
().
management
,
startsWith
(
"{"
));
assertContent
(
"/error"
,
ports
.
get
().
management
,
startsWith
(
"{"
));
this
.
applicationContext
.
close
();
assertAllClosed
();
}
}
@Test
@Test
...
@@ -245,8 +236,6 @@ public class EndpointWebMvcAutoConfigurationTests {
...
@@ -245,8 +236,6 @@ public class EndpointWebMvcAutoConfigurationTests {
EndpointWebMvcAutoConfiguration
.
class
);
EndpointWebMvcAutoConfiguration
.
class
);
this
.
applicationContext
.
refresh
();
this
.
applicationContext
.
refresh
();
assertContent
(
"/error"
,
ports
.
get
().
management
,
null
);
assertContent
(
"/error"
,
ports
.
get
().
management
,
null
);
this
.
applicationContext
.
close
();
assertAllClosed
();
}
}
@Test
@Test
...
@@ -263,8 +252,6 @@ public class EndpointWebMvcAutoConfigurationTests {
...
@@ -263,8 +252,6 @@ public class EndpointWebMvcAutoConfigurationTests {
this
.
applicationContext
.
refresh
();
this
.
applicationContext
.
refresh
();
assertContent
(
"/controller"
,
ports
.
get
().
management
,
null
);
assertContent
(
"/controller"
,
ports
.
get
().
management
,
null
);
assertContent
(
"/endpoint"
,
ports
.
get
().
management
,
null
);
assertContent
(
"/endpoint"
,
ports
.
get
().
management
,
null
);
this
.
applicationContext
.
close
();
assertAllClosed
();
}
}
@Test
@Test
...
@@ -297,7 +284,6 @@ public class EndpointWebMvcAutoConfigurationTests {
...
@@ -297,7 +284,6 @@ public class EndpointWebMvcAutoConfigurationTests {
this
.
applicationContext
.
publishEvent
(
event
);
this
.
applicationContext
.
publishEvent
(
event
);
assertThat
(((
ConfigurableApplicationContext
)
managementContext
).
isActive
())
assertThat
(((
ConfigurableApplicationContext
)
managementContext
).
isActive
())
.
isFalse
();
.
isFalse
();
this
.
applicationContext
.
close
();
}
}
@Test
@Test
...
@@ -310,8 +296,6 @@ public class EndpointWebMvcAutoConfigurationTests {
...
@@ -310,8 +296,6 @@ public class EndpointWebMvcAutoConfigurationTests {
assertContent
(
"/endpoint"
,
ports
.
get
().
server
,
null
);
assertContent
(
"/endpoint"
,
ports
.
get
().
server
,
null
);
assertContent
(
"/controller"
,
ports
.
get
().
management
,
null
);
assertContent
(
"/controller"
,
ports
.
get
().
management
,
null
);
assertContent
(
"/endpoint"
,
ports
.
get
().
management
,
null
);
assertContent
(
"/endpoint"
,
ports
.
get
().
management
,
null
);
this
.
applicationContext
.
close
();
assertAllClosed
();
}
}
@Test
@Test
...
@@ -327,8 +311,6 @@ public class EndpointWebMvcAutoConfigurationTests {
...
@@ -327,8 +311,6 @@ public class EndpointWebMvcAutoConfigurationTests {
assertContent
(
"/endpoint"
,
ports
.
get
().
server
,
null
);
assertContent
(
"/endpoint"
,
ports
.
get
().
server
,
null
);
assertContent
(
"/controller"
,
ports
.
get
().
management
,
null
);
assertContent
(
"/controller"
,
ports
.
get
().
management
,
null
);
assertContent
(
"/endpoint"
,
ports
.
get
().
management
,
"endpointoutput"
);
assertContent
(
"/endpoint"
,
ports
.
get
().
management
,
"endpointoutput"
);
this
.
applicationContext
.
close
();
assertAllClosed
();
}
}
@Test
@Test
...
@@ -345,11 +327,9 @@ public class EndpointWebMvcAutoConfigurationTests {
...
@@ -345,11 +327,9 @@ public class EndpointWebMvcAutoConfigurationTests {
ErrorMvcAutoConfiguration
.
class
);
ErrorMvcAutoConfiguration
.
class
);
this
.
thrown
.
expect
(
EmbeddedServletContainerException
.
class
);
this
.
thrown
.
expect
(
EmbeddedServletContainerException
.
class
);
this
.
applicationContext
.
refresh
();
this
.
applicationContext
.
refresh
();
this
.
applicationContext
.
close
();
}
}
finally
{
finally
{
serverSocket
.
close
();
serverSocket
.
close
();
assertAllClosed
();
}
}
}
}
...
@@ -368,8 +348,6 @@ public class EndpointWebMvcAutoConfigurationTests {
...
@@ -368,8 +348,6 @@ public class EndpointWebMvcAutoConfigurationTests {
this
.
applicationContext
.
refresh
();
this
.
applicationContext
.
refresh
();
assertContent
(
"/controller"
,
ports
.
get
().
server
,
"controlleroutput"
);
assertContent
(
"/controller"
,
ports
.
get
().
server
,
"controlleroutput"
);
assertContent
(
"/test/endpoint"
,
ports
.
get
().
server
,
"endpointoutput"
);
assertContent
(
"/test/endpoint"
,
ports
.
get
().
server
,
"endpointoutput"
);
this
.
applicationContext
.
close
();
assertAllClosed
();
}
}
@Test
@Test
...
@@ -389,8 +367,6 @@ public class EndpointWebMvcAutoConfigurationTests {
...
@@ -389,8 +367,6 @@ public class EndpointWebMvcAutoConfigurationTests {
ServerProperties
serverProperties
=
this
.
applicationContext
ServerProperties
serverProperties
=
this
.
applicationContext
.
getBean
(
ServerProperties
.
class
);
.
getBean
(
ServerProperties
.
class
);
assertThat
(
serverProperties
.
getDisplayName
()).
isEqualTo
(
"foo"
);
assertThat
(
serverProperties
.
getDisplayName
()).
isEqualTo
(
"foo"
);
this
.
applicationContext
.
close
();
assertAllClosed
();
}
}
@Test
@Test
...
@@ -407,8 +383,6 @@ public class EndpointWebMvcAutoConfigurationTests {
...
@@ -407,8 +383,6 @@ public class EndpointWebMvcAutoConfigurationTests {
assertThat
(
localServerPort
).
isNotNull
();
assertThat
(
localServerPort
).
isNotNull
();
assertThat
(
localManagementPort
).
isNotNull
();
assertThat
(
localManagementPort
).
isNotNull
();
assertThat
(
localServerPort
).
isEqualTo
(
localManagementPort
);
assertThat
(
localServerPort
).
isEqualTo
(
localManagementPort
);
this
.
applicationContext
.
close
();
assertAllClosed
();
}
}
@Test
@Test
...
@@ -428,8 +402,6 @@ public class EndpointWebMvcAutoConfigurationTests {
...
@@ -428,8 +402,6 @@ public class EndpointWebMvcAutoConfigurationTests {
assertThat
(
localServerPort
).
isNotEqualTo
(
localManagementPort
);
assertThat
(
localServerPort
).
isNotEqualTo
(
localManagementPort
);
assertThat
(
this
.
applicationContext
.
getBean
(
ServerPortConfig
.
class
).
getCount
())
assertThat
(
this
.
applicationContext
.
getBean
(
ServerPortConfig
.
class
).
getCount
())
.
isEqualTo
(
2
);
.
isEqualTo
(
2
);
this
.
applicationContext
.
close
();
assertAllClosed
();
}
}
@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