Search in sources :

Example 1 with RelationshipReference

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

the class TruncatedQuerySnapshotTest method shouldTruncateRelationship.

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

Example 2 with RelationshipReference

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

the class PrettyPrinterTest method shouldHandleRelationshipReference.

@Test
void shouldHandleRelationshipReference() {
    // Given
    RelationshipReference rel = VirtualValues.relationship(42L);
    PrettyPrinter printer = new PrettyPrinter();
    // When
    rel.writeTo(printer);
    // Then
    assertThat(printer.value()).isEqualTo("-[id=42]-");
}
Also used : RelationshipReference(org.neo4j.values.virtual.RelationshipReference) Test(org.junit.jupiter.api.Test)

Aggregations

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