Fix test for backing off when a TransactionManager is already defined

See gh-35336
pull/35401/head
davin111 2 years ago committed by Andy Wilkinson
parent 40a392f65b
commit cf5500fc78

@ -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,7 +77,7 @@ 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)
.hasBean("myTransactionManager"));

Loading…
Cancel
Save