Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into kie-issues#1610
Browse files Browse the repository at this point in the history
  • Loading branch information
josedee committed Nov 19, 2024
2 parents f6d570a + 0f97ed5 commit 6052ae2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ private static ObjectMapper buildObjectMapper() {
ObjectMapper objectMapper = new ObjectMapper()
.registerModule(new JavaTimeModule())
.registerModule(JsonFormat.getCloudEventJacksonModule())
.disable(com.fasterxml.jackson.databind.SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
.disable(com.fasterxml.jackson.databind.SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
.disable(com.fasterxml.jackson.databind.DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE);
registerDescriptors(objectMapper);
return objectMapper;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private static void assertCreateJobEvent(JobCloudEvent<?> result) {

assertThat(job.getSchedule()).isInstanceOf(TimerSchedule.class);
TimerSchedule schedule = (TimerSchedule) job.getSchedule();
assertThat(schedule.getStartTime()).isEqualTo(SCHEDULE_START_TIME);
assertThat(schedule.getStartTime()).hasToString(SCHEDULE_START_TIME.toString());
assertThat(schedule.getRepeatCount()).isEqualTo(SCHEDULE_REPEAT_COUNT);
assertThat(schedule.getDelay()).isEqualTo(SCHEDULE_DELAY);
assertThat(schedule.getDelayUnit()).isEqualTo(SCHEDULE_DELAY_UNIT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public void customize(ObjectMapper mapper) {
if (!configBean.failOnEmptyBean()) {
mapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
}
mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
mapper.setDateFormat(new StdDateFormat().withColonInTimeZone(true).withTimeZone(TimeZone.getDefault()));
mapper.registerModule(JsonFormat.getCloudEventJacksonModule()).findAndRegisterModules();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public void customize(Jackson2ObjectMapperBuilder builder) {
if (!configBean.failOnEmptyBean()) {
builder.featuresToDisable (SerializationFeature.FAIL_ON_EMPTY_BEANS);
}
builder.featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
builder.dateFormat(new StdDateFormat().withColonInTimeZone(true).withTimeZone(TimeZone.getDefault()));
builder.modulesToInstall(new JavaTimeModule());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.json.JsonMapper;
import com.fasterxml.jackson.databind.type.TypeFactory;

Expand All @@ -39,6 +40,7 @@ private static class DefaultObjectMapper {
.setTypeFactory(TypeFactory.defaultInstance().withClassLoader(Thread.currentThread().getContextClassLoader()))
.registerModule(JsonFormat.getCloudEventJacksonModule())
.registerModule(new CommonObjectModule())
.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
.findAndRegisterModules();
}

Expand Down

0 comments on commit 6052ae2

Please sign in to comment.