summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-vendor-license-lib
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-vendor-license-lib')
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/FeatureGroupDaoZusammenImpl.java15
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LicenseAgreementDaoZusammenImpl.java9
2 files changed, 19 insertions, 5 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/FeatureGroupDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/FeatureGroupDaoZusammenImpl.java
index ee6ffbfca2..624ffeb05e 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/FeatureGroupDaoZusammenImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/FeatureGroupDaoZusammenImpl.java
@@ -176,8 +176,12 @@ public class FeatureGroupDaoZusammenImpl implements FeatureGroupDao {
mapElementInfoToFeatureGroup(featureGroup.getId(), featureGroup.getVersion(),
elementInfo.get());
- currentFeatureGroup.getEntitlementPoolIds().removeAll(removedEntitlementPools);
- currentFeatureGroup.getEntitlementPoolIds().addAll(addedEntitlementPools);
+ if (!(removedEntitlementPools == null)) {
+ currentFeatureGroup.getEntitlementPoolIds().removeAll(removedEntitlementPools);
+ }
+ if (!(addedEntitlementPools == null)) {
+ currentFeatureGroup.getEntitlementPoolIds().addAll(addedEntitlementPools);
+ }
if (featureGroupElement.getRelations() == null) {
featureGroupElement.setRelations(new ArrayList<>());
}
@@ -187,7 +191,12 @@ public class FeatureGroupDaoZusammenImpl implements FeatureGroupDao {
.createRelation(RelationType.FeatureGroupToEntitlmentPool, relation))
.collect(Collectors.toList()));
- currentFeatureGroup.getLicenseKeyGroupIds().removeAll(removedLicenseKeyGroups);
+ if (!(removedLicenseKeyGroups == null)) {
+ currentFeatureGroup.getLicenseKeyGroupIds().removeAll(removedLicenseKeyGroups);
+ }
+ if (!(addedLicenseKeyGroups == null)) {
+ currentFeatureGroup.getLicenseKeyGroupIds().addAll(addedLicenseKeyGroups);
+ }
currentFeatureGroup.getLicenseKeyGroupIds().addAll(addedLicenseKeyGroups);
featureGroupElement.getRelations()
.addAll(currentFeatureGroup.getLicenseKeyGroupIds().stream()
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LicenseAgreementDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LicenseAgreementDaoZusammenImpl.java
index 55bbae9b33..45c831fbd7 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LicenseAgreementDaoZusammenImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LicenseAgreementDaoZusammenImpl.java
@@ -187,8 +187,13 @@ public class LicenseAgreementDaoZusammenImpl implements LicenseAgreementDao {
mapElementInfoToLicenseAgreement(licenseAgreement.getId(), licenseAgreement.getVersion(),
elementInfo.get());
- currentLicenseAgreement.getFeatureGroupIds().removeAll(removedFeatureGroupIds);
- currentLicenseAgreement.getFeatureGroupIds().addAll(addedFeatureGroupIds);
+ if (! (removedFeatureGroupIds == null) ) {
+ currentLicenseAgreement.getFeatureGroupIds().removeAll(removedFeatureGroupIds);
+ }
+
+ if (! (addedFeatureGroupIds == null)) {
+ currentLicenseAgreement.getFeatureGroupIds().addAll(addedFeatureGroupIds);
+ }
licenseAgreementElement.setRelations(currentLicenseAgreement.getFeatureGroupIds().stream()
.map(relation -> VlmZusammenUtil
.createRelation(RelationType.LicenseAgreementToFeatureGroup, relation))