diff options
author | 2021-03-01 09:19:39 +0100 | |
---|---|---|
committer | 2021-03-10 13:22:39 +0000 | |
commit | 114b2affd49c0c5a77f65267d53fc417d79d29f7 (patch) | |
tree | 44b2b3c46d5d12c94e54496c04c5ff524c0d4b4a /common/onap-tosca-datatype/src/test/java | |
parent | 280149632b48dfabd4c12719d1ff391414bbd02f (diff) |
Fix sonar bugs
Fix the bugs indicated by Sonar in YamlUtilTest.
Issue-ID: SDC-3428
Change-Id: Ic0a4b9e4ee45d047414bb14929abcd5d390466d4
Signed-off-by: xuegao <xue.gao@intl.att.com>
Diffstat (limited to 'common/onap-tosca-datatype/src/test/java')
-rw-r--r-- | common/onap-tosca-datatype/src/test/java/org/onap/sdc/tosca/services/YamlUtilTest.java | 12 |
1 files changed, 6 insertions, 6 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); |