@Test public void shouldGetExtendedNodeRepresentationsWhenGettingFromIndex() { String key = "mykey3"; String value = "value"; long nodeId = graphdbHelper.createNode(); String indexName = "node"; graphdbHelper.addNodeToIndex(indexName, key, value, nodeId); int counter = 0; for (Object rep : serialize(actions.getIndexedNodes(indexName, key, value))) { Map<String, Object> serialized = (Map<String, Object>) rep; NodeRepresentationTest.verifySerialisation(serialized); assertNotNull(serialized.get("indexed")); counter++; } assertEquals(1, counter); }
@Test public void shouldBeAbleToGetFullPathsIfSpecified() { long startNode = createBasicTraversableGraph(); List<Object> hits = serialize( actions.traverse( startNode, new HashMap<String, Object>(), TraverserReturnType.fullpath)); for (Object hit : hits) { Map<String, Object> map = (Map<String, Object>) hit; Collection<Object> relationships = (Collection<Object>) map.get("relationships"); for (Object relationship : relationships) { RelationshipRepresentationTest.verifySerialisation((Map<String, Object>) relationship); } Collection<Object> nodes = (Collection<Object>) map.get("nodes"); for (Object node : nodes) { NodeRepresentationTest.verifySerialisation((Map<String, Object>) node); } assertThat(map, hasKey("start")); assertThat(map, hasKey("end")); assertThat(map, hasKey("length")); } }