Remove 32K limit from queries with collection parameters
[cps.git] / integration-test / src / test / groovy / org / onap / cps / integration / performance / cps / CpsDataServiceLimits.groovy
index 2df9101..1579470 100644 (file)
@@ -23,8 +23,7 @@ package org.onap.cps.integration.performance.cps
 import java.time.OffsetDateTime
 import org.onap.cps.api.CpsDataService
 import org.onap.cps.integration.performance.base.CpsPerfTestBase
-import org.springframework.dao.DataAccessResourceFailureException
-import org.springframework.transaction.TransactionSystemException
+import org.onap.cps.spi.exceptions.DataNodeNotFoundException
 
 import static org.onap.cps.spi.FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS
 
@@ -36,29 +35,29 @@ class CpsDataServiceLimits extends CpsPerfTestBase {
 
     def 'Multiple get limit exceeded: 32,764 (~ 2^15) xpaths.'() {
         given: 'more than 32,764 xpaths'
-            def xpaths = (0..32_764).collect { "/size/of/this/path/does/not/matter/for/limit[@id='" + it + "']" }
+            def xpaths = (0..40_000).collect { "/size/of/this/path/does/not/matter/for/limit[@id='" + it + "']" }
         when: 'single operation is executed to get all datanodes with given xpaths'
             objectUnderTest.getDataNodesForMultipleXpaths(CPS_PERFORMANCE_TEST_DATASPACE, 'bookstore1', xpaths, INCLUDE_ALL_DESCENDANTS)
-        then: 'a database exception is thrown'
-            thrown(DataAccessResourceFailureException.class)
+        then: 'a database exception is not thrown'
+            noExceptionThrown()
     }
 
     def 'Delete multiple datanodes limit exceeded: 32,767 (~ 2^15) xpaths.'() {
         given: 'more than 32,767 xpaths'
-            def xpaths = (0..32_767).collect { "/size/of/this/path/does/not/matter/for/limit[@id='" + it + "']" }
+            def xpaths = (0..40_000).collect { "/size/of/this/path/does/not/matter/for/limit[@id='" + it + "']" }
         when: 'single operation is executed to delete all datanodes with given xpaths'
             objectUnderTest.deleteDataNodes(CPS_PERFORMANCE_TEST_DATASPACE, 'bookstore1', xpaths, OffsetDateTime.now())
-        then: 'a database exception is thrown'
-            thrown(TransactionSystemException.class)
+        then: 'a database exception is not thrown (but a CPS DataNodeNotFoundException is thrown)'
+            thrown(DataNodeNotFoundException.class)
     }
 
     def 'Delete datanodes from multiple anchors limit exceeded: 32,766 (~ 2^15) anchors.'() {
         given: 'more than 32,766 anchor names'
-            def anchorNames = (0..32_766).collect { "size-of-this-name-does-not-matter-for-limit-" + it }
+            def anchorNames = (0..40_000).collect { "size-of-this-name-does-not-matter-for-limit-" + it }
         when: 'single operation is executed to delete all datanodes in given anchors'
             objectUnderTest.deleteDataNodes(CPS_PERFORMANCE_TEST_DATASPACE, anchorNames, OffsetDateTime.now())
-        then: 'a database exception is thrown'
-            thrown(DataAccessResourceFailureException.class)
+        then: 'a database exception is not thrown'
+            noExceptionThrown()
     }
 
 }