Skip to content

Commit

Permalink
Remove JavaTimeModule registration
Browse files Browse the repository at this point in the history
  • Loading branch information
maple-buice committed Dec 11, 2023
1 parent 28b524b commit d8a9994
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.hubspot.jinjava.lib.filter;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.hubspot.jinjava.doc.annotations.JinjavaDoc;
import com.hubspot.jinjava.doc.annotations.JinjavaParam;
import com.hubspot.jinjava.doc.annotations.JinjavaSnippet;
Expand Down Expand Up @@ -56,7 +55,6 @@ public Object filter(Object var, JinjavaInterpreter interpreter, String... args)
interpreter
.getConfig()
.getObjectMapper()
.registerModule(new JavaTimeModule())
.writerWithDefaultPrettyPrinter()
.writeValueAsString(var);
} catch (JsonProcessingException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import static org.assertj.core.api.Assertions.assertThat;

import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.hubspot.jinjava.Jinjava;
Expand All @@ -21,7 +23,10 @@ public class PrettyPrintFilterTest {

@Before
public void setup() {
JinjavaConfig config = JinjavaConfig.newBuilder().build();
JinjavaConfig config = JinjavaConfig
.newBuilder()
.withObjectMapper(new ObjectMapper().registerModule(new JavaTimeModule()))
.build();
Jinjava jinjava = new Jinjava(config);
Context context = jinjava.getGlobalContext();
i = new JinjavaInterpreter(jinjava, context, config);
Expand Down

0 comments on commit d8a9994

Please sign in to comment.