diff --git a/spring-context-support/src/test/java/org/springframework/cache/jcache/interceptor/AnnotatedJCacheableService.java b/spring-context-support/src/test/java/org/springframework/cache/jcache/interceptor/AnnotatedJCacheableService.java index 94c84a202f..5ea84fa6b0 100644 --- a/spring-context-support/src/test/java/org/springframework/cache/jcache/interceptor/AnnotatedJCacheableService.java +++ b/spring-context-support/src/test/java/org/springframework/cache/jcache/interceptor/AnnotatedJCacheableService.java @@ -177,12 +177,6 @@ public class AnnotatedJCacheableService implements JCacheableService { public void noAnnotation() { } - @CacheRemove - @CacheRemoveAll - public void multiAnnotations() { - - } - @Override public long exceptionInvocations() { return exceptionCounter.get(); diff --git a/spring-context-support/src/test/java/org/springframework/cache/jcache/interceptor/AnnotationCacheOperationSourceTests.java b/spring-context-support/src/test/java/org/springframework/cache/jcache/interceptor/AnnotationCacheOperationSourceTests.java index ad16df23e3..f37184c422 100644 --- a/spring-context-support/src/test/java/org/springframework/cache/jcache/interceptor/AnnotationCacheOperationSourceTests.java +++ b/spring-context-support/src/test/java/org/springframework/cache/jcache/interceptor/AnnotationCacheOperationSourceTests.java @@ -25,6 +25,8 @@ import java.util.Comparator; import javax.cache.annotation.CacheDefaults; import javax.cache.annotation.CacheKeyGenerator; +import javax.cache.annotation.CacheRemove; +import javax.cache.annotation.CacheRemoveAll; import javax.cache.annotation.CacheResult; import org.junit.Before; @@ -105,7 +107,7 @@ public class AnnotationCacheOperationSourceTests extends AbstractJCacheTests { @Test public void multiAnnotations() { thrown.expect(IllegalStateException.class); - getCacheOperation(AnnotatedJCacheableService.class, name.getMethodName()); + getCacheOperation(InvalidCases.class, name.getMethodName()); } @Test @@ -259,4 +261,12 @@ public class AnnotationCacheOperationSourceTests extends AbstractJCacheTests { } } + static class InvalidCases { + + @CacheRemove + @CacheRemoveAll + public void multiAnnotations() { + } + } + }