mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix bug
This commit is contained in:
21
hutool-cache/src/test/java/cn/hutool/cache/WeakCacheTest.java
vendored
Normal file
21
hutool-cache/src/test/java/cn/hutool/cache/WeakCacheTest.java
vendored
Normal 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());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user