diff options
author | Sindhuri.A <arcot.sindhuri@huawei.com> | 2018-10-29 20:18:53 +0530 |
---|---|---|
committer | Sindhuri.A <arcot.sindhuri@huawei.com> | 2018-10-29 20:18:53 +0530 |
commit | 0dba067883b948aa7b9a1b1d6f6073ed215441f7 (patch) | |
tree | 2413ce8398c5a7d323ab613695a3b5d1bfbc016a /catalog-model/src | |
parent | 8b7a0405a97cacf765c0e9a1988af98cd91a9f67 (diff) |
UT-ToscaElementOperation
UT for catalog be ToscaElementOperation class
Issue-ID: SDC-1775
Change-Id: I2b4824897dbd08c028d1dd3e1c6e50c6883dfe95
Signed-off-by: Sindhuri.A <arcot.sindhuri@huawei.com>
Diffstat (limited to 'catalog-model/src')
-rw-r--r-- | catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaElementOperationTest.java | 15 |
1 files changed, 15 insertions, 0 deletions
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<TopologyTemplate, StorageOperationStatus> 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<ResourceTypeEnum> excludeList) { Either<List<ToscaElement>, StorageOperationStatus> highestResourcesRes = toscaElementOperation.getElementCatalogData(ComponentTypeEnum.RESOURCE,excludeList, true); assertTrue(highestResourcesRes.isLeft()); |