diff options
Diffstat (limited to 'catalog-be/src/test')
-rw-r--r-- | catalog-be/src/test/java/org/openecomp/sdc/be/components/csar/CsarInfoTest.java | 14 | ||||
-rw-r--r-- | catalog-be/src/test/resources/nodeTypeInGlobalSub.csar | bin | 0 -> 2442 bytes |
2 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()); + } } diff --git a/catalog-be/src/test/resources/nodeTypeInGlobalSub.csar b/catalog-be/src/test/resources/nodeTypeInGlobalSub.csar Binary files differnew file mode 100644 index 0000000000..67ada85000 --- /dev/null +++ b/catalog-be/src/test/resources/nodeTypeInGlobalSub.csar |