@Test public void testUpdateNode() { double lon = -139.12; double lat = -45.24; Transaction tx = graphDb.beginTx(); String query = "MATCH n-[r]-() DELETE n, r"; graphDb.execute(query); query = "MATCH (n) WHERE HAS (n.geohash) DELETE n"; graphDb.execute(query); root = PrefixTree.getOrCreateRoot(INDEXLABEL, graphDb); List<Node> candidate = gendata.insertNode(graphDb, 10, true); for (Node node : candidate) { PrefixTree.addNode(graphDb, root, node); } String geoHashPre = (String) candidate.get(0).getProperty(GEOHASH); String geoHashCur = GeoHash.getHash(lon, lat); List<Node> child = PrefixTree.getChild(geoHashPre, root, 7); assertEquals(child.size(), 1); PrefixTree.updateNode(graphDb, root, candidate.get(0), lon, lat); child = PrefixTree.getChild(geoHashPre, root, 7); assertEquals(child.size(), 0); child = PrefixTree.getChild(geoHashCur, root, 7); assertEquals(child.size(), 1); tx.close(); graphDb.shutdown(); }