SEC-2114: Polishing Spring Based Cache

This commit is contained in:
Rob Winch
2013-01-04 11:12:08 -06:00
parent 01ea39ce35
commit 6b81f97081
6 changed files with 41 additions and 121 deletions

View File

@@ -61,9 +61,7 @@ public class SpringCacheBasedUserCacheTests {
@Test
public void cacheOperationsAreSuccessful() throws Exception {
SpringCacheBasedUserCache cache = new SpringCacheBasedUserCache();
cache.setCache(getCache());
cache.afterPropertiesSet();
SpringCacheBasedUserCache cache = new SpringCacheBasedUserCache(getCache());
// Check it gets stored in the cache
cache.putUserInCache(getUser());
@@ -80,13 +78,6 @@ public class SpringCacheBasedUserCacheTests {
@Test(expected = IllegalArgumentException.class)
public void startupDetectsMissingCache() throws Exception {
SpringCacheBasedUserCache cache = new SpringCacheBasedUserCache();
cache.afterPropertiesSet();
fail("Should have thrown IllegalArgumentException");
Cache myCache = getCache();
cache.setCache(myCache);
assertEquals(myCache, cache.getCache());
new SpringCacheBasedUserCache(null);
}
}