Fix VNF entityId in policies
Fix the VNF entity IDs value in json schema for each policies (in UI)
Issue-ID: CLAMP-843
Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Change-Id: I9515b01422acdfc0ec36f10cc70994145e561d7f
diff --git a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java
index 5f6cb31..ee40306 100644
--- a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java
+++ b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java
@@ -130,7 +130,7 @@
properties.add(TYPE, createSchemaProperty("Type", STRING, "VNF", "True", null));
}
properties.add("resourceID", createSchemaProperty("Resource ID", STRING,
- modelVnfs.get(entry.getKey()).getAsJsonObject().get("name").getAsString(), "True", null));
+ modelVnfs.get(entry.getKey()).getAsJsonObject().get("invariantUUID").getAsString(), "True", null));
vnfOneOfSchema.add(PROPERTIES, properties);
vnfSchemaArray.add(vnfOneOfSchema);
diff --git a/src/test/resources/tosca/new-converter/tosca_apex_with_metadata.json b/src/test/resources/tosca/new-converter/tosca_apex_with_metadata.json
index e03e48f..f6713af 100644
--- a/src/test/resources/tosca/new-converter/tosca_apex_with_metadata.json
+++ b/src/test/resources/tosca/new-converter/tosca_apex_with_metadata.json
@@ -267,7 +267,7 @@
"resourceID": {
"title": "Resource ID",
"type": "string",
- "default": "vLoadBalancerMS",
+ "default": "1a31b9f2-e50d-43b7-89b3-a040250cf506",
"readOnly": "True"
}
}
diff --git a/src/test/resources/tosca/operational-policy-cds-payload-with-list.json b/src/test/resources/tosca/operational-policy-cds-payload-with-list.json
index 190636c..9a9308e 100644
--- a/src/test/resources/tosca/operational-policy-cds-payload-with-list.json
+++ b/src/test/resources/tosca/operational-policy-cds-payload-with-list.json
@@ -386,7 +386,7 @@
"resourceID": {
"title": "Resource ID",
"type": "string",
- "default": "vLoadBalancerMS",
+ "default": "1a31b9f2-e50d-43b7-89b3-a040250cf506",
"readOnly": "True"
}
}
diff --git a/src/test/resources/tosca/operational-policy-json-schema.json b/src/test/resources/tosca/operational-policy-json-schema.json
index 32adce9..e8363b4 100644
--- a/src/test/resources/tosca/operational-policy-json-schema.json
+++ b/src/test/resources/tosca/operational-policy-json-schema.json
@@ -744,7 +744,7 @@
"resourceID": {
"title": "Resource ID",
"type": "string",
- "default": "vLoadBalancerMS",
+ "default": "1a31b9f2-e50d-43b7-89b3-a040250cf506",
"readOnly": "True"
}
}