diff --git a/spring-tx/src/main/java/org/springframework/transaction/annotation/EnableTransactionManagement.java b/spring-tx/src/main/java/org/springframework/transaction/annotation/EnableTransactionManagement.java
index e5e23cd7d49..1f4a2db53ea 100644
--- a/spring-tx/src/main/java/org/springframework/transaction/annotation/EnableTransactionManagement.java
+++ b/spring-tx/src/main/java/org/springframework/transaction/annotation/EnableTransactionManagement.java
@@ -85,14 +85,14 @@ import org.springframework.core.Ordered;
* In both of the scenarios above, {@code @EnableTransactionManagement} and {@code
*
A minor difference between the two examples lies in the naming of the {@code
* TransactionManager} bean: In the {@code @Bean} case, the name is
* "txManager" (per the name of the method); in the XML case, the name is
- * "transactionManager". The {@code
This can either point to a traditional {@link PlatformTransactionManager} or a * {@link ReactiveTransactionManager} for reactive transaction management. */ public void setTransactionManagerBeanName(@Nullable String transactionManagerBeanName) { @@ -209,7 +209,7 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init /** * Specify the default transaction manager to use to drive transactions. - * This can either be a traditional {@link PlatformTransactionManager} or a + *
This can either be a traditional {@link PlatformTransactionManager} or a * {@link ReactiveTransactionManager} for reactive transaction management. *
The default transaction manager will be used if a qualifier * has not been declared for a given transaction or if an explicit name for the @@ -222,7 +222,7 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init /** * Return the default transaction manager, or {@code null} if unknown. - * This can either be a traditional {@link PlatformTransactionManager} or a + *
This can either be a traditional {@link PlatformTransactionManager} or a * {@link ReactiveTransactionManager} for reactive transaction management. */ @Nullable diff --git a/spring-tx/src/test/java/org/springframework/transaction/annotation/EnableTransactionManagementTests.java b/spring-tx/src/test/java/org/springframework/transaction/annotation/EnableTransactionManagementTests.java index fd445526674..ddc6e0713c7 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/annotation/EnableTransactionManagementTests.java +++ b/spring-tx/src/test/java/org/springframework/transaction/annotation/EnableTransactionManagementTests.java @@ -35,6 +35,7 @@ import org.springframework.context.annotation.Primary; import org.springframework.core.type.AnnotatedTypeMetadata; import org.springframework.stereotype.Service; import org.springframework.transaction.PlatformTransactionManager; +import org.springframework.transaction.TransactionManager; import org.springframework.transaction.config.TransactionManagementConfigUtils; import org.springframework.transaction.event.TransactionalEventListenerFactory; import org.springframework.transaction.testfixture.CallCountingTransactionManager; @@ -106,6 +107,7 @@ public class EnableTransactionManagementTests { public void txManagerIsResolvedCorrectlyWhenMultipleManagersArePresent() { AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext( EnableTxConfig.class, MultiTxManagerConfig.class); + assertThat(ctx.getBeansOfType(TransactionManager.class)).hasSize(2); TransactionalTestBean bean = ctx.getBean(TransactionalTestBean.class); CallCountingTransactionManager txManager = ctx.getBean("txManager", CallCountingTransactionManager.class); CallCountingTransactionManager txManager2 = ctx.getBean("txManager2", CallCountingTransactionManager.class); @@ -126,6 +128,7 @@ public class EnableTransactionManagementTests { public void txManagerIsResolvedCorrectlyWhenMultipleManagersArePresentAndOneIsPrimary() { AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext( EnableTxConfig.class, PrimaryMultiTxManagerConfig.class); + assertThat(ctx.getBeansOfType(TransactionManager.class)).hasSize(2); TransactionalTestBean bean = ctx.getBean(TransactionalTestBean.class); CallCountingTransactionManager primary = ctx.getBean("primary", CallCountingTransactionManager.class); CallCountingTransactionManager txManager2 = ctx.getBean("txManager2", CallCountingTransactionManager.class); @@ -147,6 +150,7 @@ public class EnableTransactionManagementTests { public void txManagerIsResolvedCorrectlyWithTxMgmtConfigurerAndPrimaryPresent() { AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext( EnableTxConfig.class, PrimaryTxManagerAndTxMgmtConfigurerConfig.class); + assertThat(ctx.getBeansOfType(TransactionManager.class)).hasSize(2); TransactionalTestBean bean = ctx.getBean(TransactionalTestBean.class); CallCountingTransactionManager primary = ctx.getBean("primary", CallCountingTransactionManager.class); CallCountingTransactionManager annotationDriven = ctx.getBean("annotationDrivenTransactionManager", CallCountingTransactionManager.class);