Use Jackson improved default configuration everywhere

With this commit, Jackson builder is now used in spring-websocket
to create the ObjectMapper instance.

It is not possible to use the builder for spring-messaging
and spring-jms since these modules don't have a dependency on
spring-web, thus they now just customize the same features:
 - MapperFeature#DEFAULT_VIEW_INCLUSION is disabled
 - DeserializationFeature#FAIL_ON_UNKNOWN_PROPERTIES is disabled

Issue: SPR-12293
This commit is contained in:
Sebastien Deleuze
2014-12-03 09:49:41 +01:00
parent 87f1512e88
commit fbd85925de
9 changed files with 146 additions and 17 deletions

View File

@@ -87,11 +87,12 @@ public class MappingJackson2MessageConverterTests {
this.converter.fromMessage(message, MyBean.class);
}
@Test(expected = MessageConversionException.class)
@Test
public void fromMessageValidJsonWithUnknownProperty() throws IOException {
String payload = "{\"string\":\"string\",\"unknownProperty\":\"value\"}";
Message<?> message = MessageBuilder.withPayload(payload.getBytes(UTF_8)).build();
this.converter.fromMessage(message, MyBean.class);
MyBean myBean = (MyBean)this.converter.fromMessage(message, MyBean.class);
assertEquals("string", myBean.getString());
}
@Test