JsonUtils { public static Node getNode(Object root, String path) { return getNode(root, Path.create(path)); }  static Node convertToJson(Object source, String label); static Node convertToJson(Object source, String label, boolean lenient); static Node valueToNode(Object source); static Node getNode(Object root, String path); static Node getNode(Object root, Path path); @Deprecated static boolean nodeExists(Object json, String path); static boolean nodeAbsent(Object json, String path, Configuration configuration); static boolean nodeAbsent(Object json, Path path, Configuration configuration); static Object jsonSource(final Object json, final String pathPrefix); static String getPathPrefix(Object json); static Node wrapDeserializedObject(Object source); static Object missingNode();  }
@Test void testGetStartNodeArraysRootComplex() throws IOException { Node startNode = getNode(mapper.readTree("[{\"values\":[1,2]}, {\"values\":[3,4]}]"), "[1].values[1]"); assertEquals(4, startNode.decimalValue().intValue()); }
@Test void testGetStartNodeArraysConvoluted() throws IOException { Node startNode = getNode(mapper.readTree("{\"test\":[{\"values\":[1,2]}, {\"values\":[3,4]}]}"), "test.[1].values.[1]"); assertEquals(4, startNode.decimalValue().intValue()); }
@Test void testGetStartNodeArraysRoot() throws IOException { Node startNode = getNode(mapper.readTree("[1,2]"), "[0]"); assertEquals(1, startNode.decimalValue().intValue()); }
@Test void testGetStartNodeNonexisting() throws IOException { Node startNode = getNode(mapper.readTree("{\"test\":{\"value\":1}}"), "test.bogus"); assertEquals(true, startNode.isMissingNode()); }
@Test void testGetStartNodeRoot() throws IOException { Node startNode = getNode(mapper.readTree("{\"test\":{\"value\":1}}"), ""); assertEquals("{\"test\":{\"value\":1}}", startNode.toString()); }
@Test void testGetStartNodeSimple() throws IOException { Node startNode = getNode(mapper.readTree("{\"test\":{\"value\":1}}"), "test"); assertEquals("{\"value\":1}", startNode.toString()); }
@Test void testGetStartNodeTwoSteps() throws IOException { Node startNode = getNode(mapper.readTree("{\"test\":{\"value\":1}}"), "test.value"); assertEquals(1, startNode.decimalValue().intValue()); }
@Test void testGetStartNodeArrays() throws IOException { Node startNode = getNode(mapper.readTree("{\"test\":{\"values\":[1,2]}}"), "test.values[1]"); assertEquals(2, startNode.decimalValue().intValue()); }
@Test void testGetStartNodeArraysNegated() throws IOException { Node startNode = getNode(mapper.readTree("{\"test\":{\"values\":[1,2,3,4,5]}}"), "test.values[-2]"); assertEquals(4, startNode.decimalValue().intValue()); }
@Test void testGetStartNodeArrays2() throws IOException { Node startNode = getNode(mapper.readTree("{\"test\":[{\"values\":[1,2]}, {\"values\":[3,4]}]}"), "test[1].values[1]"); assertEquals(4, startNode.decimalValue().intValue()); }