aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java
diff options
context:
space:
mode:
authorEster Rotstein <er767y@att.com>2017-06-20 09:42:36 +0300
committerEster Rotstein <er767y@att.com>2017-06-20 09:45:59 +0300
commitb29c5c244b23bbf549bc4e7637019e28ed48b0c4 (patch)
tree8ce7c46e081aebd233f22b62263255cbf0aa800c /src/test/java
parent6b61b88108c5d35efb61cd1006d0a3b9db9d35bf (diff)
[SDC-36] support get nt by sdc type
Change-Id: I0e514827ea7e9a420438a20c369e0b6a9967c66a Signed-off-by: Ester Rotstein <er767y@att.com>
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/org/openecomp/sdc/impl/ToscaParserNodeTemplateTest.java43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/test/java/org/openecomp/sdc/impl/ToscaParserNodeTemplateTest.java b/src/test/java/org/openecomp/sdc/impl/ToscaParserNodeTemplateTest.java
index 42a6bd4..f9cedf3 100644
--- a/src/test/java/org/openecomp/sdc/impl/ToscaParserNodeTemplateTest.java
+++ b/src/test/java/org/openecomp/sdc/impl/ToscaParserNodeTemplateTest.java
@@ -12,6 +12,7 @@ import java.util.Map;
import org.apache.commons.lang3.tuple.Pair;
import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
+import org.openecomp.sdc.tosca.parser.impl.SdcTypes;
import org.openecomp.sdc.toscaparser.api.Group;
import org.openecomp.sdc.toscaparser.api.NodeTemplate;
import org.testng.annotations.Test;
@@ -394,4 +395,46 @@ public class ToscaParserNodeTemplateTest extends SdcToscaParserBasicTest {
}
//endregion
+ //region getServiceNodeTemplateBySdcType
+ @Test
+ public void testServiceNodeTemplateBySdcType() {
+ List<NodeTemplate> serviceVfList = fdntCsarHelper.getServiceNodeTemplateBySdcType(SdcTypes.VF);
+ assertNotNull(serviceVfList);
+ assertEquals(2, serviceVfList.size());
+ assertEquals(serviceVfList.get(0).getName(), "FDNT 1");
+ }
+
+ @Test
+ public void testServiceNodeTemplateByNullSdcType() {
+ List<NodeTemplate> serviceVfList = fdntCsarHelper.getServiceNodeTemplateBySdcType(null);
+ assertNotNull(serviceVfList);
+ assertEquals(serviceVfList.size(), 0);
+ }
+ //endregion
+
+ //region getNodeTemplateBySdcType
+ @Test
+ public void testNodeTemplateBySdcType() {
+ List<NodeTemplate> vfList = fdntCsarHelper.getServiceVfList();
+ List<NodeTemplate> vfcList = fdntCsarHelper.getNodeTemplateBySdcType(vfList.get(0), SdcTypes.VFC);
+ assertNotNull(vfcList);
+ assertEquals(2, vfcList.size());
+ assertEquals("DNT_FW_RSG_SI_1", vfcList.get(0).getName());
+ }
+
+ @Test
+ public void testNodeTemplateByNullSdcType() {
+ List<NodeTemplate> vfList = fdntCsarHelper.getServiceVfList();
+ List<NodeTemplate> vfcList = fdntCsarHelper.getNodeTemplateBySdcType(vfList.get(0), null);
+ assertNotNull(vfcList);
+ assertEquals(0, vfcList.size());
+ }
+
+ @Test
+ public void testNodeTemplateBySdcTypeNullNT() {
+ List<NodeTemplate> vfcList = fdntCsarHelper.getNodeTemplateBySdcType(null, SdcTypes.VFC);
+ assertNotNull(vfcList);
+ assertEquals(0, vfcList.size());
+ }
+ //endregion
}