Merge branch '2.7.x' into 3.0.x

Closes gh-35361
pull/35611/head
Andy Wilkinson 2 years ago
commit 6c1c8fb405

@ -38,6 +38,7 @@ import static org.mockito.Mockito.mock;
* @author Dave Syer * @author Dave Syer
* @author Stephane Nicoll * @author Stephane Nicoll
* @author Kazuki Shimizu * @author Kazuki Shimizu
* @author Davin Byeon
*/ */
class DataSourceTransactionManagerAutoConfigurationTests { class DataSourceTransactionManagerAutoConfigurationTests {
@ -76,9 +77,10 @@ class DataSourceTransactionManagerAutoConfigurationTests {
@Test @Test
void transactionManagerWithExistingTransactionManagerIsNotOverridden() { void transactionManagerWithExistingTransactionManagerIsNotOverridden() {
this.contextRunner this.contextRunner.withConfiguration(AutoConfigurations.of(DataSourceAutoConfiguration.class))
.withBean("myTransactionManager", TransactionManager.class, () -> mock(TransactionManager.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")); .hasBean("myTransactionManager"));
} }

Loading…
Cancel
Save