From c572ed8873bee57ad925fb231464efbca98a8007 Mon Sep 17 00:00:00 2001 From: aribeiro Date: Wed, 26 Aug 2020 17:54:01 +0100 Subject: Delete node_filter capabilities Issue-ID: SDC-3264 Signed-off-by: aribeiro Change-Id: I91bb476819aaf247ec106139a3af1afe327a700c --- .../impl/ComponentNodeFilterBusinessLogicTest.java | 15 +++++++++------ .../sdc/be/servlets/ComponentNodeFilterServletTest.java | 6 ++++-- 2 files changed, 13 insertions(+), 8 deletions(-) (limited to 'catalog-be/src/test/java') diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ComponentNodeFilterBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ComponentNodeFilterBusinessLogicTest.java index 6996465a82..a475943735 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ComponentNodeFilterBusinessLogicTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ComponentNodeFilterBusinessLogicTest.java @@ -376,7 +376,8 @@ public class ComponentNodeFilterBusinessLogicTest extends BaseBusinessLogicMock .thenReturn(StorageOperationStatus.OK); when(nodeFilterOperation - .deleteConstraint(componentId, componentInstanceId, ciNodeFilterDataDefinition, 0)) + .deleteConstraint(componentId, componentInstanceId, ciNodeFilterDataDefinition, 0, + NodeFilterConstraintType.PROPERTIES)) .thenReturn(Either.left(ciNodeFilterDataDefinition)); when(graphLockOperation.unlockComponent(componentId, NodeTypeEnum.Resource)) @@ -384,7 +385,7 @@ public class ComponentNodeFilterBusinessLogicTest extends BaseBusinessLogicMock final Optional deleteNodeFilterResult = componentNodeFilterBusinessLogic .deleteNodeFilter(componentId, componentInstanceId, NodeFilterConstraintAction.DELETE, constraint, - 0, true, ComponentTypeEnum.RESOURCE); + 0, true, ComponentTypeEnum.RESOURCE, NodeFilterConstraintType.PROPERTIES); assertThat(deleteNodeFilterResult).isPresent(); @@ -396,7 +397,8 @@ public class ComponentNodeFilterBusinessLogicTest extends BaseBusinessLogicMock .validateFilter(resource, componentInstanceId, singletonList(constraint), NodeFilterConstraintAction.DELETE); verify(nodeFilterOperation, times(1)) - .deleteConstraint(componentId, componentInstanceId, ciNodeFilterDataDefinition, 0); + .deleteConstraint(componentId, componentInstanceId, ciNodeFilterDataDefinition, 0, + NodeFilterConstraintType.PROPERTIES); verify(graphLockOperation, times(1)).unlockComponent(componentId, NodeTypeEnum.Resource); } @@ -413,7 +415,8 @@ public class ComponentNodeFilterBusinessLogicTest extends BaseBusinessLogicMock .thenReturn(StorageOperationStatus.OK); when(nodeFilterOperation - .deleteConstraint(componentId, componentInstanceId, ciNodeFilterDataDefinition, 0)) + .deleteConstraint(componentId, componentInstanceId, ciNodeFilterDataDefinition, 0, + NodeFilterConstraintType.PROPERTIES)) .thenReturn(Either.right(StorageOperationStatus.GENERAL_ERROR)); when(graphLockOperation.unlockComponent(componentId, NodeTypeEnum.Resource)) @@ -421,7 +424,7 @@ public class ComponentNodeFilterBusinessLogicTest extends BaseBusinessLogicMock assertThrows(BusinessLogicException.class, () -> componentNodeFilterBusinessLogic .deleteNodeFilter(componentId, componentInstanceId, NodeFilterConstraintAction.DELETE, constraint, - 0, true, ComponentTypeEnum.RESOURCE)); + 0, true, ComponentTypeEnum.RESOURCE, NodeFilterConstraintType.PROPERTIES)); verify(toscaOperationFacade, times(1)).getToscaElement(componentId); verify(graphLockOperation, times(1)).lockComponent(componentId, NodeTypeEnum.Resource); @@ -443,7 +446,7 @@ public class ComponentNodeFilterBusinessLogicTest extends BaseBusinessLogicMock assertThrows(BusinessLogicException.class, () -> componentNodeFilterBusinessLogic .deleteNodeFilter(componentId, componentInstanceId, NodeFilterConstraintAction.DELETE, constraint, - 0, true, ComponentTypeEnum.RESOURCE)); + 0, true, ComponentTypeEnum.RESOURCE, NodeFilterConstraintType.PROPERTIES)); verify(toscaOperationFacade, times(1)).getToscaElement(componentId); verify(nodeFilterValidator, times(1)) diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentNodeFilterServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentNodeFilterServletTest.java index 3bad7dd497..31cb1ac4e4 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentNodeFilterServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentNodeFilterServletTest.java @@ -437,7 +437,8 @@ public class ComponentNodeFilterServletTest extends JerseyTest { when(componentsUtils.getResponseFormat(ActionStatus.OK)).thenReturn(responseFormat); when(componentNodeFilterBusinessLogic.deleteNodeFilter(componentId, componentInstance, - NodeFilterConstraintAction.DELETE, null, 0, true, ComponentTypeEnum.RESOURCE)) + NodeFilterConstraintAction.DELETE, null, 0, true, ComponentTypeEnum.RESOURCE, + NodeFilterConstraintType.PROPERTIES)) .thenReturn(Optional.of(ciNodeFilterDataDefinition)); final Response response = target() @@ -449,7 +450,8 @@ public class ComponentNodeFilterServletTest extends JerseyTest { verify(componentNodeFilterBusinessLogic, times(1)) .deleteNodeFilter(anyString(), anyString(), ArgumentMatchers.any(NodeFilterConstraintAction.class), - nullable(String.class), anyInt(), anyBoolean(), ArgumentMatchers.any(ComponentTypeEnum.class)); + nullable(String.class), anyInt(), anyBoolean(), ArgumentMatchers.any(ComponentTypeEnum.class), + ArgumentMatchers.any(NodeFilterConstraintType.class)); assertThat(response.getStatus()).isEqualTo(HttpStatus.OK_200); } -- cgit 1.2.3-korg