Remove reference to spring.datasource.jmx-enabled
This commits moves the single use of that property to the already existing Tomcat-specific one. Closes gh-16673
This commit is contained in:
parent
22ae160faa
commit
1c3a91883d
|
|
@ -75,7 +75,7 @@ class DataSourceJmxConfiguration {
|
|||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnProperty(prefix = "spring.datasource", name = "jmx-enabled")
|
||||
@ConditionalOnProperty(prefix = "spring.datasource.tomcat", name = "jmx-enabled")
|
||||
@ConditionalOnClass(DataSourceProxy.class)
|
||||
@ConditionalOnSingleCandidate(DataSource.class)
|
||||
static class TomcatDataSourceJmxConfiguration {
|
||||
|
|
|
|||
|
|
@ -298,12 +298,6 @@
|
|||
"description": "Whether to enable the PersistenceExceptionTranslationPostProcessor.",
|
||||
"defaultValue": true
|
||||
},
|
||||
{
|
||||
"name": "spring.datasource.jmx-enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
"description": "Whether to enable JMX support (if provided by the underlying pool).",
|
||||
"defaultValue": false
|
||||
},
|
||||
{
|
||||
"name": "spring.datasource.initialization-mode",
|
||||
"defaultValue": "embedded"
|
||||
|
|
@ -1572,6 +1566,16 @@
|
|||
"level": "error"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "spring.datasource.jmx-enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
"description": "Whether to enable JMX support (if provided by the underlying pool).",
|
||||
"defaultValue": false,
|
||||
"deprecation": {
|
||||
"level": "error",
|
||||
"replacement": "spring.datasource.tomcat.jmx-enabled"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "spring.datasource.initialize",
|
||||
"defaultValue": true,
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ public class DataSourceJmxConfigurationTests {
|
|||
public void tomcatAutoConfiguredCanExposeMBeanPool() {
|
||||
this.contextRunner.withPropertyValues(
|
||||
"spring.datasource.type=" + DataSource.class.getName(),
|
||||
"spring.datasource.jmx-enabled=true").run((context) -> {
|
||||
"spring.datasource.tomcat.jmx-enabled=true").run((context) -> {
|
||||
assertThat(context).hasBean("dataSourceMBean");
|
||||
assertThat(context).hasSingleBean(ConnectionPool.class);
|
||||
assertThat(context.getBean(DataSourceProxy.class).createPool()
|
||||
|
|
@ -170,7 +170,7 @@ public class DataSourceJmxConfigurationTests {
|
|||
this.contextRunner.withUserConfiguration(DataSourceProxyConfiguration.class)
|
||||
.withPropertyValues(
|
||||
"spring.datasource.type=" + DataSource.class.getName(),
|
||||
"spring.datasource.jmx-enabled=true")
|
||||
"spring.datasource.tomcat.jmx-enabled=true")
|
||||
.run((context) -> {
|
||||
assertThat(context).hasBean("dataSourceMBean");
|
||||
assertThat(context).getBean("dataSourceMBean")
|
||||
|
|
@ -183,7 +183,7 @@ public class DataSourceJmxConfigurationTests {
|
|||
this.contextRunner.withUserConfiguration(DataSourceDelegateConfiguration.class)
|
||||
.withPropertyValues(
|
||||
"spring.datasource.type=" + DataSource.class.getName(),
|
||||
"spring.datasource.jmx-enabled=true")
|
||||
"spring.datasource.tomcat.jmx-enabled=true")
|
||||
.run((context) -> {
|
||||
assertThat(context).hasBean("dataSourceMBean");
|
||||
assertThat(context).getBean("dataSourceMBean")
|
||||
|
|
|
|||
|
|
@ -42,8 +42,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
|||
* @author Dave Syer
|
||||
*/
|
||||
// Enable JMX so we can test the MBeans (you can't do this in a properties file)
|
||||
@SpringBootTest(
|
||||
properties = { "spring.jmx.enabled:true", "spring.datasource.jmx-enabled:true" })
|
||||
@SpringBootTest(properties = "spring.jmx.enabled:true")
|
||||
@ActiveProfiles("scratch")
|
||||
// Separate profile for web tests to avoid clashing databases
|
||||
class SampleDataJpaApplicationTests {
|
||||
|
|
|
|||
Loading…
Reference in New Issue