|
1 | 1 | package org.springframework.security.acls.jdbc;
|
2 | 2 |
|
3 | 3 | import org.junit.After;
|
4 |
| -import org.junit.AfterClass; |
5 | 4 | import org.junit.BeforeClass;
|
6 | 5 | import org.junit.Test;
|
7 | 6 | import org.springframework.cache.Cache;
|
|
17 | 16 | import org.springframework.security.core.context.SecurityContextHolder;
|
18 | 17 | import org.springframework.security.util.FieldUtils;
|
19 | 18 |
|
20 |
| -import java.io.*; |
21 | 19 | import java.util.Map;
|
22 | 20 |
|
23 | 21 | import static org.junit.Assert.*;
|
24 | 22 |
|
25 | 23 | /**
|
26 |
| - * Tests {@link org.springframework.security.acls.domain.EhCacheBasedAclCache} |
| 24 | + * Tests {@link org.springframework.security.acls.domain.SpringCacheBasedAclCache} |
27 | 25 | *
|
28 |
| - * @author Andrei Stefan |
| 26 | + * @author Marten Deinum |
29 | 27 | */
|
30 | 28 | public class SpringCacheBasedAclCacheTests {
|
31 | 29 | private static final String TARGET_CLASS = "org.springframework.security.acls.TargetObject";
|
@@ -55,6 +53,7 @@ public void constructorRejectsNullParameters() throws Exception {
|
55 | 53 | new SpringCacheBasedAclCache(null, null, null);
|
56 | 54 | }
|
57 | 55 |
|
| 56 | + @SuppressWarnings("rawtypes") |
58 | 57 | @Test
|
59 | 58 | public void cacheOperationsAclWithoutParent() throws Exception {
|
60 | 59 | Cache cache = getCache();
|
@@ -98,7 +97,7 @@ public void cacheOperationsAclWithoutParent() throws Exception {
|
98 | 97 | assertEquals(realCache.size(), 0);
|
99 | 98 | }
|
100 | 99 |
|
101 |
| - @SuppressWarnings("unchecked") |
| 100 | + @SuppressWarnings("rawtypes") |
102 | 101 | @Test
|
103 | 102 | public void cacheOperationsAclWithParent() throws Exception {
|
104 | 103 | Cache cache = getCache();
|
@@ -140,33 +139,4 @@ public void cacheOperationsAclWithParent() throws Exception {
|
140 | 139 | assertNotNull(FieldUtils.getFieldValue(parentAclFromCache, "aclAuthorizationStrategy"));
|
141 | 140 | assertEquals(parentAcl, myCache.getFromCache(identityParent));
|
142 | 141 | }
|
143 |
| - |
144 |
| - //~ Inner Classes ================================================================================================== |
145 |
| - |
146 |
| - private class MockCache implements Cache { |
147 |
| - |
148 |
| - @Override |
149 |
| - public String getName() { |
150 |
| - return "mockcache"; |
151 |
| - } |
152 |
| - |
153 |
| - @Override |
154 |
| - public Object getNativeCache() { |
155 |
| - return null; |
156 |
| - } |
157 |
| - |
158 |
| - @Override |
159 |
| - public ValueWrapper get(Object key) { |
160 |
| - return null; |
161 |
| - } |
162 |
| - |
163 |
| - @Override |
164 |
| - public void put(Object key, Object value) {} |
165 |
| - |
166 |
| - @Override |
167 |
| - public void evict(Object key) {} |
168 |
| - |
169 |
| - @Override |
170 |
| - public void clear() {} |
171 |
| - } |
172 | 142 | }
|
0 commit comments