summaryrefslogtreecommitdiffstats
path: root/csarvalidation/src/main
diff options
context:
space:
mode:
authorBartosz Gardziejewski <bartosz.gardziejewski@nokia.com>2020-06-24 13:12:55 +0200
committerBartosz Gardziejewski <bartosz.gardziejewski@nokia.com>2020-06-25 08:30:30 +0200
commit4d94d239aa4f768f5348ac11401fa63d986f963d (patch)
treee2346655d5692c84dafbfd358097e85995c49b09 /csarvalidation/src/main
parent1335f80f88909934ad159530c62ab0f8800c4ec3 (diff)
Skip YAML validation in rule R816745, if onap_pm_dictionary is not present in non_mano_artifact_sets
Issue-ID: VNFSDK-594 Signed-off-by: Bartosz Gardziejewski <bartosz.gardziejewski@nokia.com> Change-Id: I0e52bcc84583a65243fd821f6434f986d12fdadd
Diffstat (limited to 'csarvalidation/src/main')
-rw-r--r--csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR816745.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR816745.java b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR816745.java
index ef901f9..47b963e 100644
--- a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR816745.java
+++ b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR816745.java
@@ -20,16 +20,33 @@ import org.onap.cli.fw.schema.OnapCommandSchema;
import org.onap.cvc.csar.CSARArchive;
import org.onap.cvc.csar.cc.VTPValidateCSARBase;
+import java.util.List;
+import java.util.Map;
+
@OnapCommandSchema(schema = "vtp-validate-csar-r816745.yaml")
public class VTPValidateCSARR816745 extends VTPValidateCSARBase {
+ private static final String PM_DICTIONARY = "onap_pm_dictionary";
+
@Override
protected void validateCSAR(CSARArchive csar) throws Exception {
+ Map<String, Map<String, List<String>>> nonManoFields = csar.getManifest().getNonMano();
+ if(nonManoFields.containsKey(PM_DICTIONARY)) {
+ validateYamlFile(getLocationOfPmDictionaryFile(nonManoFields));
+ }
+ }
+ private String getLocationOfPmDictionaryFile(Map<String, Map<String, List<String>>> nonManoFields) {
+ return nonManoFields.get(PM_DICTIONARY).get("source").get(0);
+ }
+
+ private void validateYamlFile(String path) {
+ throw new UnsupportedOperationException("Under development");
}
@Override
protected String getVnfReqsNo() {
return "R816745";
}
+
}