Sample sample = new Sample();
sample.date = new Date();
ObjectMapper mapper = context.getBean("objectMapper", ObjectMapper.class);
DateFormatter formatter = new DateFormatter();
formatter.setIso(ISO.DATE_TIME);
Object result = JsonPath.read(mapper.writeValueAsString(sample), "$.date");
assertThat(result, is(instanceOf(String.class)));
assertThat(result, is((Object) formatter.print(sample.date, Locale.US)));
}