b17c8a17cd8456e75471bad7685073760ad4438d
[sdc.git] /
1 package org.openecomp.sdc.vendorsoftwareproduct.upload.csar;
2
3
4 import static org.testng.Assert.assertEquals;
5
6 import java.io.IOException;
7 import java.io.InputStream;
8 import org.openecomp.sdc.vendorsoftwareproduct.impl.orchestration.csar.OnboardingToscaMetadata;
9 import org.testng.annotations.Test;
10
11 public class MetadataParsingTest {
12
13   @Test
14   public void testNoEntryDefinitions() throws IOException {
15     try (InputStream is = getClass()
16         .getResourceAsStream("/vspmanager.csar/metadata/Invalidtosca.meta")) {
17       OnboardingToscaMetadata onboardingToscaMetadata = new OnboardingToscaMetadata(is);
18       assertEquals(onboardingToscaMetadata.getEntryDefinitionsPath(), null);
19     }
20   }
21
22   @Test
23   public void testValidMetadataFile() throws IOException {
24     try (InputStream is = getClass()
25         .getResourceAsStream("/vspmanager.csar/metadata/Validtosca.meta")) {
26       OnboardingToscaMetadata onboardingToscaMetadata = new OnboardingToscaMetadata(is);
27       assertEquals(onboardingToscaMetadata.getEntryDefinitionsPath(), "Definitions/MainServiceTemplate.yaml");
28     }
29
30   }
31 }