Search in sources :

Example 1 with NodeReference

use of org.neo4j.values.virtual.NodeReference in project neo4j by neo4j.

the class TruncatedQuerySnapshotTest method shouldTruncateNode.

@Test
void shouldTruncateNode() {
    // when
    TruncatedQuerySnapshot x = new TruncatedQuerySnapshot(null, "", null, map("n", NODE), -1L, -1L, -1L, 100);
    // then
    AnyValue truncatedNode = x.queryParameters.get("n");
    assertTrue(truncatedNode instanceof NodeReference);
    assertEquals(NODE.id(), ((NodeReference) truncatedNode).id());
}
Also used : NodeReference(org.neo4j.values.virtual.NodeReference) AnyValue(org.neo4j.values.AnyValue) Test(org.junit.jupiter.api.Test)

Example 2 with NodeReference

use of org.neo4j.values.virtual.NodeReference in project neo4j by neo4j.

the class PrettyPrinterTest method shouldHandleNodeReference.

@Test
void shouldHandleNodeReference() {
    // Given
    NodeReference node = VirtualValues.node(42L);
    PrettyPrinter printer = new PrettyPrinter();
    // When
    node.writeTo(printer);
    // Then
    assertThat(printer.value()).isEqualTo("(id=42)");
}
Also used : NodeReference(org.neo4j.values.virtual.NodeReference) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)2 NodeReference (org.neo4j.values.virtual.NodeReference)2 AnyValue (org.neo4j.values.AnyValue)1