From 9a2e5b95ae5094fc08c9d50e91a3980f6e9107ad Mon Sep 17 00:00:00 2001
From: uihassan <najam.hassan@xflowresearch.com>
Date: Wed, 7 Oct 2020 16:09:06 +0500
Subject: [PATCH] template fix added

---
 SOL002/VNFPerformanceManagement-API/PMJobs.robot       |  2 +-
 .../VNFPerformanceManagementKeywords.robot             |  7 +++++--
 .../environment/variables.txt                          |  4 +++-
 .../jsons/subscriptions.json                           | 10 +++++-----
 4 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/SOL002/VNFPerformanceManagement-API/PMJobs.robot b/SOL002/VNFPerformanceManagement-API/PMJobs.robot
index 78883d75..27a85112 100644
--- a/SOL002/VNFPerformanceManagement-API/PMJobs.robot
+++ b/SOL002/VNFPerformanceManagement-API/PMJobs.robot
@@ -288,7 +288,7 @@ Send Post Request Create new VNF Performance Monitoring Job
     Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
     Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
     ${template}=    Get File    jsons/CreatePmJobRequest.json
-    ${body}=        Format String   ${template}     objectInstanceIds=${objectInstanceIds}    callbackuri=${callback_uri}
+    ${body}=        Format String   ${template}     objectInstanceIds=${objectInstanceIds}    callback_uri=${callback_uri}
     POST    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs    ${body}
     ${output}=    Output    response
     Set Suite Variable    ${response}    ${output}
diff --git a/SOL002/VNFPerformanceManagement-API/VNFPerformanceManagementKeywords.robot b/SOL002/VNFPerformanceManagement-API/VNFPerformanceManagementKeywords.robot
index f131a721..80ac22c2 100644
--- a/SOL002/VNFPerformanceManagement-API/VNFPerformanceManagementKeywords.robot
+++ b/SOL002/VNFPerformanceManagement-API/VNFPerformanceManagementKeywords.robot
@@ -1,4 +1,5 @@
 *** Settings ***
+Library    String
 Resource    environment/variables.txt
 Resource    environment/subscriptions.txt
 Resource    environment/individualSubscription.txt
@@ -104,7 +105,8 @@ Send Post Request for VNF Performance Subscription
     Set headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
     Set headers    {"Accept": "${ACCEPT_JSON}"}
     Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
-    ${body_request}=    Get File    jsons/subscriptions.json
+    ${template}=    Get File    jsons/subscriptions.json
+    ${body_request}=        Format String   ${template}     callback_uri=${callback_uri}    subscribe=${subscribe}
     POST    ${apiRoot}/${apiName}/${apiVersion}/subscriptions    ${body_request}
     ${output}=    Output    response
     Set Suite Variable    ${response}    ${output}
@@ -135,7 +137,8 @@ Send Post Request for Duplicated VNF Performance Subscription
     Set headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
     Set headers    {"Accept": "${ACCEPT_JSON}"}
     Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
-    ${body_request}=    Get File    jsons/subscriptions.json
+    ${template}=    Get File    jsons/subscriptions.json
+    ${body_request}=        Format String   ${template}     callback_uri=${callback_uri}    subscribe=${subscribe}
     POST    ${apiRoot}/${apiName}/${apiVersion}/subscriptions    ${body_request}
     ${output}=    Output    response
     Set Suite Variable    ${response}    ${output}    
diff --git a/SOL002/VNFPerformanceManagement-API/environment/variables.txt b/SOL002/VNFPerformanceManagement-API/environment/variables.txt
index debf7b6a..65cab3fb 100644
--- a/SOL002/VNFPerformanceManagement-API/environment/variables.txt
+++ b/SOL002/VNFPerformanceManagement-API/environment/variables.txt
@@ -25,4 +25,6 @@ ${MOCK_SERVER_JAR}    ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.
 
 ${response}        http-response
 
-${objectInstanceIds}    1f50d68b-82e8-4deb-bd40-c934d4d1ac0a
\ No newline at end of file
+${objectInstanceIds}    1f50d68b-82e8-4deb-bd40-c934d4d1ac0a
+
+${subscribe}    /subscribe
\ No newline at end of file
diff --git a/SOL002/VNFPerformanceManagement-API/jsons/subscriptions.json b/SOL002/VNFPerformanceManagement-API/jsons/subscriptions.json
index 3fcc4e59..7072ba32 100644
--- a/SOL002/VNFPerformanceManagement-API/jsons/subscriptions.json
+++ b/SOL002/VNFPerformanceManagement-API/jsons/subscriptions.json
@@ -1,6 +1,6 @@
-{
-	"callbackUri": "http://127.0.0.1/subscribe",
-	"filter": {
+{{
+	"callbackUri": "{callback_uri}{subscribe}",
+	"filter": {{
 		"notificationTypes": ["ThresholdCrossedNotification"]
-	}
-}
\ No newline at end of file
+	}}
+}}
\ No newline at end of file
-- 
GitLab