aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src
diff options
context:
space:
mode:
authorayalaben <ayala.benzvi@amdocs.com>2018-02-13 12:44:17 +0200
committerAvi Gaffa <avi.gaffa@amdocs.com>2018-02-15 13:37:55 +0000
commitb4c4dbc6bbcd9995387c0716ee57f620c7a701df (patch)
tree8ff9d83fdc62c677bea4943cb328f292694bc27a /openecomp-be/backend/openecomp-sdc-vendor-license-manager/src
parent4e1b18cb2c939993558070c3a963d6fb6dca25db (diff)
Delete Item status Draft - Fix Errors
Change-Id: I2e602a82f70ac77545b70658a35bbeffaf713a9b Issue-ID: SDC-1014 Signed-off-by: ayalaben <ayala.benzvi@amdocs.com>
Diffstat (limited to 'openecomp-be/backend/openecomp-sdc-vendor-license-manager/src')
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java
index 5553b784f6..8135efa89a 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java
@@ -94,7 +94,14 @@ public class VendorLicenseManagerImpl implements VendorLicenseManager {
@Override
public void updateVendorLicenseModel(VendorLicenseModelEntity vendorLicenseModelEntity) {
- String existingVendorName = vendorLicenseModelDao.get(vendorLicenseModelEntity).getVendorName();
+ VendorLicenseModelEntity retrieved = vendorLicenseModelDao.get(vendorLicenseModelEntity);
+ if (retrieved == null){
+ throw new CoreException((new ErrorCode.ErrorCodeBuilder()
+ .withMessage(String.format("Vlm with id %s and version %s does not exist.",
+ vendorLicenseModelEntity.getId(), vendorLicenseModelEntity.getVersion().getId()))).build());
+ }
+
+ String existingVendorName = retrieved.getVendorName();
updateUniqueName(VendorLicenseConstants.UniqueValues.VENDOR_NAME, existingVendorName,
vendorLicenseModelEntity.getVendorName());