use of org.neo4j.values.virtual.PathValue in project neo4j by neo4j.
the class PrettyPrinterTest method shouldHandlePaths.
@Test
void shouldHandlePaths() {
// Given
NodeValue startNode = VirtualValues.nodeValue(1L, Values.stringArray("L"), EMPTY_MAP);
NodeValue endNode = VirtualValues.nodeValue(2L, Values.stringArray("L"), EMPTY_MAP);
RelationshipValue rel = VirtualValues.relationshipValue(42L, startNode, endNode, stringValue("R"), EMPTY_MAP);
PathValue path = VirtualValues.path(new NodeValue[] { startNode, endNode }, new RelationshipValue[] { rel });
PrettyPrinter printer = new PrettyPrinter();
// When
path.writeTo(printer);
// Then
assertThat(printer.value()).isEqualTo("(id=1 :L)-[id=42 :R]->(id=2 :L)");
}
use of org.neo4j.values.virtual.PathValue in project neo4j by neo4j.
the class Neo4jPackV1Test method shouldNotBeAbleToUnpackPaths.
@Test
void shouldNotBeAbleToUnpackPaths() {
for (PathValue path : ALL_PATHS) {
var ex = assertThrows(BoltIOException.class, () -> unpacked(packed(path)));
assertEquals(Neo4jError.from(TypeError, "Path values cannot be unpacked with this version of bolt."), Neo4jError.from(ex));
}
}
Aggregations