SPR-8730
+ more tests
This commit is contained in:
@@ -20,13 +20,11 @@ import static org.junit.Assert.*;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.springframework.aop.framework.AopProxyUtils;
|
||||
import org.springframework.cache.Cache;
|
||||
import org.springframework.cache.CacheManager;
|
||||
import org.springframework.cache.interceptor.CacheInterceptor;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
|
||||
@@ -286,10 +284,4 @@ public abstract class AbstractAnnotationTests {
|
||||
public void testClassUncheckedException() throws Exception {
|
||||
testUncheckedThrowable(ccs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testKeyStrategy() throws Exception {
|
||||
CacheInterceptor bean = ctx.getBean("cacheAdviceClass", CacheInterceptor.class);
|
||||
Assert.assertSame(ctx.getBean("keyGenerator"), bean.getKeyGenerator());
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,11 @@
|
||||
|
||||
package org.springframework.cache.config;
|
||||
|
||||
import junit.framework.Assert;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.cache.interceptor.CacheInterceptor;
|
||||
|
||||
|
||||
/**
|
||||
* @author Costin Leau
|
||||
@@ -27,4 +32,10 @@ public class AnnotationNamespaceDrivenTests extends AbstractAnnotationTests {
|
||||
return "/org/springframework/cache/config/annotationDrivenCacheNamespace.xml";
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testKeyStrategy() throws Exception {
|
||||
CacheInterceptor ci = ctx.getBean("org.springframework.cache.interceptor.CacheInterceptor#0",
|
||||
CacheInterceptor.class);
|
||||
Assert.assertSame(ctx.getBean("keyGenerator"), ci.getKeyGenerator());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package org.springframework.cache.config;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @author Costin Leau
|
||||
*/
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
|
||||
package org.springframework.cache.config;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.springframework.cache.interceptor.CacheInterceptor;
|
||||
|
||||
|
||||
/**
|
||||
* @author Costin Leau
|
||||
@@ -27,4 +31,10 @@ public class CacheAdviceNamespaceTests extends AbstractAnnotationTests {
|
||||
protected String getConfig() {
|
||||
return "/org/springframework/cache/config/cache-advice.xml";
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testKeyStrategy() throws Exception {
|
||||
CacheInterceptor bean = ctx.getBean("cacheAdviceClass", CacheInterceptor.class);
|
||||
Assert.assertSame(ctx.getBean("keyGenerator"), bean.getKeyGenerator());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user