From 4fad46a48b8e2b060541609acc0cf0484deb5ed4 Mon Sep 17 00:00:00 2001 From: Fiete <41323592+FieteO@users.noreply.github.com> Date: Sat, 23 Mar 2024 15:23:45 +0000 Subject: [PATCH] Upgrade dropwizard.version to 2.1.12 (#1481) --- src/server/pom.xml | 4 ++-- .../src/main/java/io/cassandrareaper/ReaperApplication.java | 3 ++- .../java/io/cassandrareaper/management/ClusterFacade.java | 3 ++- .../src/test/java/io/cassandrareaper/SimpleReaperClient.java | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/server/pom.xml b/src/server/pom.xml index d76436684..a5c8e9987 100644 --- a/src/server/pom.xml +++ b/src/server/pom.xml @@ -29,8 +29,8 @@ jar - 2.0.34 - 2.33 + 2.1.12 + 2.35 1.2.9 3.4.5 1.12.0 diff --git a/src/server/src/main/java/io/cassandrareaper/ReaperApplication.java b/src/server/src/main/java/io/cassandrareaper/ReaperApplication.java index 6b2a8938e..538bbb934 100644 --- a/src/server/src/main/java/io/cassandrareaper/ReaperApplication.java +++ b/src/server/src/main/java/io/cassandrareaper/ReaperApplication.java @@ -58,6 +58,7 @@ import javax.servlet.FilterRegistration; import com.codahale.metrics.InstrumentedScheduledExecutorService; +import com.fasterxml.jackson.datatype.joda.JodaModule; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; @@ -127,7 +128,7 @@ public AppContext getContext() { public void initialize(Bootstrap bootstrap) { bootstrap.addCommand(new ReaperDbMigrationCommand("schema-migration", "Performs database schema migrations")); bootstrap.addBundle(new AssetsBundle("/assets/", "/webui", "index.html")); - bootstrap.getObjectMapper().registerModule(new JavaTimeModule()); + bootstrap.getObjectMapper().registerModule(new JavaTimeModule()).registerModule(new JodaModule()); // enable using environment variables in yml files final SubstitutingSourceProvider envSourceProvider = new SubstitutingSourceProvider( diff --git a/src/server/src/main/java/io/cassandrareaper/management/ClusterFacade.java b/src/server/src/main/java/io/cassandrareaper/management/ClusterFacade.java index 82560be3d..ff860417b 100644 --- a/src/server/src/main/java/io/cassandrareaper/management/ClusterFacade.java +++ b/src/server/src/main/java/io/cassandrareaper/management/ClusterFacade.java @@ -61,6 +61,7 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; +import com.fasterxml.jackson.datatype.joda.JodaModule; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; import com.google.common.cache.Cache; @@ -181,7 +182,7 @@ public static CompactionStats parseCompactionStats(String json) throws IOExcepti private static T parseJson(String json, TypeReference ref) throws IOException { try { ObjectMapper mapper = new ObjectMapper(); - mapper.registerModule(new Jdk8Module()); + mapper.registerModule(new Jdk8Module()).registerModule(new JodaModule()); return mapper.readValue(json, ref); } catch (IOException e) { LOG.error("Error parsing json", e); diff --git a/src/server/src/test/java/io/cassandrareaper/SimpleReaperClient.java b/src/server/src/test/java/io/cassandrareaper/SimpleReaperClient.java index 4df96ddb1..3a2eea87f 100644 --- a/src/server/src/test/java/io/cassandrareaper/SimpleReaperClient.java +++ b/src/server/src/test/java/io/cassandrareaper/SimpleReaperClient.java @@ -46,6 +46,7 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.joda.JodaModule; import com.google.common.collect.Maps; import org.slf4j.Logger; @@ -127,7 +128,7 @@ public static Response doHttpCall( private static T parseJSON(String json, TypeReference ref) { try { - return new ObjectMapper().readValue(json, ref); + return new ObjectMapper().registerModule(new JodaModule()).readValue(json, ref); } catch (IOException e) { LOG.error("error parsing json", e); throw new RuntimeException(e);