@EnableTransactionManagement and co get detected on superclasses as well
Issue: SPR-10864
This commit is contained in:
@@ -52,6 +52,17 @@ public class EnableTransactionManagementTests {
|
||||
assertThat("Stereotype annotation not visible", services.containsKey("testBean"), is(true));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void transactionProxyIsCreatedWithEnableOnSuperclass() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
ctx.register(InheritedEnableTxConfig.class, TxManagerConfig.class);
|
||||
ctx.refresh();
|
||||
TransactionalTestBean bean = ctx.getBean(TransactionalTestBean.class);
|
||||
assertThat("testBean is not a proxy", AopUtils.isAopProxy(bean), is(true));
|
||||
Map<?,?> services = ctx.getBeansWithAnnotation(Service.class);
|
||||
assertThat("Stereotype annotation not visible", services.containsKey("testBean"), is(true));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void txManagerIsResolvedOnInvocationOfTransactionalMethod() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
@@ -97,6 +108,11 @@ public class EnableTransactionManagementTests {
|
||||
}
|
||||
|
||||
|
||||
@Configuration
|
||||
static class InheritedEnableTxConfig extends EnableTxConfig {
|
||||
}
|
||||
|
||||
|
||||
@Configuration
|
||||
@EnableTransactionManagement(mode=AdviceMode.ASPECTJ)
|
||||
static class EnableAspectJTxConfig {
|
||||
|
||||
Reference in New Issue
Block a user