@Test public void jsonSaverCreatesExpectedJsonOutput() throws IOException { URL url = Resources.getResource(JSON_EXPECTED_OUTPUT_FILE); String expectedOutput = Resources.toString(url, Charsets.UTF_8); ObjectMapper mapper = new ObjectMapper(); JsonNode expectedJsonObject = mapper.readTree(expectedOutput); JsonNode actualJsonObject = mapper.readTree(outputStream.toString()); assertEquals(expectedJsonObject, actualJsonObject); }
mapper.enable(DeserializationFeature.FAIL_ON_READING_DUP_TREE_KEY); try { mapper.readTree(s); break; } catch (IOException e) {
JsonNode jsonNode = mapper.readTree(json); vertices = jsonNode.get("vertices");