summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xtestsuites/run-s3p-test.sh58
-rw-r--r--testsuites/stability/src/main/resources/s3p.jmx2978
2 files changed, 1400 insertions, 1636 deletions
diff --git a/testsuites/run-s3p-test.sh b/testsuites/run-s3p-test.sh
index 8af1c9291..0523876e6 100755
--- a/testsuites/run-s3p-test.sh
+++ b/testsuites/run-s3p-test.sh
@@ -1,6 +1,6 @@
#!/bin/bash
# ============LICENSE_START=======================================================
-# Copyright (C) 2023 Nordix Foundation. All rights reserved.
+# Copyright (C) 2023-2025 Nordix Foundation. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -22,28 +22,44 @@ if [ -z "${WORKSPACE}" ]; then
export WORKSPACE=$(git rev-parse --show-toplevel)
fi
+export PROJECT="drools-pdp"
export TESTDIR=${WORKSPACE}/testsuites
export DROOLS_PERF_TEST_FILE=$TESTDIR/performance/src/main/resources/amsterdam/policyMTPerformanceTestPlan.jmx
export DROOLS_STAB_TEST_FILE=$TESTDIR/stability/src/main/resources/s3p.jmx
-if [ $1 == "run" ]
-then
-
- mkdir automate-performance;cd automate-performance;
- git clone "https://gerrit.onap.org/r/policy/docker"
- cd docker/csit
-
- if [ $2 == "performance" ]
- then
- bash start-s3p-tests.sh run $DROOLS_PERF_TEST_FILE drools-applications;
- elif [ $2 == "stability" ]
- then
- bash start-s3p-tests.sh run $DROOLS_STAB_TEST_FILE drools-applications;
- else
- echo "echo Invalid arguments provided. Usage: $0 [option..] {performance | stability}"
- fi
-
-else
- echo "Invalid arguments provided. Usage: $0 [option..] {run | uninstall}"
-fi
+function run_tests() {
+ local test_file=$1
+
+ mkdir -p automate-s3p-test
+ cd automate-s3p-test || exit 1
+ git clone "https://gerrit.onap.org/r/policy/docker"
+ cd docker/csit || exit 1
+
+ bash run-s3p-tests.sh test "$test_file" $PROJECT
+}
+
+function clean() {
+ cd $TESTDIR/automate-s3p-test/docker/csit
+ bash run-s3p-tests.sh clean
+}
+
+echo "==========================="
+echo "Running tests for: $PROJECT"
+echo "==========================="
+
+case $1 in
+ performance)
+ run_tests "$DROOLS_PERF_TEST_FILE"
+ ;;
+ stability)
+ run_tests "$DROOLS_STAB_TEST_FILE"
+ ;;
+ clean)
+ clean
+ ;;
+ *)
+ echo "Invalid arguments provided. Usage: $0 {performance | stability | clean}"
+ exit 1
+ ;;
+esac
diff --git a/testsuites/stability/src/main/resources/s3p.jmx b/testsuites/stability/src/main/resources/s3p.jmx
index c4ebb7ae9..cde152771 100644
--- a/testsuites/stability/src/main/resources/s3p.jmx
+++ b/testsuites/stability/src/main/resources/s3p.jmx
@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
-<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.6.2">
+<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.6.3">
<hashTree>
- <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="PDP-D Stability" enabled="true">
- <boolProp name="TestPlan.functional_mode">false</boolProp>
+ <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="PDP-D Stability">
<boolProp name="TestPlan.tearDown_on_shutdown">true</boolProp>
- <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
- <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
+ <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables">
<collectionProp name="Arguments.arguments">
<elementProp name="API_HOST" elementType="Argument">
<stringProp name="Argument.name">API_HOST</stringProp>
@@ -34,7 +32,7 @@
</elementProp>
<elementProp name="KAFKA_PORT" elementType="Argument">
<stringProp name="Argument.name">KAFKA_PORT</stringProp>
- <stringProp name="Argument.value">9092</stringProp>
+ <stringProp name="Argument.value">29092</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="DROOLS_HOST" elementType="Argument">
@@ -54,14 +52,14 @@
</elementProp>
<elementProp name="HTTP" elementType="Argument">
<stringProp name="Argument.name">HTTP</stringProp>
- <stringProp name="Argument.value">https</stringProp>
+ <stringProp name="Argument.value">http</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
</collectionProp>
</elementProp>
</TestPlan>
<hashTree>
- <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
+ <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager">
<collectionProp name="HeaderManager.headers">
<elementProp name="" elementType="Header">
<stringProp name="Header.name">Accept</stringProp>
@@ -102,52 +100,41 @@
</AuthManager>
<hashTree/>
<ConfigTestElement guiclass="HttpDefaultsGui" testclass="ConfigTestElement" testname="HTTP Request Defaults" enabled="true">
- <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
- <collectionProp name="Arguments.arguments"/>
- </elementProp>
<stringProp name="HTTPSampler.port">9696</stringProp>
<stringProp name="HTTPSampler.protocol">http</stringProp>
+ <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables">
+ <collectionProp name="Arguments.arguments"/>
+ </elementProp>
+ <stringProp name="HTTPSampler.implementation"></stringProp>
</ConfigTestElement>
<hashTree/>
- <SetupThreadGroup guiclass="SetupThreadGroupGui" testclass="SetupThreadGroup" testname="Set up" enabled="true">
+ <SetupThreadGroup guiclass="SetupThreadGroupGui" testclass="SetupThreadGroup" testname="Set up">
+ <intProp name="ThreadGroup.num_threads">1</intProp>
+ <intProp name="ThreadGroup.ramp_time">1</intProp>
+ <boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
- <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
+ <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller">
<stringProp name="LoopController.loops">1</stringProp>
<boolProp name="LoopController.continue_forever">false</boolProp>
</elementProp>
- <stringProp name="ThreadGroup.num_threads">1</stringProp>
- <stringProp name="ThreadGroup.ramp_time">1</stringProp>
- <boolProp name="ThreadGroup.scheduler">false</boolProp>
- <stringProp name="ThreadGroup.duration"></stringProp>
- <stringProp name="ThreadGroup.delay"></stringProp>
- <boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
</SetupThreadGroup>
<hashTree>
<GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="API" enabled="true"/>
<hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API Healthcheck" 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>
+ <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API Healthcheck">
+ <intProp name="HTTPSampler.concurrentPool">6</intProp>
<stringProp name="HTTPSampler.domain">${API_HOST}</stringProp>
<stringProp name="HTTPSampler.port">${API_PORT}</stringProp>
<stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
<stringProp name="HTTPSampler.path">/policy/api/v1/healthcheck</stringProp>
<stringProp name="HTTPSampler.method">GET</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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>
+ <boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
+ <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables">
+ <collectionProp name="Arguments.arguments"/>
+ </elementProp>
</HTTPSamplerProxy>
<hashTree>
- <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
+ <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion">
<collectionProp name="Asserion.test_strings">
<stringProp name="49586">200</stringProp>
</collectionProp>
@@ -157,7 +144,7 @@
<intProp name="Assertion.test_type">8</intProp>
</ResponseAssertion>
<hashTree/>
- <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion" enabled="true">
+ <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion">
<stringProp name="JSON_PATH">$.healthy</stringProp>
<stringProp name="EXPECTED_VALUE">true</stringProp>
<boolProp name="JSONVALIDATION">true</boolProp>
@@ -167,7 +154,13 @@
</JSONPathAssertion>
<hashTree/>
</hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create vCPE Policy" enabled="true">
+ <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create vCPE Policy">
+ <intProp name="HTTPSampler.concurrentPool">6</intProp>
+ <stringProp name="HTTPSampler.domain">${API_HOST}</stringProp>
+ <stringProp name="HTTPSampler.port">${API_PORT}</stringProp>
+ <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
+ <stringProp name="HTTPSampler.path">policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0/policies</stringProp>
+ <stringProp name="HTTPSampler.method">POST</stringProp>
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
<collectionProp name="Arguments.arguments">
@@ -222,26 +215,11 @@
</elementProp>
</collectionProp>
</elementProp>
- <stringProp name="HTTPSampler.domain">${API_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${API_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0/policies</stringProp>
- <stringProp name="HTTPSampler.method">POST</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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>
+ <stringProp name="49587">201</stringProp>
</collectionProp>
<stringProp name="Assertion.custom_message"></stringProp>
<stringProp name="Assertion.test_field">Assertion.response_code</stringProp>
@@ -251,6 +229,12 @@
<hashTree/>
</hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create 5G SON O1 Policy" enabled="true">
+ <intProp name="HTTPSampler.concurrentPool">6</intProp>
+ <stringProp name="HTTPSampler.domain">${API_HOST}</stringProp>
+ <stringProp name="HTTPSampler.port">${API_PORT}</stringProp>
+ <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
+ <stringProp name="HTTPSampler.path">policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0/policies</stringProp>
+ <stringProp name="HTTPSampler.method">POST</stringProp>
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
<collectionProp name="Arguments.arguments">
@@ -305,26 +289,11 @@
</elementProp>
</collectionProp>
</elementProp>
- <stringProp name="HTTPSampler.domain">${API_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${API_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0/policies</stringProp>
- <stringProp name="HTTPSampler.method">POST</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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>
+ <stringProp name="49587">201</stringProp>
</collectionProp>
<stringProp name="Assertion.custom_message"></stringProp>
<stringProp name="Assertion.test_field">Assertion.response_code</stringProp>
@@ -334,6 +303,12 @@
<hashTree/>
</hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create 5G SON A1 Policy" enabled="true">
+ <intProp name="HTTPSampler.concurrentPool">6</intProp>
+ <stringProp name="HTTPSampler.domain">${API_HOST}</stringProp>
+ <stringProp name="HTTPSampler.port">${API_PORT}</stringProp>
+ <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
+ <stringProp name="HTTPSampler.path">policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0/policies</stringProp>
+ <stringProp name="HTTPSampler.method">POST</stringProp>
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
<collectionProp name="Arguments.arguments">
@@ -388,26 +363,11 @@
</elementProp>
</collectionProp>
</elementProp>
- <stringProp name="HTTPSampler.domain">${API_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${API_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0/policies</stringProp>
- <stringProp name="HTTPSampler.method">POST</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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>
+ <stringProp name="49587">201</stringProp>
</collectionProp>
<stringProp name="Assertion.custom_message"></stringProp>
<stringProp name="Assertion.test_field">Assertion.response_code</stringProp>
@@ -417,31 +377,22 @@
<hashTree/>
</hashTree>
</hashTree>
- <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="PAP" enabled="true"/>
+ <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="PAP"/>
<hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="PAP Healthcheck" 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>
+ <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="PAP Healthcheck">
+ <intProp name="HTTPSampler.concurrentPool">6</intProp>
<stringProp name="HTTPSampler.domain">${PAP_HOST}</stringProp>
<stringProp name="HTTPSampler.port">${PAP_PORT}</stringProp>
<stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
<stringProp name="HTTPSampler.path">/policy/pap/v1/healthcheck</stringProp>
<stringProp name="HTTPSampler.method">GET</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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>
+ <boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
+ <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables">
+ <collectionProp name="Arguments.arguments"/>
+ </elementProp>
</HTTPSamplerProxy>
<hashTree>
- <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
+ <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion">
<collectionProp name="Asserion.test_strings">
<stringProp name="49586">200</stringProp>
</collectionProp>
@@ -451,7 +402,7 @@
<intProp name="Assertion.test_type">8</intProp>
</ResponseAssertion>
<hashTree/>
- <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion" enabled="true">
+ <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion">
<stringProp name="JSON_PATH">$.healthy</stringProp>
<stringProp name="EXPECTED_VALUE">true</stringProp>
<boolProp name="JSONVALIDATION">true</boolProp>
@@ -461,7 +412,13 @@
</JSONPathAssertion>
<hashTree/>
</hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Deploy vCPE Policy" enabled="true">
+ <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Deploy vCPE Policy">
+ <intProp name="HTTPSampler.concurrentPool">6</intProp>
+ <stringProp name="HTTPSampler.domain">${PAP_HOST}</stringProp>
+ <stringProp name="HTTPSampler.port">${PAP_PORT}</stringProp>
+ <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
+ <stringProp name="HTTPSampler.path">policy/pap/v1/pdps/policies</stringProp>
+ <stringProp name="HTTPSampler.method">POST</stringProp>
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
<collectionProp name="Arguments.arguments">
@@ -472,24 +429,9 @@
</elementProp>
</collectionProp>
</elementProp>
- <stringProp name="HTTPSampler.domain">${PAP_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${PAP_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">policy/pap/v1/pdps/policies</stringProp>
- <stringProp name="HTTPSampler.method">POST</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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">
+ <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion">
<collectionProp name="Asserion.test_strings">
<stringProp name="49588">202</stringProp>
</collectionProp>
@@ -500,7 +442,13 @@
</ResponseAssertion>
<hashTree/>
</hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Deploy 5G SON O1" enabled="true">
+ <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Deploy 5G SON O1">
+ <intProp name="HTTPSampler.concurrentPool">6</intProp>
+ <stringProp name="HTTPSampler.domain">${PAP_HOST}</stringProp>
+ <stringProp name="HTTPSampler.port">${PAP_PORT}</stringProp>
+ <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
+ <stringProp name="HTTPSampler.path">policy/pap/v1/pdps/policies</stringProp>
+ <stringProp name="HTTPSampler.method">POST</stringProp>
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
<collectionProp name="Arguments.arguments">
@@ -511,21 +459,6 @@
</elementProp>
</collectionProp>
</elementProp>
- <stringProp name="HTTPSampler.domain">${PAP_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${PAP_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">policy/pap/v1/pdps/policies</stringProp>
- <stringProp name="HTTPSampler.method">POST</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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">
@@ -539,7 +472,13 @@
</ResponseAssertion>
<hashTree/>
</hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Deploy 5G SON A1" enabled="true">
+ <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Deploy 5G SON A1">
+ <intProp name="HTTPSampler.concurrentPool">6</intProp>
+ <stringProp name="HTTPSampler.domain">${PAP_HOST}</stringProp>
+ <stringProp name="HTTPSampler.port">${PAP_PORT}</stringProp>
+ <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
+ <stringProp name="HTTPSampler.path">policy/pap/v1/pdps/policies</stringProp>
+ <stringProp name="HTTPSampler.method">POST</stringProp>
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
<collectionProp name="Arguments.arguments">
@@ -550,21 +489,6 @@
</elementProp>
</collectionProp>
</elementProp>
- <stringProp name="HTTPSampler.domain">${PAP_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${PAP_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">policy/pap/v1/pdps/policies</stringProp>
- <stringProp name="HTTPSampler.method">POST</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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">
@@ -579,425 +503,19 @@
<hashTree/>
</hashTree>
</hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="POLICY-PDP-PAP " 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">${KAFKA_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${KAFKA_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">events/policy-pdp-pap/${__time()}/1?timeout=2000</stringProp>
- <stringProp name="HTTPSampler.method">GET</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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">8</intProp>
- </ResponseAssertion>
- <hashTree/>
- </hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Drain vCPE success appc-lcm-read" 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">${KAFKA_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${KAFKA_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">events/appc-lcm-read/vcpesuccess/1?timeout=5000</stringProp>
- <stringProp name="HTTPSampler.method">GET</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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">8</intProp>
- </ResponseAssertion>
- <hashTree/>
- </hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Drain vCPE success policy-cl-mgt" 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">${KAFKA_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${KAFKA_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">events/policy-cl-mgt/vcpesuccess/1?timeout=5000</stringProp>
- <stringProp name="HTTPSampler.method">GET</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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">8</intProp>
- </ResponseAssertion>
- <hashTree/>
- </hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Drain SON 01 SDNR-CL" 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">${KAFKA_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${KAFKA_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">events/SDNR-CL/sonO1/1?timeout=5000</stringProp>
- <stringProp name="HTTPSampler.method">GET</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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">8</intProp>
- </ResponseAssertion>
- <hashTree/>
- </hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Drain SON 01 SDNR-CL-RSP" 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">${KAFKA_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${KAFKA_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">events/SDNR-CL-RSP/sonO1/1?timeout=5000</stringProp>
- <stringProp name="HTTPSampler.method">GET</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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">8</intProp>
- </ResponseAssertion>
- <hashTree/>
- </hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Drain SON 01 DCAE_CL_RSP" 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">${KAFKA_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${KAFKA_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">events/DCAE_CL_RSP/son01/1?timeout=5000</stringProp>
- <stringProp name="HTTPSampler.method">GET</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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">8</intProp>
- </ResponseAssertion>
- <hashTree/>
- </hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Drain SON A1 SDNR-CL" 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">${KAFKA_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${KAFKA_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">events/SDNR-CL/sonA1/1?timeout=5000</stringProp>
- <stringProp name="HTTPSampler.method">GET</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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">8</intProp>
- </ResponseAssertion>
- <hashTree/>
- </hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Drain SON A1 SDNR-CL-RSP" 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">${KAFKA_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${KAFKA_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">events/SDNR-CL-RSP/sonA1/1?timeout=5000</stringProp>
- <stringProp name="HTTPSampler.method">GET</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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">8</intProp>
- </ResponseAssertion>
- <hashTree/>
- </hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Drain SON A1 DCAE_CL_RSP" 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">${KAFKA_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${KAFKA_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">events/DCAE_CL_RSP/sonA1/1?timeout=5000</stringProp>
- <stringProp name="HTTPSampler.method">GET</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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">8</intProp>
- </ResponseAssertion>
- <hashTree/>
- </hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Drain SON A1 policy-cl-mgt" 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">${KAFKA_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${KAFKA_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">events/policy-cl-mgt/sonA1/1?timeout=5000</stringProp>
- <stringProp name="HTTPSampler.method">GET</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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">8</intProp>
- </ResponseAssertion>
- <hashTree/>
- </hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Drain SON A1 policy-cl-mgt" 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">${KAFKA_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${KAFKA_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">events/policy-cl-mgt/sonA1/1?timeout=5000</stringProp>
- <stringProp name="HTTPSampler.method">GET</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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">8</intProp>
- </ResponseAssertion>
- <hashTree/>
- </hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="PDP-D" 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">${DROOLS_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${DROOLS_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">policy/pdp/engine/controllers/usecases/drools/facts</stringProp>
- <stringProp name="HTTPSampler.method">GET</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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">8</intProp>
- </ResponseAssertion>
- <hashTree/>
- <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion" enabled="true">
- <stringProp name="JSON_PATH">$.usecases</stringProp>
- <stringProp name="EXPECTED_VALUE">7</stringProp>
- <boolProp name="JSONVALIDATION">true</boolProp>
- <boolProp name="EXPECT_NULL">false</boolProp>
- <boolProp name="INVERT">false</boolProp>
- <boolProp name="ISREGEX">false</boolProp>
- </JSONPathAssertion>
- <hashTree/>
- </hashTree>
</hashTree>
- <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="vCPE Success" enabled="true">
- <stringProp name="ThreadGroup.on_sample_error">startnextloop</stringProp>
- <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
+ <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="vCPE SUCCESS">
+ <intProp name="ThreadGroup.num_threads">1</intProp>
+ <intProp name="ThreadGroup.ramp_time">1</intProp>
+ <stringProp name="ThreadGroup.duration">${duration}</stringProp>
+ <longProp name="ThreadGroup.delay">11</longProp>
+ <boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
+ <boolProp name="ThreadGroup.scheduler">true</boolProp>
+ <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
+ <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller">
<intProp name="LoopController.loops">-1</intProp>
<boolProp name="LoopController.continue_forever">false</boolProp>
</elementProp>
- <stringProp name="ThreadGroup.num_threads">1</stringProp>
- <stringProp name="ThreadGroup.ramp_time">1</stringProp>
- <boolProp name="ThreadGroup.scheduler">true</boolProp>
- <stringProp name="ThreadGroup.duration">${duration}</stringProp>
- <stringProp name="ThreadGroup.delay">11</stringProp>
- <boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
- <boolProp name="ThreadGroup.delayedStart">false</boolProp>
</ThreadGroup>
<hashTree>
<UserParameters guiclass="UserParametersGui" testclass="UserParameters" testname="Set consumer group per scenario" enabled="true">
@@ -1013,7 +531,7 @@
<stringProp name="TestPlan.comments">Global to the thread group</stringProp>
</UserParameters>
<hashTree/>
- <UserParameters guiclass="UserParametersGui" testclass="UserParameters" testname="Set request id per cycle" enabled="true">
+ <UserParameters guiclass="UserParametersGui" testclass="UserParameters" testname="Set request id per cycle">
<collectionProp name="UserParameters.names">
<stringProp name="693933066">requestId</stringProp>
</collectionProp>
@@ -1026,60 +544,65 @@
<stringProp name="TestPlan.comments">Update on a per iteration basis</stringProp>
</UserParameters>
<hashTree/>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="DCAE[DCAE_TOPIC]: ONSET" enabled="true">
- <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
- <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
- <collectionProp name="Arguments.arguments">
- <elementProp name="" elementType="HTTPArgument">
- <boolProp name="HTTPArgument.always_encode">false</boolProp>
- <stringProp name="Argument.value">{&#xd;
- &quot;closedLoopControlName&quot;: &quot;ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e&quot;,&#xd;
- &quot;closedLoopAlarmStart&quot;: 1463679805324,&#xd;
- &quot;closedLoopEventClient&quot;: &quot;DCAE_INSTANCE_ID.dcae-tca&quot;,&#xd;
- &quot;closedLoopEventStatus&quot;: &quot;ONSET&quot;,&#xd;
- &quot;requestID&quot;: &quot;${requestId}&quot;,&#xd;
- &quot;target_type&quot;: &quot;VNF&quot;,&#xd;
- &quot;target&quot;: &quot;generic-vnf.vnf-id&quot;,&#xd;
- &quot;AAI&quot;: {&#xd;
- &quot;vserver.is-closed-loop-disabled&quot;: &quot;false&quot;,&#xd;
- &quot;vserver.prov-status&quot;: &quot;ACTIVE&quot;,&#xd;
- &quot;generic-vnf.vnf-id&quot;: &quot;vCPE_Infrastructure_vGMUX_demo_app&quot;&#xd;
- },&#xd;
- &quot;from&quot;: &quot;DCAE&quot;,&#xd;
- &quot;version&quot;: &quot;1.0.2&quot;&#xd;
-}</stringProp>
- <stringProp name="Argument.metadata">=</stringProp>
- </elementProp>
- </collectionProp>
- </elementProp>
- <stringProp name="HTTPSampler.domain">${DROOLS_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${DROOLS_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">policy/pdp/engine/topics/sources/dmaap/dcae_topic/events</stringProp>
- <stringProp name="HTTPSampler.method">PUT</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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>
- <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
- <collectionProp name="HeaderManager.headers">
- <elementProp name="" elementType="Header">
- <stringProp name="Header.name">Content-Type</stringProp>
- <stringProp name="Header.value">text/plain</stringProp>
- </elementProp>
- </collectionProp>
- </HeaderManager>
- <hashTree/>
- </hashTree>
- <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="Init DMaaP Counter" enabled="true">
+ <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="DCAE[dcae-topic]: ONSET">
+ <stringProp name="scriptLanguage">groovy</stringProp>
+ <stringProp name="parameters"></stringProp>
+ <stringProp name="filename"></stringProp>
+ <stringProp name="cacheKey">true</stringProp>
+ <stringProp name="script">import org.apache.kafka.clients.producer.KafkaProducer
+import org.apache.kafka.clients.producer.ProducerConfig
+import org.apache.kafka.clients.producer.ProducerRecord
+import org.apache.kafka.common.serialization.StringSerializer
+
+// Kafka producer configuration
+def props = new Properties()
+props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, vars.get(&quot;KAFKA_HOST&quot;) + &quot;:&quot; + vars.get(&quot;KAFKA_PORT&quot;))
+props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName())
+props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName())
+props.put(ProducerConfig.CLIENT_ID_CONFIG, &quot;dcae-topic-producer&quot;)
+
+// Create Kafka producer
+def producer = new KafkaProducer&lt;&gt;(props)
+
+// Prepare the message
+def message = &quot;&quot;&quot;
+{
+ &quot;closedLoopControlName&quot;: &quot;ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e&quot;,
+ &quot;closedLoopAlarmStart&quot;: 1463679805324,
+ &quot;closedLoopEventClient&quot;: &quot;DCAE_INSTANCE_ID.dcae-tca&quot;,
+ &quot;closedLoopEventStatus&quot;: &quot;ONSET&quot;,
+ &quot;requestID&quot;: &quot;${requestId}&quot;,
+ &quot;target_type&quot;: &quot;VNF&quot;,
+ &quot;target&quot;: &quot;generic-vnf.vnf-id&quot;,
+ &quot;AAI&quot;: {
+ &quot;vserver.is-closed-loop-disabled&quot;: &quot;false&quot;,
+ &quot;vserver.prov-status&quot;: &quot;ACTIVE&quot;,
+ &quot;generic-vnf.vnf-id&quot;: &quot;vCPE_Infrastructure_vGMUX_demo_app&quot;
+ },
+ &quot;from&quot;: &quot;DCAE&quot;,
+ &quot;version&quot;: &quot;1.0.2&quot;
+}
+&quot;&quot;&quot;.toString()
+
+// Create a producer record
+def record = new ProducerRecord&lt;&gt;(&quot;unauthenticated.dcae_cl_output&quot;, vars.get(&quot;requestId&quot;).toString(), message)
+
+// Send the message
+def future = producer.send(record)
+
+// Wait for the send to complete and log the result
+def metadata = future.get()
+log.info(&quot;Message sent to topic: ${metadata.topic()}, partition: ${metadata.partition()}, offset: ${metadata.offset()}&quot;)
+
+// Close the producer
+producer.close()
+
+// Set a variable to indicate successful sending
+vars.put(&quot;messageSent&quot;, &quot;true&quot;)
+</stringProp>
+ </JSR223Sampler>
+ <hashTree/>
+ <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="Init Kafka Counter">
<stringProp name="scriptLanguage">groovy</stringProp>
<stringProp name="parameters"></stringProp>
<stringProp name="filename"></stringProp>
@@ -1087,318 +610,403 @@
<stringProp name="script">vars.put(&quot;counter&quot;, &quot;0&quot;);</stringProp>
</JSR223Sampler>
<hashTree/>
- <WhileController guiclass="WhileControllerGui" testclass="WhileController" testname="APPCL Restart Loop Controller" enabled="true">
- <stringProp name="WhileController.condition">${__javaScript(${counter} &lt; 10)}</stringProp>
- </WhileController>
+ <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="APPCL Restart Loop Controller">
+ <stringProp name="LoopController.loops">10</stringProp>
+ </LoopController>
<hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="POLICY[appc-lcm-read]: Restart" 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 name="filter" elementType="HTTPArgument">
- <boolProp name="HTTPArgument.always_encode">true</boolProp>
- <stringProp name="Argument.value">{&quot;class&quot;:&quot;And&quot;, &quot;filters&quot;: [ { &quot;class&quot;:&quot;Equals&quot;, &quot;field&quot;:&quot;request-id&quot;, &quot;value&quot;:&quot;${requestId}&quot; }, { &quot;class&quot;:&quot;Equals&quot;, &quot;field&quot;:&quot;rpc-name&quot;, &quot;value&quot;:&quot;restart&quot; }]}</stringProp>
- <stringProp name="Argument.metadata">=</stringProp>
- <boolProp name="HTTPArgument.use_equals">true</boolProp>
- <stringProp name="Argument.name">filter</stringProp>
- </elementProp>
- </collectionProp>
- </elementProp>
- <stringProp name="HTTPSampler.domain">${KAFKA_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${KAFKA_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">events/appc-lcm-read/${consumerGroup}/1?timeout=15000&amp;limit=1</stringProp>
- <stringProp name="HTTPSampler.method">GET</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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>
+ <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="Read kafka topic">
+ <stringProp name="scriptLanguage">groovy</stringProp>
+ <stringProp name="parameters"></stringProp>
+ <stringProp name="filename"></stringProp>
+ <stringProp name="cacheKey">true</stringProp>
+ <stringProp name="script">import org.apache.kafka.clients.consumer.KafkaConsumer
+import org.apache.kafka.clients.consumer.ConsumerConfig
+import org.apache.kafka.common.serialization.StringDeserializer
+import java.time.Duration
+
+// Kafka consumer configuration
+def props = new Properties()
+props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, vars.get(&quot;KAFKA_HOST&quot;) + &quot;:&quot; + vars.get(&quot;KAFKA_PORT&quot;))
+props.put(ConsumerConfig.GROUP_ID_CONFIG, vars.get(&quot;consumerGroup&quot;))
+props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName())
+props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName())
+props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, &quot;earliest&quot;)
+
+// Create Kafka consumer
+def consumer = new KafkaConsumer&lt;&gt;(props)
+
+try {
+ // Subscribe to the topic
+ consumer.subscribe(Arrays.asList(&quot;appc-lcm-read&quot;))
+
+ // Poll for records
+ def records = consumer.poll(Duration.ofMillis(15000))
+
+ if (records.isEmpty()) {
+ log.warn(&quot;No records found within the timeout period&quot;)
+ vars.put(&quot;messageConsumed&quot;, &quot;false&quot;)
+ } else {
+ // Process the first record
+ def record = records.first()
+ def requestId = record.key()
+ def value = record.value()
+
+ // Store the entire message
+ vars.put(&quot;kafkaMessage&quot;, value)
+
+ // Parse the value
+ def jsonSlurper = new groovy.json.JsonSlurper()
+ def parsedValue = jsonSlurper.parseText(value)
+
+ // Extract required fields
+ vars.put(&quot;requestIdOnset&quot;, parsedValue[&quot;request-id&quot;])
+ vars.put(&quot;correlationId&quot;, parsedValue[&quot;correlation-id&quot;])
+ vars.put(&quot;subRequestId&quot;, parsedValue[&quot;sub-request-id&quot;])
+
+ // Log the extracted information
+ log.info(&quot;RequestId: &quot; + requestId)
+ log.info(&quot;Parsed Value: &quot; + parsedValue)
+
+ vars.put(&quot;messageConsumed&quot;, &quot;true&quot;)
+ }
+} catch (Exception e) {
+ log.error(&quot;Error processing Kafka message: &quot; + e.getMessage())
+ vars.put(&quot;messageConsumed&quot;, &quot;false&quot;)
+} finally {
+ // Close the consumer
+ consumer.close()
+}
+</stringProp>
+ </JSR223Sampler>
<hashTree>
- <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="No []" enabled="true">
- <collectionProp name="Asserion.test_strings">
- <stringProp name="2914">[]</stringProp>
- </collectionProp>
- <stringProp name="Assertion.custom_message"></stringProp>
- <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
- <boolProp name="Assertion.assume_success">false</boolProp>
- <intProp name="Assertion.test_type">12</intProp>
- </ResponseAssertion>
- <hashTree/>
- <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="request-id extractor" enabled="true">
- <stringProp name="RegexExtractor.useHeaders">false</stringProp>
- <stringProp name="RegexExtractor.refname">requestIdOnset</stringProp>
- <stringProp name="RegexExtractor.regex">\\&quot;request-id\\&quot;: \\&quot;(.+?)\\&quot;</stringProp>
- <stringProp name="RegexExtractor.template">$1$</stringProp>
- <stringProp name="RegexExtractor.default">none</stringProp>
- <boolProp name="RegexExtractor.default_empty_value">false</boolProp>
- </RegexExtractor>
- <hashTree/>
- <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="correlation-id extractor" enabled="true">
- <stringProp name="RegexExtractor.useHeaders">false</stringProp>
- <stringProp name="RegexExtractor.refname">correlationId</stringProp>
- <stringProp name="RegexExtractor.regex">correlation-id\\&quot;: \\&quot;(.+?)\\&quot;</stringProp>
- <stringProp name="RegexExtractor.template">$1$</stringProp>
- <stringProp name="RegexExtractor.default">none</stringProp>
- <boolProp name="RegexExtractor.default_empty_value">false</boolProp>
- </RegexExtractor>
+ <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="requestId extractor">
+ <stringProp name="cacheKey">true</stringProp>
+ <stringProp name="filename"></stringProp>
+ <stringProp name="parameters"></stringProp>
+ <stringProp name="script">import groovy.json.JsonSlurper
+
+def message = vars.get(&quot;kafkaMessage&quot;)
+def jsonSlurper = new JsonSlurper()
+def parsedMessage = jsonSlurper.parseText(message)
+
+vars.put(&quot;requestIdOnset&quot;, parsedMessage.requestId ?: &quot;none&quot;)
+</stringProp>
+ <stringProp name="scriptLanguage">groovy</stringProp>
+ </JSR223PostProcessor>
<hashTree/>
- <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="sub-request-id extractor" enabled="true">
- <stringProp name="RegexExtractor.useHeaders">false</stringProp>
- <stringProp name="RegexExtractor.refname">subRequestId</stringProp>
- <stringProp name="RegexExtractor.regex">sub-request-id\\&quot;: \\&quot;(.+?)\\&quot;</stringProp>
- <stringProp name="RegexExtractor.template">$1$</stringProp>
- <stringProp name="RegexExtractor.default">none</stringProp>
- <boolProp name="RegexExtractor.default_empty_value">false</boolProp>
- </RegexExtractor>
+ <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="notification extractor">
+ <stringProp name="scriptLanguage">groovy</stringProp>
+ <stringProp name="parameters"></stringProp>
+ <stringProp name="filename"></stringProp>
+ <stringProp name="cacheKey">true</stringProp>
+ <stringProp name="script">import groovy.json.JsonSlurper
+
+def message = vars.get(&quot;kafkaMessage&quot;)
+def jsonSlurper = new JsonSlurper()
+def parsedMessage = jsonSlurper.parseText(message)
+
+vars.put(&quot;notification&quot;, parsedMessage.notification ?: &quot;none&quot;)
+</stringProp>
+ </JSR223PostProcessor>
<hashTree/>
- <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="JSR223 Assertion" enabled="true">
+ <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="JSR223 Assertion">
<stringProp name="scriptLanguage">groovy</stringProp>
<stringProp name="parameters"></stringProp>
<stringProp name="filename"></stringProp>
<stringProp name="cacheKey">true</stringProp>
- <stringProp name="script">String requestIdOnset = vars.get(&quot;requestIdOnset&quot;);
-String requestId = vars.get(&quot;requestId&quot;);
-String correlationId = vars.get(&quot;correlationId&quot;);
-String subRequestId = vars.get(&quot;subRequestId&quot;);
-String counter = vars.get(&quot;counter&quot;);
-
-String transaction = &quot;none&quot;;
-
-log.info (&quot;The requestId id is &quot; + requestId);
-log.info (&quot;The requestIdOnset id is &quot; + requestIdOnset);
-log.info (&quot;The correlation id is &quot; + correlationId);
-log.info (&quot;The subrequest id is &quot; + subRequestId);
-log.info (&quot;The counter is &quot; + counter);
-
-if ( requestId == requestIdOnset ) {
- if ( correlationId == &quot;none&quot; || subRequestId == &quot;none&quot; ) {
- transaction = &quot;FINAL&quot;;
- log.info (&quot;Final Failure Transaction&quot;);
- AssertionResult.setFailureMessage(&quot;Missing correlationId or subRequestId&quot;);
- AssertionResult.setFailure(true);
- } else {
- transaction = &quot;FINAL&quot;;
- vars.put(&quot;transaction&quot;, &quot;FINAL&quot;);
- log.info (&quot;Final Success Transaction&quot;);
- }
+ <stringProp name="script">import org.apache.kafka.clients.consumer.ConsumerRecord
+
+// Assuming the Kafka message is stored in a variable named &apos;kafkaMessage&apos;
+ConsumerRecord&lt;String, String&gt; record = vars.getObject(&quot;kafkaMessage&quot;)
+
+String requestIdOnset = record.key()
+String requestId = vars.get(&quot;requestId&quot;)
+String correlationId = &quot;none&quot;
+String subRequestId = &quot;none&quot;
+String counter = vars.get(&quot;counter&quot;)
+
+String transaction = &quot;none&quot;
+
+// Parse the Kafka message value (assuming it&apos;s JSON)
+def jsonSlurper = new groovy.json.JsonSlurper()
+def messageContent = jsonSlurper.parseText(record.value())
+
+if (messageContent.containsKey(&quot;correlation-id&quot;)) {
+ correlationId = messageContent[&quot;correlation-id&quot;]
+}
+if (messageContent.containsKey(&quot;sub-request-id&quot;)) {
+ subRequestId = messageContent[&quot;sub-request-id&quot;]
}
-int counterTemp = Integer.parseInt(counter) +1;
+log.info(&quot;The requestId is &quot; + requestId)
+log.info(&quot;The requestIdOnset is &quot; + requestIdOnset)
+log.info(&quot;The correlation id is &quot; + correlationId)
+log.info(&quot;The subrequest id is &quot; + subRequestId)
+log.info(&quot;The counter is &quot; + counter)
+
+if (requestId == requestIdOnset) {
+ if (correlationId == &quot;none&quot; || subRequestId == &quot;none&quot;) {
+ transaction = &quot;FINAL&quot;
+ log.info(&quot;Final Failure Transaction&quot;)
+ AssertionResult.setFailureMessage(&quot;Missing correlationId or subRequestId&quot;)
+ AssertionResult.setFailure(true)
+ } else {
+ transaction = &quot;FINAL&quot;
+ vars.put(&quot;transaction&quot;, &quot;FINAL&quot;)
+ log.info(&quot;Final Success Transaction&quot;)
+ }
+}
+
+int counterTemp = Integer.parseInt(counter) + 1
if (transaction == &quot;FINAL&quot;) {
- counterTemp = 99;
+ counterTemp = 99
} else if (counterTemp &gt;= 10) {
- AssertionResult.setFailureMessage(&quot;vCPE Success APPCL Failure, reached maximum number of 10 attempts &quot;);
- AssertionResult.setFailure(true);
+ AssertionResult.setFailureMessage(&quot;vCPE Success APPCL Failure, reached maximum number of 10 attempts&quot;)
+ AssertionResult.setFailure(true)
}
-vars.put(&quot;counter&quot;, Integer.toString(counterTemp));
-
+vars.put(&quot;counter&quot;, Integer.toString(counterTemp))
</stringProp>
</JSR223Assertion>
<hashTree/>
</hashTree>
</hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="APPC[appc-lcm-read]: SUCCESS" enabled="true">
- <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
- <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
- <collectionProp name="Arguments.arguments">
- <elementProp name="" elementType="HTTPArgument">
- <boolProp name="HTTPArgument.always_encode">false</boolProp>
- <stringProp name="Argument.value">{&#xd;
- &quot;body&quot;: {&#xd;
- &quot;output&quot;: {&#xd;
- &quot;common-header&quot;: {&#xd;
- &quot;timestamp&quot;: &quot;2020-05-05T15:56:34.845Z&quot;,&#xd;
- &quot;api-ver&quot;: &quot;2.00&quot;,&#xd;
- &quot;originator-id&quot;: &quot;${requestId}&quot;,&#xd;
- &quot;request-id&quot;: &quot;${requestId}&quot;,&#xd;
- &quot;sub-request-id&quot;: &quot;${subRequestId}&quot;,&#xd;
- &quot;flags&quot;: {}&#xd;
- },&#xd;
- &quot;status&quot;: {&#xd;
- &quot;code&quot;: 400,&#xd;
- &quot;message&quot;: &quot;Restart Successful&quot;&#xd;
- }&#xd;
- }&#xd;
- },&#xd;
- &quot;version&quot;: &quot;2.0&quot;,&#xd;
- &quot;rpc-name&quot;: &quot;restart&quot;,&#xd;
- &quot;correlation-id&quot;: &quot;${correlationId}&quot;,&#xd;
- &quot;type&quot;: &quot;response&quot;&#xd;
-}&#xd;
-</stringProp>
- <stringProp name="Argument.metadata">=</stringProp>
- </elementProp>
- </collectionProp>
- </elementProp>
- <stringProp name="HTTPSampler.domain">${DROOLS_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${DROOLS_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">policy/pdp/engine/topics/sources/dmaap/appc-lcm-write/events</stringProp>
- <stringProp name="HTTPSampler.method">PUT</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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>
- <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
- <collectionProp name="HeaderManager.headers">
- <elementProp name="" elementType="Header">
- <stringProp name="Header.name">Content-Type</stringProp>
- <stringProp name="Header.value">text/plain</stringProp>
- </elementProp>
- </collectionProp>
- </HeaderManager>
- <hashTree/>
- </hashTree>
- <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="Init DMaaP Counter" enabled="true">
+ <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="APPC [appc-lcm-read]: SUCCESS">
<stringProp name="scriptLanguage">groovy</stringProp>
<stringProp name="parameters"></stringProp>
<stringProp name="filename"></stringProp>
<stringProp name="cacheKey">true</stringProp>
- <stringProp name="script">vars.put(&quot;counter&quot;, &quot;0&quot;);</stringProp>
+ <stringProp name="script">import org.apache.kafka.clients.producer.KafkaProducer
+import org.apache.kafka.clients.producer.ProducerConfig
+import org.apache.kafka.clients.producer.ProducerRecord
+import org.apache.kafka.common.serialization.StringSerializer
+
+// Kafka producer configuration
+def props = new Properties()
+props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, vars.get(&quot;KAFKA_HOST&quot;) + &quot;:&quot; + vars.get(&quot;KAFKA_PORT&quot;))
+props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName())
+props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName())
+props.put(ProducerConfig.CLIENT_ID_CONFIG, &quot;appc-lcm-write-producer&quot;)
+
+// Create Kafka producer
+def producer = new KafkaProducer&lt;&gt;(props)
+
+// Prepare the message
+def message = &quot;&quot;&quot;
+{
+ &quot;body&quot;: {
+ &quot;output&quot;: {
+ &quot;common-header&quot;: {
+ &quot;timestamp&quot;: &quot;${new Date().format(&quot;yyyy-MM-dd&apos;T&apos;HH:mm:ss.SSS&apos;Z&apos;&quot;, TimeZone.getTimeZone(&quot;UTC&quot;))}&quot;,
+ &quot;api-ver&quot;: &quot;2.00&quot;,
+ &quot;originator-id&quot;: &quot;${vars.get(&quot;requestId&quot;)}&quot;,
+ &quot;request-id&quot;: &quot;${vars.get(&quot;requestId&quot;)}&quot;,
+ &quot;sub-request-id&quot;: &quot;${vars.get(&quot;subRequestId&quot;)}&quot;,
+ &quot;flags&quot;: {}
+ },
+ &quot;status&quot;: {
+ &quot;code&quot;: 400,
+ &quot;message&quot;: &quot;Restart Successful&quot;
+ }
+ }
+ },
+ &quot;version&quot;: &quot;2.0&quot;,
+ &quot;rpc-name&quot;: &quot;restart&quot;,
+ &quot;correlation-id&quot;: &quot;${vars.get(&quot;correlationId&quot;)}&quot;,
+ &quot;type&quot;: &quot;response&quot;
+}
+&quot;&quot;&quot;.toString()
+
+// Create a producer record
+def record = new ProducerRecord&lt;&gt;(&quot;appc-lcm-write&quot;, vars.get(&quot;requestId&quot;).toString(), message)
+
+// Send the message
+def future = producer.send(record)
+
+// Wait for the send to complete and log the result
+def metadata = future.get()
+log.info(&quot;Message sent to topic: ${metadata.topic()}, partition: ${metadata.partition()}, offset: ${metadata.offset()}&quot;)
+
+// Close the producer
+producer.close()
+
+// Set a variable to indicate successful sending
+vars.put(&quot;messageSent&quot;, &quot;true&quot;)
+</stringProp>
</JSR223Sampler>
<hashTree/>
- <WhileController guiclass="WhileControllerGui" testclass="WhileController" testname="Final Success Controller" enabled="true">
+ <WhileController guiclass="WhileControllerGui" testclass="WhileController" testname="Final Success Controller">
<stringProp name="WhileController.condition">${__javaScript(${counter} &lt; 60)}</stringProp>
</WhileController>
<hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="POLICY[policy-cl-mgt]: FINAL_SUCCESS" 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 name="filter" elementType="HTTPArgument">
- <boolProp name="HTTPArgument.always_encode">true</boolProp>
- <stringProp name="Argument.value">{&quot;class&quot;:&quot;And&quot;, &quot;filters&quot;: [ { &quot;class&quot;:&quot;Equals&quot;, &quot;field&quot;:&quot;requestId&quot;, &quot;value&quot;:&quot;${requestId}&quot; }, { &quot;class&quot;:&quot;Equals&quot;, &quot;field&quot;:&quot;notification&quot;, &quot;value&quot;:&quot;FINAL: SUCCESS&quot; }]}</stringProp>
- <stringProp name="Argument.metadata">=</stringProp>
- <boolProp name="HTTPArgument.use_equals">true</boolProp>
- <stringProp name="Argument.name">filter</stringProp>
- </elementProp>
- </collectionProp>
- </elementProp>
- <stringProp name="HTTPSampler.domain">${KAFKA_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${KAFKA_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">events/policy-cl-mgt/${consumerGroup}/1?timeout=15000&amp;limit=1</stringProp>
- <stringProp name="HTTPSampler.method">GET</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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>
+ <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="POLICY [policy-cl-mgt]: FINAL_SUCCESS">
+ <stringProp name="scriptLanguage">groovy</stringProp>
+ <stringProp name="parameters"></stringProp>
+ <stringProp name="filename"></stringProp>
+ <stringProp name="cacheKey">true</stringProp>
+ <stringProp name="script">import org.apache.kafka.clients.consumer.KafkaConsumer
+import org.apache.kafka.clients.consumer.ConsumerConfig
+import org.apache.kafka.common.serialization.StringDeserializer
+import java.time.Duration
+
+// Kafka consumer configuration
+def props = new Properties()
+props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, vars.get(&quot;KAFKA_HOST&quot;) + &quot;:&quot; + vars.get(&quot;KAFKA_PORT&quot;))
+props.put(ConsumerConfig.GROUP_ID_CONFIG, vars.get(&quot;consumerGroup&quot;))
+props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName())
+props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName())
+props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, &quot;earliest&quot;)
+
+// Create Kafka consumer
+def consumer = new KafkaConsumer&lt;&gt;(props)
+
+// Subscribe to the topic
+consumer.subscribe(Arrays.asList(&quot;policy-cl-mgt&quot;))
+
+// Initialize variables
+def maxAttempts = 60
+def attempts = 0
+def success = false
+
+// Poll for records
+while (attempts &lt; maxAttempts &amp;&amp; !success) {
+ def records = consumer.poll(Duration.ofMillis(15000))
+
+ for (record in records) {
+ def value = record.value()
+ log.info(&quot;Received message: &quot; + value)
+
+ // Parse the value
+ def jsonSlurper = new groovy.json.JsonSlurper()
+ def parsedValue = jsonSlurper.parseText(value)
+
+ // Extract required fields
+ def requestId = parsedValue.requestId
+ def notification = parsedValue.notification
+
+ // Check if this is the message we&apos;re looking for
+ if (requestId == vars.get(&quot;requestId&quot;) &amp;&amp; notification == &quot;FINAL: SUCCESS&quot;) {
+ success = true
+ log.info(&quot;Final Success: RequestId=&quot; + requestId + &quot;, Notification=&quot; + notification)
+ break
+ }
+ }
+
+ attempts++
+ if (!success) {
+ log.info(&quot;Attempt &quot; + attempts + &quot; of &quot; + maxAttempts + &quot; failed to find matching message&quot;)
+ }
+}
+
+// Close the consumer
+consumer.close()
+
+// Set variables based on the result
+if (success) {
+ vars.put(&quot;finalStatus&quot;, &quot;SUCCESS&quot;)
+} else {
+ vars.put(&quot;finalStatus&quot;, &quot;FAILURE&quot;)
+ AssertionResult.setFailureMessage(&quot;Failed to receive FINAL: SUCCESS notification after &quot; + maxAttempts + &quot; attempts&quot;)
+ AssertionResult.setFailure(true)
+}
+</stringProp>
+ </JSR223Sampler>
<hashTree>
- <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="No []" enabled="true">
- <collectionProp name="Asserion.test_strings">
- <stringProp name="2914">[]</stringProp>
- </collectionProp>
- <stringProp name="Assertion.custom_message"></stringProp>
- <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
- <boolProp name="Assertion.assume_success">false</boolProp>
- <intProp name="Assertion.test_type">12</intProp>
- </ResponseAssertion>
- <hashTree/>
- <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="requestId extractor" enabled="true">
- <stringProp name="RegexExtractor.useHeaders">false</stringProp>
- <stringProp name="RegexExtractor.refname">requestIdOnset</stringProp>
- <stringProp name="RegexExtractor.regex">requestId\\&quot;: \\&quot;(.+?)\\&quot;</stringProp>
- <stringProp name="RegexExtractor.template">$1$</stringProp>
- <stringProp name="RegexExtractor.default">none</stringProp>
- <boolProp name="RegexExtractor.default_empty_value">false</boolProp>
- </RegexExtractor>
+ <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="requestId extractor" enabled="true">
+ <stringProp name="cacheKey">true</stringProp>
+ <stringProp name="filename"></stringProp>
+ <stringProp name="parameters"></stringProp>
+ <stringProp name="script">import groovy.json.JsonSlurper
+
+def message = vars.get(&quot;kafkaMessage&quot;)
+def jsonSlurper = new JsonSlurper()
+def parsedMessage = jsonSlurper.parseText(message)
+
+vars.put(&quot;requestIdOnset&quot;, parsedMessage.requestId ?: &quot;none&quot;)
+</stringProp>
+ <stringProp name="scriptLanguage">groovy</stringProp>
+ </JSR223PostProcessor>
<hashTree/>
- <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="notification extractor" enabled="true">
- <stringProp name="RegexExtractor.useHeaders">false</stringProp>
- <stringProp name="RegexExtractor.refname">notification</stringProp>
- <stringProp name="RegexExtractor.regex">notification\\&quot;: \\&quot;FINAL: (.+?)\\&quot;</stringProp>
- <stringProp name="RegexExtractor.template">$1$</stringProp>
- <stringProp name="RegexExtractor.default">none</stringProp>
- <boolProp name="RegexExtractor.default_empty_value">false</boolProp>
- </RegexExtractor>
+ <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="notification extractor">
+ <stringProp name="scriptLanguage">groovy</stringProp>
+ <stringProp name="parameters"></stringProp>
+ <stringProp name="filename"></stringProp>
+ <stringProp name="cacheKey">true</stringProp>
+ <stringProp name="script">import groovy.json.JsonSlurper
+
+def message = vars.get(&quot;kafkaMessage&quot;)
+def jsonSlurper = new JsonSlurper()
+def parsedMessage = jsonSlurper.parseText(message)
+
+vars.put(&quot;notification&quot;, parsedMessage.notification ?: &quot;none&quot;)
+</stringProp>
+ </JSR223PostProcessor>
<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 requestIdOnset = vars.get(&quot;requestIdOnset&quot;);
-String requestId = vars.get(&quot;requestId&quot;);
-String notification = vars.get(&quot;notification&quot;);
-String counter = vars.get(&quot;counter&quot;);
-
-String transaction = &quot;none&quot;;
-
-log.info (&quot;The requestId id is &quot; + requestId);
-log.info (&quot;The requestIdOnset id is &quot; + requestIdOnset);
-log.info (&quot;The notification is &quot; + notification);
-log.info (&quot;The transaction is &quot; + transaction);
-log.info (&quot;The counter is &quot; + counter);
-
-if ( requestId == requestIdOnset ) {
- if ( notification == &quot;SUCCESS&quot; ) {
- transaction = &quot;FINAL&quot;;
- log.info (&quot;Final Success Transaction&quot;);
- log.info (&quot;The notification is SUCCESS&quot;);
- } else if ( notification == &quot;FAILURE&quot; ) {
- transaction = &quot;FINAL&quot;;
- log.info (&quot;Final Failure Transaction&quot;);
- AssertionResult.setFailureMessage(&quot;Bad final notification&quot;);
- AssertionResult.setFailure(true);
- }
+ <stringProp name="script">import groovy.json.JsonSlurper
+
+// Parse Kafka message content
+def message = vars.get(&quot;kafkaMessage&quot;)
+def jsonSlurper = new JsonSlurper()
+def parsedMessage = jsonSlurper.parseText(message)
+
+// Extract relevant fields
+String requestIdOnset = parsedMessage.requestId
+String notification = parsedMessage.notification
+String requestId = vars.get(&quot;requestId&quot;)
+String counter = vars.get(&quot;counter&quot;)
+String transaction = &quot;none&quot;
+
+// Log extracted information
+log.info(&quot;The requestId is &quot; + requestId)
+log.info(&quot;The requestIdOnset is &quot; + requestIdOnset)
+log.info(&quot;The notification is &quot; + notification)
+log.info(&quot;The counter is &quot; + counter)
+
+// Perform assertions
+if (requestId == requestIdOnset) {
+ if (notification == &quot;SUCCESS&quot;) {
+ transaction = &quot;FINAL&quot;
+ log.info(&quot;Final Success Transaction&quot;)
+ } else if (notification == &quot;FAILURE&quot;) {
+ transaction = &quot;FINAL&quot;
+ log.info(&quot;Final Failure Transaction&quot;)
+ AssertionResult.setFailureMessage(&quot;Bad final notification&quot;)
+ AssertionResult.setFailure(true)
+ }
}
-int counterTemp = Integer.parseInt(counter) +1;
+// Update counter
+int counterTemp = Integer.parseInt(counter) + 1
if (transaction == &quot;FINAL&quot;) {
- counterTemp = 99;
+ counterTemp = 99
} else if (counterTemp &gt;= 60) {
- AssertionResult.setFailureMessage(&quot;vCPE Success POLICYCL Failure, reached maximum number of attempts &quot;);
- AssertionResult.setFailure(true);
+ AssertionResult.setFailureMessage(&quot;vCPE Success POLICYCL Failure, reached maximum number of attempts&quot;)
+ AssertionResult.setFailure(true)
}
-
-vars.put(&quot;counter&quot;, Integer.toString(counterTemp));</stringProp>
+vars.put(&quot;counter&quot;, Integer.toString(counterTemp))
+</stringProp>
</JSR223Assertion>
<hashTree/>
</hashTree>
</hashTree>
- <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Flow Control Action" enabled="true">
- <intProp name="ActionProcessor.action">1</intProp>
- <intProp name="ActionProcessor.target">0</intProp>
- <stringProp name="ActionProcessor.duration">200</stringProp>
- </TestAction>
- <hashTree/>
</hashTree>
- <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="SON O1 Success" enabled="true">
- <stringProp name="ThreadGroup.on_sample_error">startnextloop</stringProp>
- <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
+ <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="SON 01 Success">
+ <intProp name="ThreadGroup.num_threads">1</intProp>
+ <intProp name="ThreadGroup.ramp_time">1</intProp>
+ <stringProp name="ThreadGroup.duration">${duration}</stringProp>
+ <longProp name="ThreadGroup.delay">11</longProp>
+ <boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
+ <boolProp name="ThreadGroup.scheduler">true</boolProp>
+ <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
+ <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller">
<intProp name="LoopController.loops">-1</intProp>
<boolProp name="LoopController.continue_forever">false</boolProp>
</elementProp>
- <stringProp name="ThreadGroup.num_threads">1</stringProp>
- <stringProp name="ThreadGroup.ramp_time">1</stringProp>
- <boolProp name="ThreadGroup.scheduler">true</boolProp>
- <stringProp name="ThreadGroup.duration">${duration}</stringProp>
- <stringProp name="ThreadGroup.delay">11</stringProp>
- <boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
- <boolProp name="ThreadGroup.delayedStart">false</boolProp>
</ThreadGroup>
<hashTree>
<UserParameters guiclass="UserParametersGui" testclass="UserParameters" testname="Set consumer group per scenario" enabled="true">
@@ -1427,385 +1035,482 @@ vars.put(&quot;counter&quot;, Integer.toString(counterTemp));</stringProp>
<stringProp name="TestPlan.comments">Update on a per iteration basis</stringProp>
</UserParameters>
<hashTree/>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="DCAE[DCAE_TOPIC]: ONSET" enabled="true">
- <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
- <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
- <collectionProp name="Arguments.arguments">
- <elementProp name="" elementType="HTTPArgument">
- <boolProp name="HTTPArgument.always_encode">false</boolProp>
- <stringProp name="Argument.value">{&#xd;
- &quot;closedLoopControlName&quot;: &quot;ControlLoop-SONO1-fb41f388-a5f2-11e8-98d0-529269fb1459&quot;,&#xd;
- &quot;closedLoopAlarmStart&quot;: 1606806580487,&#xd;
- &quot;closedLoopEventClient&quot;: &quot;microservice.PCI&quot;,&#xd;
- &quot;closedLoopEventStatus&quot;: &quot;ONSET&quot;,&#xd;
- &quot;requestID&quot;: &quot;${requestId}&quot;,&#xd;
- &quot;target_type&quot;: &quot;PNF&quot;,&#xd;
- &quot;target&quot;: &quot;pnf.pnf-name&quot;,&#xd;
- &quot;AAI&quot;: {&#xd;
- &quot;generic-vnf.prov-status&quot;: &quot;ACTIVE&quot;,&#xd;
- &quot;generic-vnf.is-closed-loop-disabled&quot;: &quot;false&quot;,&#xd;
- &quot;pnf.pnf-name&quot;: &quot;ncserver1&quot;&#xd;
- }, &#xd;
- &quot;from&quot;: &quot;PCIMS&quot;,&#xd;
- &quot;version&quot;: &quot;1.0.2&quot;,&#xd;
- &quot;policyName&quot;: &quot;SONO1&quot;,&#xd;
- &quot;policyVersion&quot;: &quot;1.0.2&quot;,&#xd;
- &quot;Action&quot;: &quot;ModifyO1Config&quot;,&#xd;
- &quot;payload&quot;: &quot;{\&quot;Configurations\&quot;:[{\&quot;data\&quot;:{\&quot;FAPService\&quot;:{\&quot;alias\&quot;:\&quot;Chn0330\&quot;,\&quot;X0005b9Lte\&quot;:{\&quot;phyCellIdInUse\&quot;:6,\&quot;pnfName\&quot;:\&quot;ncserver23\&quot;},\&quot;CellConfig\&quot;:{\&quot;LTE\&quot;:{\&quot;RAN\&quot;:{\&quot;Common\&quot;:{\&quot;CellIdentity\&quot;:\&quot;Chn0330\&quot;}}}}}}},{\&quot;data\&quot;:{\&quot;FAPService\&quot;:{\&quot;alias\&quot;:\&quot;Chn0331\&quot;,\&quot;X0005b9Lte\&quot;:{\&quot;phyCellIdInUse\&quot;:7,\&quot;pnfName\&quot;:\&quot;ncserver23\&quot;},\&quot;CellConfig\&quot;:{\&quot;LTE\&quot;:{\&quot;RAN\&quot;:{\&quot;Common\&quot;:{\&quot;CellIdentity\&quot;:\&quot;Chn0331\&quot;}}}}}}}]}&quot;&#xd;
-}</stringProp>
- <stringProp name="Argument.metadata">=</stringProp>
- </elementProp>
- </collectionProp>
- </elementProp>
- <stringProp name="HTTPSampler.domain">${DROOLS_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${DROOLS_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">policy/pdp/engine/topics/sources/dmaap/dcae_topic/events</stringProp>
- <stringProp name="HTTPSampler.method">PUT</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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>
- <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
- <collectionProp name="HeaderManager.headers">
- <elementProp name="" elementType="Header">
- <stringProp name="Header.name">Content-Type</stringProp>
- <stringProp name="Header.value">text/plain</stringProp>
- </elementProp>
- </collectionProp>
- </HeaderManager>
- <hashTree/>
- </hashTree>
- <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="Init DMaaP Counter" enabled="true">
+ <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="DCAE[dcae-topic]: ONSET">
<stringProp name="scriptLanguage">groovy</stringProp>
<stringProp name="parameters"></stringProp>
<stringProp name="filename"></stringProp>
<stringProp name="cacheKey">true</stringProp>
- <stringProp name="script">vars.put(&quot;counterO1&quot;, &quot;0&quot;);</stringProp>
+ <stringProp name="script">import org.apache.kafka.clients.producer.KafkaProducer
+import org.apache.kafka.clients.producer.ProducerConfig
+import org.apache.kafka.clients.producer.ProducerRecord
+import org.apache.kafka.common.serialization.StringSerializer
+
+// Kafka producer configuration
+def props = new Properties()
+props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, vars.get(&quot;KAFKA_HOST&quot;) + &quot;:&quot; + vars.get(&quot;KAFKA_PORT&quot;))
+props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName())
+props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName())
+props.put(ProducerConfig.CLIENT_ID_CONFIG, &quot;dcae-topic-producer&quot;)
+
+// Create Kafka producer
+def producer = new KafkaProducer&lt;&gt;(props)
+
+// Prepare the message
+def message = &quot;&quot;&quot;
+{
+ &quot;closedLoopControlName&quot;: &quot;ControlLoop-SONO1-fb41f388-a5f2-11e8-98d0-529269fb1459&quot;,
+ &quot;closedLoopAlarmStart&quot;: 1606806580487,
+ &quot;closedLoopEventClient&quot;: &quot;microservice.PCI&quot;,
+ &quot;closedLoopEventStatus&quot;: &quot;ONSET&quot;,
+ &quot;requestID&quot;: &quot;${requestId}&quot;,
+ &quot;target_type&quot;: &quot;PNF&quot;,
+ &quot;target&quot;: &quot;pnf.pnf-name&quot;,
+ &quot;AAI&quot;: {
+ &quot;generic-vnf.prov-status&quot;: &quot;ACTIVE&quot;,
+ &quot;generic-vnf.is-closed-loop-disabled&quot;: &quot;false&quot;,
+ &quot;pnf.pnf-name&quot;: &quot;ncserver1&quot;
+ },
+ &quot;from&quot;: &quot;PCIMS&quot;,
+ &quot;version&quot;: &quot;1.0.2&quot;,
+ &quot;policyName&quot;: &quot;SONO1&quot;,
+ &quot;policyVersion&quot;: &quot;1.0.2&quot;,
+ &quot;Action&quot;: &quot;ModifyO1Config&quot;,
+ &quot;payload&quot;: &quot;{\&quot;Configurations\&quot;:[{\&quot;data\&quot;:{\&quot;FAPService\&quot;:{\&quot;alias\&quot;:\&quot;Chn0330\&quot;,\&quot;X0005b9Lte\&quot;:{\&quot;phyCellIdInUse\&quot;:6,\&quot;pnfName\&quot;:\&quot;ncserver23\&quot;},\&quot;CellConfig\&quot;:{\&quot;LTE\&quot;:{\&quot;RAN\&quot;:{\&quot;Common\&quot;:{\&quot;CellIdentity\&quot;:\&quot;Chn0330\&quot;}}}}}}},{\&quot;data\&quot;:{\&quot;FAPService\&quot;:{\&quot;alias\&quot;:\&quot;Chn0331\&quot;,\&quot;X0005b9Lte\&quot;:{\&quot;phyCellIdInUse\&quot;:7,\&quot;pnfName\&quot;:\&quot;ncserver23\&quot;},\&quot;CellConfig\&quot;:{\&quot;LTE\&quot;:{\&quot;RAN\&quot;:{\&quot;Common\&quot;:{\&quot;CellIdentity\&quot;:\&quot;Chn0331\&quot;}}}}}}}]}&quot;
+}
+&quot;&quot;&quot;.toString()
+
+// Create a producer record
+def record = new ProducerRecord&lt;&gt;(&quot;unauthenticated.dcae_cl_output&quot;, vars.get(&quot;requestId&quot;).toString(), message)
+
+// Send the message
+def future = producer.send(record)
+
+// Wait for the send to complete and log the result
+def metadata = future.get()
+log.info(&quot;Message sent to topic: ${metadata.topic()}, partition: ${metadata.partition()}, offset: ${metadata.offset()}&quot;)
+
+// Close the producer
+producer.close()
+
+// Set a variable to indicate successful sending
+vars.put(&quot;messageSent&quot;, &quot;true&quot;)
+</stringProp>
</JSR223Sampler>
<hashTree/>
- <WhileController guiclass="WhileControllerGui" testclass="WhileController" testname="SDNR-CL Modify01Config" enabled="true">
- <stringProp name="WhileController.condition">${__javaScript(${counterO1} &lt; 10)}</stringProp>
- </WhileController>
+ <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="Init Kafka Counter">
+ <stringProp name="scriptLanguage">groovy</stringProp>
+ <stringProp name="parameters"></stringProp>
+ <stringProp name="filename"></stringProp>
+ <stringProp name="cacheKey">true</stringProp>
+ <stringProp name="script">vars.put(&quot;counter01&quot;, &quot;0&quot;);</stringProp>
+ </JSR223Sampler>
+ <hashTree/>
+ <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="SDNR-CL Modify Config">
+ <stringProp name="LoopController.loops">10</stringProp>
+ </LoopController>
<hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="POLICY[SDNR-CL]: Modify01Config" 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 name="filter" elementType="HTTPArgument">
- <boolProp name="HTTPArgument.always_encode">true</boolProp>
- <stringProp name="Argument.value">{&quot;class&quot;:&quot;And&quot;, &quot;filters&quot;: [ { &quot;class&quot;:&quot;Equals&quot;, &quot;field&quot;:&quot;request-id&quot;, &quot;value&quot;:&quot;${requestId}&quot; }, { &quot;class&quot;:&quot;Equals&quot;, &quot;field&quot;:&quot;rpc-name&quot;, &quot;value&quot;:&quot;modifyo1config&quot; }]}</stringProp>
- <stringProp name="Argument.metadata">=</stringProp>
- <boolProp name="HTTPArgument.use_equals">true</boolProp>
- <stringProp name="Argument.name">filter</stringProp>
- </elementProp>
- </collectionProp>
- </elementProp>
- <stringProp name="HTTPSampler.domain">${KAFKA_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${KAFKA_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">events/SDNR-CL/${consumerGroup}/1?timeout=15000&amp;limit=1</stringProp>
- <stringProp name="HTTPSampler.method">GET</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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>
+ <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="Read kafka topic">
+ <stringProp name="scriptLanguage">groovy</stringProp>
+ <stringProp name="parameters"></stringProp>
+ <stringProp name="filename"></stringProp>
+ <stringProp name="cacheKey">true</stringProp>
+ <stringProp name="script">import org.apache.kafka.clients.consumer.KafkaConsumer
+import org.apache.kafka.clients.consumer.ConsumerConfig
+import org.apache.kafka.common.serialization.StringDeserializer
+import java.time.Duration
+
+// Kafka consumer configuration
+def props = new Properties()
+props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, vars.get(&quot;KAFKA_HOST&quot;) + &quot;:&quot; + vars.get(&quot;KAFKA_PORT&quot;))
+props.put(ConsumerConfig.GROUP_ID_CONFIG, vars.get(&quot;consumerGroup&quot;))
+props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName())
+props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName())
+props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, &quot;earliest&quot;)
+
+// Create Kafka consumer
+def consumer = new KafkaConsumer&lt;&gt;(props)
+
+try {
+ // Subscribe to the topic
+ consumer.subscribe(Arrays.asList(&quot;SDNR-CL&quot;))
+
+ // Poll for records
+ def records = consumer.poll(Duration.ofMillis(15000))
+
+ if (records.isEmpty()) {
+ log.warn(&quot;No records found within the timeout period&quot;)
+ vars.put(&quot;messageConsumed&quot;, &quot;false&quot;)
+ } else {
+ // Process the first record
+ def record = records.first()
+ def requestId = record.key()
+ def value = record.value()
+
+ // Store the entire message
+ vars.put(&quot;kafkaMessage&quot;, value)
+
+ // Parse the value
+ def jsonSlurper = new groovy.json.JsonSlurper()
+ def parsedValue = jsonSlurper.parseText(value)
+
+ // Extract required fields
+ vars.put(&quot;requestIdOnset&quot;, parsedValue[&quot;request-id&quot;])
+ vars.put(&quot;correlationId&quot;, parsedValue[&quot;correlation-id&quot;])
+ vars.put(&quot;subRequestId&quot;, parsedValue[&quot;sub-request-id&quot;])
+
+ // Log the extracted information
+ log.info(&quot;RequestId: &quot; + requestId)
+ log.info(&quot;Parsed Value: &quot; + parsedValue)
+
+ vars.put(&quot;messageConsumed&quot;, &quot;true&quot;)
+ }
+} catch (Exception e) {
+ log.error(&quot;Error processing Kafka message: &quot; + e.getMessage())
+ vars.put(&quot;messageConsumed&quot;, &quot;false&quot;)
+} finally {
+ // Close the consumer
+ consumer.close()
+}
+</stringProp>
+ </JSR223Sampler>
<hashTree>
- <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="No []" enabled="true">
- <collectionProp name="Asserion.test_strings">
- <stringProp name="2914">[]</stringProp>
- </collectionProp>
- <stringProp name="Assertion.custom_message"></stringProp>
- <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
- <boolProp name="Assertion.assume_success">false</boolProp>
- <intProp name="Assertion.test_type">12</intProp>
- </ResponseAssertion>
- <hashTree/>
- <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="request-id extractor" enabled="true">
- <stringProp name="RegexExtractor.useHeaders">false</stringProp>
- <stringProp name="RegexExtractor.refname">requestIdOnset</stringProp>
- <stringProp name="RegexExtractor.regex">\\&quot;RequestID\\&quot;: \\&quot;(.+?)\\&quot;</stringProp>
- <stringProp name="RegexExtractor.template">$1$</stringProp>
- <stringProp name="RegexExtractor.default">none</stringProp>
- <boolProp name="RegexExtractor.default_empty_value">false</boolProp>
- </RegexExtractor>
- <hashTree/>
- <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="correlation-id extractor" enabled="true">
- <stringProp name="RegexExtractor.useHeaders">false</stringProp>
- <stringProp name="RegexExtractor.refname">correlationId</stringProp>
- <stringProp name="RegexExtractor.regex">correlation-id\\&quot;: \\&quot;(.+?)\\&quot;</stringProp>
- <stringProp name="RegexExtractor.template">$1$</stringProp>
- <stringProp name="RegexExtractor.default">none</stringProp>
- <boolProp name="RegexExtractor.default_empty_value">false</boolProp>
- </RegexExtractor>
+ <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="requestId extractor" enabled="true">
+ <stringProp name="cacheKey">true</stringProp>
+ <stringProp name="filename"></stringProp>
+ <stringProp name="parameters"></stringProp>
+ <stringProp name="script">import groovy.json.JsonSlurper
+
+def message = vars.get(&quot;kafkaMessage&quot;)
+def jsonSlurper = new JsonSlurper()
+def parsedMessage = jsonSlurper.parseText(message)
+
+vars.put(&quot;requestIdOnset&quot;, parsedMessage.requestId ?: &quot;none&quot;)
+</stringProp>
+ <stringProp name="scriptLanguage">groovy</stringProp>
+ </JSR223PostProcessor>
<hashTree/>
- <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="sub-request-id extractor" enabled="true">
- <stringProp name="RegexExtractor.useHeaders">false</stringProp>
- <stringProp name="RegexExtractor.refname">subRequestId</stringProp>
- <stringProp name="RegexExtractor.regex">SubRequestID\\&quot;: \\&quot;(.+?)\\&quot;</stringProp>
- <stringProp name="RegexExtractor.template">$1$</stringProp>
- <stringProp name="RegexExtractor.default">none</stringProp>
- <boolProp name="RegexExtractor.default_empty_value">false</boolProp>
- </RegexExtractor>
+ <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="notification extractor" enabled="true">
+ <stringProp name="scriptLanguage">groovy</stringProp>
+ <stringProp name="parameters"></stringProp>
+ <stringProp name="filename"></stringProp>
+ <stringProp name="cacheKey">true</stringProp>
+ <stringProp name="script">import groovy.json.JsonSlurper
+
+def message = vars.get(&quot;kafkaMessage&quot;)
+def jsonSlurper = new JsonSlurper()
+def parsedMessage = jsonSlurper.parseText(message)
+
+vars.put(&quot;notification&quot;, parsedMessage.notification ?: &quot;none&quot;)
+</stringProp>
+ </JSR223PostProcessor>
<hashTree/>
- <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="JSR223 Assertion" enabled="true">
+ <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="JSR223 Assertion">
<stringProp name="scriptLanguage">groovy</stringProp>
<stringProp name="parameters"></stringProp>
<stringProp name="filename"></stringProp>
<stringProp name="cacheKey">true</stringProp>
- <stringProp name="script">String requestIdOnset = vars.get(&quot;requestIdOnset&quot;);
-String requestId = vars.get(&quot;requestId&quot;);
-String correlationId = vars.get(&quot;correlationId&quot;);
-String subRequestId = vars.get(&quot;subRequestId&quot;);
-String counter = vars.get(&quot;counterO1&quot;);
-
-String transaction = &quot;none&quot;;
-
-log.info (&quot;The requestId id is &quot; + requestId);
-log.info (&quot;The requestIdOnset id is &quot; + requestIdOnset);
-log.info (&quot;The correlation id is &quot; + correlationId);
-log.info (&quot;The subrequest id is &quot; + subRequestId);
-log.info (&quot;The counter is &quot; + counter);
-
-if ( requestId == requestIdOnset ) {
- if ( correlationId == &quot;none&quot; || subRequestId == &quot;none&quot; ) {
- transaction = &quot;FINAL&quot;;
- log.info (&quot;Final Failure Transaction&quot;);
- AssertionResult.setFailureMessage(&quot;Missing correlationId or subRequestId&quot;);
- AssertionResult.setFailure(true);
- } else {
- transaction = &quot;FINAL&quot;;
- vars.put(&quot;transaction&quot;, &quot;FINAL&quot;);
- log.info (&quot;Final Success Transaction&quot;);
- }
+ <stringProp name="script">import org.apache.kafka.clients.consumer.ConsumerRecord
+
+// Assuming the Kafka message is stored in a variable named &apos;kafkaMessage&apos;
+ConsumerRecord&lt;String, String&gt; record = vars.getObject(&quot;kafkaMessage&quot;)
+
+String requestIdOnset = record.key()
+String requestId = vars.get(&quot;requestId&quot;)
+String correlationId = &quot;none&quot;
+String subRequestId = &quot;none&quot;
+String counter = vars.get(&quot;counter&quot;)
+
+String transaction = &quot;none&quot;
+
+// Parse the Kafka message value (assuming it&apos;s JSON)
+def jsonSlurper = new groovy.json.JsonSlurper()
+def messageContent = jsonSlurper.parseText(record.value())
+
+if (messageContent.containsKey(&quot;correlation-id&quot;)) {
+ correlationId = messageContent[&quot;correlation-id&quot;]
+}
+if (messageContent.containsKey(&quot;sub-request-id&quot;)) {
+ subRequestId = messageContent[&quot;sub-request-id&quot;]
}
-int counterTemp = Integer.parseInt(counter) +1;
+log.info(&quot;The requestId is &quot; + requestId)
+log.info(&quot;The requestIdOnset is &quot; + requestIdOnset)
+log.info(&quot;The correlation id is &quot; + correlationId)
+log.info(&quot;The subrequest id is &quot; + subRequestId)
+log.info(&quot;The counter is &quot; + counter)
+
+if (requestId == requestIdOnset) {
+ if (correlationId == &quot;none&quot; || subRequestId == &quot;none&quot;) {
+ transaction = &quot;FINAL&quot;
+ log.info(&quot;Final Failure Transaction&quot;)
+ AssertionResult.setFailureMessage(&quot;Missing correlationId or subRequestId&quot;)
+ AssertionResult.setFailure(true)
+ } else {
+ transaction = &quot;FINAL&quot;
+ vars.put(&quot;transaction&quot;, &quot;FINAL&quot;)
+ log.info(&quot;Final Success Transaction&quot;)
+ }
+}
+
+int counterTemp = Integer.parseInt(counter) + 1
if (transaction == &quot;FINAL&quot;) {
- counterTemp = 99;
+ counterTemp = 99
} else if (counterTemp &gt;= 10) {
- AssertionResult.setFailureMessage(&quot;SON 01 Failure, reached maximum number of 10 attempts &quot;);
- AssertionResult.setFailure(true);
+ AssertionResult.setFailureMessage(&quot;SON 01 Failure, reached maximum number of 10 attempts&quot;)
+ AssertionResult.setFailure(true)
}
-vars.put(&quot;counterO1&quot;, Integer.toString(counterTemp));
-
+vars.put(&quot;counter01&quot;, Integer.toString(counterTemp))
</stringProp>
</JSR223Assertion>
<hashTree/>
</hashTree>
</hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SDNR[SDNR-CL-RSP]: SUCCESS" enabled="true">
- <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
- <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
- <collectionProp name="Arguments.arguments">
- <elementProp name="" elementType="HTTPArgument">
- <boolProp name="HTTPArgument.always_encode">false</boolProp>
- <stringProp name="Argument.value">{&#xd;
- &quot;body&quot;: {&#xd;
- &quot;output&quot;: {&#xd;
- &quot;CommonHeader&quot;: {&#xd;
- &quot;TimeStamp&quot;: &quot;2022-08-10T07:10:05.614Z&quot;,&#xd;
- &quot;APIver&quot;: &quot;1.0&quot;,&#xd;
- &quot;RequestID&quot;: &quot;${requestId}&quot;,&#xd;
- &quot;SubRequestID&quot;: &quot;${subRequestId}&quot;,&#xd;
- &quot;RequestTrack&quot;: [],&#xd;
- &quot;Flags&quot;: []&#xd;
- },&#xd;
- &quot;Status&quot;: {&#xd;
- &quot;Code&quot;: 200,&#xd;
- &quot;Value&quot;: &quot;SUCCESS&quot;&#xd;
- },&#xd;
- &quot;Payload&quot;: &quot;{ \&quot;Configurations\&quot;:[ { \&quot;Status\&quot;: { \&quot;Code\&quot;: 200, \&quot;Value\&quot;: \&quot;SUCCESS\&quot; }, \&quot;data\&quot;:{\&quot;FAPService\&quot;:{\&quot;alias\&quot;:\&quot;Chn0330\&quot;,\&quot;X0005b9Lte\&quot;:{\&quot;phyCellIdInUse\&quot;:6,\&quot;pnfName\&quot;:\&quot;ncserver23\&quot;},\&quot;CellConfig\&quot;:{\&quot;LTE\&quot;:{\&quot;RAN\&quot;:{\&quot;Common\&quot;:{\&quot;CellIdentity\&quot;:\&quot;Chn0330\&quot;}}}}}} } ] }&quot;&#xd;
- }&#xd;
- },&#xd;
- &quot;version&quot;: &quot;1.0&quot;,&#xd;
- &quot;rpc-name&quot;: &quot;ModifyO1Config&quot;,&#xd;
- &quot;correlation-id&quot;: &quot;${correlationId}&quot;,&#xd;
- &quot;type&quot;: &quot;response&quot;&#xd;
-}&#xd;
-&#xd;
+ <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SDNR[SDNR-CL-RSP]: SUCCESS">
+ <stringProp name="scriptLanguage">groovy</stringProp>
+ <stringProp name="parameters"></stringProp>
+ <stringProp name="filename"></stringProp>
+ <stringProp name="cacheKey">true</stringProp>
+ <stringProp name="script">import org.apache.kafka.clients.producer.KafkaProducer
+import org.apache.kafka.clients.producer.ProducerConfig
+import org.apache.kafka.clients.producer.ProducerRecord
+import org.apache.kafka.common.serialization.StringSerializer
+
+// Kafka producer configuration
+def props = new Properties()
+props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, vars.get(&quot;KAFKA_HOST&quot;) + &quot;:&quot; + vars.get(&quot;KAFKA_PORT&quot;))
+props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName())
+props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName())
+props.put(ProducerConfig.CLIENT_ID_CONFIG, &quot;sdnr-cl-rsp-producer&quot;)
+
+// Create Kafka producer
+def producer = new KafkaProducer&lt;&gt;(props)
+
+// Prepare the message
+def message = &quot;&quot;&quot;
+{
+ &quot;body&quot;: {
+ &quot;output&quot;: {
+ &quot;CommonHeader&quot;: {
+ &quot;TimeStamp&quot;: &quot;2022-08-10T07:10:05.614Z&quot;,
+ &quot;APIver&quot;: &quot;1.0&quot;,
+ &quot;RequestID&quot;: &quot;${requestId}&quot;,
+ &quot;SubRequestID&quot;: &quot;${subRequestId}&quot;,
+ &quot;RequestTrack&quot;: [],
+ &quot;Flags&quot;: []
+ },
+ &quot;Status&quot;: {
+ &quot;Code&quot;: 200,
+ &quot;Value&quot;: &quot;SUCCESS&quot;
+ },
+ &quot;Payload&quot;: &quot;{ \&quot;Configurations\&quot;:[ { \&quot;Status\&quot;: { \&quot;Code\&quot;: 200, \&quot;Value\&quot;: \&quot;SUCCESS\&quot; }, \&quot;data\&quot;:{\&quot;FAPService\&quot;:{\&quot;alias\&quot;:\&quot;Chn0330\&quot;,\&quot;X0005b9Lte\&quot;:{\&quot;phyCellIdInUse\&quot;:6,\&quot;pnfName\&quot;:\&quot;ncserver23\&quot;},\&quot;CellConfig\&quot;:{\&quot;LTE\&quot;:{\&quot;RAN\&quot;:{\&quot;Common\&quot;:{\&quot;CellIdentity\&quot;:\&quot;Chn0330\&quot;}}}}}} } ] }&quot;
+ }
+ },
+ &quot;version&quot;: &quot;1.0&quot;,
+ &quot;rpc-name&quot;: &quot;ModifyO1Config&quot;,
+ &quot;correlation-id&quot;: &quot;${correlationId}&quot;,
+ &quot;type&quot;: &quot;response&quot;
+}
+&quot;&quot;&quot;.toString()
+
+// Create a producer record
+def record = new ProducerRecord&lt;&gt;(&quot;sdnr-cl-rsp&quot;, vars.get(&quot;requestId&quot;).toString(), message)
+
+// Send the message
+def future = producer.send(record)
+
+// Wait for the send to complete and log the result
+def metadata = future.get()
+log.info(&quot;Message sent to topic: ${metadata.topic()}, partition: ${metadata.partition()}, offset: ${metadata.offset()}&quot;)
+
+// Close the producer
+producer.close()
+
+// Set a variable to indicate successful sending
+vars.put(&quot;messageSent&quot;, &quot;true&quot;)
</stringProp>
- <stringProp name="Argument.metadata">=</stringProp>
- </elementProp>
- </collectionProp>
- </elementProp>
- <stringProp name="HTTPSampler.domain">${DROOLS_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${DROOLS_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">policy/pdp/engine/topics/sources/dmaap/sdnr-cl-rsp/events</stringProp>
- <stringProp name="HTTPSampler.method">PUT</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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>
- <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
- <collectionProp name="HeaderManager.headers">
- <elementProp name="" elementType="Header">
- <stringProp name="Header.name">Content-Type</stringProp>
- <stringProp name="Header.value">text/plain</stringProp>
- </elementProp>
- </collectionProp>
- </HeaderManager>
- <hashTree/>
- </hashTree>
- <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="Init DMaaP Counter" enabled="true">
+ </JSR223Sampler>
+ <hashTree/>
+ <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="Init Kafka Counter">
<stringProp name="scriptLanguage">groovy</stringProp>
<stringProp name="parameters"></stringProp>
<stringProp name="filename"></stringProp>
<stringProp name="cacheKey">true</stringProp>
- <stringProp name="script">vars.put(&quot;counterO1&quot;, &quot;0&quot;);</stringProp>
+ <stringProp name="script">vars.put(&quot;counter01&quot;, &quot;0&quot;);</stringProp>
</JSR223Sampler>
<hashTree/>
- <WhileController guiclass="WhileControllerGui" testclass="WhileController" testname="Final Success Controller" enabled="true">
- <stringProp name="WhileController.condition">${__javaScript(${counterO1} &lt; 60)}</stringProp>
+ <WhileController guiclass="WhileControllerGui" testclass="WhileController" testname="Final Success Controller">
+ <stringProp name="WhileController.condition">${__javaScript(${counter} &lt; 60)}</stringProp>
</WhileController>
<hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="POLICY[policy-cl-mgt]: FINAL_SUCCESS" 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 name="filter" elementType="HTTPArgument">
- <boolProp name="HTTPArgument.always_encode">true</boolProp>
- <stringProp name="Argument.value">{&quot;class&quot;:&quot;And&quot;, &quot;filters&quot;: [ { &quot;class&quot;:&quot;Equals&quot;, &quot;field&quot;:&quot;requestId&quot;, &quot;value&quot;:&quot;${requestId}&quot; }, { &quot;class&quot;:&quot;Equals&quot;, &quot;field&quot;:&quot;notification&quot;, &quot;value&quot;:&quot;FINAL: SUCCESS&quot; }]}</stringProp>
- <stringProp name="Argument.metadata">=</stringProp>
- <boolProp name="HTTPArgument.use_equals">true</boolProp>
- <stringProp name="Argument.name">filter</stringProp>
- </elementProp>
- </collectionProp>
- </elementProp>
- <stringProp name="HTTPSampler.domain">${KAFKA_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${KAFKA_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">events/policy-cl-mgt/${consumerGroup}/1?timeout=15000&amp;limit=1</stringProp>
- <stringProp name="HTTPSampler.method">GET</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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>
+ <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="POLICY [policy-cl-mgt]: FINAL_SUCCESS">
+ <stringProp name="scriptLanguage">groovy</stringProp>
+ <stringProp name="parameters"></stringProp>
+ <stringProp name="filename"></stringProp>
+ <stringProp name="cacheKey">true</stringProp>
+ <stringProp name="script">import org.apache.kafka.clients.consumer.KafkaConsumer
+import org.apache.kafka.clients.consumer.ConsumerConfig
+import org.apache.kafka.common.serialization.StringDeserializer
+import java.time.Duration
+
+// Kafka consumer configuration
+def props = new Properties()
+props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, vars.get(&quot;KAFKA_HOST&quot;) + &quot;:&quot; + vars.get(&quot;KAFKA_PORT&quot;))
+props.put(ConsumerConfig.GROUP_ID_CONFIG, vars.get(&quot;consumerGroup&quot;))
+props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName())
+props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName())
+props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, &quot;earliest&quot;)
+
+// Create Kafka consumer
+def consumer = new KafkaConsumer&lt;&gt;(props)
+
+// Subscribe to the topic
+consumer.subscribe(Arrays.asList(&quot;policy-cl-mgt&quot;))
+
+// Initialize variables
+def maxAttempts = 60
+def attempts = 0
+def success = false
+
+// Poll for records
+while (attempts &lt; maxAttempts &amp;&amp; !success) {
+ def records = consumer.poll(Duration.ofMillis(15000))
+
+ for (record in records) {
+ def value = record.value()
+ log.info(&quot;Received message: &quot; + value)
+
+ // Parse the value
+ def jsonSlurper = new groovy.json.JsonSlurper()
+ def parsedValue = jsonSlurper.parseText(value)
+
+ // Extract required fields
+ def requestId = parsedValue.requestId
+ def notification = parsedValue.notification
+
+ // Check if this is the message we&apos;re looking for
+ if (requestId == vars.get(&quot;requestId&quot;) &amp;&amp; notification == &quot;FINAL: SUCCESS&quot;) {
+ success = true
+ log.info(&quot;Final Success: RequestId=&quot; + requestId + &quot;, Notification=&quot; + notification)
+ break
+ }
+ }
+
+ attempts++
+ if (!success) {
+ log.info(&quot;Attempt &quot; + attempts + &quot; of &quot; + maxAttempts + &quot; failed to find matching message&quot;)
+ }
+}
+
+// Close the consumer
+consumer.close()
+
+// Set variables based on the result
+if (success) {
+ vars.put(&quot;finalStatus&quot;, &quot;SUCCESS&quot;)
+} else {
+ vars.put(&quot;finalStatus&quot;, &quot;FAILURE&quot;)
+ AssertionResult.setFailureMessage(&quot;Failed to receive FINAL: SUCCESS notification after &quot; + maxAttempts + &quot; attempts&quot;)
+ AssertionResult.setFailure(true)
+}
+</stringProp>
+ </JSR223Sampler>
<hashTree>
- <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="No []" enabled="true">
- <collectionProp name="Asserion.test_strings">
- <stringProp name="2914">[]</stringProp>
- </collectionProp>
- <stringProp name="Assertion.custom_message"></stringProp>
- <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
- <boolProp name="Assertion.assume_success">false</boolProp>
- <intProp name="Assertion.test_type">12</intProp>
- </ResponseAssertion>
- <hashTree/>
- <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="requestId extractor" enabled="true">
- <stringProp name="RegexExtractor.useHeaders">false</stringProp>
- <stringProp name="RegexExtractor.refname">requestIdOnset</stringProp>
- <stringProp name="RegexExtractor.regex">requestId\\&quot;: \\&quot;(.+?)\\&quot;</stringProp>
- <stringProp name="RegexExtractor.template">$1$</stringProp>
- <stringProp name="RegexExtractor.default">none</stringProp>
- <boolProp name="RegexExtractor.default_empty_value">false</boolProp>
- </RegexExtractor>
+ <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="requestId extractor" enabled="true">
+ <stringProp name="cacheKey">true</stringProp>
+ <stringProp name="filename"></stringProp>
+ <stringProp name="parameters"></stringProp>
+ <stringProp name="script">import groovy.json.JsonSlurper
+
+def message = vars.get(&quot;kafkaMessage&quot;)
+def jsonSlurper = new JsonSlurper()
+def parsedMessage = jsonSlurper.parseText(message)
+
+vars.put(&quot;requestIdOnset&quot;, parsedMessage.requestId ?: &quot;none&quot;)
+</stringProp>
+ <stringProp name="scriptLanguage">groovy</stringProp>
+ </JSR223PostProcessor>
<hashTree/>
- <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="notification extractor" enabled="true">
- <stringProp name="RegexExtractor.useHeaders">false</stringProp>
- <stringProp name="RegexExtractor.refname">notification</stringProp>
- <stringProp name="RegexExtractor.regex">notification\\&quot;: \\&quot;FINAL: (.+?)\\&quot;</stringProp>
- <stringProp name="RegexExtractor.template">$1$</stringProp>
- <stringProp name="RegexExtractor.default">none</stringProp>
- <boolProp name="RegexExtractor.default_empty_value">false</boolProp>
- </RegexExtractor>
+ <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="notification extractor" enabled="true">
+ <stringProp name="scriptLanguage">groovy</stringProp>
+ <stringProp name="parameters"></stringProp>
+ <stringProp name="filename"></stringProp>
+ <stringProp name="cacheKey">true</stringProp>
+ <stringProp name="script">import groovy.json.JsonSlurper
+
+def message = vars.get(&quot;kafkaMessage&quot;)
+def jsonSlurper = new JsonSlurper()
+def parsedMessage = jsonSlurper.parseText(message)
+
+vars.put(&quot;notification&quot;, parsedMessage.notification ?: &quot;none&quot;)
+</stringProp>
+ </JSR223PostProcessor>
<hashTree/>
- <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="JSR223 Assertion" enabled="true">
+ <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="JSR223 Assertion">
<stringProp name="scriptLanguage">groovy</stringProp>
<stringProp name="parameters"></stringProp>
<stringProp name="filename"></stringProp>
<stringProp name="cacheKey">true</stringProp>
- <stringProp name="script">String requestIdOnset = vars.get(&quot;requestIdOnset&quot;);
-String requestId = vars.get(&quot;requestId&quot;);
-String notification = vars.get(&quot;notification&quot;);
-String counter = vars.get(&quot;counterO1&quot;);
-
-String transaction = &quot;none&quot;;
-
-log.info (&quot;The requestId id is &quot; + requestId);
-log.info (&quot;The requestIdOnset id is &quot; + requestIdOnset);
-log.info (&quot;The notification is &quot; + notification);
-log.info (&quot;The transaction is &quot; + transaction);
-log.info (&quot;The counter is &quot; + counter);
-
-if ( requestId == requestIdOnset ) {
- if ( notification == &quot;SUCCESS&quot; ) {
- transaction = &quot;FINAL&quot;;
- log.info (&quot;Final Success Transaction&quot;);
- log.info (&quot;The notification is SUCCESS&quot;);
- } else if ( notification == &quot;FAILURE&quot; ) {
- transaction = &quot;FINAL&quot;;
- log.info (&quot;Final Failure Transaction&quot;);
- AssertionResult.setFailureMessage(&quot;Bad final notification&quot;);
- AssertionResult.setFailure(true);
- }
+ <stringProp name="script">import groovy.json.JsonSlurper
+
+// Parse Kafka message content
+def message = vars.get(&quot;kafkaMessage&quot;)
+def jsonSlurper = new JsonSlurper()
+def parsedMessage = jsonSlurper.parseText(message)
+
+// Extract relevant fields
+String requestIdOnset = parsedMessage.requestId
+String notification = parsedMessage.notification
+String requestId = vars.get(&quot;requestId&quot;)
+String counter = vars.get(&quot;counter&quot;)
+String transaction = &quot;none&quot;
+
+// Log extracted information
+log.info(&quot;The requestId is &quot; + requestId)
+log.info(&quot;The requestIdOnset is &quot; + requestIdOnset)
+log.info(&quot;The notification is &quot; + notification)
+log.info(&quot;The counter is &quot; + counter)
+
+// Perform assertions
+if (requestId == requestIdOnset) {
+ if (notification == &quot;SUCCESS&quot;) {
+ transaction = &quot;FINAL&quot;
+ log.info(&quot;Final Success Transaction&quot;)
+ } else if (notification == &quot;FAILURE&quot;) {
+ transaction = &quot;FINAL&quot;
+ log.info(&quot;Final Failure Transaction&quot;)
+ AssertionResult.setFailureMessage(&quot;Bad final notification&quot;)
+ AssertionResult.setFailure(true)
+ }
}
-int counterTemp = Integer.parseInt(counter) +1;
+// Update counter
+int counterTemp = Integer.parseInt(counter) + 1
if (transaction == &quot;FINAL&quot;) {
- counterTemp = 99;
+ counterTemp = 99
} else if (counterTemp &gt;= 60) {
- AssertionResult.setFailureMessage(&quot;vCPE Success POLICYCL Failure, reached maximum number of attempts &quot;);
- AssertionResult.setFailure(true);
+ AssertionResult.setFailureMessage(&quot;vCPE Success POLICYCL Failure, reached maximum number of attempts&quot;)
+ AssertionResult.setFailure(true)
}
-
-vars.put(&quot;counterO1&quot;, Integer.toString(counterTemp));</stringProp>
+vars.put(&quot;counter01&quot;, Integer.toString(counterTemp))
+</stringProp>
</JSR223Assertion>
<hashTree/>
</hashTree>
</hashTree>
- <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Flow Control Action" enabled="true">
- <intProp name="ActionProcessor.action">1</intProp>
- <intProp name="ActionProcessor.target">0</intProp>
- <stringProp name="ActionProcessor.duration">250</stringProp>
- </TestAction>
- <hashTree/>
</hashTree>
- <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="SON A1 Success" enabled="true">
- <stringProp name="ThreadGroup.on_sample_error">startnextloop</stringProp>
- <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
+ <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="SON A1 Success">
+ <intProp name="ThreadGroup.num_threads">1</intProp>
+ <intProp name="ThreadGroup.ramp_time">1</intProp>
+ <stringProp name="ThreadGroup.duration">${duration}</stringProp>
+ <longProp name="ThreadGroup.delay">11</longProp>
+ <boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
+ <boolProp name="ThreadGroup.scheduler">true</boolProp>
+ <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
+ <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller">
<intProp name="LoopController.loops">-1</intProp>
<boolProp name="LoopController.continue_forever">false</boolProp>
</elementProp>
- <stringProp name="ThreadGroup.num_threads">1</stringProp>
- <stringProp name="ThreadGroup.ramp_time">1</stringProp>
- <boolProp name="ThreadGroup.scheduler">true</boolProp>
- <stringProp name="ThreadGroup.duration">${duration}</stringProp>
- <stringProp name="ThreadGroup.delay">11</stringProp>
- <boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
- <boolProp name="ThreadGroup.delayedStart">false</boolProp>
</ThreadGroup>
<hashTree>
<UserParameters guiclass="UserParametersGui" testclass="UserParameters" testname="Set consumer group per scenario" enabled="true">
@@ -1813,8 +1518,8 @@ vars.put(&quot;counterO1&quot;, Integer.toString(counterTemp));</stringProp>
<stringProp name="-308835287">consumerGroup</stringProp>
</collectionProp>
<collectionProp name="UserParameters.thread_values">
- <collectionProp name="1059562701">
- <stringProp name="109619490">sonA1</stringProp>
+ <collectionProp name="1059733039">
+ <stringProp name="109619924">sonO1</stringProp>
</collectionProp>
</collectionProp>
<boolProp name="UserParameters.per_iteration">false</boolProp>
@@ -1834,406 +1539,494 @@ vars.put(&quot;counterO1&quot;, Integer.toString(counterTemp));</stringProp>
<stringProp name="TestPlan.comments">Update on a per iteration basis</stringProp>
</UserParameters>
<hashTree/>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="DCAE[DCAE_TOPIC]: ONSET" enabled="true">
- <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
- <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
- <collectionProp name="Arguments.arguments">
- <elementProp name="" elementType="HTTPArgument">
- <boolProp name="HTTPArgument.always_encode">false</boolProp>
- <stringProp name="Argument.value">{&#xd;
- &quot;closedLoopControlName&quot;: &quot;ControlLoop-SONA1-7d4baf04-8875-4d1f-946d-06b874048b61&quot;,&#xd;
- &quot;closedLoopAlarmStart&quot;: 1606805921693,&#xd;
- &quot;closedLoopEventClient&quot;: &quot;microservice.SONH&quot;,&#xd;
- &quot;closedLoopEventStatus&quot;: &quot;ONSET&quot;,&#xd;
- &quot;requestID&quot;: &quot;${requestId}&quot;,&#xd;
- &quot;target_type&quot;: &quot;PNF&quot;,&#xd;
- &quot;target&quot;: &quot;pnf.pnf-name&quot;,&#xd;
- &quot;AAI&quot;: {&#xd;
- &quot;generic-vnf.prov-status&quot;: &quot;ACTIVE&quot;,&#xd;
- &quot;generic-vnf.is-closed-loop-disabled&quot;: &quot;false&quot;,&#xd;
- &quot;pnf.pnf-name&quot;: &quot;ncserver2&quot;&#xd;
- },&#xd;
- &quot;from&quot;: &quot;SONHMS&quot;,&#xd;
- &quot;version&quot;: &quot;1.0.2&quot;,&#xd;
- &quot;policyName&quot;: &quot;SONA1&quot;,&#xd;
- &quot;policyVersion&quot;: &quot;1.0.2&quot;,&#xd;
- &quot;Action&quot;: &quot;ModifyA1Policy&quot;,&#xd;
- &quot;payload&quot;: &quot;{ \&quot;Configurations\&quot;:[ { \&quot;data\&quot;:{ \&quot;FAPService\&quot;:{ \&quot;alias\&quot;:\&quot;Cell1\&quot;, \&quot;CellConfig\&quot;:{ \&quot;LTE\&quot;:{ \&quot;RAN\&quot;:{ \&quot;Common\&quot;:{ \&quot;CellIdentity\&quot;:\&quot;1\&quot; }, \&quot;NeighborListInUse\&quot; : { \&quot;LTECellNumberOfEntries\&quot; : \&quot;1\&quot; , \&quot;LTECell\&quot; : [{ \&quot;PLMNID\&quot; :\&quot;plmnid1\&quot;, \&quot;CID\&quot;:\&quot;Chn0001\&quot;, \&quot;PhyCellID\&quot;:\&quot;3\&quot;, \&quot;PNFName\&quot;:\&quot;ncserver01\&quot;, \&quot;Blacklisted\&quot;:\&quot;false\&quot;}] } } } } } } } ] }&quot;&#xd;
-}</stringProp>
- <stringProp name="Argument.metadata">=</stringProp>
- </elementProp>
- </collectionProp>
- </elementProp>
- <stringProp name="HTTPSampler.domain">${DROOLS_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${DROOLS_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">policy/pdp/engine/topics/sources/dmaap/dcae_topic/events</stringProp>
- <stringProp name="HTTPSampler.method">PUT</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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>
- <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
- <collectionProp name="HeaderManager.headers">
- <elementProp name="" elementType="Header">
- <stringProp name="Header.name">Content-Type</stringProp>
- <stringProp name="Header.value">text/plain</stringProp>
- </elementProp>
- </collectionProp>
- </HeaderManager>
- <hashTree/>
- </hashTree>
- <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="Init DMaaP Counter" enabled="true">
+ <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="DCAE[dcae-topic]: ONSET">
+ <stringProp name="scriptLanguage">groovy</stringProp>
+ <stringProp name="parameters"></stringProp>
+ <stringProp name="filename"></stringProp>
+ <stringProp name="cacheKey">true</stringProp>
+ <stringProp name="script">import org.apache.kafka.clients.producer.KafkaProducer
+import org.apache.kafka.clients.producer.ProducerConfig
+import org.apache.kafka.clients.producer.ProducerRecord
+import org.apache.kafka.common.serialization.StringSerializer
+
+// Kafka producer configuration
+def props = new Properties()
+props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, vars.get(&quot;KAFKA_HOST&quot;) + &quot;:&quot; + vars.get(&quot;KAFKA_PORT&quot;))
+props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName())
+props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName())
+props.put(ProducerConfig.CLIENT_ID_CONFIG, &quot;dcae-topic-producer&quot;)
+
+// Create Kafka producer
+def producer = new KafkaProducer&lt;&gt;(props)
+
+// Prepare the message
+def message = &quot;&quot;&quot;
+{
+ &quot;closedLoopControlName&quot;: &quot;ControlLoop-SONA1-7d4baf04-8875-4d1f-946d-06b874048b61&quot;,
+ &quot;closedLoopAlarmStart&quot;: 1606805921693,
+ &quot;closedLoopEventClient&quot;: &quot;microservice.SONH&quot;,
+ &quot;closedLoopEventStatus&quot;: &quot;ONSET&quot;,
+ &quot;requestID&quot;: &quot;${requestId}&quot;,
+ &quot;target_type&quot;: &quot;PNF&quot;,
+ &quot;target&quot;: &quot;pnf.pnf-name&quot;,
+ &quot;AAI&quot;: {
+ &quot;generic-vnf.prov-status&quot;: &quot;ACTIVE&quot;,
+ &quot;generic-vnf.is-closed-loop-disabled&quot;: &quot;false&quot;,
+ &quot;pnf.pnf-name&quot;: &quot;ncserver2&quot;
+ },
+ &quot;from&quot;: &quot;SONHMS&quot;,
+ &quot;version&quot;: &quot;1.0.2&quot;,
+ &quot;policyName&quot;: &quot;SONA1&quot;,
+ &quot;policyVersion&quot;: &quot;1.0.2&quot;,
+ &quot;Action&quot;: &quot;ModifyA1Policy&quot;,
+ &quot;payload&quot;: &quot;{ \&quot;Configurations\&quot;:[ { \&quot;data\&quot;:{ \&quot;FAPService\&quot;:{ \&quot;alias\&quot;:\&quot;Cell1\&quot;, \&quot;CellConfig\&quot;:{ \&quot;LTE\&quot;:{ \&quot;RAN\&quot;:{ \&quot;Common\&quot;:{ \&quot;CellIdentity\&quot;:\&quot;1\&quot; }, \&quot;NeighborListInUse\&quot; : { \&quot;LTECellNumberOfEntries\&quot; : \&quot;1\&quot; , \&quot;LTECell\&quot; : [{ \&quot;PLMNID\&quot; :\&quot;plmnid1\&quot;, \&quot;CID\&quot;:\&quot;Chn0001\&quot;, \&quot;PhyCellID\&quot;:\&quot;3\&quot;, \&quot;PNFName\&quot;:\&quot;ncserver01\&quot;, \&quot;Blacklisted\&quot;:\&quot;false\&quot;}] } } } } } } } ] }&quot;
+}
+&quot;&quot;&quot;.toString()
+
+// Create a producer record
+def record = new ProducerRecord&lt;&gt;(&quot;unauthenticated.dcae_cl_output&quot;, vars.get(&quot;requestId&quot;).toString(), message)
+
+// Send the message
+def future = producer.send(record)
+
+// Wait for the send to complete and log the result
+def metadata = future.get()
+log.info(&quot;Message sent to topic: ${metadata.topic()}, partition: ${metadata.partition()}, offset: ${metadata.offset()}&quot;)
+
+// Close the producer
+producer.close()
+
+// Set a variable to indicate successful sending
+vars.put(&quot;messageSent&quot;, &quot;true&quot;)
+</stringProp>
+ </JSR223Sampler>
+ <hashTree/>
+ <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="Init Kafka Counter" enabled="true">
<stringProp name="scriptLanguage">groovy</stringProp>
<stringProp name="parameters"></stringProp>
<stringProp name="filename"></stringProp>
<stringProp name="cacheKey">true</stringProp>
- <stringProp name="script">vars.put(&quot;counterA1&quot;, &quot;0&quot;);</stringProp>
+ <stringProp name="script">vars.put(&quot;counter01&quot;, &quot;0&quot;);</stringProp>
</JSR223Sampler>
<hashTree/>
- <WhileController guiclass="WhileControllerGui" testclass="WhileController" testname="SDNR-CL ModifyA1Config" enabled="true">
- <stringProp name="WhileController.condition">${__javaScript(${counterA1} &lt; 10)}</stringProp>
- </WhileController>
+ <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="SDNR-CL Modify A1 Config">
+ <stringProp name="LoopController.loops">10</stringProp>
+ </LoopController>
<hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="POLICY[SDNR-CL]: ModifyA1Config" 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 name="filter" elementType="HTTPArgument">
- <boolProp name="HTTPArgument.always_encode">true</boolProp>
- <stringProp name="Argument.value">{&quot;class&quot;:&quot;And&quot;, &quot;filters&quot;: [ { &quot;class&quot;:&quot;Equals&quot;, &quot;field&quot;:&quot;request-id&quot;, &quot;value&quot;:&quot;${requestId}&quot; }, { &quot;class&quot;:&quot;Equals&quot;, &quot;field&quot;:&quot;rpc-name&quot;, &quot;value&quot;:&quot;modifya1config&quot; }]}</stringProp>
- <stringProp name="Argument.metadata">=</stringProp>
- <boolProp name="HTTPArgument.use_equals">true</boolProp>
- <stringProp name="Argument.name">filter</stringProp>
- </elementProp>
- </collectionProp>
- </elementProp>
- <stringProp name="HTTPSampler.domain">${KAFKA_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${KAFKA_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">events/SDNR-CL/${consumerGroup}/1?timeout=15000&amp;limit=1</stringProp>
- <stringProp name="HTTPSampler.method">GET</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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>
+ <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="Read kafka topic" enabled="true">
+ <stringProp name="scriptLanguage">groovy</stringProp>
+ <stringProp name="parameters"></stringProp>
+ <stringProp name="filename"></stringProp>
+ <stringProp name="cacheKey">true</stringProp>
+ <stringProp name="script">import org.apache.kafka.clients.consumer.KafkaConsumer
+import org.apache.kafka.clients.consumer.ConsumerConfig
+import org.apache.kafka.common.serialization.StringDeserializer
+import java.time.Duration
+
+// Kafka consumer configuration
+def props = new Properties()
+props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, vars.get(&quot;KAFKA_HOST&quot;) + &quot;:&quot; + vars.get(&quot;KAFKA_PORT&quot;))
+props.put(ConsumerConfig.GROUP_ID_CONFIG, vars.get(&quot;consumerGroup&quot;))
+props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName())
+props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName())
+props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, &quot;earliest&quot;)
+
+// Create Kafka consumer
+def consumer = new KafkaConsumer&lt;&gt;(props)
+
+try {
+ // Subscribe to the topic
+ consumer.subscribe(Arrays.asList(&quot;SDNR-CL&quot;))
+
+ // Poll for records
+ def records = consumer.poll(Duration.ofMillis(15000))
+
+ if (records.isEmpty()) {
+ log.warn(&quot;No records found within the timeout period&quot;)
+ vars.put(&quot;messageConsumed&quot;, &quot;false&quot;)
+ } else {
+ // Process the first record
+ def record = records.first()
+ def requestId = record.key()
+ def value = record.value()
+
+ // Store the entire message
+ vars.put(&quot;kafkaMessage&quot;, value)
+
+ // Parse the value
+ def jsonSlurper = new groovy.json.JsonSlurper()
+ def parsedValue = jsonSlurper.parseText(value)
+
+ // Extract required fields
+ vars.put(&quot;requestIdOnset&quot;, parsedValue[&quot;request-id&quot;])
+ vars.put(&quot;correlationId&quot;, parsedValue[&quot;correlation-id&quot;])
+ vars.put(&quot;subRequestId&quot;, parsedValue[&quot;sub-request-id&quot;])
+
+ // Log the extracted information
+ log.info(&quot;RequestId: &quot; + requestId)
+ log.info(&quot;Parsed Value: &quot; + parsedValue)
+
+ vars.put(&quot;messageConsumed&quot;, &quot;true&quot;)
+ }
+} catch (Exception e) {
+ log.error(&quot;Error processing Kafka message: &quot; + e.getMessage())
+ vars.put(&quot;messageConsumed&quot;, &quot;false&quot;)
+} finally {
+ // Close the consumer
+ consumer.close()
+}
+</stringProp>
+ </JSR223Sampler>
<hashTree>
- <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="No []" enabled="true">
- <collectionProp name="Asserion.test_strings">
- <stringProp name="2914">[]</stringProp>
- </collectionProp>
- <stringProp name="Assertion.custom_message"></stringProp>
- <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
- <boolProp name="Assertion.assume_success">false</boolProp>
- <intProp name="Assertion.test_type">12</intProp>
- </ResponseAssertion>
- <hashTree/>
- <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="request-id extractor" enabled="true">
- <stringProp name="RegexExtractor.useHeaders">false</stringProp>
- <stringProp name="RegexExtractor.refname">requestIdOnset</stringProp>
- <stringProp name="RegexExtractor.regex">\\&quot;RequestID\\&quot;: \\&quot;(.+?)\\&quot;</stringProp>
- <stringProp name="RegexExtractor.template">$1$</stringProp>
- <stringProp name="RegexExtractor.default">none</stringProp>
- <boolProp name="RegexExtractor.default_empty_value">false</boolProp>
- </RegexExtractor>
- <hashTree/>
- <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="correlation-id extractor" enabled="true">
- <stringProp name="RegexExtractor.useHeaders">false</stringProp>
- <stringProp name="RegexExtractor.refname">correlationId</stringProp>
- <stringProp name="RegexExtractor.regex">correlation-id\\&quot;: \\&quot;(.+?)\\&quot;</stringProp>
- <stringProp name="RegexExtractor.template">$1$</stringProp>
- <stringProp name="RegexExtractor.default">none</stringProp>
- <boolProp name="RegexExtractor.default_empty_value">false</boolProp>
- </RegexExtractor>
+ <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="requestId extractor" enabled="true">
+ <stringProp name="cacheKey">true</stringProp>
+ <stringProp name="filename"></stringProp>
+ <stringProp name="parameters"></stringProp>
+ <stringProp name="script">import groovy.json.JsonSlurper
+
+def message = vars.get(&quot;kafkaMessage&quot;)
+def jsonSlurper = new JsonSlurper()
+def parsedMessage = jsonSlurper.parseText(message)
+
+vars.put(&quot;requestIdOnset&quot;, parsedMessage.requestId ?: &quot;none&quot;)
+</stringProp>
+ <stringProp name="scriptLanguage">groovy</stringProp>
+ </JSR223PostProcessor>
<hashTree/>
- <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="sub-request-id extractor" enabled="true">
- <stringProp name="RegexExtractor.useHeaders">false</stringProp>
- <stringProp name="RegexExtractor.refname">subRequestId</stringProp>
- <stringProp name="RegexExtractor.regex">SubRequestID\\&quot;: \\&quot;(.+?)\\&quot;</stringProp>
- <stringProp name="RegexExtractor.template">$1$</stringProp>
- <stringProp name="RegexExtractor.default">none</stringProp>
- <boolProp name="RegexExtractor.default_empty_value">false</boolProp>
- </RegexExtractor>
+ <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="notification extractor" enabled="true">
+ <stringProp name="scriptLanguage">groovy</stringProp>
+ <stringProp name="parameters"></stringProp>
+ <stringProp name="filename"></stringProp>
+ <stringProp name="cacheKey">true</stringProp>
+ <stringProp name="script">import groovy.json.JsonSlurper
+
+def message = vars.get(&quot;kafkaMessage&quot;)
+def jsonSlurper = new JsonSlurper()
+def parsedMessage = jsonSlurper.parseText(message)
+
+vars.put(&quot;notification&quot;, parsedMessage.notification ?: &quot;none&quot;)
+</stringProp>
+ </JSR223PostProcessor>
<hashTree/>
- <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="JSR223 Assertion" enabled="true">
+ <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="JSR223 Assertion">
<stringProp name="scriptLanguage">groovy</stringProp>
<stringProp name="parameters"></stringProp>
<stringProp name="filename"></stringProp>
<stringProp name="cacheKey">true</stringProp>
- <stringProp name="script">String requestIdOnset = vars.get(&quot;requestIdOnset&quot;);
-String requestId = vars.get(&quot;requestId&quot;);
-String correlationId = vars.get(&quot;correlationId&quot;);
-String subRequestId = vars.get(&quot;subRequestId&quot;);
-String counter = vars.get(&quot;counterA1&quot;);
-
-String transaction = &quot;none&quot;;
-
-log.info (&quot;The requestId id is &quot; + requestId);
-log.info (&quot;The requestIdOnset id is &quot; + requestIdOnset);
-log.info (&quot;The correlation id is &quot; + correlationId);
-log.info (&quot;The subrequest id is &quot; + subRequestId);
-log.info (&quot;The counter is &quot; + counter);
-
-if ( requestId == requestIdOnset ) {
- if ( correlationId == &quot;none&quot; || subRequestId == &quot;none&quot; ) {
- transaction = &quot;FINAL&quot;;
- log.info (&quot;Final Failure Transaction&quot;);
- AssertionResult.setFailureMessage(&quot;Missing correlationId or subRequestId&quot;);
- AssertionResult.setFailure(true);
- } else {
- transaction = &quot;FINAL&quot;;
- vars.put(&quot;transaction&quot;, &quot;FINAL&quot;);
- log.info (&quot;Final Success Transaction&quot;);
- }
+ <stringProp name="script">import org.apache.kafka.clients.consumer.ConsumerRecord
+
+// Assuming the Kafka message is stored in a variable named &apos;kafkaMessage&apos;
+ConsumerRecord&lt;String, String&gt; record = vars.getObject(&quot;kafkaMessage&quot;)
+
+String requestIdOnset = record.key()
+String requestId = vars.get(&quot;requestId&quot;)
+String correlationId = &quot;none&quot;
+String subRequestId = &quot;none&quot;
+String counter = vars.get(&quot;counter&quot;)
+
+String transaction = &quot;none&quot;
+
+// Parse the Kafka message value (assuming it&apos;s JSON)
+def jsonSlurper = new groovy.json.JsonSlurper()
+def messageContent = jsonSlurper.parseText(record.value())
+
+if (messageContent.containsKey(&quot;correlation-id&quot;)) {
+ correlationId = messageContent[&quot;correlation-id&quot;]
+}
+if (messageContent.containsKey(&quot;sub-request-id&quot;)) {
+ subRequestId = messageContent[&quot;sub-request-id&quot;]
+}
+
+log.info(&quot;The requestId is &quot; + requestId)
+log.info(&quot;The requestIdOnset is &quot; + requestIdOnset)
+log.info(&quot;The correlation id is &quot; + correlationId)
+log.info(&quot;The subrequest id is &quot; + subRequestId)
+log.info(&quot;The counter is &quot; + counter)
+
+if (requestId == requestIdOnset) {
+ if (correlationId == &quot;none&quot; || subRequestId == &quot;none&quot;) {
+ transaction = &quot;FINAL&quot;
+ log.info(&quot;Final Failure Transaction&quot;)
+ AssertionResult.setFailureMessage(&quot;Missing correlationId or subRequestId&quot;)
+ AssertionResult.setFailure(true)
+ } else {
+ transaction = &quot;FINAL&quot;
+ vars.put(&quot;transaction&quot;, &quot;FINAL&quot;)
+ log.info(&quot;Final Success Transaction&quot;)
+ }
}
-int counterTemp = Integer.parseInt(counter) +1;
+int counterTemp = Integer.parseInt(counter) + 1
if (transaction == &quot;FINAL&quot;) {
- counterTemp = 99;
+ counterTemp = 99
} else if (counterTemp &gt;= 10) {
- AssertionResult.setFailureMessage(&quot;SON A1 Success SDNR-CL Failure, reached maximum number of 10 attempts &quot;);
- AssertionResult.setFailure(true);
+ AssertionResult.setFailureMessage(&quot;SON A1 Failure, reached maximum number of 10 attempts&quot;)
+ AssertionResult.setFailure(true)
}
-vars.put(&quot;counterA1&quot;, Integer.toString(counterTemp));
-
+vars.put(&quot;counter01&quot;, Integer.toString(counterTemp))
</stringProp>
</JSR223Assertion>
<hashTree/>
</hashTree>
</hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SDNR[SDNR-CL-RSP]: SUCCESS" enabled="true">
- <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
- <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
- <collectionProp name="Arguments.arguments">
- <elementProp name="" elementType="HTTPArgument">
- <boolProp name="HTTPArgument.always_encode">false</boolProp>
- <stringProp name="Argument.value">{&#xd;
- &quot;body&quot;: {&#xd;
- &quot;output&quot;: {&#xd;
- &quot;CommonHeader&quot;: {&#xd;
- &quot;TimeStamp&quot;: &quot;2022-09-10T07:10:05.614Z&quot;,&#xd;
- &quot;APIver&quot;: &quot;1.0&quot;,&#xd;
- &quot;RequestID&quot;: &quot;${requestId}&quot;,&#xd;
- &quot;SubRequestID&quot;: &quot;${subRequestId}&quot;,&#xd;
- &quot;RequestTrack&quot;: [],&#xd;
- &quot;Flags&quot;: []&#xd;
- },&#xd;
- &quot;Status&quot;: {&#xd;
- &quot;Code&quot;: 200,&#xd;
- &quot;Value&quot;: &quot;SUCCESS&quot;&#xd;
- },&#xd;
- &quot;Payload&quot;: &quot;{ \&quot;Configurations\&quot;:[ { \&quot;Status\&quot;: { \&quot;Code\&quot;: 200, \&quot;Value\&quot;: \&quot;SUCCESS\&quot; }, \&quot;data\&quot;:{ \&quot;FAPService\&quot;:{ \&quot;alias\&quot;:\&quot;Cell1\&quot;, \&quot;CellConfig\&quot;:{ \&quot;LTE\&quot;:{ \&quot;RAN\&quot;:{ \&quot;Common\&quot;:{ \&quot;CellIdentity\&quot;:\&quot;1\&quot; }, \&quot;NeighborListInUse\&quot; : { \&quot;LTECellNumberOfEntries\&quot; : \&quot;1\&quot; , \&quot;LTECell\&quot; : [{ \&quot;PLMNID\&quot; :\&quot;plmnid1\&quot;, \&quot;CID\&quot;:\&quot;Chn0001\&quot;, \&quot;PhyCellID\&quot;:\&quot;3\&quot;, \&quot;PNFName\&quot;:\&quot;ncserver01\&quot;, \&quot;Blacklisted\&quot;:\&quot;false\&quot;}] } } } } } } } ] }&quot;&#xd;
- }&#xd;
- },&#xd;
- &quot;version&quot;: &quot;1.0&quot;,&#xd;
- &quot;rpc-name&quot;: &quot;ModifyA1Policy&quot;,&#xd;
- &quot;correlation-id&quot;: &quot;${correlationId}&quot;,&#xd;
- &quot;type&quot;: &quot;response&quot;&#xd;
-}</stringProp>
- <stringProp name="Argument.metadata">=</stringProp>
- </elementProp>
- </collectionProp>
- </elementProp>
- <stringProp name="HTTPSampler.domain">${DROOLS_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${DROOLS_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">policy/pdp/engine/topics/sources/dmaap/sdnr-cl-rsp/events</stringProp>
- <stringProp name="HTTPSampler.method">PUT</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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>
- <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
- <collectionProp name="HeaderManager.headers">
- <elementProp name="" elementType="Header">
- <stringProp name="Header.name">Content-Type</stringProp>
- <stringProp name="Header.value">text/plain</stringProp>
- </elementProp>
- </collectionProp>
- </HeaderManager>
- <hashTree/>
- </hashTree>
- <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="Init DMaaP Counter" enabled="true">
+ <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SDNR[SDNR-CL-RSP]: SUCCESS">
+ <stringProp name="scriptLanguage">groovy</stringProp>
+ <stringProp name="parameters"></stringProp>
+ <stringProp name="filename"></stringProp>
+ <stringProp name="cacheKey">true</stringProp>
+ <stringProp name="script">import org.apache.kafka.clients.producer.KafkaProducer
+import org.apache.kafka.clients.producer.ProducerConfig
+import org.apache.kafka.clients.producer.ProducerRecord
+import org.apache.kafka.common.serialization.StringSerializer
+
+// Kafka producer configuration
+def props = new Properties()
+props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, vars.get(&quot;KAFKA_HOST&quot;) + &quot;:&quot; + vars.get(&quot;KAFKA_PORT&quot;))
+props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName())
+props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName())
+props.put(ProducerConfig.CLIENT_ID_CONFIG, &quot;sdnr-cl-rsp-producer&quot;)
+
+// Create Kafka producer
+def producer = new KafkaProducer&lt;&gt;(props)
+
+// Prepare the message
+def message = &quot;&quot;&quot;
+{
+ &quot;body&quot;: {
+ &quot;output&quot;: {
+ &quot;CommonHeader&quot;: {
+ &quot;TimeStamp&quot;: &quot;2022-08-10T07:10:05.614Z&quot;,
+ &quot;APIver&quot;: &quot;1.0&quot;,
+ &quot;RequestID&quot;: &quot;${requestId}&quot;,
+ &quot;SubRequestID&quot;: &quot;${subRequestId}&quot;,
+ &quot;RequestTrack&quot;: [],
+ &quot;Flags&quot;: []
+ },
+ &quot;Status&quot;: {
+ &quot;Code&quot;: 200,
+ &quot;Value&quot;: &quot;SUCCESS&quot;
+ },
+ &quot;Payload&quot;: &quot;{ \&quot;Configurations\&quot;:[ { \&quot;Status\&quot;: { \&quot;Code\&quot;: 200, \&quot;Value\&quot;: \&quot;SUCCESS\&quot; }, \&quot;data\&quot;:{\&quot;FAPService\&quot;:{\&quot;alias\&quot;:\&quot;Chn0330\&quot;,\&quot;X0005b9Lte\&quot;:{\&quot;phyCellIdInUse\&quot;:6,\&quot;pnfName\&quot;:\&quot;ncserver23\&quot;},\&quot;CellConfig\&quot;:{\&quot;LTE\&quot;:{\&quot;RAN\&quot;:{\&quot;Common\&quot;:{\&quot;CellIdentity\&quot;:\&quot;Chn0330\&quot;}}}}}} } ] }&quot;
+ }
+ },
+ &quot;version&quot;: &quot;1.0&quot;,
+ &quot;rpc-name&quot;: &quot;ModifyO1Config&quot;,
+ &quot;correlation-id&quot;: &quot;${correlationId}&quot;,
+ &quot;type&quot;: &quot;response&quot;
+}
+&quot;&quot;&quot;.toString()
+
+// Create a producer record
+def record = new ProducerRecord&lt;&gt;(&quot;sdnr-cl-rsp&quot;, vars.get(&quot;requestId&quot;).toString(), message)
+
+// Send the message
+def future = producer.send(record)
+
+// Wait for the send to complete and log the result
+def metadata = future.get()
+log.info(&quot;Message sent to topic: ${metadata.topic()}, partition: ${metadata.partition()}, offset: ${metadata.offset()}&quot;)
+
+// Close the producer
+producer.close()
+
+// Set a variable to indicate successful sending
+vars.put(&quot;messageSent&quot;, &quot;true&quot;)
+</stringProp>
+ </JSR223Sampler>
+ <hashTree/>
+ <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="Init Kafka Counter">
<stringProp name="scriptLanguage">groovy</stringProp>
<stringProp name="parameters"></stringProp>
<stringProp name="filename"></stringProp>
<stringProp name="cacheKey">true</stringProp>
- <stringProp name="script">vars.put(&quot;counterA1&quot;, &quot;0&quot;);</stringProp>
+ <stringProp name="script">vars.put(&quot;counter01&quot;, &quot;0&quot;);</stringProp>
</JSR223Sampler>
<hashTree/>
<WhileController guiclass="WhileControllerGui" testclass="WhileController" testname="Final Success Controller" enabled="true">
- <stringProp name="WhileController.condition">${__javaScript(${counterA1} &lt; 60)}</stringProp>
+ <stringProp name="WhileController.condition">${__javaScript(${counter} &lt; 60)}</stringProp>
</WhileController>
<hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="POLICY[policy-cl-mgt]: FINAL_SUCCESS" 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 name="filter" elementType="HTTPArgument">
- <boolProp name="HTTPArgument.always_encode">true</boolProp>
- <stringProp name="Argument.value">{&quot;class&quot;:&quot;And&quot;, &quot;filters&quot;: [ { &quot;class&quot;:&quot;Equals&quot;, &quot;field&quot;:&quot;requestId&quot;, &quot;value&quot;:&quot;${requestId}&quot; }, { &quot;class&quot;:&quot;Equals&quot;, &quot;field&quot;:&quot;notification&quot;, &quot;value&quot;:&quot;FINAL: SUCCESS&quot; }]}</stringProp>
- <stringProp name="Argument.metadata">=</stringProp>
- <boolProp name="HTTPArgument.use_equals">true</boolProp>
- <stringProp name="Argument.name">filter</stringProp>
- </elementProp>
- </collectionProp>
- </elementProp>
- <stringProp name="HTTPSampler.domain">${KAFKA_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${KAFKA_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
- <stringProp name="HTTPSampler.path">events/policy-cl-mgt/${consumerGroup}/1?timeout=15000&amp;limit=1</stringProp>
- <stringProp name="HTTPSampler.method">GET</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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>
+ <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="POLICY [policy-cl-mgt]: FINAL_SUCCESS" enabled="true">
+ <stringProp name="scriptLanguage">groovy</stringProp>
+ <stringProp name="parameters"></stringProp>
+ <stringProp name="filename"></stringProp>
+ <stringProp name="cacheKey">true</stringProp>
+ <stringProp name="script">import org.apache.kafka.clients.consumer.KafkaConsumer
+import org.apache.kafka.clients.consumer.ConsumerConfig
+import org.apache.kafka.common.serialization.StringDeserializer
+import java.time.Duration
+
+// Kafka consumer configuration
+def props = new Properties()
+props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, vars.get(&quot;KAFKA_HOST&quot;) + &quot;:&quot; + vars.get(&quot;KAFKA_PORT&quot;))
+props.put(ConsumerConfig.GROUP_ID_CONFIG, vars.get(&quot;consumerGroup&quot;))
+props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName())
+props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName())
+props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, &quot;earliest&quot;)
+
+// Create Kafka consumer
+def consumer = new KafkaConsumer&lt;&gt;(props)
+
+// Subscribe to the topic
+consumer.subscribe(Arrays.asList(&quot;policy-cl-mgt&quot;))
+
+// Initialize variables
+def maxAttempts = 60
+def attempts = 0
+def success = false
+
+// Poll for records
+while (attempts &lt; maxAttempts &amp;&amp; !success) {
+ def records = consumer.poll(Duration.ofMillis(15000))
+
+ for (record in records) {
+ def value = record.value()
+ log.info(&quot;Received message: &quot; + value)
+
+ // Parse the value
+ def jsonSlurper = new groovy.json.JsonSlurper()
+ def parsedValue = jsonSlurper.parseText(value)
+
+ // Extract required fields
+ def requestId = parsedValue.requestId
+ def notification = parsedValue.notification
+
+ // Check if this is the message we&apos;re looking for
+ if (requestId == vars.get(&quot;requestId&quot;) &amp;&amp; notification == &quot;FINAL: SUCCESS&quot;) {
+ success = true
+ log.info(&quot;Final Success: RequestId=&quot; + requestId + &quot;, Notification=&quot; + notification)
+ break
+ }
+ }
+
+ attempts++
+ if (!success) {
+ log.info(&quot;Attempt &quot; + attempts + &quot; of &quot; + maxAttempts + &quot; failed to find matching message&quot;)
+ }
+}
+
+// Close the consumer
+consumer.close()
+
+// Set variables based on the result
+if (success) {
+ vars.put(&quot;finalStatus&quot;, &quot;SUCCESS&quot;)
+} else {
+ vars.put(&quot;finalStatus&quot;, &quot;FAILURE&quot;)
+ AssertionResult.setFailureMessage(&quot;Failed to receive FINAL: SUCCESS notification after &quot; + maxAttempts + &quot; attempts&quot;)
+ AssertionResult.setFailure(true)
+}
+</stringProp>
+ </JSR223Sampler>
<hashTree>
- <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="No []" enabled="true">
- <collectionProp name="Asserion.test_strings">
- <stringProp name="2914">[]</stringProp>
- </collectionProp>
- <stringProp name="Assertion.custom_message"></stringProp>
- <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
- <boolProp name="Assertion.assume_success">false</boolProp>
- <intProp name="Assertion.test_type">12</intProp>
- </ResponseAssertion>
- <hashTree/>
- <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="requestId extractor" enabled="true">
- <stringProp name="RegexExtractor.useHeaders">false</stringProp>
- <stringProp name="RegexExtractor.refname">requestIdOnset</stringProp>
- <stringProp name="RegexExtractor.regex">requestId\\&quot;: \\&quot;(.+?)\\&quot;</stringProp>
- <stringProp name="RegexExtractor.template">$1$</stringProp>
- <stringProp name="RegexExtractor.default">none</stringProp>
- <boolProp name="RegexExtractor.default_empty_value">false</boolProp>
- </RegexExtractor>
+ <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="requestId extractor" enabled="true">
+ <stringProp name="cacheKey">true</stringProp>
+ <stringProp name="filename"></stringProp>
+ <stringProp name="parameters"></stringProp>
+ <stringProp name="script">import groovy.json.JsonSlurper
+
+def message = vars.get(&quot;kafkaMessage&quot;)
+def jsonSlurper = new JsonSlurper()
+def parsedMessage = jsonSlurper.parseText(message)
+
+vars.put(&quot;requestIdOnset&quot;, parsedMessage.requestId ?: &quot;none&quot;)
+</stringProp>
+ <stringProp name="scriptLanguage">groovy</stringProp>
+ </JSR223PostProcessor>
<hashTree/>
- <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="notification extractor" enabled="true">
- <stringProp name="RegexExtractor.useHeaders">false</stringProp>
- <stringProp name="RegexExtractor.refname">notification</stringProp>
- <stringProp name="RegexExtractor.regex">notification\\&quot;: \\&quot;FINAL: (.+?)\\&quot;</stringProp>
- <stringProp name="RegexExtractor.template">$1$</stringProp>
- <stringProp name="RegexExtractor.default">none</stringProp>
- <boolProp name="RegexExtractor.default_empty_value">false</boolProp>
- </RegexExtractor>
+ <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="notification extractor" enabled="true">
+ <stringProp name="scriptLanguage">groovy</stringProp>
+ <stringProp name="parameters"></stringProp>
+ <stringProp name="filename"></stringProp>
+ <stringProp name="cacheKey">true</stringProp>
+ <stringProp name="script">import groovy.json.JsonSlurper
+
+def message = vars.get(&quot;kafkaMessage&quot;)
+def jsonSlurper = new JsonSlurper()
+def parsedMessage = jsonSlurper.parseText(message)
+
+vars.put(&quot;notification&quot;, parsedMessage.notification ?: &quot;none&quot;)
+</stringProp>
+ </JSR223PostProcessor>
<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 requestIdOnset = vars.get(&quot;requestIdOnset&quot;);
-String requestId = vars.get(&quot;requestId&quot;);
-String notification = vars.get(&quot;notification&quot;);
-String counter = vars.get(&quot;counterA1&quot;);
-
-String transaction = &quot;none&quot;;
-
-log.info (&quot;The requestId id is &quot; + requestId);
-log.info (&quot;The requestIdOnset id is &quot; + requestIdOnset);
-log.info (&quot;The notification is &quot; + notification);
-log.info (&quot;The transaction is &quot; + transaction);
-log.info (&quot;The counter is &quot; + counter);
-
-if ( requestId == requestIdOnset ) {
- if ( notification == &quot;SUCCESS&quot; ) {
- transaction = &quot;FINAL&quot;;
- log.info (&quot;Final Success Transaction&quot;);
- log.info (&quot;The notification is SUCCESS&quot;);
- } else if ( notification == &quot;FAILURE&quot; ) {
- transaction = &quot;FINAL&quot;;
- log.info (&quot;Final Failure Transaction&quot;);
- AssertionResult.setFailureMessage(&quot;Bad final notification&quot;);
- AssertionResult.setFailure(true);
- }
+ <stringProp name="script">import groovy.json.JsonSlurper
+
+// Parse Kafka message content
+def message = vars.get(&quot;kafkaMessage&quot;)
+def jsonSlurper = new JsonSlurper()
+def parsedMessage = jsonSlurper.parseText(message)
+
+// Extract relevant fields
+String requestIdOnset = parsedMessage.requestId
+String notification = parsedMessage.notification
+String requestId = vars.get(&quot;requestId&quot;)
+String counter = vars.get(&quot;counter&quot;)
+String transaction = &quot;none&quot;
+
+// Log extracted information
+log.info(&quot;The requestId is &quot; + requestId)
+log.info(&quot;The requestIdOnset is &quot; + requestIdOnset)
+log.info(&quot;The notification is &quot; + notification)
+log.info(&quot;The counter is &quot; + counter)
+
+// Perform assertions
+if (requestId == requestIdOnset) {
+ if (notification == &quot;SUCCESS&quot;) {
+ transaction = &quot;FINAL&quot;
+ log.info(&quot;Final Success Transaction&quot;)
+ } else if (notification == &quot;FAILURE&quot;) {
+ transaction = &quot;FINAL&quot;
+ log.info(&quot;Final Failure Transaction&quot;)
+ AssertionResult.setFailureMessage(&quot;Bad final notification&quot;)
+ AssertionResult.setFailure(true)
+ }
}
-int counterTemp = Integer.parseInt(counter) +1;
+// Update counter
+int counterTemp = Integer.parseInt(counter) + 1
if (transaction == &quot;FINAL&quot;) {
- counterTemp = 99;
+ counterTemp = 99
} else if (counterTemp &gt;= 60) {
- AssertionResult.setFailureMessage(&quot;vCPE Success POLICYCL Failure, reached maximum number of attempts &quot;);
- AssertionResult.setFailure(true);
+ AssertionResult.setFailureMessage(&quot;vCPE Success POLICYCL Failure, reached maximum number of attempts&quot;)
+ AssertionResult.setFailure(true)
}
-
-vars.put(&quot;counterA1&quot;, Integer.toString(counterTemp));</stringProp>
+vars.put(&quot;counter01&quot;, Integer.toString(counterTemp))
+</stringProp>
</JSR223Assertion>
<hashTree/>
</hashTree>
</hashTree>
- <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Flow Control Action" enabled="true">
- <intProp name="ActionProcessor.action">1</intProp>
- <intProp name="ActionProcessor.target">0</intProp>
- <stringProp name="ActionProcessor.duration">250</stringProp>
- </TestAction>
- <hashTree/>
</hashTree>
<PostThreadGroup guiclass="PostThreadGroupGui" testclass="PostThreadGroup" testname="Tear down" enabled="true">
+ <intProp name="ThreadGroup.num_threads">1</intProp>
+ <intProp name="ThreadGroup.ramp_time">1</intProp>
+ <boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
- <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
+ <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller">
<stringProp name="LoopController.loops">1</stringProp>
<boolProp name="LoopController.continue_forever">false</boolProp>
</elementProp>
- <stringProp name="ThreadGroup.num_threads">1</stringProp>
- <stringProp name="ThreadGroup.ramp_time">1</stringProp>
- <boolProp name="ThreadGroup.scheduler">false</boolProp>
- <stringProp name="ThreadGroup.duration"></stringProp>
- <stringProp name="ThreadGroup.delay"></stringProp>
- <boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
</PostThreadGroup>
<hashTree>
<GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="PAP" enabled="true"/>
<hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Undeploy vCPE Policy" 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>
+ <intProp name="HTTPSampler.concurrentPool">6</intProp>
<stringProp name="HTTPSampler.domain">${PAP_HOST}</stringProp>
<stringProp name="HTTPSampler.port">${PAP_PORT}</stringProp>
<stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
<stringProp name="HTTPSampler.path">policy/pap/v1/pdps/policies/operational.restart/versions/1.0.0</stringProp>
<stringProp name="HTTPSampler.method">DELETE</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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>
+ <boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
+ <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables">
+ <collectionProp name="Arguments.arguments"/>
+ </elementProp>
</HTTPSamplerProxy>
<hashTree>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
@@ -2248,25 +2041,16 @@ vars.put(&quot;counterA1&quot;, Integer.toString(counterTemp));</stringProp>
<hashTree/>
</hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Undeploy 5G SON A1" 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>
+ <intProp name="HTTPSampler.concurrentPool">6</intProp>
<stringProp name="HTTPSampler.domain">${PAP_HOST}</stringProp>
<stringProp name="HTTPSampler.port">${PAP_PORT}</stringProp>
<stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
<stringProp name="HTTPSampler.path">policy/pap/v1/pdps/policies/op.5g.son.a1/versions/1.0.0</stringProp>
<stringProp name="HTTPSampler.method">DELETE</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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>
+ <boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
+ <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables">
+ <collectionProp name="Arguments.arguments"/>
+ </elementProp>
</HTTPSamplerProxy>
<hashTree>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
@@ -2281,25 +2065,16 @@ vars.put(&quot;counterA1&quot;, Integer.toString(counterTemp));</stringProp>
<hashTree/>
</hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Undeploy 5G SON O1" 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>
+ <intProp name="HTTPSampler.concurrentPool">6</intProp>
<stringProp name="HTTPSampler.domain">${PAP_HOST}</stringProp>
<stringProp name="HTTPSampler.port">${PAP_PORT}</stringProp>
<stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
<stringProp name="HTTPSampler.path">policy/pap/v1/pdps/policies/op.5g.son.o1/versions/1.0.0</stringProp>
<stringProp name="HTTPSampler.method">DELETE</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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>
+ <boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
+ <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables">
+ <collectionProp name="Arguments.arguments"/>
+ </elementProp>
</HTTPSamplerProxy>
<hashTree>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
@@ -2317,25 +2092,16 @@ vars.put(&quot;counterA1&quot;, Integer.toString(counterTemp));</stringProp>
<GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="API" enabled="true"/>
<hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Delete vCPE Policy" 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>
+ <intProp name="HTTPSampler.concurrentPool">6</intProp>
<stringProp name="HTTPSampler.domain">${API_HOST}</stringProp>
<stringProp name="HTTPSampler.port">${API_PORT}</stringProp>
<stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
<stringProp name="HTTPSampler.path">policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0/policies/operational.restart/versions/1.0.0</stringProp>
<stringProp name="HTTPSampler.method">DELETE</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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>
+ <boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
+ <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables">
+ <collectionProp name="Arguments.arguments"/>
+ </elementProp>
</HTTPSamplerProxy>
<hashTree>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
@@ -2350,25 +2116,16 @@ vars.put(&quot;counterA1&quot;, Integer.toString(counterTemp));</stringProp>
<hashTree/>
</hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Delete 5G SON A1" 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>
+ <intProp name="HTTPSampler.concurrentPool">6</intProp>
<stringProp name="HTTPSampler.domain">${API_HOST}</stringProp>
<stringProp name="HTTPSampler.port">${API_PORT}</stringProp>
<stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
<stringProp name="HTTPSampler.path">policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0/policies/op.5g.son.a1/versions/1.0.0</stringProp>
<stringProp name="HTTPSampler.method">DELETE</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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>
+ <boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
+ <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables">
+ <collectionProp name="Arguments.arguments"/>
+ </elementProp>
</HTTPSamplerProxy>
<hashTree>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
@@ -2383,25 +2140,16 @@ vars.put(&quot;counterA1&quot;, Integer.toString(counterTemp));</stringProp>
<hashTree/>
</hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Delete 5G SON O1" 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>
+ <intProp name="HTTPSampler.concurrentPool">6</intProp>
<stringProp name="HTTPSampler.domain">${API_HOST}</stringProp>
<stringProp name="HTTPSampler.port">${API_PORT}</stringProp>
<stringProp name="HTTPSampler.protocol">${HTTP}</stringProp>
<stringProp name="HTTPSampler.path">policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0/policies/op.5g.son.o1/versions/1.0.0</stringProp>
<stringProp name="HTTPSampler.method">DELETE</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">false</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>
+ <boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
+ <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables">
+ <collectionProp name="Arguments.arguments"/>
+ </elementProp>
</HTTPSamplerProxy>
<hashTree>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">