use of com.fasterxml.jackson.datatype.joda.JodaModule in project camunda-bpm-platform by camunda.
the class JodaJsonDataFormatConfigurator method configure.
@Override
public void configure(JacksonJsonDataFormat dataFormat) {
ObjectMapper objectMapper = dataFormat.getObjectMapper();
objectMapper.registerModule(new JodaModule());
objectMapper.configure(com.fasterxml.jackson.databind.SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
}
use of com.fasterxml.jackson.datatype.joda.JodaModule in project ninja by ninjaframework.
the class ObjectMapperProvider method get.
@Override
public ObjectMapper get() {
ObjectMapper objectMapper = new ObjectMapper();
// Afterburner optimizes performance of Pojo to Json mapper
objectMapper.registerModule(new AfterburnerModule());
// Java 8 data type
objectMapper.registerModule(new JavaTimeModule());
objectMapper.registerModule(new Jdk8Module());
// Joda
objectMapper.registerModule(new JodaModule());
return objectMapper;
}
use of com.fasterxml.jackson.datatype.joda.JodaModule in project goci by EBISPOT.
the class CurationApplication method getObjectMapper.
@Bean(name = "JodaMapper")
@Primary
public ObjectMapper getObjectMapper() {
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new JodaModule()).configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false).configure(SerializationFeature.INDENT_OUTPUT, true).setSerializationInclusion(JsonInclude.Include.NON_NULL);
return mapper;
}
use of com.fasterxml.jackson.datatype.joda.JodaModule in project goci by EBISPOT.
the class DepositionSubmissionTest method testReadSubmissionEnvelopes.
@Test
public void testReadSubmissionEnvelopes() {
try {
Resource resource = new ClassPathResource("envelope-submissions.json");
assertTrue(resource.exists());
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.registerModule(new JodaModule());
DepositionSubmission[] submission = objectMapper.readValue(resource.getFile(), DepositionSubmission[].class);
assertNotNull(submission);
assertEquals("2020-04-27T13:17:27.724Z", submission[0].getCreated().getTimestamp().toString());
assertNotNull(submission[0].getStatus());
} catch (IOException e) {
e.printStackTrace();
fail(e.getMessage());
}
}
use of com.fasterxml.jackson.datatype.joda.JodaModule in project goci by EBISPOT.
the class DepositionPublicationTest method testReadAllPublications.
@Test
public void testReadAllPublications() {
try {
Resource resource = new ClassPathResource("publications.json");
assertTrue(resource.exists());
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.registerModule(new JodaModule());
DepositionPublicationListWrapper publication = objectMapper.readValue(resource.getFile(), DepositionPublicationListWrapper.class);
assertNotNull(publication);
assertNotNull(publication.getPublications().getPublications().get(0).getPublicationDate().year());
assertNotNull(publication.getPublications().getPublications().get(0).getStatus());
} catch (IOException e) {
e.printStackTrace();
fail(e.getMessage());
}
}
Aggregations