use of org.neo4j.values.virtual.NodeValue in project neo4j by neo4j.
the class PrettyPrinterTest method shouldHandleNodeValueAsReference.
@Test
void shouldHandleNodeValueAsReference() {
// Given
NodeValue node = VirtualValues.nodeValue(42L, Values.stringArray("L1", "L2", "L3"), props("foo", intValue(42), "bar", list(intValue(1337), stringValue("baz"))));
PrettyPrinter printer = new PrettyPrinter(REFERENCE);
// When
node.writeTo(printer);
// Then
assertThat(printer.value()).isEqualTo("(id=42)");
}
use of org.neo4j.values.virtual.NodeValue in project neo4j by neo4j.
the class PrettyPrinterTest method shouldHandleRelationshipValueWithoutProperties.
@Test
void shouldHandleRelationshipValueWithoutProperties() {
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);
PrettyPrinter printer = new PrettyPrinter();
// When
rel.writeTo(printer);
// Then
assertThat(printer.value()).isEqualTo("-[id=42 :R]-");
}
use of org.neo4j.values.virtual.NodeValue in project neo4j by neo4j.
the class PrettyPrinterTest method shouldHandleNodeValueWithoutLabels.
@Test
void shouldHandleNodeValueWithoutLabels() {
// Given
NodeValue node = VirtualValues.nodeValue(42L, Values.stringArray(), props("foo", intValue(42), "bar", list(intValue(1337), stringValue("baz"))));
PrettyPrinter printer = new PrettyPrinter();
// When
node.writeTo(printer);
// Then
assertThat(printer.value()).isEqualTo("(id=42 {bar: [1337, \"baz\"], foo: 42})");
}
use of org.neo4j.values.virtual.NodeValue in project neo4j by neo4j.
the class PrettyPrinterTest method shouldHandleNodeValue.
@Test
void shouldHandleNodeValue() {
// Given
NodeValue node = VirtualValues.nodeValue(42L, Values.stringArray("L1", "L2", "L3"), props("foo", intValue(42), "bar", list(intValue(1337), stringValue("baz"))));
PrettyPrinter printer = new PrettyPrinter();
// When
node.writeTo(printer);
// Then
assertThat(printer.value()).isEqualTo("(id=42 :L1:L2:L3 {bar: [1337, \"baz\"], foo: 42})");
}
use of org.neo4j.values.virtual.NodeValue in project neo4j by neo4j.
the class PrettyPrinterTest method shouldHandleNodeValueWithoutProperties.
@Test
void shouldHandleNodeValueWithoutProperties() {
// Given
NodeValue node = VirtualValues.nodeValue(42L, Values.stringArray("L1", "L2", "L3"), EMPTY_MAP);
PrettyPrinter printer = new PrettyPrinter();
// When
node.writeTo(printer);
// Then
assertThat(printer.value()).isEqualTo("(id=42 :L1:L2:L3)");
}
Aggregations