diff options
author | ayalaben <ayala.benzvi@amdocs.com> | 2018-02-13 12:44:17 +0200 |
---|---|---|
committer | Avi Gaffa <avi.gaffa@amdocs.com> | 2018-02-15 13:37:55 +0000 |
commit | b4c4dbc6bbcd9995387c0716ee57f620c7a701df (patch) | |
tree | 8ff9d83fdc62c677bea4943cb328f292694bc27a /openecomp-be/backend | |
parent | 4e1b18cb2c939993558070c3a963d6fb6dca25db (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')
2 files changed, 11 insertions, 4 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()); diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java index cc24873e92..bf5f19fb2b 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java @@ -509,10 +509,10 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa @Override public void updateVsp(VspDetails vspDetails) { VspDetails retrieved = vspInfoDao.get(vspDetails); - // TODO: 6/21/2017 remove this validation when validation will be added in the REST level if (retrieved == null) { - throw new RuntimeException(String.format("Vsp with id %s and version %s does not exist.", - vspDetails.getId(), vspDetails.getVersion().getId())); + throw new CoreException((new ErrorCode.ErrorCodeBuilder() + .withMessage(String.format("Vsp with id %s and version %s does not exist.", + vspDetails.getId(), vspDetails.getVersion().getId()))).build()); } vspDetails.setOnboardingMethod(retrieved.getOnboardingMethod()); |