aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoramitjai <amitjai@amdocs.com>2018-01-16 14:21:27 +0530
committerVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>2018-01-17 06:40:20 +0000
commit6c03bbdc00dd380b1232a543b72a5e909c3af46d (patch)
tree7d0395b3614a02592fa1e63a8dd1052f42ea8bb3
parent5197c8b7b3cf7576f1198e4b59a7d6484e793107 (diff)
Incorrect FG version in vf-license-model.xml
vf-license-model.xml file should show the latest version of FG, which is currently linked with LA in VSP Change-Id: Iafd14e2c964df5c4e276f96589e9ac95b8d64740 Issue-ID: SDC-935 Signed-off-by: amitjai <amitjai@amdocs.com>
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java17
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImplTest.java2
2 files changed, 17 insertions, 2 deletions
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 a022fb697e..d36f1bc8ce 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
@@ -100,6 +100,8 @@ import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.ComponentQu
import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateContext;
import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateInput;
import org.openecomp.sdc.vendorsoftwareproduct.utils.ComponentDependencyTracker;
+import org.openecomp.sdc.versioning.VersioningManager;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
import org.openecomp.sdc.versioning.VersioningUtil;
import org.openecomp.sdc.versioning.dao.types.Version;
@@ -628,7 +630,9 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa
ToscaServiceModel toscaServiceModel = enrichedServiceModelDao.getServiceModel(vspId, version);
VspDetails vspDetails = vspInfoDao.get(new VspDetails(vspId, version));
Version vlmVersion = vspDetails.getVlmVersion();
-
+ if (vlmVersion != null) {
+ populateVersionsForVlm(vspDetails.getVendorId(), vlmVersion);
+ }
PackageInfo packageInfo = createPackageInfo(vspDetails);
ToscaFileOutputServiceCsarImpl toscaServiceTemplateServiceCsar =
@@ -646,6 +650,17 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa
return packageInfo;
}
+ protected void populateVersionsForVlm(String vlmId, Version vlmVersion) {
+ VersioningManager versioningManager = VersioningManagerFactory.getInstance().createInterface();
+ versioningManager.list(vlmId).stream()
+ .filter(version -> version.getId().equalsIgnoreCase(vlmVersion.getId()))
+ .findAny()
+ .ifPresent(version -> {
+ vlmVersion.setMinor(vlmVersion.getMinor());
+ vlmVersion.setMajor(vlmVersion.getMajor());
+ });
+ }
+
private PackageInfo createPackageInfo(VspDetails vspDetails) {
PackageInfo packageInfo = new PackageInfo(vspDetails.getId(), vspDetails.getVersion());
packageInfo.setVspName(vspDetails.getName());
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImplTest.java
index cc262ed869..fd274d0898 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImplTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImplTest.java
@@ -456,7 +456,7 @@ public class VendorSoftwareProductManagerImplTest {
doReturn(new ToscaServiceModel(new FileContentHandler(), new HashMap<>(), "")).when
(enrichedServiceModelDaoMock).getServiceModel(VSP_ID, VERSION10);
-
+ doNothing().when(vendorSoftwareProductManager).populateVersionsForVlm(anyObject(), anyObject());
VspDetails vsp = new VspDetails(VSP_ID, VERSION10);
vsp.setVendorId("vendorId");
vsp.setVlmVersion(VERSION10);