use of org.neo4j.consistency.checking.full.QueueDistribution.RelationshipNodesQueueDistributor in project neo4j by neo4j.
the class RecordDistributorTest method shouldDistributeRelationshipRecordsByNodeId.
@Test
public void shouldDistributeRelationshipRecordsByNodeId() throws Exception {
// GIVEN
QueueDistributor<RelationshipRecord> distributor = new RelationshipNodesQueueDistributor(5, 100);
RecordConsumer<RelationshipRecord> consumer = mock(RecordConsumer.class);
// WHEN/THEN
RelationshipRecord relationship = relationship(0, 0, 1);
distributor.distribute(relationship, consumer);
verify(consumer, times(1)).accept(relationship, 0);
relationship = relationship(1, 0, 7);
distributor.distribute(relationship, consumer);
verify(consumer, times(1)).accept(relationship, 0);
verify(consumer, times(1)).accept(relationship, 1);
relationship = relationship(3, 26, 11);
distributor.distribute(relationship, consumer);
verify(consumer, times(1)).accept(relationship, 5);
verify(consumer, times(1)).accept(relationship, 2);
}
Aggregations