diff --git a/handlebars-jackson2/.gitignore b/handlebars-jackson/.gitignore similarity index 100% rename from handlebars-jackson2/.gitignore rename to handlebars-jackson/.gitignore diff --git a/handlebars-jackson2/pom.xml b/handlebars-jackson/pom.xml similarity index 97% rename from handlebars-jackson2/pom.xml rename to handlebars-jackson/pom.xml index f5dd81965..8a42c26f4 100644 --- a/handlebars-jackson2/pom.xml +++ b/handlebars-jackson/pom.xml @@ -8,7 +8,7 @@ 4.0.0 - handlebars-jackson2 + handlebars-jackson JSON Jackson helpers diff --git a/handlebars-jackson2/src/main/java/com/github/jknack/handlebars/Jackson2Helper.java b/handlebars-jackson/src/main/java/com/github/jknack/handlebars/jackson/JacksonHelper.java similarity index 88% rename from handlebars-jackson2/src/main/java/com/github/jknack/handlebars/Jackson2Helper.java rename to handlebars-jackson/src/main/java/com/github/jknack/handlebars/jackson/JacksonHelper.java index 6f82af07c..0af4d76ef 100644 --- a/handlebars-jackson2/src/main/java/com/github/jknack/handlebars/Jackson2Helper.java +++ b/handlebars-jackson/src/main/java/com/github/jknack/handlebars/jackson/JacksonHelper.java @@ -3,7 +3,7 @@ * Apache License Version 2.0 http://www.apache.org/licenses/LICENSE-2.0 * Copyright (c) 2012 Edgar Espina */ -package com.github.jknack.handlebars; +package com.github.jknack.handlebars.jackson; import static java.util.Objects.requireNonNull; @@ -18,6 +18,9 @@ import com.fasterxml.jackson.core.io.SegmentedStringWriter; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectWriter; +import com.github.jknack.handlebars.Handlebars; +import com.github.jknack.handlebars.Helper; +import com.github.jknack.handlebars.Options; /** * A Jackson 2.x helper. @@ -69,7 +72,7 @@ * @author edgar.espina * @since 0.4.0 */ -public class Jackson2Helper implements Helper { +public class JacksonHelper implements Helper { /** * Escape HTML chars from JSON content. See @@ -106,8 +109,8 @@ public SerializableString getEscapeSequence(final int ch) { } } - /** A singleton version of {@link Jackson2Helper}. */ - public static final Helper INSTANCE = new Jackson2Helper(); + /** A singleton version of {@link JacksonHelper}. */ + public static final Helper INSTANCE = new JacksonHelper(); /** The JSON parser. */ private final ObjectMapper mapper; @@ -116,16 +119,16 @@ public SerializableString getEscapeSequence(final int ch) { private final Map> alias = new HashMap>(); /** - * Creates a new {@link Jackson2Helper}. + * Creates a new {@link JacksonHelper}. * * @param objectMapper The object's mapper. Required. */ - public Jackson2Helper(final ObjectMapper objectMapper) { + public JacksonHelper(final ObjectMapper objectMapper) { mapper = requireNonNull(objectMapper, "The object mapper is required."); } - /** Creates a new {@link Jackson2Helper}. */ - private Jackson2Helper() { + /** Creates a new {@link JacksonHelper}. */ + private JacksonHelper() { this(new ObjectMapper()); } @@ -189,7 +192,7 @@ public Object apply(final Object context, final Options options) throws IOExcept * @param viewClass The view class. Required. * @return This helper. */ - public Jackson2Helper viewAlias(final String alias, final Class viewClass) { + public JacksonHelper viewAlias(final String alias, final Class viewClass) { this.alias.put( requireNonNull(alias, "A view alias is required."), requireNonNull(viewClass, "A view class is required.")); diff --git a/handlebars-jackson2/src/main/java/com/github/jknack/handlebars/JsonNodeValueResolver.java b/handlebars-jackson/src/main/java/com/github/jknack/handlebars/jackson/JsonNodeValueResolver.java similarity index 98% rename from handlebars-jackson2/src/main/java/com/github/jknack/handlebars/JsonNodeValueResolver.java rename to handlebars-jackson/src/main/java/com/github/jknack/handlebars/jackson/JsonNodeValueResolver.java index 47bf43c19..e5be1eb80 100644 --- a/handlebars-jackson2/src/main/java/com/github/jknack/handlebars/JsonNodeValueResolver.java +++ b/handlebars-jackson/src/main/java/com/github/jknack/handlebars/jackson/JsonNodeValueResolver.java @@ -3,7 +3,7 @@ * Apache License Version 2.0 http://www.apache.org/licenses/LICENSE-2.0 * Copyright (c) 2012 Edgar Espina */ -package com.github.jknack.handlebars; +package com.github.jknack.handlebars.jackson; import java.util.AbstractMap; import java.util.Collections; @@ -27,6 +27,7 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.node.POJONode; import com.fasterxml.jackson.databind.node.TextNode; +import com.github.jknack.handlebars.ValueResolver; /** * Resolve a context stack value from {@link JsonNode}. diff --git a/handlebars-jackson/src/main/java/module-info.java b/handlebars-jackson/src/main/java/module-info.java new file mode 100644 index 000000000..57e8d1ca2 --- /dev/null +++ b/handlebars-jackson/src/main/java/module-info.java @@ -0,0 +1,8 @@ +module com.github.jknack.handlebars.jackson { + exports com.github.jknack.handlebars.jackson; + + requires org.slf4j; + requires com.github.jknack.handlebars; + requires com.fasterxml.jackson.core; + requires com.fasterxml.jackson.databind; +} diff --git a/handlebars-tests/pom.xml b/handlebars-tests/pom.xml index 0a03d7acf..7bdb4cb13 100644 --- a/handlebars-tests/pom.xml +++ b/handlebars-tests/pom.xml @@ -24,6 +24,12 @@ ${project.version} + + com.github.jknack + handlebars-jackson + ${project.version} + + joda-time joda-time @@ -56,6 +62,12 @@ mockito-core test + + + org.hamcrest + hamcrest + test + diff --git a/handlebars-jackson2/src/test/java/com/github/jknack/handlebars/Blog.java b/handlebars-tests/src/test/java/com/github/jknack/handlebars/jackson/Blog.java similarity index 96% rename from handlebars-jackson2/src/test/java/com/github/jknack/handlebars/Blog.java rename to handlebars-tests/src/test/java/com/github/jknack/handlebars/jackson/Blog.java index 31dfeacb9..7ee799947 100644 --- a/handlebars-jackson2/src/test/java/com/github/jknack/handlebars/Blog.java +++ b/handlebars-tests/src/test/java/com/github/jknack/handlebars/jackson/Blog.java @@ -3,7 +3,7 @@ * Apache License Version 2.0 http://www.apache.org/licenses/LICENSE-2.0 * Copyright (c) 2012 Edgar Espina */ -package com.github.jknack.handlebars; +package com.github.jknack.handlebars.jackson; import java.util.ArrayList; import java.util.List; diff --git a/handlebars-jackson2/src/test/java/com/github/jknack/handlebars/Comment.java b/handlebars-tests/src/test/java/com/github/jknack/handlebars/jackson/Comment.java similarity index 93% rename from handlebars-jackson2/src/test/java/com/github/jknack/handlebars/Comment.java rename to handlebars-tests/src/test/java/com/github/jknack/handlebars/jackson/Comment.java index d763a0c22..1def938d7 100644 --- a/handlebars-jackson2/src/test/java/com/github/jknack/handlebars/Comment.java +++ b/handlebars-tests/src/test/java/com/github/jknack/handlebars/jackson/Comment.java @@ -3,7 +3,7 @@ * Apache License Version 2.0 http://www.apache.org/licenses/LICENSE-2.0 * Copyright (c) 2012 Edgar Espina */ -package com.github.jknack.handlebars; +package com.github.jknack.handlebars.jackson; public class Comment { private String author; diff --git a/handlebars-jackson2/src/test/java/com/github/jknack/handlebars/Issue260.java b/handlebars-tests/src/test/java/com/github/jknack/handlebars/jackson/Issue260.java similarity index 90% rename from handlebars-jackson2/src/test/java/com/github/jknack/handlebars/Issue260.java rename to handlebars-tests/src/test/java/com/github/jknack/handlebars/jackson/Issue260.java index a64612140..685ca5987 100644 --- a/handlebars-jackson2/src/test/java/com/github/jknack/handlebars/Issue260.java +++ b/handlebars-tests/src/test/java/com/github/jknack/handlebars/jackson/Issue260.java @@ -3,7 +3,7 @@ * Apache License Version 2.0 http://www.apache.org/licenses/LICENSE-2.0 * Copyright (c) 2012 Edgar Espina */ -package com.github.jknack.handlebars; +package com.github.jknack.handlebars.jackson; import java.io.IOException; @@ -11,6 +11,8 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import com.github.jknack.handlebars.AbstractTest; +import com.github.jknack.handlebars.Context; import com.github.jknack.handlebars.context.MapValueResolver; public class Issue260 extends AbstractTest { diff --git a/handlebars-jackson2/src/test/java/com/github/jknack/handlebars/i280/Issue280.java b/handlebars-tests/src/test/java/com/github/jknack/handlebars/jackson/Issue280.java similarity index 89% rename from handlebars-jackson2/src/test/java/com/github/jknack/handlebars/i280/Issue280.java rename to handlebars-tests/src/test/java/com/github/jknack/handlebars/jackson/Issue280.java index 0d0fc45b6..79268ad05 100644 --- a/handlebars-jackson2/src/test/java/com/github/jknack/handlebars/i280/Issue280.java +++ b/handlebars-tests/src/test/java/com/github/jknack/handlebars/jackson/Issue280.java @@ -3,7 +3,7 @@ * Apache License Version 2.0 http://www.apache.org/licenses/LICENSE-2.0 * Copyright (c) 2012 Edgar Espina */ -package com.github.jknack.handlebars.i280; +package com.github.jknack.handlebars.jackson; import org.junit.jupiter.api.Test; @@ -11,7 +11,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.github.jknack.handlebars.AbstractTest; import com.github.jknack.handlebars.Context; -import com.github.jknack.handlebars.JsonNodeValueResolver; public class Issue280 extends AbstractTest { diff --git a/handlebars-jackson2/src/test/java/com/github/jknack/handlebars/i368/Issue368.java b/handlebars-tests/src/test/java/com/github/jknack/handlebars/jackson/Issue368.java similarity index 92% rename from handlebars-jackson2/src/test/java/com/github/jknack/handlebars/i368/Issue368.java rename to handlebars-tests/src/test/java/com/github/jknack/handlebars/jackson/Issue368.java index 19b25bbc0..e2b533850 100644 --- a/handlebars-jackson2/src/test/java/com/github/jknack/handlebars/i368/Issue368.java +++ b/handlebars-tests/src/test/java/com/github/jknack/handlebars/jackson/Issue368.java @@ -3,7 +3,7 @@ * Apache License Version 2.0 http://www.apache.org/licenses/LICENSE-2.0 * Copyright (c) 2012 Edgar Espina */ -package com.github.jknack.handlebars.i368; +package com.github.jknack.handlebars.jackson; import java.io.IOException; @@ -13,7 +13,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.github.jknack.handlebars.AbstractTest; import com.github.jknack.handlebars.Context; -import com.github.jknack.handlebars.JsonNodeValueResolver; import com.github.jknack.handlebars.context.MapValueResolver; public class Issue368 extends AbstractTest { diff --git a/handlebars-jackson2/src/test/java/com/github/jknack/handlebars/Issue412.java b/handlebars-tests/src/test/java/com/github/jknack/handlebars/jackson/Issue412.java similarity index 86% rename from handlebars-jackson2/src/test/java/com/github/jknack/handlebars/Issue412.java rename to handlebars-tests/src/test/java/com/github/jknack/handlebars/jackson/Issue412.java index c8377673e..61749a2ea 100644 --- a/handlebars-jackson2/src/test/java/com/github/jknack/handlebars/Issue412.java +++ b/handlebars-tests/src/test/java/com/github/jknack/handlebars/jackson/Issue412.java @@ -3,7 +3,7 @@ * Apache License Version 2.0 http://www.apache.org/licenses/LICENSE-2.0 * Copyright (c) 2012 Edgar Espina */ -package com.github.jknack.handlebars; +package com.github.jknack.handlebars.jackson; import java.io.IOException; @@ -11,6 +11,8 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import com.github.jknack.handlebars.AbstractTest; +import com.github.jknack.handlebars.Context; import com.github.jknack.handlebars.context.MapValueResolver; public class Issue412 extends AbstractTest { diff --git a/handlebars-jackson2/src/test/java/com/github/jknack/handlebars/Issue598.java b/handlebars-tests/src/test/java/com/github/jknack/handlebars/jackson/Issue598.java similarity index 85% rename from handlebars-jackson2/src/test/java/com/github/jknack/handlebars/Issue598.java rename to handlebars-tests/src/test/java/com/github/jknack/handlebars/jackson/Issue598.java index 32d855d8c..c94b0ea29 100644 --- a/handlebars-jackson2/src/test/java/com/github/jknack/handlebars/Issue598.java +++ b/handlebars-tests/src/test/java/com/github/jknack/handlebars/jackson/Issue598.java @@ -3,7 +3,7 @@ * Apache License Version 2.0 http://www.apache.org/licenses/LICENSE-2.0 * Copyright (c) 2012 Edgar Espina */ -package com.github.jknack.handlebars; +package com.github.jknack.handlebars.jackson; import java.io.IOException; @@ -11,6 +11,8 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import com.github.jknack.handlebars.AbstractTest; +import com.github.jknack.handlebars.Context; import com.github.jknack.handlebars.context.MapValueResolver; public class Issue598 extends AbstractTest { diff --git a/handlebars-jackson2/src/test/java/com/github/jknack/handlebars/Jackson2HelperTest.java b/handlebars-tests/src/test/java/com/github/jknack/handlebars/jackson/JacksonHelperTest.java similarity index 80% rename from handlebars-jackson2/src/test/java/com/github/jknack/handlebars/Jackson2HelperTest.java rename to handlebars-tests/src/test/java/com/github/jknack/handlebars/jackson/JacksonHelperTest.java index 80bbc00fa..082be282f 100644 --- a/handlebars-jackson2/src/test/java/com/github/jknack/handlebars/Jackson2HelperTest.java +++ b/handlebars-tests/src/test/java/com/github/jknack/handlebars/jackson/JacksonHelperTest.java @@ -3,7 +3,7 @@ * Apache License Version 2.0 http://www.apache.org/licenses/LICENSE-2.0 * Copyright (c) 2012 Edgar Espina */ -package com.github.jknack.handlebars; +package com.github.jknack.handlebars.jackson; import static com.github.jknack.handlebars.IgnoreWindowsLineMatcher.equalsToStringIgnoringWindowsNewLine; import static org.hamcrest.MatcherAssert.assertThat; @@ -17,20 +17,23 @@ import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.ObjectMapper; -import com.github.jknack.handlebars.Blog.Views.Public; +import com.github.jknack.handlebars.Handlebars; +import com.github.jknack.handlebars.HandlebarsException; +import com.github.jknack.handlebars.Template; +import com.github.jknack.handlebars.jackson.Blog.Views.Public; /** - * Unit test for {@link Jackson2Helper}. + * Unit test for {@link JacksonHelper}. * * @author edgar.espina * @since 0.1.0 */ -public class Jackson2HelperTest { +public class JacksonHelperTest { @Test public void toJSON() throws IOException { Handlebars handlebars = new Handlebars(); - handlebars.registerHelper("@json", Jackson2Helper.INSTANCE); + handlebars.registerHelper("@json", JacksonHelper.INSTANCE); Template template = handlebars.compileInline("{{@json this}}"); @@ -43,7 +46,7 @@ public void toJSON() throws IOException { @Test public void toPrettyJSON() throws IOException { Handlebars handlebars = new Handlebars(); - handlebars.registerHelper("@json", Jackson2Helper.INSTANCE); + handlebars.registerHelper("@json", JacksonHelper.INSTANCE); Template template = handlebars.compileInline("{{@json this pretty=true}}"); @@ -61,11 +64,11 @@ public void toPrettyJSON() throws IOException { public void toJSONViewInclusive() throws IOException { Handlebars handlebars = new Handlebars(); - handlebars.registerHelper("@json", Jackson2Helper.INSTANCE); + handlebars.registerHelper("@json", JacksonHelper.INSTANCE); Template template = handlebars.compileInline( - "{{@json this view=\"com.github.jknack.handlebars.Blog$Views$Public\"}}"); + "{{@json this view=\"com.github.jknack.handlebars.jackson.Blog$Views$Public\"}}"); assertThat( template.apply(new Blog("First Post", "...")), @@ -80,11 +83,11 @@ public void toJSONViewExclusive() throws IOException { ObjectMapper mapper = new ObjectMapper(); mapper.configure(MapperFeature.DEFAULT_VIEW_INCLUSION, false); - handlebars.registerHelper("@json", new Jackson2Helper(mapper)); + handlebars.registerHelper("@json", new JacksonHelper(mapper)); Template template = handlebars.compileInline( - "{{@json this view=\"com.github.jknack.handlebars.Blog$Views$Public\"}}"); + "{{@json this view=\"com.github.jknack.handlebars.jackson.Blog$Views$Public\"}}"); assertThat( template.apply(new Blog("First Post", "...")), @@ -98,8 +101,7 @@ public void toJSONAliasViewExclusive() throws IOException { ObjectMapper mapper = new ObjectMapper(); mapper.configure(MapperFeature.DEFAULT_VIEW_INCLUSION, false); - handlebars.registerHelper( - "@json", new Jackson2Helper(mapper).viewAlias("myView", Public.class)); + handlebars.registerHelper("@json", new JacksonHelper(mapper).viewAlias("myView", Public.class)); Template template = handlebars.compileInline("{{@json this view=\"myView\"}}"); @@ -118,7 +120,7 @@ public void jsonViewNotFound() throws IOException { ObjectMapper mapper = new ObjectMapper(); mapper.configure(MapperFeature.DEFAULT_VIEW_INCLUSION, false); - handlebars.registerHelper("@json", new Jackson2Helper(mapper)); + handlebars.registerHelper("@json", new JacksonHelper(mapper)); Template template = handlebars.compileInline("{{@json this view=\"missing.ViewClass\"}}"); @@ -131,7 +133,7 @@ public void jsonViewNotFound() throws IOException { @Test public void escapeHtml() throws IOException { Handlebars handlebars = new Handlebars(); - handlebars.registerHelper("@json", Jackson2Helper.INSTANCE); + handlebars.registerHelper("@json", JacksonHelper.INSTANCE); Map model = new HashMap(); model.put("script", ""); diff --git a/handlebars-jackson2/src/test/java/com/github/jknack/handlebars/JsonNodeValueResolverTest.java b/handlebars-tests/src/test/java/com/github/jknack/handlebars/jackson/JsonNodeValueResolverTest.java similarity index 81% rename from handlebars-jackson2/src/test/java/com/github/jknack/handlebars/JsonNodeValueResolverTest.java rename to handlebars-tests/src/test/java/com/github/jknack/handlebars/jackson/JsonNodeValueResolverTest.java index 5c4eaafbf..45e0b8566 100644 --- a/handlebars-jackson2/src/test/java/com/github/jknack/handlebars/JsonNodeValueResolverTest.java +++ b/handlebars-tests/src/test/java/com/github/jknack/handlebars/jackson/JsonNodeValueResolverTest.java @@ -3,11 +3,10 @@ * Apache License Version 2.0 http://www.apache.org/licenses/LICENSE-2.0 * Copyright (c) 2012 Edgar Espina */ -package com.github.jknack.handlebars; +package com.github.jknack.handlebars.jackson; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -20,7 +19,9 @@ import java.util.Map.Entry; import java.util.Set; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; +import org.mockito.Mockito; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; @@ -30,6 +31,9 @@ import com.fasterxml.jackson.databind.node.LongNode; import com.fasterxml.jackson.databind.node.NullNode; import com.fasterxml.jackson.databind.node.POJONode; +import com.github.jknack.handlebars.Context; +import com.github.jknack.handlebars.Handlebars; +import com.github.jknack.handlebars.ValueResolver; import com.github.jknack.handlebars.context.MapValueResolver; public class JsonNodeValueResolverTest { @@ -55,7 +59,8 @@ public void resolveValueNode() throws IOException { @Test public void nullMustBeResolvedToUnresolved() { - assertEquals(ValueResolver.UNRESOLVED, JsonNodeValueResolver.INSTANCE.resolve(null, "nothing")); + Assertions.assertEquals( + ValueResolver.UNRESOLVED, JsonNodeValueResolver.INSTANCE.resolve(null, "nothing")); } @Test @@ -63,11 +68,11 @@ public void resolveBinaryNode() { String name = "binary"; byte[] result = new byte[] {1}; - JsonNode node = mock(JsonNode.class); + JsonNode node = Mockito.mock(JsonNode.class); BinaryNode value = BinaryNode.valueOf(result); when(node.get(name)).thenReturn(value); - assertEquals(result, JsonNodeValueResolver.INSTANCE.resolve(node, name)); + Assertions.assertEquals(result, JsonNodeValueResolver.INSTANCE.resolve(node, name)); verify(node).get(name); } @@ -77,11 +82,11 @@ public void resolveNullNode() { String name = "null"; Object result = ValueResolver.UNRESOLVED; - JsonNode node = mock(JsonNode.class); + JsonNode node = Mockito.mock(JsonNode.class); NullNode value = NullNode.instance; when(node.get(name)).thenReturn(value); - assertEquals(result, JsonNodeValueResolver.INSTANCE.resolve(node, name)); + Assertions.assertEquals(result, JsonNodeValueResolver.INSTANCE.resolve(node, name)); verify(node).get(name); } @@ -91,11 +96,11 @@ public void resolveBigIntegerNode() { String name = "bigInt"; BigInteger result = BigInteger.ONE; - JsonNode node = mock(JsonNode.class); + JsonNode node = Mockito.mock(JsonNode.class); JsonNode value = BigIntegerNode.valueOf(result); when(node.get(name)).thenReturn(value); - assertEquals(result, JsonNodeValueResolver.INSTANCE.resolve(node, name)); + Assertions.assertEquals(result, JsonNodeValueResolver.INSTANCE.resolve(node, name)); verify(node).get(name); } @@ -105,11 +110,11 @@ public void resolveDecimalNode() { String name = "decimal"; BigDecimal result = BigDecimal.TEN; - JsonNode node = mock(JsonNode.class); + JsonNode node = Mockito.mock(JsonNode.class); JsonNode value = DecimalNode.valueOf(result); when(node.get(name)).thenReturn(value); - assertEquals(result, JsonNodeValueResolver.INSTANCE.resolve(node, name)); + Assertions.assertEquals(result, JsonNodeValueResolver.INSTANCE.resolve(node, name)); verify(node).get(name); } @@ -119,11 +124,11 @@ public void resolveLongNode() { String name = "long"; Long result = 678L; - JsonNode node = mock(JsonNode.class); + JsonNode node = Mockito.mock(JsonNode.class); JsonNode value = LongNode.valueOf(result); when(node.get(name)).thenReturn(value); - assertEquals(result, JsonNodeValueResolver.INSTANCE.resolve(node, name)); + Assertions.assertEquals(result, JsonNodeValueResolver.INSTANCE.resolve(node, name)); verify(node).get(name); } @@ -133,11 +138,11 @@ public void resolvePojoNode() { String name = "pojo"; Object result = new Object(); - JsonNode node = mock(JsonNode.class); + JsonNode node = Mockito.mock(JsonNode.class); JsonNode value = new POJONode(result); when(node.get(name)).thenReturn(value); - assertEquals(result, JsonNodeValueResolver.INSTANCE.resolve(node, name)); + Assertions.assertEquals(result, JsonNodeValueResolver.INSTANCE.resolve(node, name)); verify(node).get(name); } @@ -150,7 +155,8 @@ public void propertySet() throws IOException { root.put("double", 3.14d); root.put("bool", true); - assertEquals(root.entrySet(), JsonNodeValueResolver.INSTANCE.propertySet(node(root))); + Assertions.assertEquals( + root.entrySet(), JsonNodeValueResolver.INSTANCE.propertySet(node(root))); } @Test diff --git a/pom.xml b/pom.xml index 443ad5985..bd6c17803 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ handlebars handlebars-helpers handlebars-springmvc - handlebars-jackson2 + handlebars-jackson handlebars-guava-cache handlebars-caffeine handlebars-maven-plugin