提交 7cf98261 编写于 作者: J Juergen Hoeller

Polishing

上级 247ec572
...@@ -130,8 +130,8 @@ public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFac ...@@ -130,8 +130,8 @@ public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFac
protected static AspectJAnnotation<?> findAspectJAnnotationOnMethod(Method method) { protected static AspectJAnnotation<?> findAspectJAnnotationOnMethod(Method method) {
Class<?>[] classesToLookFor = new Class<?>[] { Class<?>[] classesToLookFor = new Class<?>[] {
Before.class, Around.class, After.class, AfterReturning.class, AfterThrowing.class, Pointcut.class}; Before.class, Around.class, After.class, AfterReturning.class, AfterThrowing.class, Pointcut.class};
for (Class<?> c : classesToLookFor) { for (Class<?> clazz : classesToLookFor) {
AspectJAnnotation<?> foundAnnotation = findAnnotation(method, (Class<Annotation>) c); AspectJAnnotation<?> foundAnnotation = findAnnotation(method, (Class<Annotation>) clazz);
if (foundAnnotation != null) { if (foundAnnotation != null) {
return foundAnnotation; return foundAnnotation;
} }
......
...@@ -131,9 +131,14 @@ public class AnnotationCacheOperationSource extends AbstractFallbackCacheOperati ...@@ -131,9 +131,14 @@ public class AnnotationCacheOperationSource extends AbstractFallbackCacheOperati
Collection<CacheOperation> annOps = provider.getCacheOperations(annotationParser); Collection<CacheOperation> annOps = provider.getCacheOperations(annotationParser);
if (annOps != null) { if (annOps != null) {
if (ops == null) { if (ops == null) {
ops = new ArrayList<>(); ops = annOps;
}
else {
Collection<CacheOperation> combined = new ArrayList<>(ops.size() + annOps.size());
combined.addAll(ops);
combined.addAll(annOps);
ops = combined;
} }
ops.addAll(annOps);
} }
} }
return ops; return ops;
......
...@@ -159,7 +159,7 @@ public abstract class AnnotationConfigUtils { ...@@ -159,7 +159,7 @@ public abstract class AnnotationConfigUtils {
} }
} }
Set<BeanDefinitionHolder> beanDefs = new LinkedHashSet<>(4); Set<BeanDefinitionHolder> beanDefs = new LinkedHashSet<>(8);
if (!registry.containsBeanDefinition(CONFIGURATION_ANNOTATION_PROCESSOR_BEAN_NAME)) { if (!registry.containsBeanDefinition(CONFIGURATION_ANNOTATION_PROCESSOR_BEAN_NAME)) {
RootBeanDefinition def = new RootBeanDefinition(ConfigurationClassPostProcessor.class); RootBeanDefinition def = new RootBeanDefinition(ConfigurationClassPostProcessor.class);
...@@ -200,6 +200,7 @@ public abstract class AnnotationConfigUtils { ...@@ -200,6 +200,7 @@ public abstract class AnnotationConfigUtils {
def.setSource(source); def.setSource(source);
beanDefs.add(registerPostProcessor(registry, def, EVENT_LISTENER_PROCESSOR_BEAN_NAME)); beanDefs.add(registerPostProcessor(registry, def, EVENT_LISTENER_PROCESSOR_BEAN_NAME));
} }
if (!registry.containsBeanDefinition(EVENT_LISTENER_FACTORY_BEAN_NAME)) { if (!registry.containsBeanDefinition(EVENT_LISTENER_FACTORY_BEAN_NAME)) {
RootBeanDefinition def = new RootBeanDefinition(DefaultEventListenerFactory.class); RootBeanDefinition def = new RootBeanDefinition(DefaultEventListenerFactory.class);
def.setSource(source); def.setSource(source);
......
...@@ -24,6 +24,7 @@ import org.springframework.core.Ordered; ...@@ -24,6 +24,7 @@ import org.springframework.core.Ordered;
/** /**
* Default {@link EventListenerFactory} implementation that supports the * Default {@link EventListenerFactory} implementation that supports the
* regular {@link EventListener} annotation. * regular {@link EventListener} annotation.
*
* <p>Used as "catch-all" implementation by default. * <p>Used as "catch-all" implementation by default.
* *
* @author Stephane Nicoll * @author Stephane Nicoll
...@@ -33,14 +34,16 @@ public class DefaultEventListenerFactory implements EventListenerFactory, Ordere ...@@ -33,14 +34,16 @@ public class DefaultEventListenerFactory implements EventListenerFactory, Ordere
private int order = LOWEST_PRECEDENCE; private int order = LOWEST_PRECEDENCE;
public void setOrder(int order) {
this.order = order;
}
@Override @Override
public int getOrder() { public int getOrder() {
return this.order; return this.order;
} }
public void setOrder(int order) {
this.order = order;
}
public boolean supportsMethod(Method method) { public boolean supportsMethod(Method method) {
return true; return true;
......
...@@ -67,20 +67,20 @@ public class HandlerMethodAnnotationDetectionTests { ...@@ -67,20 +67,20 @@ public class HandlerMethodAnnotationDetectionTests {
public static Object[][] handlerTypes() { public static Object[][] handlerTypes() {
return new Object[][] { return new Object[][] {
{ SimpleController.class, true }, // CGLib proxy { SimpleController.class, true }, // CGLIB proxy
{ SimpleController.class, false }, { SimpleController.class, false },
{ AbstractClassController.class, true }, // CGLib proxy { AbstractClassController.class, true }, // CGLIB proxy
{ AbstractClassController.class, false }, { AbstractClassController.class, false },
{ ParameterizedAbstractClassController.class, true }, // CGLib proxy { ParameterizedAbstractClassController.class, true }, // CGLIB proxy
{ ParameterizedAbstractClassController.class, false }, { ParameterizedAbstractClassController.class, false },
{ ParameterizedSubclassOverridesDefaultMappings.class, true }, // CGLib proxy { ParameterizedSubclassOverridesDefaultMappings.class, true }, // CGLIB proxy
{ ParameterizedSubclassOverridesDefaultMappings.class, false }, { ParameterizedSubclassOverridesDefaultMappings.class, false },
// TODO [SPR-9517] Enable ParameterizedSubclassDoesNotOverrideConcreteImplementationsFromGenericAbstractSuperclass test cases // TODO [SPR-9517] Enable ParameterizedSubclassDoesNotOverrideConcreteImplementationsFromGenericAbstractSuperclass test cases
// { ParameterizedSubclassDoesNotOverrideConcreteImplementationsFromGenericAbstractSuperclass.class, true }, // CGLib proxy // { ParameterizedSubclassDoesNotOverrideConcreteImplementationsFromGenericAbstractSuperclass.class, true }, // CGLIB proxy
// { ParameterizedSubclassDoesNotOverrideConcreteImplementationsFromGenericAbstractSuperclass.class, false }, // { ParameterizedSubclassDoesNotOverrideConcreteImplementationsFromGenericAbstractSuperclass.class, false },
{ InterfaceController.class, true }, // JDK dynamic proxy { InterfaceController.class, true }, // JDK dynamic proxy
...@@ -88,7 +88,7 @@ public class HandlerMethodAnnotationDetectionTests { ...@@ -88,7 +88,7 @@ public class HandlerMethodAnnotationDetectionTests {
{ ParameterizedInterfaceController.class, false }, // no AOP { ParameterizedInterfaceController.class, false }, // no AOP
{ SupportClassController.class, true }, // CGLib proxy { SupportClassController.class, true }, // CGLIB proxy
{ SupportClassController.class, false } { SupportClassController.class, false }
}; };
...@@ -100,7 +100,8 @@ public class HandlerMethodAnnotationDetectionTests { ...@@ -100,7 +100,8 @@ public class HandlerMethodAnnotationDetectionTests {
private ExceptionHandlerExceptionResolver exceptionResolver = new ExceptionHandlerExceptionResolver(); private ExceptionHandlerExceptionResolver exceptionResolver = new ExceptionHandlerExceptionResolver();
public HandlerMethodAnnotationDetectionTests(final Class<?> controllerType, boolean useAutoProxy) {
public HandlerMethodAnnotationDetectionTests(Class<?> controllerType, boolean useAutoProxy) {
GenericWebApplicationContext context = new GenericWebApplicationContext(); GenericWebApplicationContext context = new GenericWebApplicationContext();
context.registerBeanDefinition("controller", new RootBeanDefinition(controllerType)); context.registerBeanDefinition("controller", new RootBeanDefinition(controllerType));
context.registerBeanDefinition("handlerMapping", new RootBeanDefinition(RequestMappingHandlerMapping.class)); context.registerBeanDefinition("handlerMapping", new RootBeanDefinition(RequestMappingHandlerMapping.class));
...@@ -120,12 +121,6 @@ public class HandlerMethodAnnotationDetectionTests { ...@@ -120,12 +121,6 @@ public class HandlerMethodAnnotationDetectionTests {
context.close(); context.close();
} }
class TestPointcut extends StaticMethodMatcherPointcut {
@Override
public boolean matches(Method method, @Nullable Class<?> clazz) {
return method.getName().equals("hashCode");
}
}
@Test @Test
public void testRequestMappingMethod() throws Exception { public void testRequestMappingMethod() throws Exception {
...@@ -203,9 +198,9 @@ public class HandlerMethodAnnotationDetectionTests { ...@@ -203,9 +198,9 @@ public class HandlerMethodAnnotationDetectionTests {
public abstract String handleException(Exception exception); public abstract String handleException(Exception exception);
} }
/** /**
* CONTROLLER WITH ABSTRACT CLASS * CONTROLLER WITH ABSTRACT CLASS
*
* <p>All annotations can be on methods in the abstract class except parameter annotations. * <p>All annotations can be on methods in the abstract class except parameter annotations.
*/ */
static class AbstractClassController extends MappingAbstractClass { static class AbstractClassController extends MappingAbstractClass {
...@@ -232,10 +227,10 @@ public class HandlerMethodAnnotationDetectionTests { ...@@ -232,10 +227,10 @@ public class HandlerMethodAnnotationDetectionTests {
} }
} }
// SPR-9374
// SPR-9374
@RequestMapping @RequestMapping
static interface MappingInterface { interface MappingInterface {
@InitBinder @InitBinder
void initBinder(WebDataBinder dataBinder, @RequestParam("datePattern") String thePattern); void initBinder(WebDataBinder dataBinder, @RequestParam("datePattern") String thePattern);
...@@ -252,14 +247,11 @@ public class HandlerMethodAnnotationDetectionTests { ...@@ -252,14 +247,11 @@ public class HandlerMethodAnnotationDetectionTests {
String handleException(Exception exception); String handleException(Exception exception);
} }
/** /**
* CONTROLLER WITH INTERFACE * CONTROLLER WITH INTERFACE
* * <p>JDK Dynamic proxy: All annotations must be on the interface.
* JDK Dynamic proxy: * <p>Without AOP: Annotations can be on interface methods except parameter annotations.
* All annotations must be on the interface.
*
* Without AOP:
* Annotations can be on interface methods except parameter annotations.
*/ */
static class InterfaceController implements MappingInterface { static class InterfaceController implements MappingInterface {
...@@ -304,9 +296,9 @@ public class HandlerMethodAnnotationDetectionTests { ...@@ -304,9 +296,9 @@ public class HandlerMethodAnnotationDetectionTests {
public abstract String handleException(Exception exception); public abstract String handleException(Exception exception);
} }
/** /**
* CONTROLLER WITH PARAMETERIZED BASE CLASS * CONTROLLER WITH PARAMETERIZED BASE CLASS
*
* <p>All annotations can be on methods in the abstract class except parameter annotations. * <p>All annotations can be on methods in the abstract class except parameter annotations.
*/ */
static class ParameterizedAbstractClassController extends MappingGenericAbstractClass<String, Date, Date> { static class ParameterizedAbstractClassController extends MappingGenericAbstractClass<String, Date, Date> {
...@@ -333,6 +325,7 @@ public class HandlerMethodAnnotationDetectionTests { ...@@ -333,6 +325,7 @@ public class HandlerMethodAnnotationDetectionTests {
} }
} }
@Controller @Controller
static abstract class MappedGenericAbstractClassWithConcreteImplementations<A, B, C> { static abstract class MappedGenericAbstractClassWithConcreteImplementations<A, B, C> {
...@@ -353,6 +346,7 @@ public class HandlerMethodAnnotationDetectionTests { ...@@ -353,6 +346,7 @@ public class HandlerMethodAnnotationDetectionTests {
public abstract String handleException(Exception exception); public abstract String handleException(Exception exception);
} }
static class ParameterizedSubclassDoesNotOverrideConcreteImplementationsFromGenericAbstractSuperclass extends static class ParameterizedSubclassDoesNotOverrideConcreteImplementationsFromGenericAbstractSuperclass extends
MappedGenericAbstractClassWithConcreteImplementations<String, Date, Date> { MappedGenericAbstractClassWithConcreteImplementations<String, Date, Date> {
...@@ -375,6 +369,7 @@ public class HandlerMethodAnnotationDetectionTests { ...@@ -375,6 +369,7 @@ public class HandlerMethodAnnotationDetectionTests {
} }
} }
@Controller @Controller
static abstract class GenericAbstractClassDeclaresDefaultMappings<A, B, C> { static abstract class GenericAbstractClassDeclaresDefaultMappings<A, B, C> {
...@@ -395,6 +390,7 @@ public class HandlerMethodAnnotationDetectionTests { ...@@ -395,6 +390,7 @@ public class HandlerMethodAnnotationDetectionTests {
public abstract String handleException(Exception exception); public abstract String handleException(Exception exception);
} }
static class ParameterizedSubclassOverridesDefaultMappings static class ParameterizedSubclassOverridesDefaultMappings
extends GenericAbstractClassDeclaresDefaultMappings<String, Date, Date> { extends GenericAbstractClassDeclaresDefaultMappings<String, Date, Date> {
...@@ -425,8 +421,9 @@ public class HandlerMethodAnnotationDetectionTests { ...@@ -425,8 +421,9 @@ public class HandlerMethodAnnotationDetectionTests {
} }
} }
@RequestMapping @RequestMapping
static interface MappingGenericInterface<A, B, C> { interface MappingGenericInterface<A, B, C> {
@InitBinder @InitBinder
void initBinder(WebDataBinder dataBinder, A thePattern); void initBinder(WebDataBinder dataBinder, A thePattern);
...@@ -443,11 +440,10 @@ public class HandlerMethodAnnotationDetectionTests { ...@@ -443,11 +440,10 @@ public class HandlerMethodAnnotationDetectionTests {
String handleException(Exception exception); String handleException(Exception exception);
} }
/** /**
* CONTROLLER WITH PARAMETERIZED INTERFACE * CONTROLLER WITH PARAMETERIZED INTERFACE
*
* <p>All annotations can be on interface except parameter annotations. * <p>All annotations can be on interface except parameter annotations.
*
* <p>Cannot be used as JDK dynamic proxy since parameterized interface does not contain type information. * <p>Cannot be used as JDK dynamic proxy since parameterized interface does not contain type information.
*/ */
static class ParameterizedInterfaceController implements MappingGenericInterface<String, Date, Date> { static class ParameterizedInterfaceController implements MappingGenericInterface<String, Date, Date> {
...@@ -483,7 +479,6 @@ public class HandlerMethodAnnotationDetectionTests { ...@@ -483,7 +479,6 @@ public class HandlerMethodAnnotationDetectionTests {
/** /**
* SPR-8248 * SPR-8248
*
* <p>Support class contains all annotations. Subclass has type-level @{@link RequestMapping}. * <p>Support class contains all annotations. Subclass has type-level @{@link RequestMapping}.
*/ */
@Controller @Controller
......
/* /*
* Copyright 2002-2014 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -70,6 +70,7 @@ public class EnableCachingIntegrationTests { ...@@ -70,6 +70,7 @@ public class EnableCachingIntegrationTests {
} }
} }
private void assertCacheProxying(AnnotationConfigApplicationContext ctx) { private void assertCacheProxying(AnnotationConfigApplicationContext ctx) {
FooRepository repo = ctx.getBean(FooRepository.class); FooRepository repo = ctx.getBean(FooRepository.class);
...@@ -89,6 +90,7 @@ public class EnableCachingIntegrationTests { ...@@ -89,6 +90,7 @@ public class EnableCachingIntegrationTests {
@Configuration @Configuration
@EnableCaching(proxyTargetClass=true) @EnableCaching(proxyTargetClass=true)
static class ProxyTargetClassCachingConfig { static class ProxyTargetClassCachingConfig {
@Bean @Bean
CacheManager mgr() { CacheManager mgr() {
return new NoOpCacheManager(); return new NoOpCacheManager();
...@@ -98,6 +100,7 @@ public class EnableCachingIntegrationTests { ...@@ -98,6 +100,7 @@ public class EnableCachingIntegrationTests {
@Configuration @Configuration
static class Config { static class Config {
@Bean @Bean
FooRepository fooRepository() { FooRepository fooRepository() {
return new DummyFooRepository(); return new DummyFooRepository();
...@@ -108,6 +111,7 @@ public class EnableCachingIntegrationTests { ...@@ -108,6 +111,7 @@ public class EnableCachingIntegrationTests {
@Configuration @Configuration
@EnableCaching(mode=AdviceMode.ASPECTJ) @EnableCaching(mode=AdviceMode.ASPECTJ)
static class AspectJCacheConfig { static class AspectJCacheConfig {
@Bean @Bean
CacheManager cacheManager() { CacheManager cacheManager() {
return new NoOpCacheManager(); return new NoOpCacheManager();
...@@ -116,6 +120,7 @@ public class EnableCachingIntegrationTests { ...@@ -116,6 +120,7 @@ public class EnableCachingIntegrationTests {
interface FooRepository { interface FooRepository {
List<Object> findAll(); List<Object> findAll();
} }
...@@ -129,4 +134,5 @@ public class EnableCachingIntegrationTests { ...@@ -129,4 +134,5 @@ public class EnableCachingIntegrationTests {
return Collections.emptyList(); return Collections.emptyList();
} }
} }
} }
...@@ -166,10 +166,30 @@ public class EnableTransactionManagementIntegrationTests { ...@@ -166,10 +166,30 @@ public class EnableTransactionManagementIntegrationTests {
} }
private void assertTxProxying(AnnotationConfigApplicationContext ctx) {
FooRepository repo = ctx.getBean(FooRepository.class);
boolean isTxProxy = false;
if (AopUtils.isAopProxy(repo)) {
for (Advisor advisor : ((Advised)repo).getAdvisors()) {
if (advisor instanceof BeanFactoryTransactionAttributeSourceAdvisor) {
isTxProxy = true;
break;
}
}
}
assertTrue("FooRepository is not a TX proxy", isTxProxy);
// trigger a transaction
repo.findAll();
}
@Configuration @Configuration
@EnableTransactionManagement @EnableTransactionManagement
@ImportResource("org/springframework/transaction/annotation/enable-caching.xml") @ImportResource("org/springframework/transaction/annotation/enable-caching.xml")
static class EnableTxAndCachingConfig { static class EnableTxAndCachingConfig {
@Bean @Bean
public PlatformTransactionManager txManager() { public PlatformTransactionManager txManager() {
return new CallCountingTransactionManager(); return new CallCountingTransactionManager();
...@@ -194,6 +214,7 @@ public class EnableTransactionManagementIntegrationTests { ...@@ -194,6 +214,7 @@ public class EnableTransactionManagementIntegrationTests {
@Configuration @Configuration
@EnableTransactionManagement @EnableTransactionManagement
static class ImplicitTxManagerConfig { static class ImplicitTxManagerConfig {
@Bean @Bean
public PlatformTransactionManager txManager() { public PlatformTransactionManager txManager() {
return new CallCountingTransactionManager(); return new CallCountingTransactionManager();
...@@ -209,6 +230,7 @@ public class EnableTransactionManagementIntegrationTests { ...@@ -209,6 +230,7 @@ public class EnableTransactionManagementIntegrationTests {
@Configuration @Configuration
@EnableTransactionManagement @EnableTransactionManagement
static class ExplicitTxManagerConfig implements TransactionManagementConfigurer { static class ExplicitTxManagerConfig implements TransactionManagementConfigurer {
@Bean @Bean
public PlatformTransactionManager txManager1() { public PlatformTransactionManager txManager1() {
return new CallCountingTransactionManager(); return new CallCountingTransactionManager();
...@@ -230,28 +252,11 @@ public class EnableTransactionManagementIntegrationTests { ...@@ -230,28 +252,11 @@ public class EnableTransactionManagementIntegrationTests {
} }
} }
private void assertTxProxying(AnnotationConfigApplicationContext ctx) {
FooRepository repo = ctx.getBean(FooRepository.class);
boolean isTxProxy = false;
if (AopUtils.isAopProxy(repo)) {
for (Advisor advisor : ((Advised)repo).getAdvisors()) {
if (advisor instanceof BeanFactoryTransactionAttributeSourceAdvisor) {
isTxProxy = true;
break;
}
}
}
assertTrue("FooRepository is not a TX proxy", isTxProxy);
// trigger a transaction
repo.findAll();
}
@Configuration @Configuration
@EnableTransactionManagement @EnableTransactionManagement
static class DefaultTxManagerNameConfig { static class DefaultTxManagerNameConfig {
@Bean @Bean
PlatformTransactionManager transactionManager(DataSource dataSource) { PlatformTransactionManager transactionManager(DataSource dataSource) {
return new DataSourceTransactionManager(dataSource); return new DataSourceTransactionManager(dataSource);
...@@ -262,6 +267,7 @@ public class EnableTransactionManagementIntegrationTests { ...@@ -262,6 +267,7 @@ public class EnableTransactionManagementIntegrationTests {
@Configuration @Configuration
@EnableTransactionManagement @EnableTransactionManagement
static class CustomTxManagerNameConfig { static class CustomTxManagerNameConfig {
@Bean @Bean
PlatformTransactionManager txManager(DataSource dataSource) { PlatformTransactionManager txManager(DataSource dataSource) {
return new DataSourceTransactionManager(dataSource); return new DataSourceTransactionManager(dataSource);
...@@ -272,6 +278,7 @@ public class EnableTransactionManagementIntegrationTests { ...@@ -272,6 +278,7 @@ public class EnableTransactionManagementIntegrationTests {
@Configuration @Configuration
@EnableTransactionManagement @EnableTransactionManagement
static class NonConventionalTxManagerNameConfig { static class NonConventionalTxManagerNameConfig {
@Bean @Bean
PlatformTransactionManager txManager(DataSource dataSource) { PlatformTransactionManager txManager(DataSource dataSource) {
return new DataSourceTransactionManager(dataSource); return new DataSourceTransactionManager(dataSource);
...@@ -282,6 +289,7 @@ public class EnableTransactionManagementIntegrationTests { ...@@ -282,6 +289,7 @@ public class EnableTransactionManagementIntegrationTests {
@Configuration @Configuration
@EnableTransactionManagement(proxyTargetClass=true) @EnableTransactionManagement(proxyTargetClass=true)
static class ProxyTargetClassTxConfig { static class ProxyTargetClassTxConfig {
@Bean @Bean
PlatformTransactionManager transactionManager(DataSource dataSource) { PlatformTransactionManager transactionManager(DataSource dataSource) {
return new DataSourceTransactionManager(dataSource); return new DataSourceTransactionManager(dataSource);
...@@ -292,6 +300,7 @@ public class EnableTransactionManagementIntegrationTests { ...@@ -292,6 +300,7 @@ public class EnableTransactionManagementIntegrationTests {
@Configuration @Configuration
@EnableTransactionManagement(mode=AdviceMode.ASPECTJ) @EnableTransactionManagement(mode=AdviceMode.ASPECTJ)
static class AspectJTxConfig { static class AspectJTxConfig {
@Bean @Bean
PlatformTransactionManager transactionManager(DataSource dataSource) { PlatformTransactionManager transactionManager(DataSource dataSource) {
return new DataSourceTransactionManager(dataSource); return new DataSourceTransactionManager(dataSource);
...@@ -301,6 +310,7 @@ public class EnableTransactionManagementIntegrationTests { ...@@ -301,6 +310,7 @@ public class EnableTransactionManagementIntegrationTests {
@Configuration @Configuration
static class Config { static class Config {
@Bean @Bean
FooRepository fooRepository() { FooRepository fooRepository() {
JdbcFooRepository repos = new JdbcFooRepository(); JdbcFooRepository repos = new JdbcFooRepository();
...@@ -318,6 +328,7 @@ public class EnableTransactionManagementIntegrationTests { ...@@ -318,6 +328,7 @@ public class EnableTransactionManagementIntegrationTests {
interface FooRepository { interface FooRepository {
List<Object> findAll(); List<Object> findAll();
} }
...@@ -335,6 +346,7 @@ public class EnableTransactionManagementIntegrationTests { ...@@ -335,6 +346,7 @@ public class EnableTransactionManagementIntegrationTests {
} }
} }
@Repository @Repository
static class DummyFooRepository implements FooRepository { static class DummyFooRepository implements FooRepository {
...@@ -344,4 +356,5 @@ public class EnableTransactionManagementIntegrationTests { ...@@ -344,4 +356,5 @@ public class EnableTransactionManagementIntegrationTests {
return Collections.emptyList(); return Collections.emptyList();
} }
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册