blob: 584a0fde15d245bc2c1faebe51d7e4dac50a0ba6 [file] [log] [blame]
Pavel Aharoni8c51a2f2017-06-07 17:24:33 +03001package org.openecomp.sdc.toscaparser;
2
3import static org.junit.Assert.assertEquals;
4import static org.junit.Assert.assertNotNull;
5
6import java.io.File;
7import java.util.LinkedHashMap;
8
9import org.junit.Test;
10import org.openecomp.sdc.toscaparser.api.ToscaTemplate;
11import org.openecomp.sdc.toscaparser.api.common.JToscaException;
12
13public class JToscaMetadataParse {
14
15 @Test
16 public void testMetadataParsedCorrectly() throws JToscaException {
17 String fileStr = JToscaMetadataParse.class.getClassLoader().getResource("csars/csar_hello_world.csar").getFile();
18 File file = new File(fileStr);
19 ToscaTemplate toscaTemplate = new ToscaTemplate(file.getAbsolutePath(), null, true, null);
20 LinkedHashMap<String, Object> metadataProperties = toscaTemplate.getMetaProperties("TOSCA.meta");
21 assertNotNull(metadataProperties);
22 Object entryDefinition = metadataProperties.get("Entry-Definitions");
23 assertNotNull(entryDefinition);
24 assertEquals("tosca_helloworld.yaml", entryDefinition);
25 }
26}