Support Jackson based XML serialization in RestTemplate

Issue: SPR-12225
This commit is contained in:
Sebastien Deleuze
2014-09-22 01:10:21 +02:00
parent f27c7df004
commit 2989fe4203
2 changed files with 9 additions and 2 deletions

View File

@@ -222,7 +222,7 @@ public class RestTemplateIntegrationTests extends AbstractJettyServerTestCase {
MySampleBean bean = new MySampleBean("with", "with", "without");
MappingJacksonValue jacksonValue = new MappingJacksonValue(bean);
jacksonValue.setSerializationView(MyJacksonView1.class);
HttpEntity<MappingJacksonValue> entity = new HttpEntity<MappingJacksonValue>(jacksonValue);
HttpEntity<MappingJacksonValue> entity = new HttpEntity<MappingJacksonValue>(jacksonValue, entityHeaders);
String s = template.postForObject(baseUrl + "/jsonpost", entity, String.class, "post");
assertTrue(s.contains("\"with1\":\"with\""));
assertFalse(s.contains("\"with2\":\"with\""));