aboutsummaryrefslogtreecommitdiffstats
path: root/plans/usecases/pnf-sw-upgrade/so/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/CloudRegionsControllerTest.java
blob: 1b96759683e711cbe3fb66d5e8686d525922c08a (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
/*-
 * ============LICENSE_START=======================================================
 *  Copyright (C) 2019 Nordix Foundation.
 * ================================================================================
 * 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.
 *
 * SPDX-License-Identifier: Apache-2.0
 * ============LICENSE_END=========================================================
 */
package org.onap.so.aaisimulator.controller;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.onap.so.aaisimulator.utils.Constants.BI_DIRECTIONAL_RELATIONSHIP_LIST_URL;
import static org.onap.so.aaisimulator.utils.Constants.RELATIONSHIP_LIST_RELATIONSHIP_URL;
import static org.onap.so.aaisimulator.utils.Constants.VSERVER;
import static org.onap.so.aaisimulator.utils.TestConstants.CLOUD_OWNER_NAME;
import static org.onap.so.aaisimulator.utils.TestConstants.CLOUD_REGION_NAME;
import static org.onap.so.aaisimulator.utils.TestConstants.CUSTOMERS_URL;
import static org.onap.so.aaisimulator.utils.TestConstants.ESR_PASSWORD;
import static org.onap.so.aaisimulator.utils.TestConstants.ESR_SERVICE_URL;
import static org.onap.so.aaisimulator.utils.TestConstants.ESR_SYSTEM_INFO_ID;
import static org.onap.so.aaisimulator.utils.TestConstants.ESR_SYSTEM_INFO_LIST_URL;
import static org.onap.so.aaisimulator.utils.TestConstants.ESR_SYSTEM_TYPE;
import static org.onap.so.aaisimulator.utils.TestConstants.ESR_TYEP;
import static org.onap.so.aaisimulator.utils.TestConstants.ESR_USERNAME;
import static org.onap.so.aaisimulator.utils.TestConstants.ESR_VENDOR;
import static org.onap.so.aaisimulator.utils.TestConstants.GENERIC_VNF_NAME;
import static org.onap.so.aaisimulator.utils.TestConstants.GENERIC_VNF_URL;
import static org.onap.so.aaisimulator.utils.TestConstants.SERVICE_INSTANCE_URL;
import static org.onap.so.aaisimulator.utils.TestConstants.SERVICE_SUBSCRIPTIONS_URL;
import static org.onap.so.aaisimulator.utils.TestConstants.SYSTEM_NAME;
import static org.onap.so.aaisimulator.utils.TestConstants.TENANTS_TENANT;
import static org.onap.so.aaisimulator.utils.TestConstants.TENANT_ID;
import static org.onap.so.aaisimulator.utils.TestConstants.VNF_ID;
import static org.onap.so.aaisimulator.utils.TestConstants.VSERVER_ID;
import static org.onap.so.aaisimulator.utils.TestConstants.VSERVER_NAME;
import static org.onap.so.aaisimulator.utils.TestConstants.VSERVER_URL;
import java.io.IOException;
import java.util.List;
import java.util.Optional;
import org.junit.After;
import org.junit.Test;
import org.onap.aai.domain.yang.CloudRegion;
import org.onap.aai.domain.yang.EsrSystemInfo;
import org.onap.aai.domain.yang.EsrSystemInfoList;
import org.onap.aai.domain.yang.GenericVnf;
import org.onap.aai.domain.yang.RelatedToProperty;
import org.onap.aai.domain.yang.Relationship;
import org.onap.aai.domain.yang.RelationshipData;
import org.onap.aai.domain.yang.RelationshipList;
import org.onap.aai.domain.yang.Tenant;
import org.onap.aai.domain.yang.Vserver;
import org.onap.so.aaisimulator.models.CloudRegionKey;
import org.onap.so.aaisimulator.service.providers.CloudRegionCacheServiceProvider;
import org.onap.so.aaisimulator.service.providers.CustomerCacheServiceProvider;
import org.onap.so.aaisimulator.service.providers.GenericVnfCacheServiceProvider;
import org.onap.so.aaisimulator.utils.Constants;
import org.onap.so.aaisimulator.utils.TestConstants;
import org.onap.so.aaisimulator.utils.TestUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;

/**
 * @author Waqas Ikram (waqas.ikram@est.tech)
 *
 */
public class CloudRegionsControllerTest extends AbstractSpringBootTest {

    private static final CloudRegionKey CLOUD_REGION_KEY = new CloudRegionKey(CLOUD_OWNER_NAME, CLOUD_REGION_NAME);

    @Autowired
    private CloudRegionCacheServiceProvider cloudRegionCacheServiceProvider;

    @Autowired
    private CustomerCacheServiceProvider customerCacheServiceProvider;

    @Autowired
    private GenericVnfCacheServiceProvider genericVnfCacheServiceProvider;

    @After
    public void after() {
        cloudRegionCacheServiceProvider.clearAll();
        customerCacheServiceProvider.clearAll();
        genericVnfCacheServiceProvider.clearAll();
    }

    @Test
    public void test_putCloudRegion_successfullyAddedToCache() throws Exception {
        final String url = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME);

        invokeCloudRegionHttpPutEndPointAndAssertResponse(url);

        final ResponseEntity<CloudRegion> response = testRestTemplateService.invokeHttpGet(url, CloudRegion.class);
        assertEquals(HttpStatus.OK, response.getStatusCode());

        assertTrue(response.hasBody());

        final CloudRegion cloudRegion = response.getBody();
        assertEquals(CLOUD_OWNER_NAME, cloudRegion.getCloudOwner());
        assertEquals(CLOUD_REGION_NAME, cloudRegion.getCloudRegionId());

        assertNotNull("ResourceVersion should not be null", cloudRegion.getResourceVersion());

    }

    @Test
    public void test_getCloudRegionWithDepthValue_shouldReturnMatchedCloudRegion() throws Exception {
        final String url = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME);

        invokeCloudRegionHttpPutEndPointAndAssertResponse(url);

        final ResponseEntity<CloudRegion> response =
                testRestTemplateService.invokeHttpGet(url + "?depth=2", CloudRegion.class);
        assertEquals(HttpStatus.OK, response.getStatusCode());

        assertTrue(response.hasBody());

        final CloudRegion cloudRegion = response.getBody();
        assertEquals(CLOUD_OWNER_NAME, cloudRegion.getCloudOwner());
        assertEquals(CLOUD_REGION_NAME, cloudRegion.getCloudRegionId());

        assertNotNull("ResourceVersion should not be null", cloudRegion.getResourceVersion());

    }

    @Test
    public void test_putGenericVnfRelationShipToPlatform_successfullyAddedToCache() throws Exception {

        final String url = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME);

        invokeCloudRegionHttpPutEndPointAndAssertResponse(url);

        final String relationShipUrl = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME,
                BI_DIRECTIONAL_RELATIONSHIP_LIST_URL);

        final ResponseEntity<Relationship> responseEntity = testRestTemplateService.invokeHttpPut(relationShipUrl,
                TestUtils.getGenericVnfRelationShip(), Relationship.class);
        assertEquals(HttpStatus.ACCEPTED, responseEntity.getStatusCode());

        final Optional<CloudRegion> optional = cloudRegionCacheServiceProvider.getCloudRegion(CLOUD_REGION_KEY);
        assertTrue(optional.isPresent());

        final CloudRegion actual = optional.get();

        assertNotNull(actual.getRelationshipList());
        final List<Relationship> relationshipList = actual.getRelationshipList().getRelationship();
        assertFalse("Relationship list should not be empty", relationshipList.isEmpty());
        final Relationship relationship = relationshipList.get(0);

        assertEquals(GENERIC_VNF_URL + VNF_ID, relationship.getRelatedLink());

        assertFalse("RelationshipData list should not be empty", relationship.getRelationshipData().isEmpty());
        assertFalse("RelatedToProperty list should not be empty", relationship.getRelatedToProperty().isEmpty());

        final RelationshipData relationshipData = relationship.getRelationshipData().get(0);
        assertEquals(Constants.GENERIC_VNF_VNF_ID, relationshipData.getRelationshipKey());
        assertEquals(TestConstants.VNF_ID, relationshipData.getRelationshipValue());

        final RelatedToProperty relatedToProperty = relationship.getRelatedToProperty().get(0);
        assertEquals(Constants.GENERIC_VNF_VNF_NAME, relatedToProperty.getPropertyKey());
        assertEquals(TestConstants.GENERIC_VNF_NAME, relatedToProperty.getPropertyValue());

    }

    @Test
    public void test_putTenant_successfullyAddedToCache() throws Exception {
        final String cloudRegionUrl = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME);

        invokeCloudRegionHttpPutEndPointAndAssertResponse(cloudRegionUrl);

        final String tenantUrl = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME,
                "/" + CLOUD_REGION_NAME + TENANTS_TENANT + TENANT_ID);
        addTenantAndAssertResponse(tenantUrl);

        final ResponseEntity<Tenant> response = testRestTemplateService.invokeHttpGet(tenantUrl, Tenant.class);
        assertEquals(HttpStatus.OK, response.getStatusCode());

        assertTrue(response.hasBody());

        final Tenant tenant = response.getBody();
        assertEquals(TENANT_ID, tenant.getTenantId());
        assertEquals("admin", tenant.getTenantName());

        assertNotNull("ResourceVersion should not be null", tenant.getResourceVersion());

    }

    @Test
    public void test_putTenantRelationToGenericVnf_successfullyAddedToCache() throws Exception {

        addCustomerServiceAndGenericVnf();

        final String cloudRegionUrl = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME);
        invokeCloudRegionHttpPutEndPointAndAssertResponse(cloudRegionUrl);

        final String tenantUrl = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME,
                TENANTS_TENANT + TENANT_ID);
        addTenantAndAssertResponse(tenantUrl);

        final String tenantRelationShipUrl = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME,
                "/" + CLOUD_REGION_NAME, TENANTS_TENANT + TENANT_ID, RELATIONSHIP_LIST_RELATIONSHIP_URL);

        final ResponseEntity<Void> tenantRelationShipResponse = testRestTemplateService
                .invokeHttpPut(tenantRelationShipUrl, TestUtils.getGenericVnfRelatedLink(), Void.class);
        assertEquals(HttpStatus.ACCEPTED, tenantRelationShipResponse.getStatusCode());

        final Optional<Tenant> optional = cloudRegionCacheServiceProvider.getTenant(CLOUD_REGION_KEY, TENANT_ID);

        assertTrue(optional.isPresent());
        final Tenant actualTenant = optional.get();
        final RelationshipList relationshipList = actualTenant.getRelationshipList();
        assertNotNull(relationshipList);
        assertFalse(relationshipList.getRelationship().isEmpty());

        final Relationship relationship = relationshipList.getRelationship().get(0);

        assertEquals(Constants.BELONGS_TO, relationship.getRelationshipLabel());
        assertFalse(relationship.getRelationshipData().isEmpty());
        assertEquals(1, relationship.getRelationshipData().size());

        final List<RelationshipData> relationshipDataList = relationship.getRelationshipData();

        final RelationshipData relationshipData =
                getRelationshipData(relationshipDataList, Constants.GENERIC_VNF_VNF_ID);
        assertNotNull(relationshipData);
        assertEquals(VNF_ID, relationshipData.getRelationshipValue());

        final List<RelatedToProperty> relatedToPropertyList = relationship.getRelatedToProperty();

        final RelatedToProperty property = getRelatedToProperty(relatedToPropertyList, Constants.GENERIC_VNF_VNF_NAME);
        assertNotNull(property);
        assertEquals(GENERIC_VNF_NAME, property.getPropertyValue());

        final Optional<GenericVnf> genericVnfOptional = genericVnfCacheServiceProvider.getGenericVnf(VNF_ID);
        assertTrue(genericVnfOptional.isPresent());
        final GenericVnf actualGenericVnf = genericVnfOptional.get();
        final RelationshipList relationshipListGenericVnf = actualGenericVnf.getRelationshipList();
        assertNotNull(relationshipListGenericVnf);
        assertFalse(relationshipListGenericVnf.getRelationship().isEmpty());

        final Relationship relationshipGenericVnf = relationshipListGenericVnf.getRelationship().get(0);

        assertEquals(Constants.BELONGS_TO, relationshipGenericVnf.getRelationshipLabel());
        assertFalse(relationshipGenericVnf.getRelationshipData().isEmpty());
        assertEquals(3, relationshipGenericVnf.getRelationshipData().size());

    }

    @Test
    public void test_putEsrSystemInfo_successfullyAddedToCache() throws Exception {
        final String url = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME);

        invokeCloudRegionHttpPutEndPointAndAssertResponse(url);

        final String esrSystemInfoListUrl = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME,
                "/" + CLOUD_REGION_NAME, ESR_SYSTEM_INFO_LIST_URL);

        final String esrSystemInfoUrl = esrSystemInfoListUrl + "/esr-system-info/" + ESR_SYSTEM_INFO_ID;
        final ResponseEntity<Void> esrSystemInfoResponse =
                testRestTemplateService.invokeHttpPut(esrSystemInfoUrl, TestUtils.getEsrSystemInfo(), Void.class);
        assertEquals(HttpStatus.ACCEPTED, esrSystemInfoResponse.getStatusCode());

        final ResponseEntity<EsrSystemInfoList> response =
                testRestTemplateService.invokeHttpGet(esrSystemInfoListUrl, EsrSystemInfoList.class);
        assertEquals(HttpStatus.OK, response.getStatusCode());

        assertTrue(response.hasBody());
        final EsrSystemInfoList actualEsrSystemInfoList = response.getBody();

        final List<EsrSystemInfo> esrSystemInfoList = actualEsrSystemInfoList.getEsrSystemInfo();
        assertNotNull(esrSystemInfoList);
        assertEquals(1, esrSystemInfoList.size());

        final EsrSystemInfo esrSystemInfo = esrSystemInfoList.get(0);
        assertEquals(ESR_SYSTEM_INFO_ID, esrSystemInfo.getEsrSystemInfoId());
        assertEquals(SYSTEM_NAME, esrSystemInfo.getSystemName());
        assertEquals(ESR_TYEP, esrSystemInfo.getType());
        assertEquals(ESR_VENDOR, esrSystemInfo.getVendor());
        assertEquals(ESR_SERVICE_URL, esrSystemInfo.getServiceUrl());
        assertEquals(ESR_USERNAME, esrSystemInfo.getUserName());
        assertEquals(ESR_PASSWORD, esrSystemInfo.getPassword());
        assertEquals(ESR_SYSTEM_TYPE, esrSystemInfo.getSystemType());
    }

    @Test
    public void test_putVServer_successfullyAddedToCache() throws Exception {
        final String url = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME);

        invokeCloudRegionHttpPutEndPointAndAssertResponse(url);
        addCustomerServiceAndGenericVnf();

        final String tenantUrl = url + TENANTS_TENANT + TENANT_ID;
        addTenantAndAssertResponse(tenantUrl);

        final String vServerUrl = tenantUrl + VSERVER_URL + VSERVER_ID;

        final ResponseEntity<Void> vServerResponse =
                testRestTemplateService.invokeHttpPut(vServerUrl, TestUtils.getVserver(), Void.class);
        assertEquals(HttpStatus.ACCEPTED, vServerResponse.getStatusCode());

        final ResponseEntity<Vserver> response = testRestTemplateService.invokeHttpGet(vServerUrl, Vserver.class);
        assertEquals(HttpStatus.OK, response.getStatusCode());

        assertTrue(response.hasBody());
        final Vserver actualVserver = response.getBody();
        assertEquals(VSERVER_NAME, actualVserver.getVserverName());
        assertEquals(VSERVER_ID, actualVserver.getVserverId());
        assertEquals("active", actualVserver.getProvStatus());
        assertNotNull(actualVserver.getRelationshipList());
        assertFalse(actualVserver.getRelationshipList().getRelationship().isEmpty());

        final Optional<GenericVnf> optional = genericVnfCacheServiceProvider.getGenericVnf(VNF_ID);
        assertTrue(optional.isPresent());
        final GenericVnf genericVnf = optional.get();
        assertNotNull(genericVnf.getRelationshipList());
        assertFalse(genericVnf.getRelationshipList().getRelationship().isEmpty());

        final Relationship expectedRelationShip = genericVnf.getRelationshipList().getRelationship().get(0);
        assertEquals(VSERVER, expectedRelationShip.getRelatedTo());
        assertNotNull(expectedRelationShip.getRelationshipData());
        assertEquals(4, expectedRelationShip.getRelationshipData().size());

        final List<RelationshipData> relationshipDataList = expectedRelationShip.getRelationshipData();
        final RelationshipData vServerrelationshipData =
                getRelationshipData(relationshipDataList, Constants.VSERVER_VSERVER_ID);
        assertNotNull(vServerrelationshipData);
        assertEquals(VSERVER_ID, vServerrelationshipData.getRelationshipValue());

        final RelationshipData cloudOwnerRelationshipData =
                getRelationshipData(relationshipDataList, Constants.CLOUD_REGION_CLOUD_OWNER);
        assertNotNull(cloudOwnerRelationshipData);
        assertEquals(CLOUD_OWNER_NAME, cloudOwnerRelationshipData.getRelationshipValue());

        final RelationshipData cloudRegionIdRelationshipData =
                getRelationshipData(relationshipDataList, Constants.CLOUD_REGION_CLOUD_REGION_ID);
        assertNotNull(cloudRegionIdRelationshipData);
        assertEquals(CLOUD_REGION_NAME, cloudRegionIdRelationshipData.getRelationshipValue());

        final RelationshipData tenantRelationshipData =
                getRelationshipData(relationshipDataList, Constants.TENANT_TENANT_ID);
        assertNotNull(tenantRelationshipData);
        assertEquals(TENANT_ID, tenantRelationshipData.getRelationshipValue());

    }

    @Test
    public void test_deleteVServer_successfullyRemoveFromCache() throws Exception {
        final String url = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME);

        invokeCloudRegionHttpPutEndPointAndAssertResponse(url);
        addCustomerServiceAndGenericVnf();

        final String tenantUrl = url + TENANTS_TENANT + TENANT_ID;
        addTenantAndAssertResponse(tenantUrl);

        final String vServerAddUrl = tenantUrl + VSERVER_URL + VSERVER_ID;

        final ResponseEntity<Void> vServerAddResponse =
                testRestTemplateService.invokeHttpPut(vServerAddUrl, TestUtils.getVserver(), Void.class);
        assertEquals(HttpStatus.ACCEPTED, vServerAddResponse.getStatusCode());

        final Optional<Vserver> optional =
                cloudRegionCacheServiceProvider.getVserver(CLOUD_REGION_KEY, TENANT_ID, VSERVER_ID);
        assertTrue(optional.isPresent());
        final Vserver vserver = optional.get();

        final String vServerRemoveUrl = vServerAddUrl + "?resource-version=" + vserver.getResourceVersion();

        final ResponseEntity<Void> responseEntity =
                testRestTemplateService.invokeHttpDelete(vServerRemoveUrl, Void.class);
        assertEquals(HttpStatus.NO_CONTENT, responseEntity.getStatusCode());
        assertFalse(cloudRegionCacheServiceProvider.getVserver(CLOUD_REGION_KEY, TENANT_ID, VSERVER_ID).isPresent());


    }

    private void addTenantAndAssertResponse(final String tenantUrl) throws IOException {
        final ResponseEntity<Void> responseEntity =
                testRestTemplateService.invokeHttpPut(tenantUrl, TestUtils.getTenant(), Void.class);
        assertEquals(HttpStatus.ACCEPTED, responseEntity.getStatusCode());
    }

    private void addCustomerServiceAndGenericVnf() throws Exception, IOException {
        final ResponseEntity<Void> customerResponse =
                testRestTemplateService.invokeHttpPut(getUrl(CUSTOMERS_URL), TestUtils.getCustomer(), Void.class);
        assertEquals(HttpStatus.ACCEPTED, customerResponse.getStatusCode());

        final String serviceInstanceUrl = getUrl(CUSTOMERS_URL, SERVICE_SUBSCRIPTIONS_URL, SERVICE_INSTANCE_URL);
        final ResponseEntity<Void> serviceInstanceResponse =
                testRestTemplateService.invokeHttpPut(serviceInstanceUrl, TestUtils.getServiceInstance(), Void.class);
        assertEquals(HttpStatus.ACCEPTED, serviceInstanceResponse.getStatusCode());

        final String genericVnfUrl = getUrl(GENERIC_VNF_URL, VNF_ID);
        final ResponseEntity<Void> genericVnfResponse =
                testRestTemplateService.invokeHttpPut(genericVnfUrl, TestUtils.getGenericVnf(), Void.class);
        assertEquals(HttpStatus.ACCEPTED, genericVnfResponse.getStatusCode());

    }

    private void invokeCloudRegionHttpPutEndPointAndAssertResponse(final String url) throws IOException {
        final ResponseEntity<Void> responseEntity =
                testRestTemplateService.invokeHttpPut(url, TestUtils.getCloudRegion(), Void.class);
        assertEquals(HttpStatus.ACCEPTED, responseEntity.getStatusCode());
    }

}