Fix tests failing due to missing 'spring.jmx.enabled=true'

See gh-43706
This commit is contained in:
Phillip Webb
2025-01-08 15:44:35 -08:00
parent bd3663748b
commit 52b9b8e711

View File

@@ -149,7 +149,7 @@ class DataSourceJmxConfigurationTests {
@Test
void tomcatAutoConfiguredCanExposeMBeanPool() {
this.contextRunner
.withPropertyValues("spring.datasource.type=" + DataSource.class.getName(),
.withPropertyValues("spring.jmx.enabled=true", "spring.datasource.type=" + DataSource.class.getName(),
"spring.datasource.tomcat.jmx-enabled=true")
.run((context) -> {
assertThat(context).hasBean("dataSourceMBean");
@@ -162,7 +162,7 @@ class DataSourceJmxConfigurationTests {
@Test
void tomcatProxiedCanExposeMBeanPool() {
this.contextRunner.withUserConfiguration(DataSourceProxyConfiguration.class)
.withPropertyValues("spring.datasource.type=" + DataSource.class.getName(),
.withPropertyValues("spring.jmx.enabled=true", "spring.datasource.type=" + DataSource.class.getName(),
"spring.datasource.tomcat.jmx-enabled=true")
.run((context) -> {
assertThat(context).hasBean("dataSourceMBean");
@@ -173,7 +173,7 @@ class DataSourceJmxConfigurationTests {
@Test
void tomcatDelegateCanExposeMBeanPool() {
this.contextRunner.withUserConfiguration(DataSourceDelegateConfiguration.class)
.withPropertyValues("spring.datasource.type=" + DataSource.class.getName(),
.withPropertyValues("spring.jmx.enabled=true", "spring.datasource.type=" + DataSource.class.getName(),
"spring.datasource.tomcat.jmx-enabled=true")
.run((context) -> {
assertThat(context).hasBean("dataSourceMBean");