Creation of Vendor Licensing Model is an optional step in VSP onboarding 90/117790/5
authorJerzySzachniewicz <jerzy.szachniewicz@nokia.com>
Fri, 12 Feb 2021 12:53:13 +0000 (13:53 +0100)
committerChristophe Closset <christophe.closset@intl.att.com>
Wed, 17 Feb 2021 15:43:47 +0000 (15:43 +0000)
Issue-ID: SDC-3471
Signed-off-by: JerzySzachniewicz <jerzy.szachniewicz@nokia.com>
Change-Id: Icb98d0832c49939e200ece77f4ca26744cb82222

16 files changed:
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/MapVspDescriptionDtoToVspDetails.java
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
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
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/MapVspDetailsToDtoTest.java
openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDescriptionDto.java
openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/LicenseType.java [new file with mode: 0644]
openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspDetails.java
openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VendorSoftwareProductInfoDaoZusammenImpl.java
openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToVSPGeneralConvertor.java
openecomp-ui/resources/scss/modules/_softwareProductLandingPage.scss
openecomp-ui/src/nfvo-utils/i18n/en.json
openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js
openecomp-ui/src/sdc-app/onboarding/softwareProduct/details/SoftwareProductDetailsView.jsx
openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPage.js
openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPageView.jsx
openecomp-ui/test/softwareProduct/landingPage/landingPage.test.js

index 634bd90..3ab2667 100644 (file)
@@ -20,6 +20,7 @@
 
 package org.openecomp.sdcrests.vsp.rest.mapping;
 
+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.sdc.versioning.dao.types.Version;
@@ -38,12 +39,15 @@ public class MapVspDescriptionDtoToVspDetails extends MappingBase<VspDescription
     target.setVendorName(source.getVendorName());
     target.setVendorId(source.getVendorId());
 
-    if (source.getLicensingVersion() != null) {
+    if (source.getLicensingVersion() != null && source.getLicenseType() != LicenseType.EXTERNAL) {
       target.setVlmVersion(new Version(source.getLicensingVersion()));
     }
+    if (source.getLicenseType() != null) {
+      target.setLicenseType(source.getLicenseType().name());
+    }
 
     LicensingData licensingData = source.getLicensingData();
-    if (licensingData != null) {
+    if (licensingData != null && source.getLicenseType() != LicenseType.EXTERNAL) {
       target.setLicenseAgreement(licensingData.getLicenseAgreement());
       target.setFeatureGroups(licensingData.getFeatureGroups());
     }
index 6e659cb..1ba5d13 100644 (file)
@@ -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());
index 9ec43e9..20a5449 100644 (file)
 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());
+    }
 }
index d5eb7be..2386328 100644 (file)
@@ -18,9 +18,9 @@ package org.openecomp.sdcrests.vsp.rest.mapping;
 
 import static org.junit.Assert.assertEquals;
 
-import org.junit.Test;
+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.sdc.versioning.dao.types.Version;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDetailsDto;
 
@@ -68,6 +68,9 @@ public class MapVspDetailsToDtoTest {
         final String onboardingMethod = "b46520ac-e62f-4a24-8f40-ee6e65889bfc";
         source.setOnboardingMethod(onboardingMethod);
 
+        final String licenseType = LicenseType.EXTERNAL.name();
+        source.setLicenseType(licenseType);
+
         final VspDetailsDto target = new VspDetailsDto();
         final MapVspDetailsToDto mapper = new MapVspDetailsToDto();
         mapper.doMapping(source, target);
@@ -83,5 +86,6 @@ public class MapVspDetailsToDtoTest {
         assertEquals(vendorName, target.getVendorName());
         assertEquals(vlmVersionId, target.getLicensingVersion());
         assertEquals(onboardingMethod, target.getOnboardingMethod());
+        assertEquals(LicenseType.EXTERNAL, target.getLicenseType());
     }
 }
index 1b64ab7..3cddb5d 100644 (file)
@@ -17,6 +17,7 @@
 package org.openecomp.sdcrests.vendorsoftwareproducts.types;
 
 import lombok.Data;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.LicenseType;
 import org.openecomp.sdc.vendorsoftwareproduct.types.LicensingData;
 
 import javax.validation.constraints.NotNull;
@@ -37,5 +38,6 @@ public class VspDescriptionDto {
     @NotNull
     private String vendorId;            // this will be populated with vlm id
     private String licensingVersion;    // this will be populated with vlm version
+    private LicenseType licenseType;
     private LicensingData licensingData;
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/LicenseType.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/LicenseType.java
new file mode 100644 (file)
index 0000000..35dfda4
--- /dev/null
@@ -0,0 +1,27 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2021 Nokia. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
+
+public enum LicenseType {
+    EXTERNAL,
+    INTERNAL
+}
index e1be8b9..de42344 100644 (file)
@@ -251,6 +251,8 @@ public class VendorSoftwareProductInfoDaoZusammenImpl implements VendorSoftwareP
       info.addProperty(InfoPropertyName.VENDOR_VERSION.getValue(),
           vspDetails.getVlmVersion().getId());
     }
+    info.addProperty(InfoPropertyName.LICENSE_TYPE.getValue(),
+        vspDetails.getLicenseType());
     info.addProperty(InfoPropertyName.LICENSE_AGREEMENT.getValue(),
         vspDetails.getLicenseAgreement());
     info.addProperty(InfoPropertyName.FEATURE_GROUPS.getValue(), vspDetails.getFeatureGroups());
@@ -267,6 +269,7 @@ public class VendorSoftwareProductInfoDaoZusammenImpl implements VendorSoftwareP
     VENDOR_ID("vendorId"),
     VENDOR_NAME("vendorName"),
     VENDOR_VERSION("vendorVersion"),
+    LICENSE_TYPE("licenseType"),
     LICENSE_AGREEMENT("licenseAgreement"),
     FEATURE_GROUPS("featureGroups"),
     ON_BOARDING_METHOD("onboardingMethod");
index 8c63167..d8bb179 100644 (file)
@@ -84,6 +84,8 @@ public class ElementToVSPGeneralConvertor extends ElementConvertor {
           VendorSoftwareProductInfoDaoZusammenImpl.InfoPropertyName.VENDOR_VERSION.getValue())));
     }
 
+    vspDetails.setLicenseType(info.getProperty(
+        VendorSoftwareProductInfoDaoZusammenImpl.InfoPropertyName.LICENSE_TYPE.getValue()));
     vspDetails.setLicenseAgreement(info.getProperty(
         VendorSoftwareProductInfoDaoZusammenImpl.InfoPropertyName.LICENSE_AGREEMENT.getValue()));
     vspDetails.setFeatureGroups(info.getProperty(
index 8f0803f..a0620b3 100644 (file)
@@ -97,7 +97,7 @@
                         margin-right: 0;
                     }
                     .software-product-landing-view-top-block-col-upl {
-                        height: 215px;
+                        height: 225px;
                         width: initial;
                     }
                 }
                     }
                     border: 1px solid $light-gray;
                     padding: 20px 18px 0 18px;
-                    height: 215px;
+                    height: 225px;
                     display: flex;
                     justify-content: space-between;
                     background-color: $white;
 
                 .software-product-landing-view-top-block-col-upl {
                     @extend .flex;
-                    height: 215px;
+                    height: 225px;
                     text-align: center;
                     flex-direction: column;
                     justify-content: center;
             }
         }
     }
+    .licenceLabel {
+        float: right;
+        margin-left: 5px;
+    }
 }
 
 .vsp-details-page {
index 5b2d09a..786fe16 100644 (file)
   "Select file": "Select file",
   "Software Product Details": "Software Product Details",
   "Missing": "Missing",
+  "Internal license": "Internal",
+  "External license": "External",
   "Filter Networks": "Filter Networks",
   "DHCP": "DHCP",
   "YES": "YES",
index a067fd4..02e5a24 100644 (file)
@@ -134,6 +134,7 @@ function putSoftwareProduct({ softwareProduct, version }) {
                 ? softwareProduct.licensingVersion
                 : undefined,
             icon: softwareProduct.icon,
+            licenseType: softwareProduct.licenseType,
             licensingData: getLicensingData(softwareProduct.licensingData)
         }
     );
index dbc04d0..06ecf6b 100644 (file)
@@ -204,7 +204,8 @@ class LicensesSection extends React.Component {
         onLicensingDataChanged: PropTypes.func.isRequired,
         featureGroupsList: PropTypes.array,
         licenseAgreementList: PropTypes.array,
-        isVendorArchived: PropTypes.bool
+        isVendorArchived: PropTypes.bool,
+        licenseType: PropTypes.string
     };
 
     onVendorParamChanged(e) {
@@ -234,7 +235,10 @@ class LicensesSection extends React.Component {
                         onChange={e => this.onVendorParamChanged(e)}
                         value={this.props.licensingVersion || ''}
                         label={i18n('Licensing Version')}
-                        disabled={this.props.isVendorArchived}
+                        disabled={
+                            this.props.isVendorArchived ||
+                            this.props.licenseType !== 'internal'
+                        }
                         type="select">
                         {this.props.licensingVersionsList.map(version => (
                             <option key={version.enum} value={version.enum}>
@@ -248,7 +252,10 @@ class LicensesSection extends React.Component {
                         data-test-id="vsp-license-agreement"
                         label={i18n('License Agreement')}
                         type="select"
-                        disabled={this.props.isVendorArchived}
+                        disabled={
+                            this.props.isVendorArchived ||
+                            this.props.licenseType !== 'internal'
+                        }
                         value={
                             this.props.licensingData.licenseAgreement
                                 ? this.props.licensingData.licenseAgreement
@@ -272,7 +279,10 @@ class LicensesSection extends React.Component {
                             type="select"
                             isMultiSelect={true}
                             onInputChange={() => {}}
-                            disabled={this.props.isVendorArchived}
+                            disabled={
+                                this.props.isVendorArchived ||
+                                this.props.licenseType !== 'internal'
+                            }
                             onEnumChange={featureGroups =>
                                 this.props.onFeatureGroupsChanged({
                                     featureGroups
@@ -466,6 +476,7 @@ class SoftwareProductDetails extends Component {
             vendorId: PropTypes.string,
             vendorName: PropTypes.string,
             licensingVersion: PropTypes.string,
+            licenseType: PropTypes.string,
             licensingData: PropTypes.shape({
                 licenceAgreement: PropTypes.string,
                 featureGroups: PropTypes.array
@@ -527,7 +538,8 @@ class SoftwareProductDetails extends Component {
         let {
             vendorId,
             licensingVersion,
-            licensingData = {}
+            licensingData = {},
+            licenseType
         } = currentSoftwareProduct;
         return {
             onVendorParamChanged: args => this.onVendorParamChanged(args),
@@ -539,7 +551,8 @@ class SoftwareProductDetails extends Component {
             onLicensingDataChanged: args => this.onLicensingDataChanged(args),
             featureGroupsList,
             licenseAgreementList,
-            isVendorArchived
+            isVendorArchived,
+            licenseType
         };
     }
 
index 52a6980..5dc0aab 100644 (file)
@@ -75,14 +75,32 @@ export const mapStateToProps = ({
     };
 };
 
+function handleScreenChange(softwareProduct, dispatch, version) {
+    const softwareProductId = softwareProduct.id;
+    if (softwareProduct.licenseType === 'INTERNAL') {
+        ScreensHelper.loadScreen(dispatch, {
+            screen: enums.SCREEN.SOFTWARE_PRODUCT_DETAILS,
+            screenType: screenTypes.SOFTWARE_PRODUCT,
+            props: { softwareProductId, version }
+        });
+    } else {
+        ScreensHelper.loadScreen(dispatch, {
+            screen: enums.SCREEN.SOFTWARE_PRODUCT_LANDING_PAGE,
+            screenType: screenTypes.SOFTWARE_PRODUCT,
+            props: { softwareProductId, version }
+        });
+    }
+}
+
 const mapActionsToProps = (dispatch, { version }) => {
     return {
-        onDetailsSelect: ({ id: softwareProductId }) =>
-            ScreensHelper.loadScreen(dispatch, {
-                screen: enums.SCREEN.SOFTWARE_PRODUCT_DETAILS,
-                screenType: screenTypes.SOFTWARE_PRODUCT,
-                props: { softwareProductId, version }
-            }),
+        onLicenseChange: softwareProduct => {
+            SoftwareProductActionHelper.updateSoftwareProductData(dispatch, {
+                softwareProduct,
+                version
+            }).then(() => {});
+            handleScreenChange(softwareProduct, dispatch, version);
+        },
         onCandidateInProcess: softwareProductId =>
             ScreensHelper.loadScreen(dispatch, {
                 screen: enums.SCREEN.SOFTWARE_PRODUCT_ATTACHMENTS_SETUP,
index e4337c7..f5cd4c6 100644 (file)
@@ -23,7 +23,6 @@ import Configuration from 'sdc-app/config/Configuration.js';
 import DraggableUploadFileBox from 'nfvo-components/fileupload/DraggableUploadFileBox.jsx';
 import VnfRepositorySearchBox from 'nfvo-components/vnfMarketPlace/VnfRepositorySearchBox.jsx';
 
-import { SVGIcon } from 'onap-ui-react';
 import SoftwareProductComponentsList from 'sdc-app/onboarding/softwareProduct/components/SoftwareProductComponents.js';
 
 const SoftwareProductPropType = PropTypes.shape({
@@ -33,6 +32,7 @@ const SoftwareProductPropType = PropTypes.shape({
     id: PropTypes.string,
     categoryId: PropTypes.string,
     vendorId: PropTypes.string,
+    licenseType: PropTypes.string,
     status: PropTypes.string,
     licensingData: PropTypes.object,
     validationData: PropTypes.object
@@ -57,7 +57,7 @@ class SoftwareProductLandingPageView extends React.Component {
         isReadOnlyMode: PropTypes.bool,
         componentsList: PropTypes.arrayOf(ComponentPropType),
         version: PropTypes.object,
-        onDetailsSelect: PropTypes.func,
+        onLicenseChange: PropTypes.func,
         onUpload: PropTypes.func,
         onUploadConfirmation: PropTypes.func,
         onInvalidFileSizeUpload: PropTypes.func,
@@ -74,13 +74,20 @@ class SoftwareProductLandingPageView extends React.Component {
             onCandidateInProcess(currentSoftwareProduct.id);
         }
     }
+
+    licenceChange = (e, currentSoftwareProduct, onLicenseChange) => {
+        currentSoftwareProduct.licenseType = e.target.value;
+        onLicenseChange(currentSoftwareProduct);
+    };
+
     render() {
         let {
             currentSoftwareProduct,
             isReadOnlyMode,
             isManual,
-            onDetailsSelect
+            onLicenseChange
         } = this.props;
+        let licenceChange = this.licenceChange;
         return (
             <div className="software-product-landing-wrapper">
                 <Dropzone
@@ -106,7 +113,8 @@ class SoftwareProductLandingPageView extends React.Component {
                                     currentSoftwareProduct={
                                         currentSoftwareProduct
                                     }
-                                    onDetailsSelect={onDetailsSelect}
+                                    licenceChange={licenceChange}
+                                    onLicenseChange={onLicenseChange}
                                 />
                                 {this.renderProductDetails(
                                     isManual,
@@ -223,22 +231,23 @@ class SoftwareProductLandingPageView extends React.Component {
     }
 }
 
-const ProductSummary = ({ currentSoftwareProduct, onDetailsSelect }) => {
+const ProductSummary = ({
+    currentSoftwareProduct,
+    licenceChange,
+    onLicenseChange
+}) => {
     let {
         name = '',
         description = '',
         vendorName = '',
-        fullCategoryDisplayName = '',
-        licenseAgreementName = ''
+        fullCategoryDisplayName = ''
     } = currentSoftwareProduct;
     return (
         <div className="details-panel">
             <div className="software-product-landing-view-heading-title">
                 {i18n('Software Product Details')}
             </div>
-            <div
-                className="software-product-landing-view-top-block clickable"
-                onClick={() => onDetailsSelect(currentSoftwareProduct)}>
+            <div className="software-product-landing-view-top-block">
                 <div className="details-container">
                     <div className="single-detail-section title-section">
                         <div className="single-detail-section title-text">
@@ -263,9 +272,11 @@ const ProductSummary = ({ currentSoftwareProduct, onDetailsSelect }) => {
                                 </div>
                                 <div className="description">
                                     <LicenseAgreement
-                                        licenseAgreementName={
-                                            licenseAgreementName
+                                        licenceChange={licenceChange}
+                                        currentSoftwareProduct={
+                                            currentSoftwareProduct
                                         }
+                                        onLicenseChange={onLicenseChange}
                                     />
                                 </div>
                             </div>
@@ -281,16 +292,52 @@ const ProductSummary = ({ currentSoftwareProduct, onDetailsSelect }) => {
     );
 };
 
-const LicenseAgreement = ({ licenseAgreementName }) => {
-    if (!licenseAgreementName) {
-        return (
-            <div className="missing-license">
-                <SVGIcon color="warning" name="exclamationTriangleFull" />
-                <div className="warning-text">{i18n('Missing')}</div>
-            </div>
-        );
-    }
-    return <div>{licenseAgreementName}</div>;
+const LicenseAgreement = ({
+    licenceChange,
+    currentSoftwareProduct,
+    onLicenseChange
+}) => {
+    return (
+        <div className="missing-license">
+            <form>
+                <input
+                    type="radio"
+                    value="INTERNAL"
+                    id="INTERNAL"
+                    onChange={event =>
+                        licenceChange(
+                            event,
+                            currentSoftwareProduct,
+                            onLicenseChange
+                        )
+                    }
+                    checked={currentSoftwareProduct.licenseType === 'INTERNAL'}
+                    name="license"
+                />
+                <div className="description licenceLabel">
+                    {i18n('Internal license')}
+                </div>
+                <br />
+                <input
+                    type="radio"
+                    value="EXTERNAL"
+                    id="EXTERNAL"
+                    onChange={event =>
+                        licenceChange(
+                            event,
+                            currentSoftwareProduct,
+                            onLicenseChange
+                        )
+                    }
+                    checked={currentSoftwareProduct.licenseType === 'EXTERNAL'}
+                    name="license"
+                />
+                <div className="description licenceLabel">
+                    {i18n('External license')}
+                </div>
+            </form>
+        </div>
+    );
 };
 
 export default SoftwareProductLandingPageView;
index 0b99933..3928a3d 100644 (file)
@@ -107,6 +107,34 @@ describe('Software Product Landing Page: ', function () {
                expect(vspLandingView).toBeTruthy();
        });
 
+       it('vsp licence agreement type change', () => {
+               const params = {
+                       ...currentScreen.props,
+                       currentSoftwareProduct,
+                       componentsList: VSPComponentsFactory.buildList(2)
+               };
+               const e = { target: {
+                       value: 'INTERNAL'
+                       }};
+               const obj = {dummyFunction: x => true};
+               const store = storeCreator();
+               let vspLandingView = TestUtils.renderIntoDocument(
+                       <Provider store={store}>
+                               <SoftwareProductLandingPageView {...params}/>
+                       </Provider>
+               );
+               let vspLandingViewWrapper = TestUtils.findRenderedComponentWithType(
+                       vspLandingView,
+                       SoftwareProductLandingPageView
+               );
+               const spy = jest.spyOn(obj, "dummyFunction");
+               vspLandingViewWrapper.licenceChange(e, currentSoftwareProduct, obj.dummyFunction);
+               expect(spy).toHaveBeenCalled();
+               expect(currentSoftwareProduct.licenseType).toBe("INTERNAL");
+               expect(vspLandingViewWrapper).toBeTruthy();
+
+       })
+
        it('vsp landing handleOnDragEnter test ', () => {
 
                const params = {