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
c9726898
Commit
c9726898
authored
Apr 12, 2017
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
d301d0f4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
20 deletions
+22
-20
LoggersMvcEndpoint.java
...amework/boot/actuate/endpoint/mvc/LoggersMvcEndpoint.java
+7
-5
TraceWebFilterAutoConfigurationTests.java
...e/autoconfigure/TraceWebFilterAutoConfigurationTests.java
+9
-9
ValidationAutoConfiguration.java
...autoconfigure/validation/ValidationAutoConfiguration.java
+2
-2
ValidationAutoConfigurationTests.java
...onfigure/validation/ValidationAutoConfigurationTests.java
+4
-4
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/LoggersMvcEndpoint.java
View file @
c9726898
...
...
@@ -68,17 +68,19 @@ public class LoggersMvcEndpoint extends EndpointMvcAdapter {
// disabled
return
getDisabledResponse
();
}
LogLevel
logLevel
;
try
{
String
level
=
configuration
.
get
(
"configuredLevel"
);
logLevel
=
level
==
null
?
null
:
LogLevel
.
valueOf
(
level
.
toUpperCase
());
LogLevel
logLevel
=
getLogLevel
(
configuration
);
this
.
delegate
.
setLogLevel
(
name
,
logLevel
);
return
ResponseEntity
.
ok
().
build
();
}
catch
(
IllegalArgumentException
ex
)
{
return
ResponseEntity
.
badRequest
().
build
();
}
}
this
.
delegate
.
setLogLevel
(
name
,
logLevel
);
return
ResponseEntity
.
ok
().
build
();
private
LogLevel
getLogLevel
(
Map
<
String
,
String
>
configuration
)
{
String
level
=
configuration
.
get
(
"configuredLevel"
);
return
(
level
==
null
?
null
:
LogLevel
.
valueOf
(
level
.
toUpperCase
()));
}
}
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/TraceWebFilterAutoConfigurationTests.java
View file @
c9726898
...
...
@@ -66,7 +66,7 @@ public class TraceWebFilterAutoConfigurationTests {
public
void
skipsFilterIfPropertyDisabled
()
throws
Exception
{
load
(
"endpoints.trace.filter.enabled:false"
);
assertThat
(
this
.
context
.
getBeansOfType
(
WebRequestTraceFilter
.
class
).
size
())
.
isEqualTo
(
0
);
.
isEqualTo
(
0
);
}
private
void
load
(
String
...
environment
)
{
...
...
@@ -74,16 +74,16 @@ public class TraceWebFilterAutoConfigurationTests {
}
private
void
load
(
Class
<?>
config
,
String
...
environment
)
{
AnnotationConfigApplicationContext
c
tx
=
new
AnnotationConfigApplicationContext
();
EnvironmentTestUtils
.
addEnvironment
(
c
tx
,
environment
);
AnnotationConfigApplicationContext
c
ontext
=
new
AnnotationConfigApplicationContext
();
EnvironmentTestUtils
.
addEnvironment
(
c
ontext
,
environment
);
if
(
config
!=
null
)
{
c
tx
.
register
(
config
);
c
ontext
.
register
(
config
);
}
c
tx
.
register
(
PropertyPlaceholderAutoConfiguration
.
class
,
TraceRepositoryAutoConfiguration
.
class
,
TraceWebFilterAutoConfiguration
.
class
);
c
tx
.
refresh
();
this
.
context
=
c
tx
;
c
ontext
.
register
(
PropertyPlaceholderAutoConfiguration
.
class
,
TraceRepositoryAutoConfiguration
.
class
,
TraceWebFilterAutoConfiguration
.
class
);
c
ontext
.
refresh
();
this
.
context
=
c
ontext
;
}
@Configuration
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.java
View file @
c9726898
...
...
@@ -66,8 +66,8 @@ public class ValidationAutoConfiguration {
}
private
static
boolean
determineProxyTargetClass
(
Environment
environment
)
{
RelaxedPropertyResolver
resolver
=
new
RelaxedPropertyResolver
(
environment
,
"spring.aop."
);
RelaxedPropertyResolver
resolver
=
new
RelaxedPropertyResolver
(
environment
,
"spring.aop."
);
Boolean
value
=
resolver
.
getProperty
(
"proxyTargetClass"
,
Boolean
.
class
);
return
(
value
!=
null
?
value
:
true
);
}
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfigurationTests.java
View file @
c9726898
...
...
@@ -78,12 +78,12 @@ public class ValidationAutoConfigurationTests {
@Test
public
void
validationCanBeConfiguredToUseJdkProxy
()
{
load
(
AnotherSampleServiceConfiguration
.
class
,
"spring.aop.proxy-target-class=false"
);
load
(
AnotherSampleServiceConfiguration
.
class
,
"spring.aop.proxy-target-class=false"
);
assertThat
(
this
.
context
.
getBeansOfType
(
Validator
.
class
)).
hasSize
(
1
);
assertThat
(
this
.
context
.
getBeansOfType
(
DefaultAnotherSampleService
.
class
))
.
isEmpty
();
AnotherSampleService
service
=
this
.
context
.
getBean
(
AnotherSampleService
.
class
);
.
isEmpty
();
AnotherSampleService
service
=
this
.
context
.
getBean
(
AnotherSampleService
.
class
);
service
.
doSomething
(
42
);
this
.
thrown
.
expect
(
ConstraintViolationException
.
class
);
service
.
doSomething
(
2
);
...
...
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