This commit is contained in:
Looly
2022-06-10 21:28:08 +08:00
parent c2c67338e7
commit abea2f5739
2 changed files with 9 additions and 1 deletions

View File

@@ -46,6 +46,14 @@ public class SimpleCacheTest {
Assert.assertEquals("value6", cache.get("key6", ()-> "value6"));
}
@Test
public void getWithPredicateTest(){
// 检查predicate空指针
final SimpleCache<String, String> cache = new SimpleCache<>();
final String value = cache.get("abc", (v)-> v.equals("1"), () -> "123");
Assert.assertEquals("123", value);
}
@Test
public void getConcurrencyTest(){
final SimpleCache<String, String> cache = new SimpleCache<>();