summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/test/java
diff options
context:
space:
mode:
authorMichaelMorris <michael.morris@est.tech>2020-05-27 18:09:40 +0100
committerOfir Sonsino <ofir.sonsino@intl.att.com>2020-06-18 05:41:53 +0000
commit7cd3f6bbd4524421f290aa6b5f89836bc98c8cbf (patch)
tree7212a75c9c4a529b352854801393ac2dee1d648d /catalog-be/src/test/java
parentccdff9dd945d15b537f922999a569deb9b08a2d6 (diff)
Importing VSP with node_type in separate file
Import fails when a node_type referenced in the main template is defined in a separate yaml file in the csar even when that separate file is correctly imported in the main template Change-Id: I6abe074585c2ce592fe9bed7abe76f0856bcfe93 Issue-ID: SDC-2850 Signed-off-by: MichaelMorris <michael.morris@est.tech>
Diffstat (limited to 'catalog-be/src/test/java')
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/components/csar/CsarInfoTest.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/csar/CsarInfoTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/csar/CsarInfoTest.java
index a28e2efcdb..f3f0ab5628 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/csar/CsarInfoTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/csar/CsarInfoTest.java
@@ -38,7 +38,7 @@ import org.openecomp.sdc.common.impl.ExternalConfiguration;
import org.openecomp.sdc.common.impl.FSConfigurationSource;
import org.openecomp.sdc.common.zip.ZipUtils;
import org.openecomp.sdc.common.zip.exception.ZipException;
-
+import com.datastax.oss.driver.shaded.guava.common.collect.Lists;
import java.io.File;
import java.net.URISyntaxException;
import java.util.Arrays;
@@ -167,4 +167,16 @@ public class CsarInfoTest {
assertTrue(csarInfo.extractNodeTypesInfo().isEmpty());
}
+
+ @Test
+ public void testCreateCsarInfoVnfWithNodeTypeInGlobalSub() throws URISyntaxException, ZipException {
+ final CsarInfo csarInfo = createCsarInfo("nodeTypeInGlobalSub.csar", "Definitions/MainServiceTemplate.yaml");
+
+ assertEquals(1, csarInfo.extractNodeTypesInfo().size());
+ final NodeTypeInfo nodeTypeInfo = csarInfo.extractNodeTypesInfo().get("tosca.nodes.l3vpn");
+ assertNotNull(nodeTypeInfo);
+ assertEquals("Definitions/GlobalSubstitutionTypesServiceTemplate.yaml", nodeTypeInfo.getTemplateFileName());
+ assertEquals("tosca.nodes.l3vpn", nodeTypeInfo.getType());
+ assertEquals(Lists.newArrayList("tosca.nodes.Root"), nodeTypeInfo.getDerivedFrom());
+ }
}