From 0f200c4f24a71e21f219c45c95dff0939bf054d2 Mon Sep 17 00:00:00 2001 From: Walter Medvedeo Date: Fri, 15 Nov 2024 16:40:23 +0100 Subject: [PATCH] kie-kogito-runtimes-3780: Disable the ADJUST_DATES_TO_CONTEXT_TIME_ZONE jackson feature in the jobs service api default deserializer --- .../jobs/service/api/serlialization/SerializationUtils.java | 3 ++- .../api/event/serialization/JobCloudEventDeserializerTest.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/api/kogito-jobs-service-api/src/main/java/org/kie/kogito/jobs/service/api/serlialization/SerializationUtils.java b/api/kogito-jobs-service-api/src/main/java/org/kie/kogito/jobs/service/api/serlialization/SerializationUtils.java index 7cca0a4535e..d5dcdb6c49d 100644 --- a/api/kogito-jobs-service-api/src/main/java/org/kie/kogito/jobs/service/api/serlialization/SerializationUtils.java +++ b/api/kogito-jobs-service-api/src/main/java/org/kie/kogito/jobs/service/api/serlialization/SerializationUtils.java @@ -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; } diff --git a/api/kogito-jobs-service-api/src/test/java/org/kie/kogito/jobs/service/api/event/serialization/JobCloudEventDeserializerTest.java b/api/kogito-jobs-service-api/src/test/java/org/kie/kogito/jobs/service/api/event/serialization/JobCloudEventDeserializerTest.java index e4088fdc83d..d83677f74b9 100644 --- a/api/kogito-jobs-service-api/src/test/java/org/kie/kogito/jobs/service/api/event/serialization/JobCloudEventDeserializerTest.java +++ b/api/kogito-jobs-service-api/src/test/java/org/kie/kogito/jobs/service/api/event/serialization/JobCloudEventDeserializerTest.java @@ -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);