@Test
public void visitOnlyLabeledNodes() throws Exception
{
LabelScanReader labelScanReader = mock( LabelScanReader.class );
when( labelScanStore.newReader() ).thenReturn( labelScanReader );
when( nodeLabelRanges.maxCount() ).thenReturn( 1L );
PrimitiveLongResourceIterator labeledNodesIterator = PrimitiveLongResourceCollections.iterator( null, 1, 2, 3, 4, 5, 6, 7, 8 );
when( nodeStore.getHighestPossibleIdInUse() ).thenReturn( 200L );
when( nodeStore.getHighId() ).thenReturn( 20L );
when( labelScanReader.nodesWithAnyOfLabels( new int[] {2, 6} ) ).thenReturn( labeledNodesIterator );
when( nodeStore.openPageCursorForReading( anyLong() ) ).thenReturn( mock( PageCursor.class ) );
mockLabelNodeCount( countStore, 2 );
mockLabelNodeCount( countStore, 6 );
DynamicIndexStoreView storeView = dynamicIndexStoreView();
StoreScan<Exception> storeScan = storeView
.visitNodes( new int[]{2, 6}, propertyKeyIdFilter, propertyUpdateVisitor, labelUpdateVisitor, false );
storeScan.run();
Mockito.verify( nodeStore, times( 8 ) )
.getRecordByCursor( anyLong(), any( NodeRecord.class ), any( RecordLoad.class ), any( PageCursor.class ) );
}