From 0f1557ebbfe7d2f11648eaf2ea445482c4debbed Mon Sep 17 00:00:00 2001 From: "Sindhuri.A" Date: Thu, 25 Oct 2018 22:54:41 +0530 Subject: UT-catalog model ModelConverter 2 Add UT for catalog model ModelConverter class Issue-ID: SDC-1775 Change-Id: I8cb17faa5a65391bc1ee0d58ed107eccf2e89204 Signed-off-by: Sindhuri.A --- .../model/jsontitan/utils/ModelConverterTest.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'catalog-model/src/test') 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"); + } } -- cgit 1.2.3-korg