From 5206f5bc9a0e4721eb173c27549e2369d9a8d919 Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Thu, 21 Apr 2011 08:07:12 +0000 Subject: [PATCH] SPR-8238 + add NPE test --- .../cache/config/AbstractAnnotationTest.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/org.springframework.context/src/test/java/org/springframework/cache/config/AbstractAnnotationTest.java b/org.springframework.context/src/test/java/org/springframework/cache/config/AbstractAnnotationTest.java index 3ba54a5a4f..d6873e0729 100644 --- a/org.springframework.context/src/test/java/org/springframework/cache/config/AbstractAnnotationTest.java +++ b/org.springframework.context/src/test/java/org/springframework/cache/config/AbstractAnnotationTest.java @@ -148,6 +148,11 @@ public abstract class AbstractAnnotationTest { assertTrue(cache.containsKey(expectedKey)); } + public void testNullArg(CacheableService service) { + Object r1 = service.cache(null); + assertSame(r1, service.cache(null)); + } + @Test public void testCacheable() throws Exception { testCacheable(cs); @@ -226,4 +231,14 @@ public abstract class AbstractAnnotationTest { public void testClassRootVars() throws Exception { testRootVars(ccs); } + + @Test + public void testNullArg() throws Exception { + testNullArg(cs); + } + + @Test + public void testClassNullArg() throws Exception { + testNullArg(ccs); + } } \ No newline at end of file