|
|
@ -156,7 +156,7 @@ public class DataSourceJmxConfigurationTests {
|
|
|
|
public void tomcatAutoConfiguredCanExposeMBeanPool() {
|
|
|
|
public void tomcatAutoConfiguredCanExposeMBeanPool() {
|
|
|
|
this.contextRunner.withPropertyValues(
|
|
|
|
this.contextRunner.withPropertyValues(
|
|
|
|
"spring.datasource.type=" + DataSource.class.getName(),
|
|
|
|
"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).hasBean("dataSourceMBean");
|
|
|
|
assertThat(context).hasSingleBean(ConnectionPool.class);
|
|
|
|
assertThat(context).hasSingleBean(ConnectionPool.class);
|
|
|
|
assertThat(context.getBean(DataSourceProxy.class).createPool()
|
|
|
|
assertThat(context.getBean(DataSourceProxy.class).createPool()
|
|
|
@ -170,7 +170,7 @@ public class DataSourceJmxConfigurationTests {
|
|
|
|
this.contextRunner.withUserConfiguration(DataSourceProxyConfiguration.class)
|
|
|
|
this.contextRunner.withUserConfiguration(DataSourceProxyConfiguration.class)
|
|
|
|
.withPropertyValues(
|
|
|
|
.withPropertyValues(
|
|
|
|
"spring.datasource.type=" + DataSource.class.getName(),
|
|
|
|
"spring.datasource.type=" + DataSource.class.getName(),
|
|
|
|
"spring.datasource.jmx-enabled=true")
|
|
|
|
"spring.datasource.tomcat.jmx-enabled=true")
|
|
|
|
.run((context) -> {
|
|
|
|
.run((context) -> {
|
|
|
|
assertThat(context).hasBean("dataSourceMBean");
|
|
|
|
assertThat(context).hasBean("dataSourceMBean");
|
|
|
|
assertThat(context).getBean("dataSourceMBean")
|
|
|
|
assertThat(context).getBean("dataSourceMBean")
|
|
|
@ -183,7 +183,7 @@ public class DataSourceJmxConfigurationTests {
|
|
|
|
this.contextRunner.withUserConfiguration(DataSourceDelegateConfiguration.class)
|
|
|
|
this.contextRunner.withUserConfiguration(DataSourceDelegateConfiguration.class)
|
|
|
|
.withPropertyValues(
|
|
|
|
.withPropertyValues(
|
|
|
|
"spring.datasource.type=" + DataSource.class.getName(),
|
|
|
|
"spring.datasource.type=" + DataSource.class.getName(),
|
|
|
|
"spring.datasource.jmx-enabled=true")
|
|
|
|
"spring.datasource.tomcat.jmx-enabled=true")
|
|
|
|
.run((context) -> {
|
|
|
|
.run((context) -> {
|
|
|
|
assertThat(context).hasBean("dataSourceMBean");
|
|
|
|
assertThat(context).hasBean("dataSourceMBean");
|
|
|
|
assertThat(context).getBean("dataSourceMBean")
|
|
|
|
assertThat(context).getBean("dataSourceMBean")
|
|
|
|