From a6a8a1869f9dae744ccf0c4e4f1a437626d0242d Mon Sep 17 00:00:00 2001 From: Josiah Noel <32279667+SentryMan@users.noreply.github.com> Date: Sun, 19 Nov 2023 18:42:24 -0500 Subject: [PATCH] fix tests --- .../java/io/avaje/jsonb/jackson/JacksonAdapter.java | 5 +++++ .../avaje/jsonb/jackson/UnwrapJacksonParserTest.java | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/jsonb-jackson/src/main/java/io/avaje/jsonb/jackson/JacksonAdapter.java b/jsonb-jackson/src/main/java/io/avaje/jsonb/jackson/JacksonAdapter.java index 76497b01..8e5cdaaa 100644 --- a/jsonb-jackson/src/main/java/io/avaje/jsonb/jackson/JacksonAdapter.java +++ b/jsonb-jackson/src/main/java/io/avaje/jsonb/jackson/JacksonAdapter.java @@ -118,6 +118,11 @@ public JacksonAdapter build() { public JacksonAdapter() { this(false, false, false, new JsonFactory()); } + + + public JacksonAdapter(JsonFactory factory) { + this(false, false, false, factory); + } /** * Create with the given default configuration. diff --git a/jsonb-jackson/src/test/java/io/avaje/jsonb/jackson/UnwrapJacksonParserTest.java b/jsonb-jackson/src/test/java/io/avaje/jsonb/jackson/UnwrapJacksonParserTest.java index 8ea1af2b..ea1776ad 100644 --- a/jsonb-jackson/src/test/java/io/avaje/jsonb/jackson/UnwrapJacksonParserTest.java +++ b/jsonb-jackson/src/test/java/io/avaje/jsonb/jackson/UnwrapJacksonParserTest.java @@ -1,7 +1,10 @@ package io.avaje.jsonb.jackson; +import com.fasterxml.jackson.core.JsonFactory; import com.fasterxml.jackson.core.JsonLocation; import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.StreamReadFeature; + import io.avaje.jsonb.JsonReader; import io.avaje.jsonb.JsonType; import io.avaje.jsonb.Jsonb; @@ -13,7 +16,12 @@ class UnwrapJacksonParserTest { - Jsonb jsonb = Jsonb.builder().build(); + Jsonb jsonb = + Jsonb.builder() + .adapter( + new JacksonAdapter( + new JsonFactory().enable(JsonParser.Feature.INCLUDE_SOURCE_IN_LOCATION))) + .build(); @Test void unwrap() {