JsonUtils { public static boolean nodeAbsent(Object json, String path, Configuration configuration) { return nodeAbsent(json, Path.create(path), configuration); }  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 testNodeAbsent() { String json = "{\"test\":{\"value\":1, \"value2\": null}}"; assertFalse(nodeAbsent(json, Path.create("test"), false)); assertFalse(nodeAbsent(json, Path.create("test.value"), false)); assertTrue(nodeAbsent(json, Path.create("test.nonsense"), false)); assertTrue(nodeAbsent(json, Path.create("root"), false)); assertTrue(nodeAbsent(json, Path.create("test.value2"), true)); assertFalse(nodeAbsent(json, Path.create("test.value2"), false)); }
@Test void shouldIgnoreEscapedDot() throws IOException { assertFalse(nodeAbsent("{\"test.1\":{\"value\":1}}", Path.create("test\\.1"), false)); }
@Test void shouldNotProcessBackslash() { assertFalse(nodeAbsent("{\"test\\\\backslash\":{\"value\":1}}", Path.create("test\\backslash"), false)); }