From e24fa783d8340236cd3d768c1271e9c918aa524f Mon Sep 17 00:00:00 2001 From: "Sindhuri.A" Date: Sat, 27 Oct 2018 10:59:25 +0530 Subject: UT-ToscaElementLifecycleOperation Add UT for catalog model ToscaElementLifecycleOperation class Issue-ID: SDC-1775 Change-Id: Ie9a876fcd3f79a67fe7084034afcbd6937ba9bb1 Signed-off-by: Sindhuri.A --- .../impl/ToscaElementLifecycleOperationTest.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'catalog-model/src/test') diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/ToscaElementLifecycleOperationTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/ToscaElementLifecycleOperationTest.java index 506bec4569..88bb5142aa 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/ToscaElementLifecycleOperationTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/ToscaElementLifecycleOperationTest.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -29,6 +29,7 @@ import org.junit.runner.RunWith; import org.openecomp.sdc.be.dao.jsongraph.GraphVertex; import org.openecomp.sdc.be.dao.jsongraph.TitanDao; import org.openecomp.sdc.be.dao.jsongraph.types.EdgeLabelEnum; +import org.openecomp.sdc.be.dao.jsongraph.types.JsonParseFlagEnum; import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum; import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; import org.openecomp.sdc.be.datatypes.elements.CapabilityDataDefinition; @@ -42,6 +43,7 @@ import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; import org.openecomp.sdc.be.model.LifecycleStateEnum; import org.openecomp.sdc.be.model.ModelTestBase; +import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.model.catalog.CatalogComponent; import org.openecomp.sdc.be.model.category.CategoryDefinition; import org.openecomp.sdc.be.model.category.SubCategoryDefinition; @@ -320,6 +322,15 @@ public class ToscaElementLifecycleOperationTest extends ModelTestBase { verifyInCatalogData(5, expectedIds); } + @Test + public void testGetToscaElOwner_Fail(){ + Either result; + String toscaEleId = "toscaElementId"; + titanDao.getVertexById(toscaEleId, JsonParseFlagEnum.NoParse); + result = lifecycleOperation.getToscaElementOwner(toscaEleId); + assertEquals(StorageOperationStatus.NOT_FOUND, result.right().value()); + } + private void createResourceCategory() { GraphVertex cat = new GraphVertex(VertexTypeEnum.RESOURCE_CATEGORY); @@ -579,7 +590,7 @@ public class ToscaElementLifecycleOperationTest extends ModelTestBase { public void verifyInCatalogData(int expected, List expectedIds) { - Either, StorageOperationStatus> highestResourcesRes = topologyTemplateOperation.getElementCatalogData(true, null); + Either, StorageOperationStatus> highestResourcesRes = topologyTemplateOperation.getElementCatalogData(true, null); assertTrue(highestResourcesRes.isLeft()); List highestResources = highestResourcesRes.left().value(); // calculate expected count value -- cgit 1.2.3-korg