Create / Update Entitlement Pool - Support Type Field 54/112354/2
authorJulienBe <julien.bertozzi@intl.att.com>
Wed, 9 Sep 2020 10:46:42 +0000 (12:46 +0200)
committerJulien Bertozzi <julien.bertozzi@intl.att.com>
Wed, 9 Sep 2020 08:57:08 +0000 (08:57 +0000)
Setting Universal as the default EntitlementPoolType if none is provided to the api

Issue-ID: SDC-2820

Signed-off-by: JulienBe <julien.bertozzi@intl.att.com>
Change-Id: I64f90e37f8969488f7453aa53543b566281f2a37

integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/utils/general/VendorLicenseModelRestUtils.java
openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/EntitlementPools.java
openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolType.java

index 072f2a9..c4c0047 100644 (file)
@@ -107,17 +107,12 @@ public class VendorLicenseModelRestUtils {
         assertEquals("did not succeed to create vendor license agreement", 200, vendorLicenseAgreement.getErrorCode().intValue());
         String vendorLicenseAgreementId = ResponseParser.getValueFromJsonResponse(vendorLicenseAgreement.getResponse(), "value");
 
-//             RestResponse checkinVendorLicense = OnboardingUtils.checkinVendorLicense(vendorId, user, versionId);
-//             assertEquals("did not succeed to checkin vendor license", 200, checkinVendorLicense.getErrorCode().intValue());
-
         vendorLicenseModel = new VendorLicenseModel(vendorId, vendorLicenseName, vendorLicenseAgreementId, featureGroupId);
         vendorLicenseModel.setVersion(versionId); // Once object created and submitted, his initial version is 1.0
 
         RestResponse submitVendorLicense = submitVendorLicense(vendorLicenseModel, user);
         assertEquals("did not succeed to submit vendor license", 200, submitVendorLicense.getErrorCode().intValue());
 
-//             ComponentBaseTest.getExtendTest().log(Status.INFO, "Succeeded in creating the vendor license");
-
         return vendorLicenseModel;
     }
 
@@ -218,7 +213,6 @@ public class VendorLicenseModelRestUtils {
         jObject.put("name", "xyz");
         jObject.put("description", "new vendor license feature groups");
         jObject.put("partNumber", "123abc456");
-//      jObject.put("manufacturerReferenceNumber", "5");
         jObject.put("addedLicenseKeyGroupsIds", Arrays.asList(licenseKeyGroupId).toArray());
         jObject.put("addedEntitlementPoolsIds", Arrays.asList(entitlementPoolId).toArray());
 
index 6b30b74..2b16ffc 100644 (file)
@@ -60,11 +60,8 @@ public interface EntitlementPools {
     @Path("/")
     @Operation(description = "Create vendor entitlement pool")
     Response createEntitlementPool(@Valid EntitlementPoolRequestDto request,
-                                   @Parameter(description = "Vendor license model Id") @PathParam("vlmId")
-                                           String vlmId,
-                                   @Parameter(description = "Vendor license model version Id") @PathParam
-                                           ("versionId")
-                                           String versionId,
+                                   @Parameter(description = "Vendor license model Id") @PathParam("vlmId") String vlmId,
+                                   @Parameter(description = "Vendor license model version Id") @PathParam ("versionId") String versionId,
                                    @NotNull(message = USER_MISSING_ERROR_MSG)
                                    @HeaderParam(USER_ID_HEADER_PARAM) String user);
 
index 3b66fab..1a851a5 100644 (file)
@@ -26,10 +26,6 @@ public enum EntitlementPoolType {
     One_Time;
 
     public static EntitlementPoolType permissiveValueOf(String name) {
-        if (name == null){
-            return null;
-        } else {
-            return EntitlementPoolType.valueOf(name);
-        }
+        return name == null ? Universal : EntitlementPoolType.valueOf(name);
     }
-}
+}
\ No newline at end of file