LocalCacheStore implements CacheStore { @Override public <T> void putAll(List<Entry<T>> values, Duration expiration, CacheContext<T> context) { logger.debug("putAll, keys={}, expiration={}", new ArrayLogParam(keys(values)), expiration); long expirationTime = System.currentTimeMillis() + expiration.toMillis(); for (Entry<T> value : values) { caches.put(value.key, new CacheItem<>(value.value, expirationTime)); } }  @Override T get(String key, CacheContext<T> context); @Override Map<String, T> getAll(String[] keys, CacheContext<T> context); @Override void put(String key, T value, Duration expiration, CacheContext<T> context); @Override void putAll(List<Entry<T>> values, Duration expiration, CacheContext<T> context); @Override boolean delete(String... keys); void cleanup(); void clear(); public int maxSize; }
@Test void putAll() { var values = List.of(new CacheStore.Entry<>("key1", new TestCache()), new CacheStore.Entry<>("key2", new TestCache())); cacheStore.putAll(values, Duration.ofMinutes(1), null); assertThat(cacheStore.caches).hasSize(2); }