aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/onap/aai/babel/testdata/CsarTest.java1
-rw-r--r--src/test/java/org/onap/aai/babel/xml/generator/TestModelGenerator.java11
-rw-r--r--src/test/resources/compressedArtifacts/service-Testpnfsvc-csar.csarbin0 -> 89414 bytes
-rw-r--r--src/test/resources/tosca-mappings.json20
4 files changed, 28 insertions, 4 deletions
diff --git a/src/test/java/org/onap/aai/babel/testdata/CsarTest.java b/src/test/java/org/onap/aai/babel/testdata/CsarTest.java
index 1885555..b8a86b4 100644
--- a/src/test/java/org/onap/aai/babel/testdata/CsarTest.java
+++ b/src/test/java/org/onap/aai/babel/testdata/CsarTest.java
@@ -37,6 +37,7 @@ import org.onap.aai.babel.xml.generator.data.GeneratorUtil;
public enum CsarTest {
// @formatter:off
VNF_VENDOR_CSAR("catalog_csar.csar"),
+ PNF_VENDOR_CSAR("service-Testpnfsvc-csar.csar"),
NO_VNF_CONFIG_CSAR("noVnfConfiguration.csar"),
SD_WAN_CSAR_FILE("service-SdWanServiceTest-csar.csar"),
COS_AVPN_CSAR_FILE("service_CosAvpn_csar.csar"),
diff --git a/src/test/java/org/onap/aai/babel/xml/generator/TestModelGenerator.java b/src/test/java/org/onap/aai/babel/xml/generator/TestModelGenerator.java
index 404fb19..168f237 100644
--- a/src/test/java/org/onap/aai/babel/xml/generator/TestModelGenerator.java
+++ b/src/test/java/org/onap/aai/babel/xml/generator/TestModelGenerator.java
@@ -21,10 +21,14 @@
package org.onap.aai.babel.xml.generator;
+import static org.junit.Assert.assertTrue;
+
import java.io.IOException;
import java.util.Collections;
+import java.util.List;
import org.junit.Before;
import org.junit.Test;
+import org.onap.aai.babel.service.data.BabelArtifact;
import org.onap.aai.babel.testdata.CsarTest;
import org.onap.aai.babel.util.ArtifactTestUtils;
import org.onap.aai.babel.xml.generator.data.Artifact;
@@ -51,5 +55,12 @@ public class TestModelGenerator {
Collections.singletonList(ymlFile));
}
+ @Test
+ public void testSdncPropsParsed() throws XmlArtifactGenerationException, IOException {
+ Artifact ymlFile = new Artifact(null, null, null, null);
+ List<BabelArtifact> babelArtifactList = new ModelGenerator().generateArtifacts(CsarTest.PNF_VENDOR_CSAR.getContent(),
+ Collections.singletonList(ymlFile));
+ assertTrue(babelArtifactList.get(1).getPayload().contains("sdnc-model-name"));
+ }
}
diff --git a/src/test/resources/compressedArtifacts/service-Testpnfsvc-csar.csar b/src/test/resources/compressedArtifacts/service-Testpnfsvc-csar.csar
new file mode 100644
index 0000000..9f563ff
--- /dev/null
+++ b/src/test/resources/compressedArtifacts/service-Testpnfsvc-csar.csar
Binary files differ
diff --git a/src/test/resources/tosca-mappings.json b/src/test/resources/tosca-mappings.json
index dfe666f..32491f6 100644
--- a/src/test/resources/tosca-mappings.json
+++ b/src/test/resources/tosca-mappings.json
@@ -121,15 +121,22 @@
"type": "CR",
"name": "cr",
"deleteFlag": true,
- "modelInvariantId": "collection-resource-invariant-id",
- "modelVersionId": "collection-resource-version-id"
+ "modelInvariantId": "collection-resource-invariant-id",
+ "modelVersionId": "collection-resource-version-id"
},
{
"type": "INSTANCE_GROUP",
"name": "instance-group",
"deleteFlag": true,
- "modelInvariantId": "instance-group-invariant-id",
- "modelVersionId": "instance-group-version-id"
+ "modelInvariantId": "instance-group-invariant-id",
+ "modelVersionId": "instance-group-version-id"
+ },
+ {
+ "type": "PNF",
+ "name": "pnf",
+ "deleteFlag": true,
+ "modelInvariantId": "pnf-instance-invariant-id",
+ "modelVersionId": "pnf-instance-version-id"
}
],
"widgetMappings": [
@@ -176,6 +183,11 @@
"type": "widget",
"widget": "VOLUME",
"deleteFlag": true
+ },
+ {
+ "prefix": "org.openecomp.resource.pnf",
+ "widget": "PNF",
+ "deleteFlag": true
}
]
}