use of org.neo4j.kernel.impl.index.schema.NodeValueIterator in project neo4j by neo4j.
the class FusionIndexReaderTest method closeIteratorMustCloseAll.
// close iterator
@Test
void closeIteratorMustCloseAll() throws Exception {
// given
IndexProgressor[] progressors = new IndexProgressor[aliveReaders.length];
for (int i = 0; i < aliveReaders.length; i++) {
int slot = i;
doAnswer(invocation -> {
IndexProgressor.EntityValueClient client = invocation.getArgument(1);
IndexProgressor progressor = mock(IndexProgressor.class);
client.initialize(DESCRIPTOR, progressor, getIndexQueryArgument(invocation), invocation.getArgument(2), false);
progressors[slot] = progressor;
return null;
}).when(aliveReaders[i]).query(any(), any(), any(), any());
}
// when
try (NodeValueIterator iterator = new NodeValueIterator()) {
fusionIndexReader.query(NULL_CONTEXT, iterator, unconstrained(), PropertyIndexQuery.exists(PROP_KEY));
}
// then
for (IndexProgressor progressor : progressors) {
verify(progressor).close();
}
}
Aggregations