Upgrade to Jackson 2.8 RC1, Undertow 1.4 CR1, Netty 4.1.1

Issue: SPR-14340
Issue: SPR-14328
Issue: SPR-14143
This commit is contained in:
Juergen Hoeller
2016-06-08 09:47:51 +02:00
parent 981c894acf
commit 8fc84e2d6f
3 changed files with 9 additions and 10 deletions

View File

@@ -64,7 +64,6 @@ import com.fasterxml.jackson.databind.ser.std.ClassSerializer;
import com.fasterxml.jackson.databind.ser.std.NumberSerializer;
import com.fasterxml.jackson.databind.type.SimpleType;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import kotlin.ranges.IntRange;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
@@ -253,7 +252,7 @@ public class Jackson2ObjectMapperBuilderTests {
assertEquals(timestamp.toString(), new String(objectMapper.writeValueAsBytes(dateTime), "UTF-8"));
Path file = Paths.get("foo");
assertEquals("\"foo\"", new String(objectMapper.writeValueAsBytes(file), "UTF-8"));
assertTrue(new String(objectMapper.writeValueAsBytes(file), "UTF-8").endsWith("foo\""));
Optional<String> optional = Optional.of("test");
assertEquals("\"test\"", new String(objectMapper.writeValueAsBytes(optional), "UTF-8"));
@@ -263,7 +262,7 @@ public class Jackson2ObjectMapperBuilderTests {
assertEquals("{\"start\":1,\"end\":3}", new String(objectMapper.writeValueAsBytes(range), "UTF-8"));
}
@Test // SPR-12634
@Test // SPR-12634
public void customizeWellKnownModulesWithModule() throws JsonProcessingException, UnsupportedEncodingException {
ObjectMapper objectMapper = Jackson2ObjectMapperBuilder.json()
.modulesToInstall(new CustomIntegerModule()).build();
@@ -272,7 +271,7 @@ public class Jackson2ObjectMapperBuilderTests {
assertThat(new String(objectMapper.writeValueAsBytes(new Integer(4)), "UTF-8"), containsString("customid"));
}
@Test // SPR-12634
@Test // SPR-12634
@SuppressWarnings("unchecked")
public void customizeWellKnownModulesWithModuleClass() throws JsonProcessingException, UnsupportedEncodingException {
ObjectMapper objectMapper = Jackson2ObjectMapperBuilder.json().modulesToInstall(CustomIntegerModule.class).build();
@@ -281,7 +280,7 @@ public class Jackson2ObjectMapperBuilderTests {
assertThat(new String(objectMapper.writeValueAsBytes(new Integer(4)), "UTF-8"), containsString("customid"));
}
@Test // SPR-12634
@Test // SPR-12634
public void customizeWellKnownModulesWithSerializer() throws JsonProcessingException, UnsupportedEncodingException {
ObjectMapper objectMapper = Jackson2ObjectMapperBuilder.json()
.serializerByType(Integer.class, new CustomIntegerSerializer()).build();
@@ -520,6 +519,7 @@ public class Jackson2ObjectMapperBuilderTests {
}
}
public static class ListContainer<T> {
private List<T> list;

View File

@@ -47,7 +47,6 @@ import com.fasterxml.jackson.databind.jsontype.TypeIdResolver;
import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
import com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder;
import com.fasterxml.jackson.databind.type.TypeFactory;
import org.junit.Before;
import org.junit.Test;
@@ -197,7 +196,7 @@ public class SpringHandlerInstantiatorTests {
return JsonTypeInfo.Id.CUSTOM;
}
@Override
// Only needed when compiling against Jackson 2.7; gone in 2.8
@SuppressWarnings("deprecation")
public JavaType typeFromId(String s) {
return TypeFactory.defaultInstance().constructFromCanonical(s);