mirror of
https://github.com/LamGC/ContentGrabbingJi.git
synced 2025-04-29 14:17:33 +00:00
[Update][Fix] CacheStore-Redis 增加测试细节, 修复 RedisMap 中 'putAll()' 方法非空检查失败导致发生异常的问题;
[Update] RedisMapCacheStoreTest 增加对 'putAll()' 参数传递空 Map 的测试; [Fix] RedisMapCacheStore 修复因条件错误导致未能准确排除空 Map 的问题;
This commit is contained in:
parent
75458dd999
commit
37689f7253
@ -110,7 +110,7 @@ public class RedisMapCacheStore<V> extends RedisCacheStore<Map<String, V>> imple
|
||||
public boolean putAll(CacheKey key, Map<String, V> map) {
|
||||
Objects.requireNonNull(key);
|
||||
Objects.requireNonNull(map);
|
||||
if (map.size() == 0 && exists(key)) {
|
||||
if (map.size() == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -135,6 +135,9 @@ public class RedisMapCacheStoreTest {
|
||||
Assert.assertTrue("clearMap operation failed!", cacheStore.clearMap(key));
|
||||
|
||||
// putAll
|
||||
// empty map
|
||||
Assert.assertTrue(cacheStore.putAll(key, new HashMap<>()));
|
||||
// non-empty map
|
||||
Assert.assertTrue(cacheStore.putAll(key, expectedMap));
|
||||
Assert.assertTrue(expectedMap.keySet().containsAll(cacheStore.mapFieldSet(key)));
|
||||
Assert.assertTrue(expectedMap.values().containsAll(cacheStore.mapValueSet(key)));
|
||||
|
Loading…
Reference in New Issue
Block a user