summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java6
-rw-r--r--openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/java/org/openecomp/sdc/healing/impl/HealingManagerImpl.java18
2 files changed, 15 insertions, 9 deletions
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java
index bb7e847ddf..16ef8c5761 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java
@@ -247,8 +247,10 @@ public class VendorSoftwareProductsImpl implements VendorSoftwareProducts {
private void submitHealedVersion(VspDetails vspDetails, String baseVersionId, String user) {
try {
- // sync vlm if not exists on user space
- versioningManager.get(vspDetails.getVendorId(), vspDetails.getVlmVersion());
+ if (vspDetails.getVlmVersion() != null) {
+ // sync vlm if not exists on user space
+ versioningManager.get(vspDetails.getVendorId(), vspDetails.getVlmVersion());
+ }
Optional<ValidationResponse> validationResponse =
submit(vspDetails.getId(), vspDetails.getVersion(), "Submit healed Vsp", user);
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/java/org/openecomp/sdc/healing/impl/HealingManagerImpl.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/java/org/openecomp/sdc/healing/impl/HealingManagerImpl.java
index 942bc43fd8..71d4ca5386 100644
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/java/org/openecomp/sdc/healing/impl/HealingManagerImpl.java
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/java/org/openecomp/sdc/healing/impl/HealingManagerImpl.java
@@ -20,6 +20,7 @@
package org.openecomp.sdc.healing.impl;
+
import org.openecomp.core.utilities.CommonMethods;
import org.openecomp.core.utilities.file.FileUtils;
import org.openecomp.core.utilities.json.JsonUtil;
@@ -39,6 +40,7 @@ import org.openecomp.sdc.versioning.dao.types.VersionStatus;
import org.openecomp.sdc.versioning.types.VersionCreationMethod;
import java.util.Collection;
+import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -229,12 +231,14 @@ public class HealingManagerImpl implements HealingManager {
private List<Healer> getHealersToRun(Collection<String> healersClassNames, String itemId,
Version version, List<String> failureMessages) {
- return healersClassNames.stream()
- .map(healerClassName -> getHealerInstance(healerClassName, failureMessages))
- .filter(Optional::isPresent)
- .map(Optional::get)
- .filter(healer -> healer.isHealingNeeded(itemId, version))
- .collect(Collectors.toList());
+ return healersClassNames == null
+ ? Collections.EMPTY_LIST
+ : healersClassNames.stream()
+ .map(healerClassName -> getHealerInstance(healerClassName, failureMessages))
+ .filter(Optional::isPresent)
+ .map(Optional::get)
+ .filter(healer -> healer.isHealingNeeded(itemId, version))
+ .collect(Collectors.toList());
}
private Optional<Healer> getHealerInstance(String healerClassName, List<String> failureMessages) {
@@ -251,7 +255,7 @@ public class HealingManagerImpl implements HealingManager {
Map healingConfig = FileUtils
.readViaInputStream(HEALERS_BY_ENTITY_TYPE_FILE,
stream -> JsonUtil.json2Object(stream, Map.class));
- return (Map<String, Collection<String>>) healingConfig.get(itemType.name());
+ return (Map<String, Collection<String>>) healingConfig.getOrDefault(itemType.name(), Collections.EMPTY_MAP);
}
private String getUser() {