Add pagination tests in performance test 94/141094/1
authorFrancescoFioraEst <francesco.fiora@est.tech>
Tue, 3 Jun 2025 09:44:27 +0000 (10:44 +0100)
committerFrancesco Fiora <francesco.fiora@est.tech>
Wed, 4 Jun 2025 09:16:47 +0000 (09:16 +0000)
Issue-ID: POLICY-5378
Change-Id: Ie94395ad59725827f94c39f7ecba630940fe5e4f
Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
testsuites/performance/src/main/resources/testplans/performance.jmx

index 6d0f804..0f423f6 100644 (file)
@@ -30,7 +30,7 @@
           </elementProp>
           <elementProp name="INSTANCES" elementType="Argument">
             <stringProp name="Argument.name">INSTANCES</stringProp>
-            <stringProp name="Argument.value">${__P(INSTANCES,50)}</stringProp>
+            <stringProp name="Argument.value">${__P(INSTANCES,100)}</stringProp>
             <stringProp name="Argument.metadata">=</stringProp>
           </elementProp>
           <elementProp name="USERS" elementType="Argument">
@@ -823,7 +823,7 @@ props.put(baseCount, (&quot;&quot; + icount));
             </hashTree>
           </hashTree>
         </hashTree>
-        <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get participants" enabled="true">
+        <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get participants with page=0 and size=10" enabled="true">
           <boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
           <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
             <collectionProp name="Arguments.arguments"/>
@@ -831,7 +831,41 @@ props.put(baseCount, (&quot;&quot; + icount));
           <stringProp name="HTTPSampler.domain">${RUNTIME_HOST}</stringProp>
           <stringProp name="HTTPSampler.port">${RUNTIME_PORT}</stringProp>
           <stringProp name="HTTPSampler.protocol">http</stringProp>
-          <stringProp name="HTTPSampler.path">/onap/policy/clamp/acm/v2/participants</stringProp>
+          <stringProp name="HTTPSampler.path">/onap/policy/clamp/acm/v2/participants?page=0&amp;size=10</stringProp>
+          <stringProp name="HTTPSampler.method">GET</stringProp>
+          <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
+          <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
+          <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
+          <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
+          <boolProp name="HTTPSampler.BROWSER_COMPATIBLE_MULTIPART">false</boolProp>
+          <boolProp name="HTTPSampler.image_parser">false</boolProp>
+          <boolProp name="HTTPSampler.concurrentDwn">false</boolProp>
+          <stringProp name="HTTPSampler.concurrentPool">6</stringProp>
+          <boolProp name="HTTPSampler.md5">false</boolProp>
+          <intProp name="HTTPSampler.ipSourceType">0</intProp>
+        </HTTPSamplerProxy>
+        <hashTree>
+          <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
+            <collectionProp name="Asserion.test_strings">
+              <stringProp name="49586">200</stringProp>
+            </collectionProp>
+            <stringProp name="Assertion.custom_message"></stringProp>
+            <stringProp name="Assertion.test_field">Assertion.response_code</stringProp>
+            <boolProp name="Assertion.assume_success">false</boolProp>
+            <intProp name="Assertion.test_type">1</intProp>
+            <stringProp name="Scope.variable"></stringProp>
+          </ResponseAssertion>
+          <hashTree/>
+        </hashTree>
+        <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get compositions with page=0 and size=10" enabled="true">
+          <boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
+          <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
+            <collectionProp name="Arguments.arguments"/>
+          </elementProp>
+          <stringProp name="HTTPSampler.domain">${RUNTIME_HOST}</stringProp>
+          <stringProp name="HTTPSampler.port">${RUNTIME_PORT}</stringProp>
+          <stringProp name="HTTPSampler.protocol">http</stringProp>
+          <stringProp name="HTTPSampler.path">/onap/policy/clamp/acm/v2/compositions?page=0&amp;size=10</stringProp>
           <stringProp name="HTTPSampler.method">GET</stringProp>
           <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
           <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
@@ -856,8 +890,23 @@ props.put(baseCount, (&quot;&quot; + icount));
             <stringProp name="Scope.variable"></stringProp>
           </ResponseAssertion>
           <hashTree/>
+          <JSONPostProcessor guiclass="JSONPostProcessorGui" testclass="JSONPostProcessor" testname="JSON Extractor" enabled="true">
+            <stringProp name="JSONPostProcessor.referenceNames">compositionIds</stringProp>
+            <stringProp name="JSONPostProcessor.jsonPathExprs">$.service_templates..metadata.compositionId</stringProp>
+            <stringProp name="JSONPostProcessor.match_numbers">-1</stringProp>
+          </JSONPostProcessor>
+          <hashTree/>
+          <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="JSR223 Assertion" enabled="true">
+            <stringProp name="scriptLanguage">groovy</stringProp>
+            <stringProp name="parameters"></stringProp>
+            <stringProp name="filename"></stringProp>
+            <stringProp name="cacheKey">true</stringProp>
+            <stringProp name="script">String compositionIds = vars.get(&quot;compositionIds_matchNr&quot;);
+assert compositionIds.equals(&quot;10&quot;)</stringProp>
+          </JSR223Assertion>
+          <hashTree/>
         </hashTree>
-        <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get compositions" enabled="true">
+        <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get compositions with page=1000 and size=10" enabled="true">
           <boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
           <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
             <collectionProp name="Arguments.arguments"/>
@@ -865,7 +914,7 @@ props.put(baseCount, (&quot;&quot; + icount));
           <stringProp name="HTTPSampler.domain">${RUNTIME_HOST}</stringProp>
           <stringProp name="HTTPSampler.port">${RUNTIME_PORT}</stringProp>
           <stringProp name="HTTPSampler.protocol">http</stringProp>
-          <stringProp name="HTTPSampler.path">/onap/policy/clamp/acm/v2/compositions</stringProp>
+          <stringProp name="HTTPSampler.path">/onap/policy/clamp/acm/v2/compositions?page=1000&amp;size=10</stringProp>
           <stringProp name="HTTPSampler.method">GET</stringProp>
           <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
           <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
@@ -890,6 +939,21 @@ props.put(baseCount, (&quot;&quot; + icount));
             <stringProp name="Scope.variable"></stringProp>
           </ResponseAssertion>
           <hashTree/>
+          <JSONPostProcessor guiclass="JSONPostProcessorGui" testclass="JSONPostProcessor" testname="JSON Extractor" enabled="true">
+            <stringProp name="JSONPostProcessor.referenceNames">compositionIds</stringProp>
+            <stringProp name="JSONPostProcessor.jsonPathExprs">$.service_templates..metadata.compositionId</stringProp>
+            <stringProp name="JSONPostProcessor.match_numbers">-1</stringProp>
+          </JSONPostProcessor>
+          <hashTree/>
+          <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="JSR223 Assertion" enabled="true">
+            <stringProp name="scriptLanguage">groovy</stringProp>
+            <stringProp name="parameters"></stringProp>
+            <stringProp name="filename"></stringProp>
+            <stringProp name="cacheKey">true</stringProp>
+            <stringProp name="script">String compositionIds = vars.get(&quot;compositionIds_matchNr&quot;);
+assert compositionIds.equals(&quot;0&quot;)</stringProp>
+          </JSR223Assertion>
+          <hashTree/>
         </hashTree>
         <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Undeploy and Delete" enabled="true">
           <stringProp name="LoopController.loops">${INSTANCES}</stringProp>
@@ -1168,8 +1232,6 @@ if (prev.getResponseCode() == &apos;200&apos;) {
             <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="BeanShell Sampler" enabled="true">
               <stringProp name="BeanShellSampler.query">// Extracted JSON array
 String jsonArray = vars.get(&quot;automationCompositionList&quot;);
-//String jsonArray = &quot;[]&quot;;
-
 
 log.info(&quot;instanceArray: &quot; + jsonArray);
 // Check if the JSON array is empty