From 1db7e72d979afa03bca38d3008f55246f8d6a6c1 Mon Sep 17 00:00:00 2001 From: "priyanka.akhade" Date: Mon, 13 Apr 2020 13:16:29 +0000 Subject: Migrate to Yamlbeans Issue-ID: CLI-248 Signed-off-by: priyanka.akhade Change-Id: I182c7a2e2f41bf09990e5b1ac0344f49af33e0c5 --- .../test/java/org/onap/cli/validation/OnapValidationTest.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'validate/validation') 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 samples = new ArrayList<>(); Map values = null; try { - values = (Map) 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(); -- cgit 1.2.3-korg