diff options
author | Michael Lando <ml636r@att.com> | 2017-06-29 16:30:42 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-06-29 16:30:42 +0000 |
commit | f118ea26bcea3a3d9af27faa7d54e895a0202dcf (patch) | |
tree | defb8b5159f143363fc825c9fee4e74b34500490 /src/test | |
parent | 45cbac699c67de72160d6aa83c3979b675bc326c (diff) | |
parent | 16b52f965b23d05cd2b57c5c29d1330e8d04a5f1 (diff) |
Merge "[SDC-43] NFOD getVnfConfig support"
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/org/openecomp/sdc/impl/SdcToscaParserBasicTest.java | 3 | ||||
-rw-r--r-- | src/test/java/org/openecomp/sdc/impl/ToscaParserNodeTemplateTest.java | 33 | ||||
-rw-r--r-- | src/test/resources/csars/service-NfodService-csar.csar | bin | 0 -> 39906 bytes |
3 files changed, 35 insertions, 1 deletions
diff --git a/src/test/java/org/openecomp/sdc/impl/SdcToscaParserBasicTest.java b/src/test/java/org/openecomp/sdc/impl/SdcToscaParserBasicTest.java index 2039645..3af654e 100644 --- a/src/test/java/org/openecomp/sdc/impl/SdcToscaParserBasicTest.java +++ b/src/test/java/org/openecomp/sdc/impl/SdcToscaParserBasicTest.java @@ -26,6 +26,7 @@ public abstract class SdcToscaParserBasicTest { static ISdcCsarHelper fdntCsarHelper; static ISdcCsarHelper complexCps; static ISdcCsarHelper fdntCsarHelperWithInputs; + static ISdcCsarHelper nfodCsarHlper; static Map<String, HashMap<String, List<String>>> fdntCsarHelper_Data; @BeforeClass @@ -37,7 +38,7 @@ public abstract class SdcToscaParserBasicTest { rainyCsarHelperSingleVf = getCsarHelper("csars/service-ServiceFdnt-csar.csar"); complexCps = getCsarHelper("csars/service-consolidated-props-csar.csar"); fdntCsarHelperWithInputs = getCsarHelper("csars/service-ServiceFdnt-with-get-input.csar"); - + nfodCsarHlper = getCsarHelper("csars/service-NfodService-csar.csar"); fdntCsarHelper_Data = new HashMap<String, HashMap<String, List<String>>>(){ { HashMap<String, List<String>> FDNT ; diff --git a/src/test/java/org/openecomp/sdc/impl/ToscaParserNodeTemplateTest.java b/src/test/java/org/openecomp/sdc/impl/ToscaParserNodeTemplateTest.java index a0808c5..8470cbd 100644 --- a/src/test/java/org/openecomp/sdc/impl/ToscaParserNodeTemplateTest.java +++ b/src/test/java/org/openecomp/sdc/impl/ToscaParserNodeTemplateTest.java @@ -522,4 +522,37 @@ public class ToscaParserNodeTemplateTest extends SdcToscaParserBasicTest { + + @Test + public void testGetVnfConfig() { + NodeTemplate vnfConfig = nfodCsarHlper.getVnfConfig("9bb2ef82-f8f6-4391-bc71-db063f15bf57"); + assertNotNull(vnfConfig); + assertEquals("vnfConfiguration", vnfConfig.getMetaData().getValue("name")); + } + + @Test + public void testGetVnfConfigByNonFoundVNF() { + NodeTemplate vnfConfig = complexCps.getVnfConfig("f999e2ca-72c0-42d3-9b11-13f2122fb8ef"); + assertNull(vnfConfig); + } + + @Test + public void testGetVnfConfigByDummyUUID() { + NodeTemplate vnfConfig = nfodCsarHlper.getVnfConfig("XXX"); + assertNull(vnfConfig); + } + + @Test + public void testGetVnfConfigByNullUUID() { + NodeTemplate vnfConfig = nfodCsarHlper.getVnfConfig(null); + assertNull(vnfConfig); + } + + @Test + public void testGetVfcTypWithoutVnf() { + List<NodeTemplate> vfcList = nfodCsarHlper.getVfcListByVf("9bb2ef82-f8f6-4391-bc71-db063f15bf57"); + assertNotNull(vfcList); + assertEquals(2, vfcList.size()); + } + } diff --git a/src/test/resources/csars/service-NfodService-csar.csar b/src/test/resources/csars/service-NfodService-csar.csar Binary files differnew file mode 100644 index 0000000..679c80b --- /dev/null +++ b/src/test/resources/csars/service-NfodService-csar.csar |