summaryrefslogtreecommitdiffstats
path: root/openecomp-be/backend
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/backend')
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java9
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java6
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());