From 4d94d239aa4f768f5348ac11401fa63d986f963d Mon Sep 17 00:00:00 2001 From: Bartosz Gardziejewski Date: Wed, 24 Jun 2020 13:12:55 +0200 Subject: 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 Change-Id: I0e52bcc84583a65243fd821f6434f986d12fdadd --- .../onap/cvc/csar/cc/sol004/VTPValidateCSARR816745.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'csarvalidation/src/main/java/org/onap') 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>> nonManoFields = csar.getManifest().getNonMano(); + if(nonManoFields.containsKey(PM_DICTIONARY)) { + validateYamlFile(getLocationOfPmDictionaryFile(nonManoFields)); + } + } + private String getLocationOfPmDictionaryFile(Map>> 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"; } + } -- cgit 1.2.3-korg