@Test public void testCustomMappingJacksonHttpMessageConverter() throws JsonGenerationException, JsonMappingException, IOException { CustomMappingJacksonHttpMessageConverter convert = new CustomMappingJacksonHttpMessageConverter(); OutputStream out = new ByteArrayOutputStream(); Person value = new Person(); value.setError("error"); convert.getObjectMapper().writeValue(out, value); assertEquals("{\"error\":\"error\"}", out.toString()); }
public CustomMappingJacksonHttpMessageConverter() { super(); getObjectMapper().enable(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY) .setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL); }
CustomMappingJacksonHttpMessageConverter extends MappingJacksonHttpMessageConverter { public CustomMappingJacksonHttpMessageConverter() { super(); getObjectMapper().enable(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY) .setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL); } }
CustomMappingJacksonHttpMessageConverter extends MappingJacksonHttpMessageConverter { public CustomMappingJacksonHttpMessageConverter() { super(); getObjectMapper().enable(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY) .setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL); } CustomMappingJacksonHttpMessageConverter(); }
CustomMappingJacksonHttpMessageConverter extends MappingJacksonHttpMessageConverter { public CustomMappingJacksonHttpMessageConverter() { super(); getObjectMapper().enable(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY) .setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL); } CustomMappingJacksonHttpMessageConverter();  }
CustomMappingJacksonHttpMessageConverter extends MappingJacksonHttpMessageConverter { public CustomMappingJacksonHttpMessageConverter() { super(); getObjectMapper().enable(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY) .setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL); } CustomMappingJacksonHttpMessageConverter();   }