update to Jackson 2.11.1

This commit is contained in:
Jörg Prante 2020-07-29 12:06:16 +02:00
parent 4151667da8
commit 3ee81143b0
4 changed files with 12 additions and 8 deletions

View file

@ -5,6 +5,7 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.io.StringReader;
import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
@ -40,7 +41,7 @@ public class PropertiesSettingsLoader implements SettingsLoader {
@Override
public Map<String, String> load(BytesReference ref) throws IOException {
Properties props = new Properties();
try (Reader reader = new InputStreamReader(ref.streamInput())) {
try (Reader reader = new InputStreamReader(ref.streamInput(), StandardCharsets.UTF_8)) {
props.load(reader);
Map<String, String> result = new HashMap<>();
for (Map.Entry<Object, Object> entry : props.entrySet()) {

View file

@ -2,6 +2,7 @@ package org.xbib.content.settings;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test;
import org.xbib.content.XContentHelper;
@ -180,10 +181,12 @@ public class SettingsTest {
@Test
public void testRefresher() throws Exception {
Settings settings = Settings.settingsBuilder()
.setRefresh(Paths.get("src/test/resources/settings.json"), 0L, 1L, TimeUnit.DAYS)
.put("name", "hello")
.setRefresh(Paths.get("src/test/resources/settings.json"), 1L, 1L, TimeUnit.SECONDS)
.build();
Thread.sleep(1000L);
assertEquals("Jörg Prante", settings.get("name"));
assertEquals("hello", settings.get("name"));
Thread.sleep(2000L);
assertEquals("world", settings.get("name"));
settings.close();
}
}

View file

@ -1,3 +1,3 @@
{
"name": "Jörg Prante"
"name": "world"
}

View file

@ -1,11 +1,11 @@
group = org.xbib
name = content
version = 2.3.1
version = 2.3.2
gradle.wrapper.version = 6.4.1
xbib.net.version = 2.1.0
jackson.version = 2.11.0
jackson.databind.version = 2.11.0
jackson.version = 2.11.1
jackson.databind.version = 2.11.1
woodstox.version = 6.2.1
snakeyaml.version = 1.26
mockito.version = 3.3.3