From c15ef65197789965734fb3aa90e9ea50bda05045 Mon Sep 17 00:00:00 2001 From: shrikantawachar Date: Fri, 10 Aug 2018 16:14:56 +0530 Subject: Inconsistent behavior in license model xmls Removing toggle and fix for Inconsistent behavior in license model xmls Change-Id: I2fd032f25afbdcc17547224beaecf626ed6322bb Issue-ID: SDC-1625 Signed-off-by: shrikantawachar --- .../MapEntitlementPoolEntityToEntitlementPoolEntityDto.java | 5 +---- ...MapEntitlementPoolRequestDtoToEntitlementPoolEntity.java | 5 +---- .../MapFeatureGroupDescriptorDtoToFeatureGroupEntity.java | 4 ---- .../MapFeatureGroupEntityToFeatureGroupDescriptorDto.java | 4 ---- .../MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto.java | 5 +---- ...MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity.java | 5 +---- .../vendorlicense/rest/services/EntitlementPoolsImpl.java | 10 ---------- .../vendorlicense/rest/services/FeatureGroupsImpl.java | 13 ------------- .../vendorlicense/types/EntitlementPoolRequestDto.java | 2 ++ .../vendorlicense/types/FeatureGroupDescriptorDto.java | 11 ----------- 10 files changed, 6 insertions(+), 58 deletions(-) (limited to 'openecomp-be/api') 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 18435b3c71..d4526da1e5 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,7 +20,6 @@ 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; @@ -47,8 +46,6 @@ public class MapEntitlementPoolEntityToEntitlementPoolEntityDto target.setStartDate(source.getStartDate()); target.setExpiryDate(source.getExpiryDate()); target.setVersionUUID(source.getVersionUuId()); - if (ToggleableFeature.MRN.isActive()) { - target.setManufacturerReferenceNumber(source.getManufacturerReferenceNumber()); - } + 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 bed7e696e7..69cd285cf7 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,7 +20,6 @@ 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; @@ -31,9 +30,7 @@ public class MapEntitlementPoolRequestDtoToEntitlementPoolEntity @Override public void doMapping(EntitlementPoolRequestDto source, EntitlementPoolEntity target) { target.setName(source.getName()); - if (ToggleableFeature.MRN.isActive()) { - target.setManufacturerReferenceNumber(source.getManufacturerReferenceNumber()); - } + 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 232588779c..5dbf087e45 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,7 +20,6 @@ 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; @@ -32,8 +31,5 @@ public class MapFeatureGroupDescriptorDtoToFeatureGroupEntity target.setName(source.getName()); target.setDescription(source.getDescription()); target.setPartNumber(source.getPartNumber()); - 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 e103b27687..70f5666bcb 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,7 +20,6 @@ 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; @@ -32,8 +31,5 @@ public class MapFeatureGroupEntityToFeatureGroupDescriptorDto target.setName(source.getName()); target.setDescription(source.getDescription()); target.setPartNumber(source.getPartNumber()); - 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 a7d4b5bc42..c543cf402e 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,7 +20,6 @@ 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; @@ -43,8 +42,6 @@ public class MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto target.setThresholdValue(source.getThresholdValue()); target.setIncrements(source.getIncrements()); target.setVersionUUID(source.getVersionUuId()); - if (ToggleableFeature.MRN.isActive()) { - target.setManufacturerReferenceNumber(source.getManufacturerReferenceNumber()); - } + 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 0eeda4a8b7..87eea4ba1e 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,7 +20,6 @@ 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; @@ -31,9 +30,7 @@ public class MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity @Override public void doMapping(LicenseKeyGroupRequestDto source, LicenseKeyGroupEntity target) { target.setName(source.getName()); - if (ToggleableFeature.MRN.isActive()) { - target.setManufacturerReferenceNumber(source.getManufacturerReferenceNumber()); - } + target.setManufacturerReferenceNumber(source.getManufacturerReferenceNumber()); target.setDescription(source.getDescription()); target.setType(source.getType()); target.setOperationalScope(new MapMultiChoiceOrOtherDtoToMultiChoiceOrOther() 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/services/EntitlementPoolsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolsImpl.java index 292b4a0937..076ae45017 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolsImpl.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolsImpl.java @@ -20,9 +20,6 @@ package org.openecomp.sdcrests.vendorlicense.rest.services; -import org.openecomp.sdc.common.errors.CoreException; -import org.openecomp.sdc.common.errors.ErrorCode; -import org.openecomp.sdc.common.togglz.ToggleableFeature; import org.openecomp.sdc.vendorlicense.VendorLicenseManager; import org.openecomp.sdc.vendorlicense.VendorLicenseManagerFactory; import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; @@ -40,7 +37,6 @@ import org.springframework.stereotype.Service; import javax.inject.Named; import javax.ws.rs.core.Response; import java.util.Collection; -import java.util.Objects; @Named @Service("entitlementPools") @@ -80,12 +76,6 @@ public class EntitlementPoolsImpl implements EntitlementPools { */ public Response createEntitlementPool(EntitlementPoolRequestDto request, String vlmId, String versionId, String user) { - if (ToggleableFeature.MRN.isActive()) { - if (Objects.isNull(request.getManufacturerReferenceNumber())) { - throw new CoreException((new ErrorCode.ErrorCodeBuilder().withMessage("Field does not conform to " - + "predefined criteria : manufacturerReferenceNumber : is mandatory and should not be empty").build())); - } - } EntitlementPoolEntity entitlementPoolEntity = new MapEntitlementPoolRequestDtoToEntitlementPoolEntity() .applyMapping(request, EntitlementPoolEntity.class); 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/services/FeatureGroupsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/FeatureGroupsImpl.java index 65b2695b5e..8b62dc1843 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/FeatureGroupsImpl.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/FeatureGroupsImpl.java @@ -21,9 +21,6 @@ package org.openecomp.sdcrests.vendorlicense.rest.services; import org.openecomp.core.utilities.CommonMethods; -import org.openecomp.sdc.common.errors.CoreException; -import org.openecomp.sdc.common.errors.ErrorCode; -import org.openecomp.sdc.common.togglz.ToggleableFeature; import org.openecomp.sdc.vendorlicense.VendorLicenseManager; import org.openecomp.sdc.vendorlicense.VendorLicenseManagerFactory; import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; @@ -46,7 +43,6 @@ import javax.inject.Named; import javax.ws.rs.core.Response; import java.util.Collection; import java.util.HashSet; -import java.util.Objects; @Named @Service("featureGroups") @@ -79,15 +75,6 @@ public class FeatureGroupsImpl implements FeatureGroups { @Override public Response createFeatureGroup(FeatureGroupRequestDto request, String vlmId, String versionId, String user) { - //Below if block is introduced to have feature toggleable. This if block needs to remove when - // we remove toggle. - if (!ToggleableFeature.MRN.isActive()) { - if (Objects.isNull(request.getManufacturerReferenceNumber())) { - throw new CoreException((new ErrorCode.ErrorCodeBuilder().withMessage("Field does not " + - "conform to predefined criteria : manufacturerReferenceNumber : is mandatory and should not be empty").build())); - } - } - FeatureGroupEntity featureGroupEntity = new MapFeatureGroupDescriptorDtoToFeatureGroupEntity() .applyMapping(request, FeatureGroupEntity.class); featureGroupEntity.setVendorLicenseModelId(vlmId); diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolRequestDto.java index 8fa34b8579..6bc4f94b5f 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolRequestDto.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolRequestDto.java @@ -22,6 +22,7 @@ package org.openecomp.sdcrests.vendorlicense.types; import io.swagger.annotations.ApiModel; import org.codehaus.jackson.annotate.JsonIgnoreProperties; +import org.hibernate.validator.constraints.NotBlank; import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope; import org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit; @@ -37,6 +38,7 @@ public class EntitlementPoolRequestDto { @Size(max = 120) private String name; + @NotBlank(message = "is mandatory and should not be empty") @Size(max = 100) private String manufacturerReferenceNumber; diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupDescriptorDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupDescriptorDto.java index 4270ffee9e..919fdb21c2 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupDescriptorDto.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupDescriptorDto.java @@ -34,10 +34,6 @@ public class FeatureGroupDescriptorDto { @NotNull private String partNumber; - - @Size(max = 100) - private String manufacturerReferenceNumber; - public String getName() { return name; } @@ -62,11 +58,4 @@ public class FeatureGroupDescriptorDto { this.partNumber = partNumber; } - public String getManufacturerReferenceNumber() { - return manufacturerReferenceNumber; - } - - public void setManufacturerReferenceNumber(String manufacturerReferenceNumber) { - this.manufacturerReferenceNumber = manufacturerReferenceNumber; - } } -- cgit 1.2.3-korg