push addional code
[sdc.git] / openecomp-be / lib / openecomp-core-lib / openecomp-nosqldb-lib / openecomp-nosqldb-core / src / test / java / org / openecomp / core / utilities / Yaml / YamlUtilTest.java
1 package org.openecomp.core.utilities.Yaml;
2
3 import org.openecomp.core.utilities.yaml.YamlUtil;
4 import org.junit.Before;
5 import org.junit.Test;
6 import testobjects.yaml.YamlFile;
7
8
9 public class YamlUtilTest {
10
11   String yamlContent;
12
13   @Before
14   public void setup() {
15     initYamlFileContent();
16   }
17
18   void initYamlFileContent() {
19     yamlContent = "heat_template_version: ss\n" +
20         "description: ab\n" +
21         "parameters:\n" +
22         "  jsa_net_name:    \n" +
23         "    description: network name of jsa log network\n" +
24         "    hidden: true\n" +
25         "    inner:\n" +
26         "        inner1:\n" +
27         "            name: shiri\n" +
28         "        inner2:\n" +
29         "            name: avi";
30   }
31
32   @Test
33   public void shouldConvertSimpleYamlToObject() {
34     new YamlUtil().yamlToObject(yamlContent, YamlFile.class);
35   }
36
37
38     /*public void loadCassandraParameters(){
39         YamlUtil yamlutil = new YamlUtil();
40         String cassandraKey = "cassandraConfig";
41         String configurationFile = "/configuration.yaml";
42         InputStream yamlAsIS = yamlutil.loadYamlFileIs(configurationFile);
43         Map<String, LinkedHashMap<String, Object>> configurationMap = yamlutil.yamlToMap(yamlAsIS);
44         LinkedHashMap<String, Object> cassandraConfiguration = configurationMap.get(cassandraKey);
45         System.out.println(cassandraConfiguration.entrySet());
46     }*/
47 }