aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/src
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be/src')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java8
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/UiComponentDataConverter.java10
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentInstanceServlet.java4
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/datamodel/UiComponentDataConverterTest.java27
4 files changed, 24 insertions, 25 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java
index baa794c6cc..3f48328cc9 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java
@@ -1254,9 +1254,7 @@ public class ComponentInstanceBusinessLogic extends BaseBusinessLogic {
ComponentInstance componentInstance = componentInstanceOptional.get();
try {
- if (containerComponent instanceof Service || containerComponent instanceof Resource &&
- isVFC(componentInstance.getOriginType())) {
-
+ if (containerComponent instanceof Service || containerComponent instanceof Resource) {
final Either<String, StorageOperationStatus> deleteServiceFilterEither =
nodeFilterOperation.deleteNodeFilter(containerComponent, componentInstanceId);
if (deleteServiceFilterEither.isRight()) {
@@ -3454,10 +3452,6 @@ public class ComponentInstanceBusinessLogic extends BaseBusinessLogic {
}
}
- public boolean isVFC(final OriginTypeEnum originTypeEnum) {
- return OriginTypeEnum.VFC.equals(originTypeEnum);
- }
-
public void validateUser(final String userId) {
final User user = userValidations.validateUserExists(userId);
userValidations.validateUserRole(user, Arrays.asList(Role.DESIGNER, Role.ADMIN));
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/UiComponentDataConverter.java b/catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/UiComponentDataConverter.java
index d742fb3aea..494ec9c6e8 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/UiComponentDataConverter.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/UiComponentDataConverter.java
@@ -390,6 +390,16 @@ public class UiComponentDataConverter {
}
break;
+ case NODE_FILTER:
+ if (resource.getNodeFilterComponents() == null) {
+ dataTransfer.setNodeFilterforNode(null);
+ } else {
+ final NodeFilterConverter nodeFilterConverter = new NodeFilterConverter();
+ dataTransfer.setNodeFilterforNode(
+ nodeFilterConverter.convertDataMapToUI(resource.getNodeFilterComponents()));
+ }
+ break;
+
default:
setUiTranferDataByFieldName(dataTransfer, resource, fieldName);
}
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentInstanceServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentInstanceServlet.java
index 0896891ad3..c5c89f7665 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentInstanceServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentInstanceServlet.java
@@ -256,9 +256,7 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet {
final ComponentInstance resultValue = actionResponse.left().value();
if (ComponentTypeEnum.SERVICE.equals(componentTypeEnum) ||
- ComponentTypeEnum.RESOURCE.equals(componentTypeEnum) &&
- componentInstanceBusinessLogic.isVFC(componentInstance.getOriginType())) {
-
+ ComponentTypeEnum.RESOURCE.equals(componentTypeEnum)) {
if(CollectionUtils.isNotEmpty(componentInstance.getDirectives())) {
final Optional<CINodeFilterDataDefinition> nodeFilterDataDefinition =
nodeFilterBusinessLogic.createNodeFilterIfNotExist(componentId, componentInstanceId,
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/datamodel/UiComponentDataConverterTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/datamodel/UiComponentDataConverterTest.java
index 84dd3b1e8c..ffe3d06e2a 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/datamodel/UiComponentDataConverterTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/datamodel/UiComponentDataConverterTest.java
@@ -18,8 +18,17 @@
package org.openecomp.sdc.be.datamodel;
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.collections.MapUtils;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.hibernate.validator.internal.util.CollectionHelper.asSet;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -47,18 +56,6 @@ import org.openecomp.sdc.be.ui.model.UiComponentDataTransfer;
import org.openecomp.sdc.be.ui.model.UiComponentMetadata;
import org.openecomp.sdc.be.ui.model.UiServiceDataTransfer;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.hibernate.validator.internal.util.CollectionHelper.asSet;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
public class UiComponentDataConverterTest {
private PolicyDefinition policy1, policy2;
@@ -312,7 +309,7 @@ public class UiComponentDataConverterTest {
UiComponentDataTransfer uiComponentDataTransfer = uiComponentDataConverter.getUiDataTransferFromResourceByParams(resource,
Collections.singletonList("nodeFilter"));
- assertThat(uiComponentDataTransfer.getNodeFilter()).isNotEmpty();
+ assertThat(uiComponentDataTransfer.getNodeFilterforNode()).isNotEmpty();
}
@Test