diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceTransactionManagerAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceTransactionManagerAutoConfigurationTests.java index a469c0495a..9004444043 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceTransactionManagerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceTransactionManagerAutoConfigurationTests.java @@ -38,6 +38,7 @@ import static org.mockito.Mockito.mock; * @author Dave Syer * @author Stephane Nicoll * @author Kazuki Shimizu + * @author Davin Byeon */ class DataSourceTransactionManagerAutoConfigurationTests { @@ -76,9 +77,10 @@ class DataSourceTransactionManagerAutoConfigurationTests { @Test void transactionManagerWithExistingTransactionManagerIsNotOverridden() { - this.contextRunner + this.contextRunner.withConfiguration(AutoConfigurations.of(DataSourceAutoConfiguration.class)) .withBean("myTransactionManager", TransactionManager.class, () -> mock(TransactionManager.class)) - .run((context) -> assertThat(context).hasSingleBean(TransactionManager.class) + .run((context) -> assertThat(context).hasSingleBean(DataSource.class) + .hasSingleBean(TransactionManager.class) .hasBean("myTransactionManager")); }