From 1bd93b1b8042d58f1e38bd7412968265ad91720a Mon Sep 17 00:00:00 2001 From: Jerome Van Der Linden Date: Fri, 20 Oct 2023 16:11:03 +0200 Subject: [PATCH 1/3] add jackson-jr implementation --- jmespath-jackson-jr/pom.xml | 56 ++++ .../jmespath/jacksonjr/JacksonJrRuntime.java | 239 ++++++++++++++++++ .../jacksonjr/JacksonJrComplianceTest.java | 26 ++ .../jmespath/jacksonjr/JacksonJrTest.java | 28 ++ 4 files changed, 349 insertions(+) create mode 100644 jmespath-jackson-jr/pom.xml create mode 100644 jmespath-jackson-jr/src/main/java/io/burt/jmespath/jacksonjr/JacksonJrRuntime.java create mode 100644 jmespath-jackson-jr/src/test/java/io/burt/jmespath/jacksonjr/JacksonJrComplianceTest.java create mode 100644 jmespath-jackson-jr/src/test/java/io/burt/jmespath/jacksonjr/JacksonJrTest.java diff --git a/jmespath-jackson-jr/pom.xml b/jmespath-jackson-jr/pom.xml new file mode 100644 index 0000000..ed56586 --- /dev/null +++ b/jmespath-jackson-jr/pom.xml @@ -0,0 +1,56 @@ + + + + + 4.0.0 + + jmespath-jackson-jr + JMESPath JacksonJr + A JMESPath implementation for Java + + + io.burt + jmespath + 0.5.2-SNAPSHOT + + + + + ${project.groupId} + jmespath-core + ${project.parent.version} + + + ${project.groupId} + jmespath-core + ${project.parent.version} + test-jar + test + + + com.fasterxml.jackson.jr + jackson-jr-objects + 2.14.2 + + + com.fasterxml.jackson.jr + jackson-jr-stree + 2.14.2 + + + + \ No newline at end of file diff --git a/jmespath-jackson-jr/src/main/java/io/burt/jmespath/jacksonjr/JacksonJrRuntime.java b/jmespath-jackson-jr/src/main/java/io/burt/jmespath/jacksonjr/JacksonJrRuntime.java new file mode 100644 index 0000000..bdb51de --- /dev/null +++ b/jmespath-jackson-jr/src/main/java/io/burt/jmespath/jacksonjr/JacksonJrRuntime.java @@ -0,0 +1,239 @@ +/* + * Copyright 2023 Amazon.com, Inc. or its affiliates. + * Licensed under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package io.burt.jmespath.jacksonjr; + +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.TreeNode; +import com.fasterxml.jackson.jr.ob.JSON; +import com.fasterxml.jackson.jr.stree.JacksonJrsTreeCodec; +import com.fasterxml.jackson.jr.stree.JrsArray; +import com.fasterxml.jackson.jr.stree.JrsBoolean; +import com.fasterxml.jackson.jr.stree.JrsNull; +import com.fasterxml.jackson.jr.stree.JrsNumber; +import com.fasterxml.jackson.jr.stree.JrsObject; +import com.fasterxml.jackson.jr.stree.JrsString; +import com.fasterxml.jackson.jr.stree.JrsValue; +import io.burt.jmespath.BaseRuntime; +import io.burt.jmespath.JmesPathType; +import io.burt.jmespath.RuntimeConfiguration; +import java.io.IOException; +import java.util.AbstractList; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +public class JacksonJrRuntime extends BaseRuntime { + private final JSON json; + public JacksonJrRuntime() { + this(RuntimeConfiguration.defaultConfiguration()); + } + + public JacksonJrRuntime(RuntimeConfiguration configuration) { + this(configuration, JSON.builder() + .treeCodec(new JacksonJrsTreeCodec()) + .build()); + } + public JacksonJrRuntime(RuntimeConfiguration configuration, JSON json) { + super(configuration); + this.json = json; + } + + @Override + public TreeNode parseString(String str) { + try { + return json.treeFrom(str); + } catch (IOException e) { + throw new IllegalStateException(e); + } + } + + private static class JrsArrayListWrapper extends AbstractList { + private final JrsArray array; + + JrsArrayListWrapper(JrsArray array) { + this.array = array; + } + + @Override + public TreeNode get(int index) { + return array.get(index); + } + + @Override + public int size() { + return array.size(); + } + } + + @Override + public List toList(TreeNode value) { + if (value == null) { + return Collections.emptyList(); + } + if (value.isArray()) { + return new JrsArrayListWrapper((JrsArray) value); + } else if (value.isObject()) { + JrsObject object = (JrsObject) value; + List list = new ArrayList<>(object.size()); + Iterator> iterator = object.fields(); + + while (iterator.hasNext()) { + Map.Entry entry = (Map.Entry) iterator.next(); + list.add(entry.getValue()); + } + return list; + } else { + return Collections.emptyList(); + } + } + + @Override + public String toString(TreeNode value) { + if (value.asToken().equals(JsonToken.VALUE_STRING)) { + return ((JrsString) value).asText(); + } else { + try { + return json.asString(value); + } catch (IOException e) { + return ""; + } + } + } + + @Override + public Number toNumber(TreeNode value) { + if (value.isValueNode() && ((JrsValue) value).isNumber()) { + JrsNumber number = (JrsNumber) value; + return number.getValue(); + } else return null; + } + + @Override + public boolean isTruthy(TreeNode value) { + // false, null, empty lists, empty objects, empty strings. + if (value.isContainerNode()) { + return value.size() > 0; + } else if (value.isValueNode()) { + if (value.asToken().equals(JsonToken.VALUE_STRING)) { + return !((JrsString) value).asText().isEmpty(); + } else return !value.asToken().equals(JsonToken.VALUE_FALSE) && + !value.asToken().equals(JsonToken.VALUE_NULL); + } else { + return !value.isMissingNode(); + } + } + + @Override + public JmesPathType typeOf(TreeNode value) { + switch (value.asToken()) { + case START_ARRAY: + case END_ARRAY: + return JmesPathType.ARRAY; + case VALUE_EMBEDDED_OBJECT: + case START_OBJECT: + case END_OBJECT: + return JmesPathType.OBJECT; + case VALUE_STRING: + return JmesPathType.STRING; + case VALUE_NUMBER_INT: + case VALUE_NUMBER_FLOAT: + return JmesPathType.NUMBER; + case VALUE_TRUE: + case VALUE_FALSE: + return JmesPathType.BOOLEAN; + case VALUE_NULL: + return JmesPathType.NULL; + case NOT_AVAILABLE: + default: + throw new IllegalStateException(String.format("Unknown node type encountered: %s", value.asToken())); + } + } + + @Override + public TreeNode getProperty(TreeNode value, TreeNode name) { + if (value == null || value.asToken().equals(JsonToken.VALUE_NULL)) { + return JrsNull.instance(); + } else { + TreeNode node = value.get(((JrsString) name).asText()); + return node != null ? node : createNull(); + } + } + + @Override + public Collection getPropertyNames(TreeNode value) { + if (value != null && value.isObject()) { + List names = new ArrayList<>(value.size()); + Iterator fieldNames = value.fieldNames(); + while (fieldNames.hasNext()) { + names.add(createString(fieldNames.next())); + } + return names; + } else { + return Collections.emptyList(); + } + } + + @Override + public TreeNode createNull() { + return JrsNull.instance(); + } + + @Override + public TreeNode createArray(Collection elements) { + List values = new ArrayList<>(); + for (TreeNode node: elements) { + if (node == null) { + values.add(JrsNull.instance()); + } else { + values.add((JrsValue) node); + } + } + return new JrsArray(values); + + } + + @Override + public TreeNode createString(String str) { + return new JrsString(str); + } + + @Override + public TreeNode createBoolean(boolean b) { + return b ? JrsBoolean.TRUE : JrsBoolean.FALSE; + } + + @Override + public TreeNode createObject(Map obj) { + Map values = new HashMap<>(); + for (Map.Entry entry : obj.entrySet()) { + values.put(((JrsString)entry.getKey()).asText(), (JrsValue) entry.getValue()); + } + return new JrsObject(values); + } + + @Override + public TreeNode createNumber(double n) { + return new JrsNumber(n); + } + + @Override + public TreeNode createNumber(long n) { + return new JrsNumber(n); + } +} diff --git a/jmespath-jackson-jr/src/test/java/io/burt/jmespath/jacksonjr/JacksonJrComplianceTest.java b/jmespath-jackson-jr/src/test/java/io/burt/jmespath/jacksonjr/JacksonJrComplianceTest.java new file mode 100644 index 0000000..2efad0b --- /dev/null +++ b/jmespath-jackson-jr/src/test/java/io/burt/jmespath/jacksonjr/JacksonJrComplianceTest.java @@ -0,0 +1,26 @@ +/* + * Copyright 2023 Amazon.com, Inc. or its affiliates. + * Licensed under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package io.burt.jmespath.jacksonjr; + +import com.fasterxml.jackson.core.TreeNode; +import io.burt.jmespath.Adapter; +import io.burt.jmespath.JmesPathComplianceTest; + +public class JacksonJrComplianceTest extends JmesPathComplianceTest { + private Adapter runtime = new JacksonJrRuntime(); + + @Override + protected Adapter runtime() { return runtime; } +} diff --git a/jmespath-jackson-jr/src/test/java/io/burt/jmespath/jacksonjr/JacksonJrTest.java b/jmespath-jackson-jr/src/test/java/io/burt/jmespath/jacksonjr/JacksonJrTest.java new file mode 100644 index 0000000..0357878 --- /dev/null +++ b/jmespath-jackson-jr/src/test/java/io/burt/jmespath/jacksonjr/JacksonJrTest.java @@ -0,0 +1,28 @@ +/* + * Copyright 2023 Amazon.com, Inc. or its affiliates. + * Licensed under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package io.burt.jmespath.jacksonjr; + + +import com.fasterxml.jackson.core.TreeNode; +import io.burt.jmespath.Adapter; +import io.burt.jmespath.JmesPathRuntimeTest; +import io.burt.jmespath.RuntimeConfiguration; + +public class JacksonJrTest extends JmesPathRuntimeTest { + @Override + protected Adapter createRuntime(RuntimeConfiguration configuration) { + return new JacksonJrRuntime(configuration); + } +} From 50115453cc2c8bb7968301563c0a9f5b24c04984 Mon Sep 17 00:00:00 2001 From: Jerome Van Der Linden Date: Fri, 20 Oct 2023 16:16:46 +0200 Subject: [PATCH 2/3] remove license headers --- jmespath-jackson-jr/pom.xml | 14 -------------- .../burt/jmespath/jacksonjr/JacksonJrRuntime.java | 14 -------------- .../jacksonjr/JacksonJrComplianceTest.java | 14 -------------- .../io/burt/jmespath/jacksonjr/JacksonJrTest.java | 14 -------------- 4 files changed, 56 deletions(-) diff --git a/jmespath-jackson-jr/pom.xml b/jmespath-jackson-jr/pom.xml index ed56586..eead53e 100644 --- a/jmespath-jackson-jr/pom.xml +++ b/jmespath-jackson-jr/pom.xml @@ -1,18 +1,4 @@ - - diff --git a/jmespath-jackson-jr/src/main/java/io/burt/jmespath/jacksonjr/JacksonJrRuntime.java b/jmespath-jackson-jr/src/main/java/io/burt/jmespath/jacksonjr/JacksonJrRuntime.java index bdb51de..c836220 100644 --- a/jmespath-jackson-jr/src/main/java/io/burt/jmespath/jacksonjr/JacksonJrRuntime.java +++ b/jmespath-jackson-jr/src/main/java/io/burt/jmespath/jacksonjr/JacksonJrRuntime.java @@ -1,17 +1,3 @@ -/* - * Copyright 2023 Amazon.com, Inc. or its affiliates. - * Licensed under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - package io.burt.jmespath.jacksonjr; import com.fasterxml.jackson.core.JsonToken; diff --git a/jmespath-jackson-jr/src/test/java/io/burt/jmespath/jacksonjr/JacksonJrComplianceTest.java b/jmespath-jackson-jr/src/test/java/io/burt/jmespath/jacksonjr/JacksonJrComplianceTest.java index 2efad0b..3e7eea5 100644 --- a/jmespath-jackson-jr/src/test/java/io/burt/jmespath/jacksonjr/JacksonJrComplianceTest.java +++ b/jmespath-jackson-jr/src/test/java/io/burt/jmespath/jacksonjr/JacksonJrComplianceTest.java @@ -1,17 +1,3 @@ -/* - * Copyright 2023 Amazon.com, Inc. or its affiliates. - * Licensed under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - package io.burt.jmespath.jacksonjr; import com.fasterxml.jackson.core.TreeNode; diff --git a/jmespath-jackson-jr/src/test/java/io/burt/jmespath/jacksonjr/JacksonJrTest.java b/jmespath-jackson-jr/src/test/java/io/burt/jmespath/jacksonjr/JacksonJrTest.java index 0357878..8dbaa37 100644 --- a/jmespath-jackson-jr/src/test/java/io/burt/jmespath/jacksonjr/JacksonJrTest.java +++ b/jmespath-jackson-jr/src/test/java/io/burt/jmespath/jacksonjr/JacksonJrTest.java @@ -1,17 +1,3 @@ -/* - * Copyright 2023 Amazon.com, Inc. or its affiliates. - * Licensed under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - package io.burt.jmespath.jacksonjr; From 451db7ee515c32272a754cf23407f94acdffe3c6 Mon Sep 17 00:00:00 2001 From: Jerome Van Der Linden Date: Mon, 23 Oct 2023 23:27:11 +0200 Subject: [PATCH 3/3] code review fixes --- jmespath-jackson-jr/pom.xml | 2 +- .../jmespath/jacksonjr/JacksonJrRuntime.java | 91 ++++++++++--------- .../jacksonjr/JacksonJrComplianceTest.java | 8 +- .../jmespath/jacksonjr/JacksonJrTest.java | 6 +- 4 files changed, 56 insertions(+), 51 deletions(-) diff --git a/jmespath-jackson-jr/pom.xml b/jmespath-jackson-jr/pom.xml index eead53e..7362efb 100644 --- a/jmespath-jackson-jr/pom.xml +++ b/jmespath-jackson-jr/pom.xml @@ -5,7 +5,7 @@ 4.0.0 jmespath-jackson-jr - JMESPath JacksonJr + JMESPath Jackson jr A JMESPath implementation for Java diff --git a/jmespath-jackson-jr/src/main/java/io/burt/jmespath/jacksonjr/JacksonJrRuntime.java b/jmespath-jackson-jr/src/main/java/io/burt/jmespath/jacksonjr/JacksonJrRuntime.java index c836220..749fe2a 100644 --- a/jmespath-jackson-jr/src/main/java/io/burt/jmespath/jacksonjr/JacksonJrRuntime.java +++ b/jmespath-jackson-jr/src/main/java/io/burt/jmespath/jacksonjr/JacksonJrRuntime.java @@ -1,7 +1,6 @@ package io.burt.jmespath.jacksonjr; import com.fasterxml.jackson.core.JsonToken; -import com.fasterxml.jackson.core.TreeNode; import com.fasterxml.jackson.jr.ob.JSON; import com.fasterxml.jackson.jr.stree.JacksonJrsTreeCodec; import com.fasterxml.jackson.jr.stree.JrsArray; @@ -15,6 +14,7 @@ import io.burt.jmespath.JmesPathType; import io.burt.jmespath.RuntimeConfiguration; import java.io.IOException; +import java.io.UncheckedIOException; import java.util.AbstractList; import java.util.ArrayList; import java.util.Collection; @@ -24,8 +24,9 @@ import java.util.List; import java.util.Map; -public class JacksonJrRuntime extends BaseRuntime { +public class JacksonJrRuntime extends BaseRuntime { private final JSON json; + public JacksonJrRuntime() { this(RuntimeConfiguration.defaultConfiguration()); } @@ -35,13 +36,14 @@ public JacksonJrRuntime(RuntimeConfiguration configuration) { .treeCodec(new JacksonJrsTreeCodec()) .build()); } + public JacksonJrRuntime(RuntimeConfiguration configuration, JSON json) { super(configuration); this.json = json; } @Override - public TreeNode parseString(String str) { + public JrsValue parseString(String str) { try { return json.treeFrom(str); } catch (IOException e) { @@ -49,7 +51,7 @@ public TreeNode parseString(String str) { } } - private static class JrsArrayListWrapper extends AbstractList { + private static class JrsArrayListWrapper extends AbstractList { private final JrsArray array; JrsArrayListWrapper(JrsArray array) { @@ -57,7 +59,7 @@ private static class JrsArrayListWrapper extends AbstractList { } @Override - public TreeNode get(int index) { + public JrsValue get(int index) { return array.get(index); } @@ -68,19 +70,18 @@ public int size() { } @Override - public List toList(TreeNode value) { + public List toList(JrsValue value) { if (value == null) { return Collections.emptyList(); - } - if (value.isArray()) { + } else if (value.isArray()) { return new JrsArrayListWrapper((JrsArray) value); } else if (value.isObject()) { JrsObject object = (JrsObject) value; - List list = new ArrayList<>(object.size()); + List list = new ArrayList<>(object.size()); Iterator> iterator = object.fields(); while (iterator.hasNext()) { - Map.Entry entry = (Map.Entry) iterator.next(); + Map.Entry entry = iterator.next(); list.add(entry.getValue()); } return list; @@ -90,50 +91,54 @@ public List toList(TreeNode value) { } @Override - public String toString(TreeNode value) { - if (value.asToken().equals(JsonToken.VALUE_STRING)) { - return ((JrsString) value).asText(); + public String toString(JrsValue value) { + if (JsonToken.VALUE_STRING.equals(value.asToken())) { + return value.asText(); } else { try { return json.asString(value); } catch (IOException e) { - return ""; + throw new UncheckedIOException(e); } } } @Override - public Number toNumber(TreeNode value) { - if (value.isValueNode() && ((JrsValue) value).isNumber()) { + public Number toNumber(JrsValue value) { + if (value.isValueNode() && value.isNumber()) { JrsNumber number = (JrsNumber) value; return number.getValue(); - } else return null; + } else { + return null; + } } @Override - public boolean isTruthy(TreeNode value) { - // false, null, empty lists, empty objects, empty strings. + public boolean isTruthy(JrsValue value) { if (value.isContainerNode()) { return value.size() > 0; } else if (value.isValueNode()) { - if (value.asToken().equals(JsonToken.VALUE_STRING)) { - return !((JrsString) value).asText().isEmpty(); - } else return !value.asToken().equals(JsonToken.VALUE_FALSE) && - !value.asToken().equals(JsonToken.VALUE_NULL); + switch (value.asToken()) { + case VALUE_STRING: + return !value.asText().isEmpty(); + case VALUE_FALSE: + case VALUE_NULL: + return false; + default: + return true; + } } else { return !value.isMissingNode(); } } @Override - public JmesPathType typeOf(TreeNode value) { + public JmesPathType typeOf(JrsValue value) { switch (value.asToken()) { case START_ARRAY: - case END_ARRAY: return JmesPathType.ARRAY; case VALUE_EMBEDDED_OBJECT: case START_OBJECT: - case END_OBJECT: return JmesPathType.OBJECT; case VALUE_STRING: return JmesPathType.STRING; @@ -152,19 +157,19 @@ public JmesPathType typeOf(TreeNode value) { } @Override - public TreeNode getProperty(TreeNode value, TreeNode name) { - if (value == null || value.asToken().equals(JsonToken.VALUE_NULL)) { + public JrsValue getProperty(JrsValue value, JrsValue name) { + if (JsonToken.VALUE_NULL.equals(value.asToken())) { return JrsNull.instance(); } else { - TreeNode node = value.get(((JrsString) name).asText()); + JrsValue node = value.get(name.asText()); return node != null ? node : createNull(); } } @Override - public Collection getPropertyNames(TreeNode value) { - if (value != null && value.isObject()) { - List names = new ArrayList<>(value.size()); + public Collection getPropertyNames(JrsValue value) { + if (value.isObject()) { + List names = new ArrayList<>(value.size()); Iterator fieldNames = value.fieldNames(); while (fieldNames.hasNext()) { names.add(createString(fieldNames.next())); @@ -176,18 +181,18 @@ public Collection getPropertyNames(TreeNode value) { } @Override - public TreeNode createNull() { + public JrsValue createNull() { return JrsNull.instance(); } @Override - public TreeNode createArray(Collection elements) { + public JrsValue createArray(Collection elements) { List values = new ArrayList<>(); - for (TreeNode node: elements) { + for (JrsValue node: elements) { if (node == null) { values.add(JrsNull.instance()); } else { - values.add((JrsValue) node); + values.add(node); } } return new JrsArray(values); @@ -195,31 +200,31 @@ public TreeNode createArray(Collection elements) { } @Override - public TreeNode createString(String str) { + public JrsValue createString(String str) { return new JrsString(str); } @Override - public TreeNode createBoolean(boolean b) { + public JrsValue createBoolean(boolean b) { return b ? JrsBoolean.TRUE : JrsBoolean.FALSE; } @Override - public TreeNode createObject(Map obj) { + public JrsValue createObject(Map obj) { Map values = new HashMap<>(); - for (Map.Entry entry : obj.entrySet()) { - values.put(((JrsString)entry.getKey()).asText(), (JrsValue) entry.getValue()); + for (Map.Entry entry : obj.entrySet()) { + values.put(entry.getKey().asText(), entry.getValue()); } return new JrsObject(values); } @Override - public TreeNode createNumber(double n) { + public JrsValue createNumber(double n) { return new JrsNumber(n); } @Override - public TreeNode createNumber(long n) { + public JrsValue createNumber(long n) { return new JrsNumber(n); } } diff --git a/jmespath-jackson-jr/src/test/java/io/burt/jmespath/jacksonjr/JacksonJrComplianceTest.java b/jmespath-jackson-jr/src/test/java/io/burt/jmespath/jacksonjr/JacksonJrComplianceTest.java index 3e7eea5..040f129 100644 --- a/jmespath-jackson-jr/src/test/java/io/burt/jmespath/jacksonjr/JacksonJrComplianceTest.java +++ b/jmespath-jackson-jr/src/test/java/io/burt/jmespath/jacksonjr/JacksonJrComplianceTest.java @@ -1,12 +1,12 @@ package io.burt.jmespath.jacksonjr; -import com.fasterxml.jackson.core.TreeNode; +import com.fasterxml.jackson.jr.stree.JrsValue; import io.burt.jmespath.Adapter; import io.burt.jmespath.JmesPathComplianceTest; -public class JacksonJrComplianceTest extends JmesPathComplianceTest { - private Adapter runtime = new JacksonJrRuntime(); +public class JacksonJrComplianceTest extends JmesPathComplianceTest { + private Adapter runtime = new JacksonJrRuntime(); @Override - protected Adapter runtime() { return runtime; } + protected Adapter runtime() { return runtime; } } diff --git a/jmespath-jackson-jr/src/test/java/io/burt/jmespath/jacksonjr/JacksonJrTest.java b/jmespath-jackson-jr/src/test/java/io/burt/jmespath/jacksonjr/JacksonJrTest.java index 8dbaa37..2c1004f 100644 --- a/jmespath-jackson-jr/src/test/java/io/burt/jmespath/jacksonjr/JacksonJrTest.java +++ b/jmespath-jackson-jr/src/test/java/io/burt/jmespath/jacksonjr/JacksonJrTest.java @@ -1,14 +1,14 @@ package io.burt.jmespath.jacksonjr; -import com.fasterxml.jackson.core.TreeNode; +import com.fasterxml.jackson.jr.stree.JrsValue; import io.burt.jmespath.Adapter; import io.burt.jmespath.JmesPathRuntimeTest; import io.burt.jmespath.RuntimeConfiguration; -public class JacksonJrTest extends JmesPathRuntimeTest { +public class JacksonJrTest extends JmesPathRuntimeTest { @Override - protected Adapter createRuntime(RuntimeConfiguration configuration) { + protected Adapter createRuntime(RuntimeConfiguration configuration) { return new JacksonJrRuntime(configuration); } }