summaryrefslogtreecommitdiffstats
path: root/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDetailsToDto.java
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDetailsToDto.java')
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDetailsToDto.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDetailsToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDetailsToDto.java
index 6e659cbb54..1ba5d1355c 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDetailsToDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDetailsToDto.java
@@ -20,6 +20,8 @@
package org.openecomp.sdcrests.vsp.rest.mapping;
+import org.apache.commons.lang3.StringUtils;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.LicenseType;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
import org.openecomp.sdc.vendorsoftwareproduct.types.LicensingData;
import org.openecomp.sdcrests.mapping.MappingBase;
@@ -40,7 +42,11 @@ public class MapVspDetailsToDto extends MappingBase<VspDetails, VspDetailsDto> {
target.setVendorName(source.getVendorName());
target.setLicensingVersion(
source.getVlmVersion() == null ? null : source.getVlmVersion().getId());
-
+ if (StringUtils.isNotBlank(source.getLicenseType())) {
+ target.setLicenseType(LicenseType.valueOf(source.getLicenseType()));
+ } else if (StringUtils.isNotBlank(target.getLicensingVersion())){
+ target.setLicenseType(LicenseType.INTERNAL);
+ }
if (source.getLicenseAgreement() != null || source.getFeatureGroups() != null) {
LicensingData licensingData = new LicensingData();
licensingData.setLicenseAgreement(source.getLicenseAgreement());