[PMSH] TLS support refactoring

Signed-off-by: efiacor <fiachra.corcoran@est.tech>
Change-Id: I169a072bdbc7ad3fddd4d002a76b798fa5627e8f
Issue-ID: DCAEGEN2-2146
diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json b/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json
index 569e938..b70b41d 100644
--- a/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json
+++ b/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json
@@ -77,6 +77,8 @@
             "control_loop_name": "pmsh-control-loop",
             "operational_policy_name": "pmsh-operational-policy",
             "cert_path": "/opt/app/pmsh/etc/certs/cert.pem",
+            "enable_tls": true,
+            "ca_cert_path": "/opt/app/pmsh/etc/certs/cacert.pem",
             "streams_publishes": {
               "policy_pm_publisher": {
                 "dmaap_info": {
diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-created.json b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-created.json
index 9c9dc6e..1a027f2 100644
--- a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-created.json
+++ b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-created.json
@@ -1,7 +1,10 @@
 [
   {
     "httpRequest": {
-      "path": "/events/AAI_EVENT/dcae_pmsh_cg/AAI-EVENT"
+      "path": "/events/AAI_EVENT/dcae_pmsh_cg/dcae_pmsh_aai_event",
+      "queryStringParameters" : {
+        "timeout" : [ "1000" ]
+      }
     },
     "httpResponse": {
       "statusCode": 200,
@@ -21,7 +24,10 @@
   },
   {
     "httpRequest": {
-      "path": "/events/AAI_EVENT/dcae_pmsh_cg/AAI-EVENT"
+      "path": "/events/AAI_EVENT/dcae_pmsh_cg/dcae_pmsh_aai_event",
+      "queryStringParameters" : {
+        "timeout" : [ "1000" ]
+      }
     },
     "httpResponse": {
       "statusCode": 200,
diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-deleted.json b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-deleted.json
index c0accc8..e5c4dd8 100644
--- a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-deleted.json
+++ b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-deleted.json
@@ -1,7 +1,10 @@
 [
   {
     "httpRequest": {
-      "path": "/events/AAI_EVENT/dcae_pmsh_cg/AAI-EVENT"
+      "path": "/events/AAI_EVENT/dcae_pmsh_cg/dcae_pmsh_aai_event",
+      "queryStringParameters" : {
+        "timeout" : [ "1000" ]
+      }
     },
     "httpResponse": {
       "statusCode": 200,
@@ -21,7 +24,10 @@
   },
   {
     "httpRequest": {
-      "path": "/events/AAI_EVENT/dcae_pmsh_cg/AAI-EVENT"
+      "path": "/events/AAI_EVENT/dcae_pmsh_cg/dcae_pmsh_aai_event",
+      "queryStringParameters" : {
+        "timeout" : [ "1000" ]
+      }
     },
     "httpResponse": {
       "statusCode": 200,
diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-existing.json b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-existing.json
index cc14f3c..eba4e4e 100644
--- a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-existing.json
+++ b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-existing.json
@@ -1,7 +1,10 @@
 [
   {
     "httpRequest": {
-      "path": "/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS/dcae_pmsh_cg/policy_response_consumer"
+      "path": "/events/unauthenticated.PMSH_CL_INPUT/dcae_pmsh_cg/dcae_pmsh_policy_cl_input",
+      "queryStringParameters" : {
+        "timeout" : [ "1000" ]
+      }
     },
     "httpResponse": {
       "statusCode": 200,
@@ -21,7 +24,10 @@
   },
   {
     "httpRequest": {
-      "path": "/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS/dcae_pmsh_cg/policy_response_consumer"
+      "path": "/events/unauthenticated.PMSH_CL_INPUT/dcae_pmsh_cg/dcae_pmsh_policy_cl_input",
+      "queryStringParameters" : {
+        "timeout" : [ "1000" ]
+      }
     },
     "httpResponse": {
       "statusCode": 200,
diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-new.json b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-new.json
index 79bfb44..f73fee8 100644
--- a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-new.json
+++ b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-new.json
@@ -1,7 +1,10 @@
 [
   {
     "httpRequest": {
-      "path": "/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS/dcae_pmsh_cg/policy_response_consumer"
+      "path": "/events/unauthenticated.PMSH_CL_INPUT/dcae_pmsh_cg/dcae_pmsh_policy_cl_input",
+      "queryStringParameters" : {
+        "timeout" : [ "1000" ]
+      }
     },
     "httpResponse": {
       "statusCode": 200,
@@ -21,7 +24,10 @@
   },
   {
     "httpRequest": {
-      "path": "/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS/dcae_pmsh_cg/policy_response_consumer"
+      "path": "/events/unauthenticated.PMSH_CL_INPUT/dcae_pmsh_cg/dcae_pmsh_policy_cl_input",
+      "queryStringParameters" : {
+        "timeout" : [ "1000" ]
+      }
     },
     "httpResponse": {
       "statusCode": 200,
diff --git a/tests/dcaegen2-services-pmsh/testcases/pmsh.robot b/tests/dcaegen2-services-pmsh/testcases/pmsh.robot
index 08ab197..a2b8cad 100644
--- a/tests/dcaegen2-services-pmsh/testcases/pmsh.robot
+++ b/tests/dcaegen2-services-pmsh/testcases/pmsh.robot
@@ -64,7 +64,7 @@
     [Documentation]                 Verify policy response on MR is handled
     [Timeout]                       40 seconds
     SimulatePolicyResponse          ${MR_EXPECTATION_POLICY_RESPONSE_PNF_EXISTING}
-    Sleep                           7 seconds      Ensure Policy response on MR is picked up
+    Sleep                           15 seconds      Ensure Policy response on MR is picked up
     ${resp}=                        Get Request                      pmsh_session  ${SUBSCRIPTIONS_ENDPOINT}
     Should Be Equal As Strings      ${resp.json()[0]['network_functions'][0]['nf_sub_status']}     CREATED
 
@@ -73,7 +73,7 @@
     [Documentation]                 Verify PNF created AAI event on MR is handled
     [Timeout]                       30 seconds
     SimulateNewPNF
-    Sleep                           12 seconds      Ensure AAI event on MR is picked up
+    Sleep                           15 seconds      Ensure AAI event on MR is picked up
     ${resp}=                        Get Request                      pmsh_session  ${SUBSCRIPTIONS_ENDPOINT}
     Should Be Equal As Strings      ${resp.json()[0]['network_functions'][1]['nf_name']}            pnf_newly_discovered
     Should Be Equal As Strings      ${resp.json()[0]['network_functions'][1]['orchestration_status']}   Active
@@ -105,7 +105,7 @@
 
 SimulateNewPNF
     ${data}=        Get Data From File    ${MR_EXPECTATION_AAI_PNF_CREATED}
-    ${resp} =       Put Request     mr_sim_session  /clear  data={"path": "/events/AAI_EVENT/dcae_pmsh_cg/AAI-EVENT"}
+    ${resp} =       Put Request     mr_sim_session  /clear  data={"path": "/events/AAI_EVENT/dcae_pmsh_cg/dcae_pmsh_aai_event"}
     Should Be True      ${resp.status_code} == 200
     ${resp} =       Put Request     mr_sim_session  /expectation     data=${data}
     Should Be True      ${resp.status_code} == 201
@@ -113,14 +113,14 @@
 SimulatePolicyResponse
     [Arguments]                     ${expected_contents}
     ${data}=        Get Data From File    ${expected_contents}
-    ${resp} =       Put Request     mr_sim_session  /clear  data={"path": "/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS/dcae_pmsh_cg/policy_response_consumer"}
+    ${resp} =       Put Request     mr_sim_session  /clear  data={"path": "/events/unauthenticated.PMSH_CL_INPUT/dcae_pmsh_cg/dcae_pmsh_policy_cl_input"}
     Should Be True      ${resp.status_code} == 200
     ${resp} =       Put Request     mr_sim_session  /expectation     data=${data}
     Should Be True      ${resp.status_code} == 201
 
 SimulateDeletedPNF
     ${data}=        Get Data From File    ${MR_EXPECTATION_AAI_PNF_REMOVED}
-    ${resp} =       Put Request     mr_sim_session  /clear  data={"path": "/events/AAI_EVENT/dcae_pmsh_cg/AAI-EVENT"}
+    ${resp} =       Put Request     mr_sim_session  /clear  data={"path": "/events/AAI_EVENT/dcae_pmsh_cg/dcae_pmsh_aai_event"}
     Should Be True      ${resp.status_code} == 200
     ${resp} =       Put Request     mr_sim_session  /expectation     data=${data}
     Should Be True      ${resp.status_code} == 201