Skip to content

Commit 52b9b8e

Browse files
committed
Fix tests failing due to missing 'spring.jmx.enabled=true'
See gh-43706
1 parent bd36637 commit 52b9b8e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceJmxConfigurationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ void tomcatDoesNotExposeMBeanPoolByDefault() {
149149
@Test
150150
void tomcatAutoConfiguredCanExposeMBeanPool() {
151151
this.contextRunner
152-
.withPropertyValues("spring.datasource.type=" + DataSource.class.getName(),
152+
.withPropertyValues("spring.jmx.enabled=true", "spring.datasource.type=" + DataSource.class.getName(),
153153
"spring.datasource.tomcat.jmx-enabled=true")
154154
.run((context) -> {
155155
assertThat(context).hasBean("dataSourceMBean");
@@ -162,7 +162,7 @@ void tomcatAutoConfiguredCanExposeMBeanPool() {
162162
@Test
163163
void tomcatProxiedCanExposeMBeanPool() {
164164
this.contextRunner.withUserConfiguration(DataSourceProxyConfiguration.class)
165-
.withPropertyValues("spring.datasource.type=" + DataSource.class.getName(),
165+
.withPropertyValues("spring.jmx.enabled=true", "spring.datasource.type=" + DataSource.class.getName(),
166166
"spring.datasource.tomcat.jmx-enabled=true")
167167
.run((context) -> {
168168
assertThat(context).hasBean("dataSourceMBean");
@@ -173,7 +173,7 @@ void tomcatProxiedCanExposeMBeanPool() {
173173
@Test
174174
void tomcatDelegateCanExposeMBeanPool() {
175175
this.contextRunner.withUserConfiguration(DataSourceDelegateConfiguration.class)
176-
.withPropertyValues("spring.datasource.type=" + DataSource.class.getName(),
176+
.withPropertyValues("spring.jmx.enabled=true", "spring.datasource.type=" + DataSource.class.getName(),
177177
"spring.datasource.tomcat.jmx-enabled=true")
178178
.run((context) -> {
179179
assertThat(context).hasBean("dataSourceMBean");

0 commit comments

Comments
 (0)