summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/test/java
diff options
context:
space:
mode:
authoraribeiro <anderson.ribeiro@est.tech>2020-08-26 17:54:01 +0100
committerSébastien Determe <sebastien.determe@intl.att.com>2020-09-07 07:11:49 +0000
commitc572ed8873bee57ad925fb231464efbca98a8007 (patch)
tree7802838a547962886d57515f64cb5665f12b303c /catalog-be/src/test/java
parentc70b7081d70edf93aefae514dc688d8dc1835db2 (diff)
Delete node_filter capabilities
Issue-ID: SDC-3264 Signed-off-by: aribeiro <anderson.ribeiro@est.tech> Change-Id: I91bb476819aaf247ec106139a3af1afe327a700c
Diffstat (limited to 'catalog-be/src/test/java')
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ComponentNodeFilterBusinessLogicTest.java15
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentNodeFilterServletTest.java6
2 files changed, 13 insertions, 8 deletions
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<CINodeFilterDataDefinition> 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);
}