diff options
Diffstat (limited to 'src/test/java/org/onap/dcae/common/XmlParserTest.java')
-rw-r--r-- | src/test/java/org/onap/dcae/common/XmlParserTest.java | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/test/java/org/onap/dcae/common/XmlParserTest.java b/src/test/java/org/onap/dcae/common/XmlParserTest.java index 5ca80c0..ee4cf21 100644 --- a/src/test/java/org/onap/dcae/common/XmlParserTest.java +++ b/src/test/java/org/onap/dcae/common/XmlParserTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * org.onap.dcaegen2.restconfcollector * ================================================================================ - * Copyright (C) 2018-2019 Huawei. All rights reserved. + * Copyright (C) 2018-2022 Huawei. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,21 +25,19 @@ import java.util.Map; import java.util.Set; import org.junit.Test; +import static org.junit.Assert.assertEquals; + public class XmlParserTest { @Test - public void setAttribute() { - String convert = "<time>2018 12:04</time>\n" + public void setAttribute() throws Exception { + String convert = "<root><time>2018 12:04</time>\n" + "<output>t2</output>\n" - + "<status>200</status>"; + + "<status>200</status></root>"; Set<String> listNameList = new HashSet<>(); listNameList.add("result"); Map<String, String> propMap; - try { - propMap = XmlParser.convertToProperties(convert, listNameList); - System.out.println(propMap); - } catch (Exception e) { - System.out.println("Exception " + e); - } + propMap = XmlParser.convertToProperties(convert, listNameList); + assertEquals("200", propMap.get("root.status")); } -}
\ No newline at end of file +} |