summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/test/java/org
diff options
context:
space:
mode:
authoraribeiro <anderson.ribeiro@est.tech>2020-06-26 16:33:22 +0100
committerOfir Sonsino <ofir.sonsino@intl.att.com>2020-07-12 06:38:18 +0000
commit2f0d276f2b924129b6c94d1a5e591cf07401cc44 (patch)
tree86161bd8333d067b8fd750c53d9193981c45d1db /catalog-be/src/test/java/org
parentfb482754b9778b7b6b9b5ee37cfd52fc6a9e6be0 (diff)
Add endpoints for supporting substitution_filter
Issue-ID: SDC-3160 Change-Id: Ibc722f283451fecde7655e867654880ae50cc645 Signed-off-by: aribeiro <anderson.ribeiro@est.tech>
Diffstat (limited to 'catalog-be/src/test/java/org')
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentNodeFilterServletTest.java18
1 files changed, 7 insertions, 11 deletions
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 dcd8a3b9c5..08890ef3e7 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
@@ -159,9 +159,9 @@ public class ComponentNodeFilterServletTest extends JerseyTest {
assertThat(sourceType).isEqualToIgnoringCase(uiConstraint.getSourceType());
assertThat(sourceName).isEqualToIgnoringCase(uiConstraint.getSourceName());
assertThat(propertyValue).isEqualToIgnoringCase(uiConstraint.getValue().toString());
- when(componentsUtils.convertJsonToObjectUsingObjectMapper(anyString(), any(User.class),
- ArgumentMatchers.<Class<UIConstraint>>any(),
- nullable(AuditingActionEnum.class), nullable(ComponentTypeEnum.class))).thenReturn(Either.left(uiConstraint));
+
+ when(componentsUtils.parseToConstraint(anyString(), any(User.class),ArgumentMatchers.any(ComponentTypeEnum.class)))
+ .thenReturn(Optional.of(uiConstraint));
assertNotNull(constraint);
assertNotNull(ciNodeFilterDataDefinition);
@@ -314,10 +314,8 @@ public class ComponentNodeFilterServletTest extends JerseyTest {
when(componentsUtils.getResponseFormat(ActionStatus.OK)).thenReturn(responseFormat);
- when(componentsUtils.convertJsonToObjectUsingObjectMapper(anyString(), any(User.class),
- ArgumentMatchers.<Class<List>>any(),
- nullable(AuditingActionEnum.class), nullable(ComponentTypeEnum.class)))
- .thenReturn(Either.left(Arrays.asList(new ObjectMapper().convertValue(uiConstraint, Map.class))));
+ when(componentsUtils.validateAndParseConstraint(ArgumentMatchers.any(ComponentTypeEnum.class), anyString(), any(User.class)))
+ .thenReturn(Collections.singletonList(uiConstraint));
when(componentNodeFilterBusinessLogic
.updateNodeFilter(componentId, componentInstance, Collections.singletonList(constraint),
@@ -347,10 +345,8 @@ public class ComponentNodeFilterServletTest extends JerseyTest {
when(componentNodeFilterBusinessLogic.validateUser(USER_ID)).thenReturn(user);
when(componentsUtils.getResponseFormat(ActionStatus.OK)).thenReturn(responseFormat);
- when(componentsUtils.convertJsonToObjectUsingObjectMapper(anyString(), any(User.class),
- ArgumentMatchers.<Class<List>>any(),
- nullable(AuditingActionEnum.class), nullable(ComponentTypeEnum.class)))
- .thenReturn(Either.right(new ResponseFormat(HttpStatus.INTERNAL_SERVER_ERROR_500)));
+ when(componentsUtils.validateAndParseConstraint(ArgumentMatchers.any(ComponentTypeEnum.class), anyString(), any(User.class)))
+ .thenReturn(Collections.emptyList());
final Response response = target()
.path(path)