From 0dba067883b948aa7b9a1b1d6f6073ed215441f7 Mon Sep 17 00:00:00 2001 From: "Sindhuri.A" Date: Mon, 29 Oct 2018 20:18:53 +0530 Subject: UT-ToscaElementOperation UT for catalog be ToscaElementOperation class Issue-ID: SDC-1775 Change-Id: I2b4824897dbd08c028d1dd3e1c6e50c6883dfe95 Signed-off-by: Sindhuri.A --- .../jsontitan/operations/ToscaElementOperationTest.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'catalog-model/src') diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaElementOperationTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaElementOperationTest.java index 9f8d015a44..e77f8e108c 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaElementOperationTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaElementOperationTest.java @@ -12,8 +12,10 @@ import org.openecomp.sdc.be.dao.jsongraph.TitanDao; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; +import org.openecomp.sdc.be.model.ComponentParametersView; import org.openecomp.sdc.be.model.LifecycleStateEnum; import org.openecomp.sdc.be.model.ModelTestBase; +import org.openecomp.sdc.be.model.jsontitan.datamodel.TopologyTemplate; import org.openecomp.sdc.be.model.jsontitan.datamodel.ToscaElement; import org.openecomp.sdc.be.model.jsontitan.utils.GraphTestUtils; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; @@ -61,6 +63,7 @@ public class ToscaElementOperationTest extends ModelTestBase{ } } + @Test public void testGetAllHighestResourcesNoFilter() { @@ -218,6 +221,18 @@ public class ToscaElementOperationTest extends ModelTestBase{ assertEquals(highestResources.stream().count(), highestResourcesExpectedCount); } + @Test + public void testUpdateToscaElement_NotFound() { + Either result; + TopologyTemplate topologyTemplate = new TopologyTemplate(); + String userID = "userID"; + topologyTemplate.setLastUpdaterUserId(userID); + GraphVertex graphVertex = new GraphVertex(); + ComponentParametersView componentParametersView = new ComponentParametersView(); + result = toscaElementOperation.updateToscaElement(topologyTemplate, graphVertex, componentParametersView); + assertEquals(null, result); + } + private boolean genericTestGetResourcesWithExcludeList(List excludeList) { Either, StorageOperationStatus> highestResourcesRes = toscaElementOperation.getElementCatalogData(ComponentTypeEnum.RESOURCE,excludeList, true); assertTrue(highestResourcesRes.isLeft()); -- cgit 1.2.3-korg