use of org.neo4j.kernel.api.index.TokenIndexReader in project neo4j by neo4j.
the class RelationshipTypeIndexIT method assertContainIds.
private void assertContainIds(List<Long> expectedIds) throws IndexNotFoundKernelException {
int relationshipTypeId = getRelationshipTypeId();
IndexProxy indexProxy = getIndexProxy();
List<Long> actualIds = new ArrayList<>();
try (TokenIndexReader reader = indexProxy.newTokenReader()) {
SimpleEntityTokenClient tokenClient = new SimpleEntityTokenClient();
reader.query(tokenClient, unconstrained(), new TokenPredicate(relationshipTypeId), CursorContext.NULL);
while (tokenClient.next()) {
actualIds.add(tokenClient.reference);
}
}
expectedIds.sort(Long::compareTo);
actualIds.sort(Long::compareTo);
assertThat(actualIds).as("contains expected relationships").isEqualTo(expectedIds);
}
Aggregations