summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/onap-tosca-datatype/src/test/java/org/onap/sdc/tosca/services/YamlUtilTest.java12
-rw-r--r--common/onap-tosca-datatype/src/test/resources/yamlMap.yaml7
2 files changed, 10 insertions, 9 deletions
diff --git a/common/onap-tosca-datatype/src/test/java/org/onap/sdc/tosca/services/YamlUtilTest.java b/common/onap-tosca-datatype/src/test/java/org/onap/sdc/tosca/services/YamlUtilTest.java
index 562b208bde..063680f9ed 100644
--- a/common/onap-tosca-datatype/src/test/java/org/onap/sdc/tosca/services/YamlUtilTest.java
+++ b/common/onap-tosca-datatype/src/test/java/org/onap/sdc/tosca/services/YamlUtilTest.java
@@ -42,18 +42,18 @@ public class YamlUtilTest {
InputStream is = yamlUtil.loadYamlFileIs("/yamlMap.yaml");
Map<String, LinkedHashMap<String, Object>> res = yamlUtil.yamlToMap(is);
assertNotNull(res);
- assertEquals(res.size(), 3);
- assertEquals(res.get("parameter1"), "value1");
- assertEquals(res.get("parameter2"), "value2");
- assertEquals(res.get("parameter3"), "value3");
+ assertEquals(1, res.size());
+ assertEquals("value1", (String)res.get("complex-mapping").get("parameter1"));
+ assertEquals("value2", (String)res.get("complex-mapping").get("parameter2"));
+ assertEquals("value3", (String)res.get("complex-mapping").get("parameter3"));
}
@Test
public void testYamlToList() {
InputStream is = yamlUtil.loadYamlFileIs("/yamlList.yaml");
Optional<List<Object>> res = yamlUtil.yamlToList(is);
- assertEquals(res.get().size(), 3);
- assertEquals(res.get().get(0), "value1");
+ assertEquals(3, res.get().size());
+ assertEquals("value1", res.get().get(0));
InputStream is2 = yamlUtil.loadYamlFileIs("/yamlListError.yaml");
Optional<List<Object>> res2 = yamlUtil.yamlToList(is2);
diff --git a/common/onap-tosca-datatype/src/test/resources/yamlMap.yaml b/common/onap-tosca-datatype/src/test/resources/yamlMap.yaml
index d4a07a82a5..4fa455c452 100644
--- a/common/onap-tosca-datatype/src/test/resources/yamlMap.yaml
+++ b/common/onap-tosca-datatype/src/test/resources/yamlMap.yaml
@@ -1,3 +1,4 @@
-parameter1: value1
-parameter2: value2
-parameter3: value3 \ No newline at end of file
+complex-mapping:
+ parameter1: value1
+ parameter2: value2
+ parameter3: value3 \ No newline at end of file