aboutsummaryrefslogtreecommitdiffstats
path: root/validate/validation/src/test/java
diff options
context:
space:
mode:
authorpriyanka.akhade <priyanka.akhade@huawei.com>2020-04-13 13:16:29 +0000
committerpriyanka.akhade <priyanka.akhade@huawei.com>2020-05-04 06:43:16 +0000
commit1db7e72d979afa03bca38d3008f55246f8d6a6c1 (patch)
tree547661ba2a459201a5aa810e92dfa2941bff4f69 /validate/validation/src/test/java
parent2bb3344c6b3ec9bd77d1491d5beb579bdabc62f2 (diff)
Migrate to Yamlbeans
Issue-ID: CLI-248 Signed-off-by: priyanka.akhade <priyanka.akhade@huawei.com> Change-Id: I182c7a2e2f41bf09990e5b1ac0344f49af33e0c5
Diffstat (limited to 'validate/validation/src/test/java')
-rw-r--r--validate/validation/src/test/java/org/onap/cli/validation/OnapValidationTest.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/validate/validation/src/test/java/org/onap/cli/validation/OnapValidationTest.java b/validate/validation/src/test/java/org/onap/cli/validation/OnapValidationTest.java
index e94de60a..9c46de86 100644
--- a/validate/validation/src/test/java/org/onap/cli/validation/OnapValidationTest.java
+++ b/validate/validation/src/test/java/org/onap/cli/validation/OnapValidationTest.java
@@ -47,7 +47,8 @@ import org.onap.cli.main.conf.OnapCliConstants;
import org.onap.cli.moco.OnapCommandSample;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.yaml.snakeyaml.Yaml;
+import org.onap.cli.fw.error.OnapCommandInvalidSchema;
+import org.onap.cli.fw.utils.OnapCommandDiscoveryUtils;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -221,9 +222,9 @@ public class OnapValidationTest {
List<OnapCommandSample> samples = new ArrayList<>();
Map<String, ?> values = null;
try {
- values = (Map<String, ?>) new Yaml().load(inputStream);
- } catch (Exception e) {
- throw new OnapCommandInvalidSample(fileName, e);
+ values = OnapCommandDiscoveryUtils.loadYaml(inputStream);
+ } catch (OnapCommandInvalidSchema e) { //NOSONAR
+ LOG.error("Failed to load schema file", e.getMessage());
}
OnapCommandSample sample = new OnapCommandSample();