summaryrefslogtreecommitdiffstats
path: root/catalog-model
diff options
context:
space:
mode:
authorSindhuri.A <arcot.sindhuri@huawei.com>2018-10-25 22:54:41 +0530
committerMichael Lando <michael.lando@intl.att.com>2018-10-27 10:21:43 +0000
commit0f1557ebbfe7d2f11648eaf2ea445482c4debbed (patch)
treeb4fc832295a21bcf6815465ae5634af1bf5aa2ed /catalog-model
parent60f1ee3944482de0ae8970125306e3a462065f4f (diff)
UT-catalog model ModelConverter 2
Add UT for catalog model ModelConverter class Issue-ID: SDC-1775 Change-Id: I8cb17faa5a65391bc1ee0d58ed107eccf2e89204 Signed-off-by: Sindhuri.A <arcot.sindhuri@huawei.com>
Diffstat (limited to 'catalog-model')
-rw-r--r--catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/utils/ModelConverterTest.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/utils/ModelConverterTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/utils/ModelConverterTest.java
index d820d9d748..72f6617e01 100644
--- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/utils/ModelConverterTest.java
+++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/utils/ModelConverterTest.java
@@ -33,6 +33,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.junit.MockitoJUnitRunner;
+import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.be.model.Resource;
import org.openecomp.sdc.be.model.Service;
@@ -41,6 +42,7 @@ import org.openecomp.sdc.be.model.jsontitan.datamodel.TopologyTemplate;
import org.openecomp.sdc.be.model.jsontitan.datamodel.NodeType;
import org.openecomp.sdc.be.model.jsontitan.datamodel.ToscaElementTypeEnum;
import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assert.assertTrue;
@RunWith(MockitoJUnitRunner.class)
public class ModelConverterTest {
@@ -82,4 +84,23 @@ public class ModelConverterTest {
Component component = test.convertFromToscaElement(topologyTemplate);
assertThat(component.getToscaType()).isEqualTo(ToscaElementTypeEnum.TOPOLOGY_TEMPLATE.getValue());
}
+
+ @Test
+ public void testIsAtomicComponent()
+ {
+ Resource component = new Resource();
+ component.setComponentType(ComponentTypeEnum.RESOURCE);
+ boolean result = test.isAtomicComponent(component);
+ assertTrue(result);
+ }
+
+ @Test
+ public void testGetVertexType()
+ {
+ VertexTypeEnum result;
+ Resource component = new Resource();
+ component.setComponentType(ComponentTypeEnum.RESOURCE);
+ result = test.getVertexType(component);
+ assertThat(result.getName()).isEqualTo("node_type");
+ }
}