This commit is contained in:
Looly
2021-11-19 02:38:12 +08:00
parent 0694891f5b
commit 1efa09d8ad
4 changed files with 129 additions and 8 deletions

View File

@@ -0,0 +1,21 @@
package cn.hutool.cache;
import cn.hutool.cache.impl.WeakCache;
import org.junit.Assert;
import org.junit.Test;
public class WeakCacheTest {
@Test
public void removeTest(){
final WeakCache<String, String> cache = new WeakCache<>(-1);
cache.put("abc", "123");
cache.put("def", "456");
Assert.assertEquals(2, cache.size());
cache.remove("abc");
Assert.assertEquals(1, cache.size());
}
}