OAK-10213 : added test for throttling findAndUpdate bulk API
diff --git a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/util/ThrottlingDocumentStoreWrapperTest.java b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/util/ThrottlingDocumentStoreWrapperTest.java
index 0aaecd4..ea807a4 100644
--- a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/util/ThrottlingDocumentStoreWrapperTest.java
+++ b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/util/ThrottlingDocumentStoreWrapperTest.java
@@ -28,6 +28,7 @@
import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner;
+import static java.util.List.of;
import static org.apache.jackrabbit.oak.plugins.document.Collection.BLOBS;
import static org.apache.jackrabbit.oak.plugins.document.Collection.CLUSTER_NODES;
import static org.apache.jackrabbit.oak.plugins.document.Collection.JOURNAL;
@@ -107,4 +108,12 @@
verify(memStore, atLeastOnce()).throttler();
}
+ @Test
+ public void testThrottlingForBulkFindAndUpdate() {
+ when(throttler.throttlingTime()).thenReturn(10L);
+ DocumentStore store = new ThrottlingDocumentStoreWrapper(memStore, statsCollector);
+ store.findAndUpdate(NODES, of(UPDATE_OP));
+ verify(memStore, atLeastOnce()).throttler();
+ }
+
}