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
f30e29a4
Commit
f30e29a4
authored
Jun 03, 2019
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename spring.reactor.stacktrace-mode.enabled property
Closes gh-16537
parent
090cc05e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
95 additions
and
11 deletions
+95
-11
ReactorCoreAutoConfiguration.java
...oconfigure/reactor/core/ReactorCoreAutoConfiguration.java
+1
-1
ReactorCoreProperties.java
...oot/autoconfigure/reactor/core/ReactorCoreProperties.java
+21
-9
ReactorCoreAutoConfigurationTests.java
...igure/reactor/core/ReactorCoreAutoConfigurationTests.java
+72
-0
DevToolsPropertyDefaultsPostProcessor.java
...t/devtools/env/DevToolsPropertyDefaultsPostProcessor.java
+1
-1
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/reactor/core/ReactorCoreAutoConfiguration.java
View file @
f30e29a4
...
@@ -39,7 +39,7 @@ public class ReactorCoreAutoConfiguration {
...
@@ -39,7 +39,7 @@ public class ReactorCoreAutoConfiguration {
@Autowired
@Autowired
protected
void
initialize
(
ReactorCoreProperties
properties
)
{
protected
void
initialize
(
ReactorCoreProperties
properties
)
{
if
(
properties
.
getStacktraceMode
().
isEnabled
())
{
if
(
properties
.
isDebug
())
{
Hooks
.
onOperatorDebug
();
Hooks
.
onOperatorDebug
();
}
}
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/reactor/core/ReactorCoreProperties.java
View file @
f30e29a4
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
package
org
.
springframework
.
boot
.
autoconfigure
.
reactor
.
core
;
package
org
.
springframework
.
boot
.
autoconfigure
.
reactor
.
core
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.DeprecatedConfigurationProperty
;
/**
/**
* Properties for Reactor Core.
* Properties for Reactor Core.
...
@@ -27,25 +28,36 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
...
@@ -27,25 +28,36 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties
(
prefix
=
"spring.reactor"
)
@ConfigurationProperties
(
prefix
=
"spring.reactor"
)
public
class
ReactorCoreProperties
{
public
class
ReactorCoreProperties
{
/**
* Whether Reactor should collect stacktrace information at runtime.
*/
private
boolean
debug
;
private
final
StacktraceMode
stacktraceMode
=
new
StacktraceMode
();
private
final
StacktraceMode
stacktraceMode
=
new
StacktraceMode
();
public
boolean
isDebug
()
{
return
this
.
debug
;
}
public
void
setDebug
(
boolean
debug
)
{
this
.
debug
=
debug
;
}
public
StacktraceMode
getStacktraceMode
()
{
public
StacktraceMode
getStacktraceMode
()
{
return
this
.
stacktraceMode
;
return
this
.
stacktraceMode
;
}
}
public
static
class
StacktraceMode
{
public
class
StacktraceMode
{
/**
* Whether Reactor should collect stacktrace information at runtime.
*/
private
boolean
enabled
;
@DeprecatedConfigurationProperty
(
replacement
=
"spring.reactor.debug"
)
@Deprecated
public
boolean
isEnabled
()
{
public
boolean
isEnabled
()
{
return
this
.
enabled
;
return
isDebug
()
;
}
}
@Deprecated
public
void
setEnabled
(
boolean
enabled
)
{
public
void
setEnabled
(
boolean
enabled
)
{
this
.
enabled
=
enabled
;
setDebug
(
enabled
)
;
}
}
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/reactor/core/ReactorCoreAutoConfigurationTests.java
0 → 100644
View file @
f30e29a4
/*
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
reactor
.
core
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
import
reactor.core.publisher.Hooks
;
import
org.springframework.boot.autoconfigure.AutoConfigurations
;
import
org.springframework.boot.test.context.assertj.AssertableApplicationContext
;
import
org.springframework.boot.test.context.runner.ApplicationContextRunner
;
import
org.springframework.boot.test.context.runner.ContextConsumer
;
import
org.springframework.test.util.ReflectionTestUtils
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
/**
* Tests for {@link ReactorCoreAutoConfiguration}.
*
* @author Stephane Nicoll
*/
class
ReactorCoreAutoConfigurationTests
{
private
final
ApplicationContextRunner
contextRunner
=
new
ApplicationContextRunner
()
.
withConfiguration
(
AutoConfigurations
.
of
(
ReactorCoreAutoConfiguration
.
class
));
@BeforeEach
void
resetDebugFlag
()
{
Hooks
.
resetOnOperatorDebug
();
}
@Test
void
debugOperatorIsDisabledByDefault
()
{
this
.
contextRunner
.
run
(
assertDebugOperator
(
false
));
}
@Test
void
debugOperatorIsSetWithProperty
()
{
this
.
contextRunner
.
withPropertyValues
(
"spring.reactor.debug=true"
)
.
run
(
assertDebugOperator
(
true
));
}
@Test
@Deprecated
void
debugOperatorIsSetWithDeprecatedProperty
()
{
this
.
contextRunner
.
withPropertyValues
(
"spring.reactor.stacktrace-mode.enabled=true"
)
.
run
(
assertDebugOperator
(
true
));
}
private
ContextConsumer
<
AssertableApplicationContext
>
assertDebugOperator
(
boolean
expected
)
{
return
(
context
)
->
assertThat
(
ReflectionTestUtils
.
getField
(
Hooks
.
class
,
"GLOBAL_TRACE"
))
.
isEqualTo
(
expected
);
}
}
spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/env/DevToolsPropertyDefaultsPostProcessor.java
View file @
f30e29a4
...
@@ -73,7 +73,7 @@ public class DevToolsPropertyDefaultsPostProcessor implements EnvironmentPostPro
...
@@ -73,7 +73,7 @@ public class DevToolsPropertyDefaultsPostProcessor implements EnvironmentPostPro
properties
.
put
(
"spring.mvc.log-resolved-exception"
,
"true"
);
properties
.
put
(
"spring.mvc.log-resolved-exception"
,
"true"
);
properties
.
put
(
"server.error.include-stacktrace"
,
"ALWAYS"
);
properties
.
put
(
"server.error.include-stacktrace"
,
"ALWAYS"
);
properties
.
put
(
"server.servlet.jsp.init-parameters.development"
,
"true"
);
properties
.
put
(
"server.servlet.jsp.init-parameters.development"
,
"true"
);
properties
.
put
(
"spring.reactor.
stacktrace-mode.enabled
"
,
"true"
);
properties
.
put
(
"spring.reactor.
debug
"
,
"true"
);
PROPERTIES
=
Collections
.
unmodifiableMap
(
properties
);
PROPERTIES
=
Collections
.
unmodifiableMap
(
properties
);
}
}
...
...
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