use of org.apache.jackrabbit.oak.plugins.document.UpdateOp.Condition in project jackrabbit-oak by apache.
the class DocumentStoreStatsIT method removeConditional.
@Test
public void removeConditional() throws Exception {
Revision r = Revision.newRevision(1);
Key modified = new Key(MODIFIED_IN_SECS, null);
Condition c = newEqualsCondition(getModifiedInSecs(r.getTimestamp()));
Map<String, Map<Key, Condition>> ids = Maps.newHashMap();
for (int i = 0; i < 10; i++) {
String id = testName.getMethodName() + "-" + i;
ids.put(id, singletonMap(modified, c));
UpdateOp up = new UpdateOp(id, true);
NodeDocument.setModified(up, r);
ds.create(Collection.NODES, singletonList(up));
removeMe.add(id);
}
DocumentStoreStatsCollector coll = mock(DocumentStoreStatsCollector.class);
configureStatsCollector(coll);
ds.remove(Collection.NODES, ids);
verify(coll).doneRemove(anyLong(), eq(Collection.NODES), eq(10));
}
Aggregations