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
724be85b
Commit
724be85b
authored
Apr 19, 2017
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
1eab67c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
LoggersMvcEndpointTests.java
...rk/boot/actuate/endpoint/mvc/LoggersMvcEndpointTests.java
+12
-7
No files found.
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/LoggersMvcEndpointTests.java
View file @
724be85b
...
@@ -121,7 +121,8 @@ public class LoggersMvcEndpointTests {
...
@@ -121,7 +121,8 @@ public class LoggersMvcEndpointTests {
@Test
@Test
public
void
getLoggersRootWhenDisabledShouldReturnNotFound
()
throws
Exception
{
public
void
getLoggersRootWhenDisabledShouldReturnNotFound
()
throws
Exception
{
this
.
context
.
getBean
(
LoggersEndpoint
.
class
).
setEnabled
(
false
);
this
.
context
.
getBean
(
LoggersEndpoint
.
class
).
setEnabled
(
false
);
this
.
mvc
.
perform
(
get
(
"/application/loggers/ROOT"
)).
andExpect
(
status
().
isNotFound
());
this
.
mvc
.
perform
(
get
(
"/application/loggers/ROOT"
))
.
andExpect
(
status
().
isNotFound
());
}
}
@Test
@Test
...
@@ -147,8 +148,10 @@ public class LoggersMvcEndpointTests {
...
@@ -147,8 +148,10 @@ public class LoggersMvcEndpointTests {
@Test
@Test
public
void
setLoggerUsingApplicationJsonShouldSetLogLevel
()
throws
Exception
{
public
void
setLoggerUsingApplicationJsonShouldSetLogLevel
()
throws
Exception
{
this
.
mvc
.
perform
(
post
(
"/application/loggers/ROOT"
).
contentType
(
MediaType
.
APPLICATION_JSON
)
this
.
mvc
.
perform
(
.
content
(
"{\"configuredLevel\":\"debug\"}"
)).
andExpect
(
status
().
isOk
());
post
(
"/application/loggers/ROOT"
).
contentType
(
MediaType
.
APPLICATION_JSON
)
.
content
(
"{\"configuredLevel\":\"debug\"}"
))
.
andExpect
(
status
().
isOk
());
verify
(
this
.
loggingSystem
).
setLogLevel
(
"ROOT"
,
LogLevel
.
DEBUG
);
verify
(
this
.
loggingSystem
).
setLogLevel
(
"ROOT"
,
LogLevel
.
DEBUG
);
}
}
...
@@ -163,16 +166,18 @@ public class LoggersMvcEndpointTests {
...
@@ -163,16 +166,18 @@ public class LoggersMvcEndpointTests {
@Test
@Test
public
void
setLoggerWhenDisabledShouldReturnNotFound
()
throws
Exception
{
public
void
setLoggerWhenDisabledShouldReturnNotFound
()
throws
Exception
{
this
.
context
.
getBean
(
LoggersEndpoint
.
class
).
setEnabled
(
false
);
this
.
context
.
getBean
(
LoggersEndpoint
.
class
).
setEnabled
(
false
);
this
.
mvc
.
perform
(
post
(
"/application/loggers/ROOT"
).
contentType
(
MediaType
.
APPLICATION_JSON
)
this
.
mvc
.
perform
(
.
content
(
"{\"configuredLevel\":\"DEBUG\"}"
))
post
(
"/application/loggers/ROOT"
).
contentType
(
MediaType
.
APPLICATION_JSON
)
.
content
(
"{\"configuredLevel\":\"DEBUG\"}"
))
.
andExpect
(
status
().
isNotFound
());
.
andExpect
(
status
().
isNotFound
());
verifyZeroInteractions
(
this
.
loggingSystem
);
verifyZeroInteractions
(
this
.
loggingSystem
);
}
}
@Test
@Test
public
void
setLoggerWithWrongLogLevel
()
throws
Exception
{
public
void
setLoggerWithWrongLogLevel
()
throws
Exception
{
this
.
mvc
.
perform
(
post
(
"/application/loggers/ROOT"
).
contentType
(
MediaType
.
APPLICATION_JSON
)
this
.
mvc
.
perform
(
.
content
(
"{\"configuredLevel\":\"other\"}"
))
post
(
"/application/loggers/ROOT"
).
contentType
(
MediaType
.
APPLICATION_JSON
)
.
content
(
"{\"configuredLevel\":\"other\"}"
))
.
andExpect
(
status
().
is4xxClientError
());
.
andExpect
(
status
().
is4xxClientError
());
verifyZeroInteractions
(
this
.
loggingSystem
);
verifyZeroInteractions
(
this
.
loggingSystem
);
}
}
...
...
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