aboutsummaryrefslogtreecommitdiffstats
path: root/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/PathUtilities.java
blob: 3ee26d3f2ec4a3b7aaafc1ad238d71cff6822c0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
/*-
 * ============LICENSE_START=======================================================
 * SDC
 * ================================================================================
 * Copyright (C) 2017 AT&T Intellectual Property. 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.ci.tests.execute.AmdocsComplexService;

import com.aventstack.extentreports.Status;
import com.clearspring.analytics.util.Pair;
import com.google.gson.Gson;
import org.apache.http.HttpStatus;
import org.openecomp.sdc.be.model.Service;
import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.ci.tests.config.Config;
import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
import org.openecomp.sdc.ci.tests.pages.CompositionPage;
import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
import org.openecomp.sdc.ci.tests.pages.HomePage;
import org.openecomp.sdc.ci.tests.pages.ServiceGeneralPage;
import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
import org.openecomp.sdc.ci.tests.utilities.ServiceUIUtils;
import org.openecomp.sdc.ci.tests.utils.Utils;
import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
import org.openecomp.sdc.ci.tests.verificator.VfVerificator;
import org.openqa.selenium.WebElement;
import org.testng.Assert;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static org.testng.AssertJUnit.assertEquals;


public class PathUtilities {

    private static final int WAITING_FOR_LOADRE_TIME_OUT = 60 * 10;
    private static final int NUMBER_OF_LINKS = 3;

    static void openPathList() throws Exception {
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_MENU_BUTTON.getValue());
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_BUTTON.getValue());
    }

    public static ServiceReqDetails createService(User user) throws Exception {
        ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
        ServiceUIUtils.createService(serviceMetadata);
        ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
        GeneralUIUtils.ultimateWait();
        return serviceMetadata;
    }

    public static List<CanvasElement> linkVFs(String vspName, int linksNum) throws Exception {
        CompositionPage.searchForElement(vspName);
        GeneralUIUtils.ultimateWait();
        CanvasManager canvasManager = CanvasManager.getCanvasManager();
        GeneralUIUtils.ultimateWait();
        List<CanvasElement> VFs = new ArrayList<CanvasElement>();
        VFs.add(canvasManager.createElementOnCanvas(vspName));
        for (int i = 1; i < linksNum; i++) {
            VFs.add(canvasManager.createElementOnCanvas(vspName));
            GeneralUIUtils.ultimateWait();
//            for(int a=0; a<3; a++)
//                try {
//                    canvasManager.linkElements(VFs.get(i), CircleSize.VF, VFs.get(i - 1), CircleSize.VF);
//                    break;
//                } catch (Exception ignore) {}
            SetupCDTest.getExtendTest().log(Status.INFO, "link VFs");
            GeneralUIUtils.ultimateWait();
        }
        return VFs;
    }

    public static List<CanvasElement> linkServices(String service1, String service2, int linksNum) throws Exception {
        CanvasManager canvasManager = CanvasManager.getCanvasManager();
        List<CanvasElement> VFs = new ArrayList<CanvasElement>();

        // get first service
        CompositionPage.searchForElement(service1);
        VFs.add(canvasManager.createElementOnCanvas(service1));

        String service = service2;
        for (int i = 1; i < linksNum; i++) {
            CompositionPage.searchForElement(service);
            VFs.add(canvasManager.createElementOnCanvas(service));
            GeneralUIUtils.ultimateWait();
//            for(int a=0; a<3; a++)
//                try {
//                    canvasManager.linkElements(VFs.get(i), CircleSize.SERVICE, VFs.get(i-1), CircleSize.SERVICE);
//                    break;
//                } catch (Exception ignore) {}
            SetupCDTest.getExtendTest().log(Status.INFO, "link services");
            GeneralUIUtils.ultimateWait();

            // change service to link
            if (service.equals(service2)) {
                service = service1;
            } else {
                service = service2;
            }
        }
        return VFs;
    }

    public static void openCreatePath() throws Exception {
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_MENU_BUTTON.getValue());
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_PATH_MENU_BUTTON.getValue());
    }

    public static void sendValue(String DataTestId, String value) throws Exception {
        GeneralUIUtils.getWebElementByTestID(DataTestId).sendKeys(value);
        GeneralUIUtils.ultimateWait();
    }

    public static void insertValues(String pathName, String pathProtocol, String pathPortNumbers) throws Exception {
        sendValue(DataTestIdEnum.ComplexServiceAmdocs.PATH_NAME.getValue(), pathName);
        sendValue(DataTestIdEnum.ComplexServiceAmdocs.PATH_PROTOCOL.getValue(), pathProtocol);
        sendValue(DataTestIdEnum.ComplexServiceAmdocs.PATH_PORT_NUMBER.getValue(), pathPortNumbers);
        GeneralUIUtils.ultimateWait();
    }

    public static void selectFirstLineParam() throws Exception {
        GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.LINK_SOURCE.getValue() + "']//option").get(0).click();
        GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.LINK_SOURCE_CP.getValue() + "']//option").get(0).click();
        GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.LINK_TARGET.getValue() + "']//option").get(0).click();
        GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.LINK_TARGET_CP.getValue() + "']//option").get(0).click();
    }

    public static void editPathName(String pathName, String newName) throws Exception {
        GeneralUIUtils.findElementsByXpath("//*[text()='" + pathName + "']/parent::*//span").get(0).click();
        GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ComplexServiceAmdocs.PATH_NAME.getValue()).clear();
        sendValue(DataTestIdEnum.ComplexServiceAmdocs.PATH_NAME.getValue(), newName);
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.SAVE.getValue());
    }

    public static void editPathProtocol(String pathName, String newProtocol) throws Exception {
        GeneralUIUtils.findElementsByXpath("//*[text()='" + pathName + "']/parent::*//span").get(0).click();
        GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ComplexServiceAmdocs.PATH_PROTOCOL.getValue()).clear();
        sendValue(DataTestIdEnum.ComplexServiceAmdocs.PATH_PROTOCOL.getValue(), newProtocol);
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.SAVE.getValue());
    }

    public static int deleteLines(int numOfLinesToDelete, int numOfLines) throws Exception {
        for (int i = 0; i < numOfLinesToDelete; i++) {
            GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.REMOVE_LINK.getValue() + "']//span").get(0).click();
            numOfLines--;
        }
        if (GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.LINK_TARGET_CP + "']//option").size() > (numOfLines + 1)) {
            throw new Exception("Path element was not deleted");
        }
        GeneralUIUtils.ultimateWait();
        return numOfLines;
    }

    public static String createPath(String pathName, String vspName) throws Exception {
        linkVFs(vspName, NUMBER_OF_LINKS);
        openCreatePath();
        insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
        selectFirstLineParam();
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
        SetupCDTest.getExtendTest().log(Status.INFO, "path" + pathName + " has been created");
        return pathName;
    }

    public static void deleteComponents(List<CanvasElement> elements) throws Exception {
        for (CanvasElement element : elements) {
            CanvasManager.getCanvasManager().clickOnCanvaElement(element);
            GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.DELETE_COMPONENT.getValue());
            GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.OK.getValue());
        }
    }

    public static void updateVF(String vspName, VendorSoftwareProductObject vendorSoftwareProduct) throws Exception {
        boolean vspFound = HomePage.searchForVSP(vspName);
        if (vspFound) {
            final List<WebElement> elementsFromTable = GeneralPageElements.getElementsFromTable();
            elementsFromTable.get(1).click();
            GeneralUIUtils.waitForLoader();
            GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ImportVfRepository.UPDATE_VSP.getValue());

            OnboardingUiUtils.doCheckOut();

            //Metadata verification
            VfVerificator.verifyOnboardedVnfMetadata(vspName, vendorSoftwareProduct);

            ExtentTestActions.log(Status.INFO, "Clicking create/update VNF");
            String duration = GeneralUIUtils.getActionDuration(() -> waitUntilVnfCreated());
            ExtentTestActions.log(Status.INFO, "Succeeded in importing/updating " + vspName, duration);
        } else {
            Assert.fail("Did not find VSP named " + vspName);
        }
    }

    public static void waitUntilVnfCreated() {
        GeneralUIUtils.clickOnElementByTestIdWithoutWait(DataTestIdEnum.GeneralElementsEnum.CREATE_BUTTON.getValue());
        GeneralUIUtils.waitForLoader(WAITING_FOR_LOADRE_TIME_OUT);
        GeneralUIUtils.waitForAngular();
        GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.CHECKIN_BUTTON.getValue());
    }

    public static void deleteComponent(CanvasElement element) throws Exception {
        CanvasManager.getCanvasManager().clickOnCanvaElement(element);
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.DELETE_COMPONENT.getValue());
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.OK.getValue());
    }

    public static void submitForTesting() {
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.SUBMIT_FOR_TESTING.getValue());
        GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ComplexServiceAmdocs.CHANGE_LIFE_CYCLE_MESSAGE.getValue()).sendKeys("new service to certify");
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.OK.getValue());
    }

    public static String createPathWithoutLink(String pathName, String vspName) throws Exception {
        openCreatePath();
        insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
        selectFirstLineParam();
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
        SetupCDTest.getExtendTest().log(Status.INFO, "path" + pathName + " has been created");
        return pathName;
    }

    // rest apis
    private static String getServiceUUIDfromCompositionURL() throws Exception {
        String url = SetupCDTest.getDriver().getCurrentUrl();
        String[] result = url.split("/");
        for (int i = 0; i < result.length; i++) {
            if (result[i].equals("workspace")) {
                return result[i + 1];
            }
        }
        throw new Exception("service uuid not found in the url");
    }

    private static Map<String, String> prepareHeadersMap(String userId) {
        Map<String, String> headersMap = new HashMap<String, String>();
        headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json");
        headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), "application/json");
        headersMap.put(HttpHeaderEnum.USER_ID.getValue(), userId);
        return headersMap;
    }

    public static Pair<RestResponse, ServiceReqDetails> getServiceIDByNameAndVersion(String serviceName, String version) throws Exception {
        User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);

        RestResponse restResponse = ServiceRestUtils.getServiceByNameAndVersion(sdncUserDetails, serviceName, version);
        ServiceReqDetails service = new ServiceReqDetails();
        service.setName(serviceName);
        service.setUniqueId(ResponseParser.getUniqueIdFromResponse(restResponse));
        service.setVersion(version);

        return new Pair<>(restResponse, service);
    }

    public static RestResponse createServiceAPI(User sdncUserDetails, ServiceReqDetails serviceDetails) throws Exception {
        String serviceBaseVersion = "0.1";
        RestResponse restResponse = ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
        assertEquals("Check API response code for CreateServiceAPI call", HttpStatus.SC_CREATED, restResponse.getErrorCode().intValue());
        return restResponse;
    }

    public static RestResponse getServiceAPI(User sdncUserDetails, ServiceReqDetails serviceDetails) throws Exception {
        String serviceBaseVersion = "0.1";
        // choose user
        // User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);

        // create serviceDetails
        // ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();

        // get service
        RestResponse restResponse = ServiceRestUtils.getServiceByNameAndVersion(sdncUserDetails, serviceDetails.getName(),
                serviceBaseVersion);
        assertEquals("Check API response code for GetServiceAPI call", HttpStatus.SC_OK, restResponse.getErrorCode().intValue());

        Service service = ResponseParser.convertServiceResponseToJavaObject(restResponse.getResponse());
        String uniqueId = service.getUniqueId();
        serviceDetails.setUniqueId(uniqueId);
        // ServiceValidationUtils.validateServiceResponseMetaData(serviceDetails, service, sdncUserDetails, (LifecycleStateEnum) null);
        return restResponse;
    }

    public static RestResponse getServiceForwardingPathsAPI(String serviceName) throws Exception {
        User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);

        // get service
        Pair<RestResponse, ServiceReqDetails> servicePaths = getServiceIDByNameAndVersion(serviceName, "0.1");

        // set url
        Config config = Utils.getConfig();
        String url = String.format(
                PathUrls.SERVICE_FORWARDING_PATHS,
                config.getCatalogBeHost(),
                config.getCatalogBePort(),
                servicePaths.right.getUniqueId()
        );
        String userId = sdncUserDetails.getUserId();

        Map<String, String> headersMap = prepareHeadersMap(userId);

        HttpRequest http = new HttpRequest();
        RestResponse restResponse = http.httpSendGet(url, headersMap);
        assertEquals("Check API response code for GetServiceForwardingPathsAPI call", HttpStatus.SC_OK, restResponse.getErrorCode().intValue());
        return restResponse;
    }

    public static RestResponse getServicePathLinkMapAPI(String serviceName) throws Exception {
        User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);

        // get service
        Pair<RestResponse, ServiceReqDetails> servicePaths = getServiceIDByNameAndVersion(serviceName, "0.1");

        // set url
        Config config = Utils.getConfig();
        String url = String.format(
                PathUrls.SERVICE_PATH_LINK_MAP,
                config.getCatalogBeHost(),
                config.getCatalogBePort(),
                servicePaths.right.getUniqueId()
        );

        String userId = sdncUserDetails.getUserId();

        Map<String, String> headersMap = prepareHeadersMap(userId);

        HttpRequest http = new HttpRequest();
        RestResponse restResponse = http.httpSendGet(url, headersMap);
        assertEquals("Check API response code for GetServiceForwardingPathsAPI call", HttpStatus.SC_OK, restResponse.getErrorCode().intValue());
        return restResponse;
    }

    public static Pair<RestResponse, ServiceReqDetails> getServicePathsAPI(String serviceName) throws Exception {
        User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
        // get service
        Pair<RestResponse, ServiceReqDetails> servicePaths = getServiceIDByNameAndVersion(serviceName, "0.1");

        // set url
        Config config = Utils.getConfig();
        String url = String.format(
                PathUrls.GET_SERVICE_PATHS,
                config.getCatalogFeHost(),
                config.getCatalogFePort(),
                servicePaths.right.getUniqueId());

        String userId = sdncUserDetails.getUserId();

        Map<String, String> headersMap = prepareHeadersMap(userId);

        HttpRequest http = new HttpRequest();
        RestResponse restResponse = http.httpSendGet(url, headersMap);
        assertEquals("Check API response code for GetServiceForwardingPathsAPI call", HttpStatus.SC_OK, restResponse.getErrorCode().intValue());
        return new Pair<>(restResponse, servicePaths.right);
    }

    public static Pair<RestResponse, OnboardItemObject> createNewItemVersion(String itemId, String itemVersion, String description, User user) throws Exception {
        Config config = Utils.getConfig();
        String url = String.format(
                PathUrls.CREATE_NEW_ITEM_VERSION,
                config.getCatalogBeHost(),
                config.getCatalogBePort(),
                itemId, itemVersion);
        String userId = user.getUserId();
        OnboardItemObject onboardItemObject = new OnboardItemObject();

        onboardItemObject.setCreationMethod("major");
        onboardItemObject.setDescription(description);

        Map<String, String> headersMap = prepareHeadersMap(userId);
        HttpRequest http = new HttpRequest();
        Gson gson = new Gson();
        String body = gson.toJson(onboardItemObject);

        RestResponse response = http.httpSendPost(url, body, headersMap);

        onboardItemObject.setItemId(ResponseParser.getValueFromJsonResponse(response.getResponse(), "id"));
        onboardItemObject.setName(ResponseParser.getValueFromJsonResponse(response.getResponse(), "name"));
        onboardItemObject.setBaseId(ResponseParser.getValueFromJsonResponse(response.getResponse(), "baseId"));
        onboardItemObject.setStatus(ResponseParser.getValueFromJsonResponse(response.getResponse(), "status"));

        return new Pair<>(response, onboardItemObject);
    }

    public static RestResponse updateVendorSoftwareProduct(VendorSoftwareProductObject vendorSoftwareProductObject, User user) throws Exception {
        Config config = Utils.getConfig();
        String url = String.format(
                PathUrls.UPDATE_VENDOR_SOFTWARE_PRODUCT,
                config.getCatalogBeHost(),
                config.getCatalogBePort(),
                vendorSoftwareProductObject.getVspId(),
                vendorSoftwareProductObject.getComponentId());
        String userId = user.getUserId();
        VendorSoftwareProductObject updateVendorSoftwareProductObject = new VendorSoftwareProductObject();

        updateVendorSoftwareProductObject.setName(vendorSoftwareProductObject.getName());
        updateVendorSoftwareProductObject.setDescription(vendorSoftwareProductObject.getDescription());
        updateVendorSoftwareProductObject.setCategory(vendorSoftwareProductObject.getCategory());
        updateVendorSoftwareProductObject.setSubCategory(vendorSoftwareProductObject.getSubCategory());
        updateVendorSoftwareProductObject.setVendorName(vendorSoftwareProductObject.getVendorName());
        updateVendorSoftwareProductObject.setVendorId(vendorSoftwareProductObject.getVendorId());
        updateVendorSoftwareProductObject.setIcon(vendorSoftwareProductObject.getIcon());
        updateVendorSoftwareProductObject.setLicensingData(vendorSoftwareProductObject.getLicensingData());
        updateVendorSoftwareProductObject.setLicensingVersion(vendorSoftwareProductObject.getLicensingVersion());

        Map<String, String> headersMap = prepareHeadersMap(userId);
        HttpRequest http = new HttpRequest();
        Gson gson = new Gson();
        String body = gson.toJson(updateVendorSoftwareProductObject);

        return http.httpSendPut(url, body, headersMap);
    }

}