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 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"));
}

Loading…
Cancel
Save