diff options
Diffstat (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/test/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToVspDetailsTest.java')
1 files changed, 22 insertions, 1 deletions
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/test/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToVspDetailsTest.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/test/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToVspDetailsTest.java index 9ec43e9226..20a544927e 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/test/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToVspDetailsTest.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/test/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToVspDetailsTest.java @@ -17,9 +17,13 @@ package org.openecomp.sdcrests.vsp.rest.mapping; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; -import org.junit.Test; +import java.util.Collections; +import org.junit.jupiter.api.Test; +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.vendorsoftwareproducts.types.VspDescriptionDto; /** @@ -65,4 +69,21 @@ public class MapVspDescriptionDtoToVspDetailsTest { assertEquals(vendorName, target.getVendorName()); assertEquals(vendorId, target.getVendorId()); } + + @Test + public void testLicenceTypeMapping() { + final VspDescriptionDto source = new VspDescriptionDto(); + LicensingData licensingData = new LicensingData(); + licensingData.setLicenseAgreement("testLicenseAgreement"); + licensingData.setFeatureGroups(Collections.emptyList()); + source.setLicenseType(LicenseType.EXTERNAL); + source.setLicensingData(licensingData); + + final VspDetails target = new VspDetails(); + final MapVspDescriptionDtoToVspDetails mapper = new MapVspDescriptionDtoToVspDetails(); + mapper.doMapping(source, target); + assertEquals(LicenseType.EXTERNAL.name(), target.getLicenseType()); + assertNull(target.getLicenseAgreement()); + assertNull(target.getFeatureGroups()); + } } |