diff options
author | shrikantawachar <shrikant.awachar@amdocs.com> | 2018-07-09 18:53:28 +0530 |
---|---|---|
committer | Oren Kleks <orenkle@amdocs.com> | 2018-07-10 07:43:39 +0000 |
commit | 47db64bab2f9555e9e2c7da243d6e0ddcbda4fd8 (patch) | |
tree | e53f8572db14b5f4de44ace7a2b4a86e4282b39d /openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping | |
parent | b781a6d5303945f23b995b7c24d11fe7d44624a4 (diff) |
Enhance MRN in EP & LKG
Enhance MRN in EP & LKG , handling healing , unit tests
Change-Id: I60b9ec73bfcdd9a53aa507c6401deab372fdcf58
Issue-ID: SDC-1485
Signed-off-by: shrikantawachar <shrikant.awachar@amdocs.com>
Diffstat (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping')
6 files changed, 24 insertions, 2 deletions
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolEntityToEntitlementPoolEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolEntityToEntitlementPoolEntityDto.java index ba23b8cbb0..18435b3c71 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolEntityToEntitlementPoolEntityDto.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolEntityToEntitlementPoolEntityDto.java @@ -20,6 +20,7 @@ package org.openecomp.sdcrests.vendorlicense.rest.mapping; +import org.openecomp.sdc.common.togglz.ToggleableFeature; import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; import org.openecomp.sdcrests.mapping.MappingBase; import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolEntityDto; @@ -46,5 +47,8 @@ public class MapEntitlementPoolEntityToEntitlementPoolEntityDto target.setStartDate(source.getStartDate()); target.setExpiryDate(source.getExpiryDate()); target.setVersionUUID(source.getVersionUuId()); + if (ToggleableFeature.MRN.isActive()) { + target.setManufacturerReferenceNumber(source.getManufacturerReferenceNumber()); + } } } diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolRequestDtoToEntitlementPoolEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolRequestDtoToEntitlementPoolEntity.java index 9b215d69aa..bed7e696e7 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolRequestDtoToEntitlementPoolEntity.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolRequestDtoToEntitlementPoolEntity.java @@ -20,6 +20,7 @@ package org.openecomp.sdcrests.vendorlicense.rest.mapping; +import org.openecomp.sdc.common.togglz.ToggleableFeature; import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther; import org.openecomp.sdcrests.mapping.MappingBase; @@ -30,6 +31,9 @@ public class MapEntitlementPoolRequestDtoToEntitlementPoolEntity @Override public void doMapping(EntitlementPoolRequestDto source, EntitlementPoolEntity target) { target.setName(source.getName()); + if (ToggleableFeature.MRN.isActive()) { + target.setManufacturerReferenceNumber(source.getManufacturerReferenceNumber()); + } target.setDescription(source.getDescription()); target.setThresholdValue(source.getThresholdValue()); target.setThresholdUnit(source.getThresholdUnits()); diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupDescriptorDtoToFeatureGroupEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupDescriptorDtoToFeatureGroupEntity.java index dedc2a01f0..232588779c 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupDescriptorDtoToFeatureGroupEntity.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupDescriptorDtoToFeatureGroupEntity.java @@ -20,6 +20,7 @@ package org.openecomp.sdcrests.vendorlicense.rest.mapping; +import org.openecomp.sdc.common.togglz.ToggleableFeature; import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity; import org.openecomp.sdcrests.mapping.MappingBase; import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupDescriptorDto; @@ -31,6 +32,8 @@ public class MapFeatureGroupDescriptorDtoToFeatureGroupEntity target.setName(source.getName()); target.setDescription(source.getDescription()); target.setPartNumber(source.getPartNumber()); - target.setManufacturerReferenceNumber(source.getManufacturerReferenceNumber()); + if (!ToggleableFeature.MRN.isActive()) { + target.setManufacturerReferenceNumber(source.getManufacturerReferenceNumber()); + } } }
\ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupEntityToFeatureGroupDescriptorDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupEntityToFeatureGroupDescriptorDto.java index ce69384f41..e103b27687 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupEntityToFeatureGroupDescriptorDto.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupEntityToFeatureGroupDescriptorDto.java @@ -20,6 +20,7 @@ package org.openecomp.sdcrests.vendorlicense.rest.mapping; +import org.openecomp.sdc.common.togglz.ToggleableFeature; import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity; import org.openecomp.sdcrests.mapping.MappingBase; import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupDescriptorDto; @@ -31,6 +32,8 @@ public class MapFeatureGroupEntityToFeatureGroupDescriptorDto target.setName(source.getName()); target.setDescription(source.getDescription()); target.setPartNumber(source.getPartNumber()); - target.setManufacturerReferenceNumber(source.getManufacturerReferenceNumber()); + if (!ToggleableFeature.MRN.isActive()) { + target.setManufacturerReferenceNumber(source.getManufacturerReferenceNumber()); + } } } diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto.java index 2b314b7416..a7d4b5bc42 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto.java @@ -20,6 +20,7 @@ package org.openecomp.sdcrests.vendorlicense.rest.mapping; +import org.openecomp.sdc.common.togglz.ToggleableFeature; import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity; import org.openecomp.sdcrests.mapping.MappingBase; import org.openecomp.sdcrests.vendorlicense.types.LicenseKeyGroupEntityDto; @@ -42,5 +43,8 @@ public class MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto target.setThresholdValue(source.getThresholdValue()); target.setIncrements(source.getIncrements()); target.setVersionUUID(source.getVersionUuId()); + if (ToggleableFeature.MRN.isActive()) { + target.setManufacturerReferenceNumber(source.getManufacturerReferenceNumber()); + } } } diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity.java index 4682a46216..0eeda4a8b7 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity.java @@ -20,6 +20,7 @@ package org.openecomp.sdcrests.vendorlicense.rest.mapping; +import org.openecomp.sdc.common.togglz.ToggleableFeature; import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity; import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther; import org.openecomp.sdcrests.mapping.MappingBase; @@ -30,6 +31,9 @@ public class MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity @Override public void doMapping(LicenseKeyGroupRequestDto source, LicenseKeyGroupEntity target) { target.setName(source.getName()); + if (ToggleableFeature.MRN.isActive()) { + target.setManufacturerReferenceNumber(source.getManufacturerReferenceNumber()); + } target.setDescription(source.getDescription()); target.setType(source.getType()); target.setOperationalScope(new MapMultiChoiceOrOtherDtoToMultiChoiceOrOther() |