2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2019 Nordix Foundation.
4 * ================================================================================
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 * SPDX-License-Identifier: Apache-2.0
18 * ============LICENSE_END=========================================================
20 package org.onap.so.sdncsimulator.controller;
22 import static org.junit.Assert.assertEquals;
23 import static org.junit.Assert.assertFalse;
24 import static org.junit.Assert.assertNotNull;
25 import static org.junit.Assert.assertTrue;
26 import static org.onap.sdnc.northbound.client.model.GenericResourceApiRpcActionEnumeration.ASSIGN;
27 import static org.onap.sdnc.northbound.client.model.GenericResourceApiRpcActionEnumeration.DEACTIVATE;
28 import static org.onap.so.sdncsimulator.controller.TestUtils.getInvalidRequestInput;
29 import static org.onap.so.sdncsimulator.controller.TestUtils.getRequestInput;
30 import static org.onap.so.sdncsimulator.controller.TestUtils.getServiceRequestWithRequestActionDeleteServiceAndSvcActionDeactivateInput;
31 import static org.onap.so.sdncsimulator.controller.TestUtils.getServiceRequestWithRequestActionDeleteServiceInput;
32 import static org.onap.so.sdncsimulator.controller.TestUtils.getVnfRequestInput;
33 import static org.onap.so.sdncsimulator.controller.TestUtils.getVnfRequestWithRequestActionDeleteVnfInput;
34 import static org.onap.so.sdncsimulator.controller.TestUtils.getVnfRequestWithSvcActionActivateInput;
35 import java.util.Optional;
36 import org.junit.After;
37 import org.junit.Test;
38 import org.junit.runner.RunWith;
39 import org.onap.sdnc.northbound.client.model.GenericResourceApiInstanceReference;
40 import org.onap.sdnc.northbound.client.model.GenericResourceApiLastRpcActionEnumeration;
41 import org.onap.sdnc.northbound.client.model.GenericResourceApiOperStatusData;
42 import org.onap.sdnc.northbound.client.model.GenericResourceApiServicedataServicedataVnfsVnf;
43 import org.onap.sdnc.northbound.client.model.GenericResourceApiServicemodelinfrastructureService;
44 import org.onap.so.sdncsimulator.models.InputRequest;
45 import org.onap.so.sdncsimulator.models.Output;
46 import org.onap.so.sdncsimulator.models.OutputRequest;
47 import org.onap.so.sdncsimulator.providers.ServiceOperationsCacheServiceProvider;
48 import org.onap.so.sdncsimulator.utils.Constants;
49 import org.onap.so.simulator.model.UserCredentials;
50 import org.springframework.beans.factory.annotation.Autowired;
51 import org.springframework.boot.test.context.SpringBootTest;
52 import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
53 import org.springframework.boot.test.web.client.TestRestTemplate;
54 import org.springframework.boot.web.server.LocalServerPort;
55 import org.springframework.context.annotation.Configuration;
56 import org.springframework.http.HttpEntity;
57 import org.springframework.http.HttpHeaders;
58 import org.springframework.http.HttpMethod;
59 import org.springframework.http.HttpStatus;
60 import org.springframework.http.ResponseEntity;
61 import org.springframework.test.context.ActiveProfiles;
62 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
65 * @author Waqas Ikram (waqas.ikram@est.tech)
68 @RunWith(SpringJUnit4ClassRunner.class)
69 @ActiveProfiles("test")
70 @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
72 public class OperationsControllerTest {
74 private static final String HTTP_STATUS_BAD_REQUEST = Integer.toString(HttpStatus.BAD_REQUEST.value());
75 private static final String HTTP_STATUS_OK = Integer.toString(HttpStatus.OK.value());
77 private static final String SVC_REQUEST_ID = "04fc9f50-87b8-430d-a232-ef24bd6c4150";
79 private static final String VNF_SVC_REQUEST_ID = "8fd2622b-01fc-424d-bfc8-f48bcd64e546";
81 private static final String SERVICE_INSTANCE_ID = "ccece8fe-13da-456a-baf6-41b3a4a2bc2b";
83 private static final String SERVICE_TOPOLOGY_OPERATION_URL = "/GENERIC-RESOURCE-API:service-topology-operation/";
85 private static final String VNF_TOPOLOGY_OPERATION_URL = "/GENERIC-RESOURCE-API:vnf-topology-operation/";
87 private static final String VNF_INSTANCE_ID = "dfd02fb5-d7fb-4aac-b3c4-cd6b60058701";
93 private TestRestTemplate restTemplate;
96 private ServiceOperationsCacheServiceProvider cacheServiceProvider;
99 private UserCredentials userCredentials;
103 public void test_postServiceOperationInformation_successfullyAddedToCache() throws Exception {
105 final HttpEntity<?> httpEntity = new HttpEntity<>(getRequestInput(), getHttpHeaders());
106 final ResponseEntity<OutputRequest> responseEntity =
107 restTemplate.exchange(getUrl(), HttpMethod.POST, httpEntity, OutputRequest.class);
109 assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
110 assertTrue(responseEntity.hasBody());
112 final OutputRequest actualOutputRequest = responseEntity.getBody();
113 assertNotNull(actualOutputRequest);
115 final Output actualObject = actualOutputRequest.getOutput();
117 assertNotNull(actualObject);
118 assertEquals(HTTP_STATUS_OK, actualObject.getResponseCode());
119 assertEquals(Constants.YES, actualObject.getAckFinalIndicator());
120 assertEquals(SVC_REQUEST_ID, actualObject.getSvcRequestId());
121 assertNotNull(actualObject.getServiceResponseInformation());
123 final GenericResourceApiInstanceReference acutalReference = actualObject.getServiceResponseInformation();
124 assertEquals(Constants.RESTCONF_CONFIG_END_POINT + SERVICE_INSTANCE_ID, acutalReference.getObjectPath());
125 assertEquals(SERVICE_INSTANCE_ID, acutalReference.getInstanceId());
126 final Optional<GenericResourceApiServicemodelinfrastructureService> optional =
127 cacheServiceProvider.getGenericResourceApiServicemodelinfrastructureService(SERVICE_INSTANCE_ID);
128 assertTrue(optional.isPresent());
130 final GenericResourceApiServicemodelinfrastructureService service = optional.get();
131 assertNotNull(service.getServiceInstanceId());
132 assertEquals(SERVICE_INSTANCE_ID, service.getServiceInstanceId());
133 assertNotNull(service.getServiceData());
134 assertNotNull(service.getServiceStatus());
139 public void test_postServiceOperationInformation_NullInputRequest_badRequest() throws Exception {
141 final HttpEntity<?> httpEntity = new HttpEntity<>(new InputRequest<>(), getHttpHeaders());
142 final ResponseEntity<OutputRequest> responseEntity =
143 restTemplate.exchange(getUrl(), HttpMethod.POST, httpEntity, OutputRequest.class);
145 assertEquals(HttpStatus.BAD_REQUEST, responseEntity.getStatusCode());
149 public void test_postServiceOperationInformation_NullServiceInstanceId_badRequest() throws Exception {
151 final HttpEntity<?> httpEntity = new HttpEntity<>(getInvalidRequestInput(), getHttpHeaders());
152 final ResponseEntity<OutputRequest> responseEntity =
153 restTemplate.exchange(getUrl(), HttpMethod.POST, httpEntity, OutputRequest.class);
155 assertEquals(HttpStatus.BAD_REQUEST, responseEntity.getStatusCode());
156 assertTrue(responseEntity.hasBody());
158 final OutputRequest actualOutputRequest = responseEntity.getBody();
159 assertNotNull(actualOutputRequest);
161 final Output actualObject = actualOutputRequest.getOutput();
162 assertNotNull(actualObject);
163 assertEquals(HTTP_STATUS_BAD_REQUEST, actualObject.getResponseCode());
164 assertEquals(SVC_REQUEST_ID, actualObject.getSvcRequestId());
165 assertEquals(Constants.YES, actualObject.getAckFinalIndicator());
170 public void test_postVnfOperationInformation_successfullyAddToExistingServiceInCache() throws Exception {
171 final HttpEntity<?> httpEntity = new HttpEntity<>(getRequestInput(), getHttpHeaders());
172 final ResponseEntity<OutputRequest> responseEntity =
173 restTemplate.exchange(getUrl(), HttpMethod.POST, httpEntity, OutputRequest.class);
175 assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
177 final HttpEntity<?> httpVnfEntity = new HttpEntity<>(getVnfRequestInput(), getHttpHeaders());
178 final ResponseEntity<OutputRequest> responseVnfEntity =
179 restTemplate.exchange(getVnfUrl(), HttpMethod.POST, httpVnfEntity, OutputRequest.class);
180 assertEquals(HttpStatus.OK, responseVnfEntity.getStatusCode());
181 assertTrue(responseVnfEntity.hasBody());
183 final OutputRequest actualOutputRequest = responseVnfEntity.getBody();
184 assertNotNull(actualOutputRequest);
185 assertNotNull(actualOutputRequest.getOutput());
187 final Output actualObject = actualOutputRequest.getOutput();
189 assertEquals(HTTP_STATUS_OK, actualObject.getResponseCode());
190 assertEquals(Constants.YES, actualObject.getAckFinalIndicator());
191 assertEquals(VNF_SVC_REQUEST_ID, actualObject.getSvcRequestId());
192 assertNotNull(actualObject.getServiceResponseInformation());
194 final GenericResourceApiInstanceReference acutalReference = actualObject.getServiceResponseInformation();
195 assertEquals(Constants.RESTCONF_CONFIG_END_POINT + SERVICE_INSTANCE_ID, acutalReference.getObjectPath());
196 assertEquals(SERVICE_INSTANCE_ID, acutalReference.getInstanceId());
197 final Optional<GenericResourceApiServicemodelinfrastructureService> optional =
198 cacheServiceProvider.getGenericResourceApiServicemodelinfrastructureService(SERVICE_INSTANCE_ID);
199 assertTrue(optional.isPresent());
201 final GenericResourceApiInstanceReference actualvnfInformation = actualObject.getVnfResponseInformation();
202 assertEquals(VNF_INSTANCE_ID, actualvnfInformation.getInstanceId());
204 final Optional<GenericResourceApiServicemodelinfrastructureService> serviceOptional =
205 cacheServiceProvider.getGenericResourceApiServicemodelinfrastructureService(SERVICE_INSTANCE_ID);
206 assertTrue(serviceOptional.isPresent());
208 final GenericResourceApiServicemodelinfrastructureService service = serviceOptional.get();
209 assertNotNull(service.getServiceInstanceId());
210 assertNotNull(service.getServiceData().getVnfs().getVnf());
211 assertNotNull(service.getServiceData());
212 assertNotNull(service.getServiceData().getVnfs());
213 assertNotNull(service.getServiceData().getVnfs().getVnf());
214 assertEquals(1, service.getServiceData().getVnfs().getVnf().size());
215 final GenericResourceApiServicedataServicedataVnfsVnf vnf = service.getServiceData().getVnfs().getVnf().get(0);
216 assertNotNull(vnf.getVnfId());
217 assertEquals(VNF_INSTANCE_ID, vnf.getVnfId());
218 assertNotNull(vnf.getVnfData());
222 public void test_postSameVnfOperationInformationTwice_ShouldReturnbadRequest() throws Exception {
224 final HttpEntity<?> httpEntity = new HttpEntity<>(getRequestInput(), getHttpHeaders());
225 final ResponseEntity<OutputRequest> responseEntity =
226 restTemplate.exchange(getUrl(), HttpMethod.POST, httpEntity, OutputRequest.class);
228 assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
230 final HttpEntity<?> httpVnfEntity = new HttpEntity<>(getVnfRequestInput(), getHttpHeaders());
231 final ResponseEntity<OutputRequest> responseVnfEntity =
232 restTemplate.exchange(getVnfUrl(), HttpMethod.POST, httpVnfEntity, OutputRequest.class);
233 assertEquals(HttpStatus.OK, responseVnfEntity.getStatusCode());
234 assertTrue(responseVnfEntity.hasBody());
236 final OutputRequest actualOutputRequest = responseVnfEntity.getBody();
237 assertNotNull(actualOutputRequest);
238 assertNotNull(actualOutputRequest.getOutput());
240 final ResponseEntity<OutputRequest> badResponse =
241 restTemplate.exchange(getVnfUrl(), HttpMethod.POST, httpVnfEntity, OutputRequest.class);
243 final OutputRequest badOutputRequest = badResponse.getBody();
244 assertNotNull(badOutputRequest);
246 final Output actualObject = badOutputRequest.getOutput();
247 assertNotNull(actualObject);
248 assertEquals(HTTP_STATUS_BAD_REQUEST, actualObject.getResponseCode());
249 assertEquals(VNF_SVC_REQUEST_ID, actualObject.getSvcRequestId());
250 assertEquals(Constants.YES, actualObject.getAckFinalIndicator());
255 public void test_postVnfOperationInformationWithSvcActionChanged_successfullyAddToExistingServiceInCache()
257 final HttpEntity<?> httpEntity = new HttpEntity<>(getRequestInput(), getHttpHeaders());
258 final ResponseEntity<OutputRequest> responseEntity =
259 restTemplate.exchange(getUrl(), HttpMethod.POST, httpEntity, OutputRequest.class);
261 assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
263 final HttpEntity<?> httpVnfWithSvcActionAssignEntity = new HttpEntity<>(getVnfRequestInput(), getHttpHeaders());
264 final ResponseEntity<OutputRequest> response = restTemplate.exchange(getVnfUrl(), HttpMethod.POST,
265 httpVnfWithSvcActionAssignEntity, OutputRequest.class);
266 assertEquals(HttpStatus.OK, response.getStatusCode());
267 assertTrue(response.hasBody());
269 final HttpEntity<?> httpVnfEntity =
270 new HttpEntity<>(getVnfRequestWithSvcActionActivateInput(), getHttpHeaders());
271 final ResponseEntity<OutputRequest> responseVnfEntity =
272 restTemplate.exchange(getVnfUrl(), HttpMethod.POST, httpVnfEntity, OutputRequest.class);
273 assertEquals(HttpStatus.OK, responseVnfEntity.getStatusCode());
274 assertTrue(responseVnfEntity.hasBody());
276 final OutputRequest actualOutputRequest = responseVnfEntity.getBody();
277 assertNotNull(actualOutputRequest);
278 assertNotNull(actualOutputRequest.getOutput());
280 final Output actualObject = actualOutputRequest.getOutput();
282 assertEquals(HTTP_STATUS_OK, actualObject.getResponseCode());
283 assertEquals(Constants.YES, actualObject.getAckFinalIndicator());
284 assertEquals(VNF_SVC_REQUEST_ID, actualObject.getSvcRequestId());
285 assertNotNull(actualObject.getServiceResponseInformation());
287 final GenericResourceApiInstanceReference acutalReference = actualObject.getServiceResponseInformation();
288 assertEquals(Constants.RESTCONF_CONFIG_END_POINT + SERVICE_INSTANCE_ID, acutalReference.getObjectPath());
289 assertEquals(SERVICE_INSTANCE_ID, acutalReference.getInstanceId());
290 final Optional<GenericResourceApiServicemodelinfrastructureService> optional =
291 cacheServiceProvider.getGenericResourceApiServicemodelinfrastructureService(SERVICE_INSTANCE_ID);
292 assertTrue(optional.isPresent());
294 final GenericResourceApiInstanceReference actualvnfInformation = actualObject.getVnfResponseInformation();
295 assertEquals(VNF_INSTANCE_ID, actualvnfInformation.getInstanceId());
297 final Optional<GenericResourceApiServicemodelinfrastructureService> serviceOptional =
298 cacheServiceProvider.getGenericResourceApiServicemodelinfrastructureService(SERVICE_INSTANCE_ID);
299 assertTrue(serviceOptional.isPresent());
301 final GenericResourceApiServicemodelinfrastructureService service = serviceOptional.get();
302 assertNotNull(service.getServiceInstanceId());
303 assertNotNull(service.getServiceData().getVnfs().getVnf());
304 assertNotNull(service.getServiceData());
305 assertNotNull(service.getServiceData().getVnfs());
306 assertNotNull(service.getServiceData().getVnfs().getVnf());
307 assertEquals(1, service.getServiceData().getVnfs().getVnf().size());
308 final GenericResourceApiServicedataServicedataVnfsVnf vnf = service.getServiceData().getVnfs().getVnf().get(0);
309 assertNotNull(vnf.getVnfId());
310 assertEquals(VNF_INSTANCE_ID, vnf.getVnfId());
311 assertNotNull(vnf.getVnfData());
312 final GenericResourceApiOperStatusData vnfLevelOperStatus = vnf.getVnfData().getVnfLevelOperStatus();
313 assertNotNull(vnfLevelOperStatus);
314 assertEquals(GenericResourceApiLastRpcActionEnumeration.ACTIVATE, vnfLevelOperStatus.getLastRpcAction());
319 public void test_postVnfOperationInformation_successfullyRemoveVnfFromExistingServiceInCache() throws Exception {
320 final HttpEntity<?> httpEntity = new HttpEntity<>(getRequestInput(), getHttpHeaders());
321 final ResponseEntity<OutputRequest> responseEntity =
322 restTemplate.exchange(getUrl(), HttpMethod.POST, httpEntity, OutputRequest.class);
324 assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
326 final HttpEntity<?> httpAddVnfEntity = new HttpEntity<>(getVnfRequestInput(), getHttpHeaders());
327 final ResponseEntity<OutputRequest> responseAddVnfEntity =
328 restTemplate.exchange(getVnfUrl(), HttpMethod.POST, httpAddVnfEntity, OutputRequest.class);
329 assertEquals(HttpStatus.OK, responseAddVnfEntity.getStatusCode());
331 Optional<GenericResourceApiServicemodelinfrastructureService> serviceOptional =
332 cacheServiceProvider.getGenericResourceApiServicemodelinfrastructureService(SERVICE_INSTANCE_ID);
333 assertTrue(serviceOptional.isPresent());
335 GenericResourceApiServicemodelinfrastructureService service = serviceOptional.get();
336 assertNotNull(service.getServiceInstanceId());
337 assertNotNull(service.getServiceData().getVnfs().getVnf());
338 assertNotNull(service.getServiceData());
339 assertNotNull(service.getServiceData().getVnfs());
340 assertNotNull(service.getServiceData().getVnfs().getVnf());
341 assertFalse(service.getServiceData().getVnfs().getVnf().isEmpty());
343 final HttpEntity<?> httpRemoveVnfEntity =
344 new HttpEntity<>(getVnfRequestWithRequestActionDeleteVnfInput(), getHttpHeaders());
345 final ResponseEntity<OutputRequest> responseRemoveVnfEntity =
346 restTemplate.exchange(getVnfUrl(), HttpMethod.POST, httpRemoveVnfEntity, OutputRequest.class);
347 assertEquals(HttpStatus.OK, responseRemoveVnfEntity.getStatusCode());
349 final OutputRequest actualOutputRequest = responseRemoveVnfEntity.getBody();
350 assertNotNull(actualOutputRequest);
351 assertNotNull(actualOutputRequest.getOutput());
353 final Output actualObject = actualOutputRequest.getOutput();
355 assertEquals(HTTP_STATUS_OK, actualObject.getResponseCode());
356 assertEquals(Constants.YES, actualObject.getAckFinalIndicator());
357 assertEquals(VNF_SVC_REQUEST_ID, actualObject.getSvcRequestId());
360 cacheServiceProvider.getGenericResourceApiServicemodelinfrastructureService(SERVICE_INSTANCE_ID);
361 assertTrue(serviceOptional.isPresent());
363 service = serviceOptional.get();
364 assertNotNull(service.getServiceInstanceId());
365 assertNotNull(service.getServiceData().getVnfs().getVnf());
366 assertNotNull(service.getServiceData());
367 assertNotNull(service.getServiceData().getVnfs());
368 assertNotNull(service.getServiceData().getVnfs().getVnf());
369 assertTrue(service.getServiceData().getVnfs().getVnf().isEmpty());
375 public void test_postServiceOperationInformation_withActionDeleteServiceInstance_successfullyRemoveServiceFromExistingServiceInCache()
377 final HttpEntity<?> httpEntity = new HttpEntity<>(getRequestInput(), getHttpHeaders());
378 final ResponseEntity<OutputRequest> responseEntity =
379 restTemplate.exchange(getUrl(), HttpMethod.POST, httpEntity, OutputRequest.class);
381 assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
382 Optional<GenericResourceApiServicemodelinfrastructureService> serviceOptional =
383 cacheServiceProvider.getGenericResourceApiServicemodelinfrastructureService(SERVICE_INSTANCE_ID);
384 assertTrue(serviceOptional.isPresent());
386 final GenericResourceApiServicemodelinfrastructureService service = serviceOptional.get();
387 assertNotNull(service.getServiceInstanceId());
389 final HttpEntity<?> httpRemoveServiceEntity =
390 new HttpEntity<>(getServiceRequestWithRequestActionDeleteServiceInput(), getHttpHeaders());
391 final ResponseEntity<OutputRequest> responseRemoveServiceEntity =
392 restTemplate.exchange(getUrl(), HttpMethod.POST, httpRemoveServiceEntity, OutputRequest.class);
393 assertEquals(HttpStatus.OK, responseRemoveServiceEntity.getStatusCode());
395 final OutputRequest actualOutputRequest = responseRemoveServiceEntity.getBody();
396 assertNotNull(actualOutputRequest);
397 assertNotNull(actualOutputRequest.getOutput());
399 final Output actualObject = actualOutputRequest.getOutput();
401 assertEquals(HTTP_STATUS_OK, actualObject.getResponseCode());
402 assertEquals(Constants.YES, actualObject.getAckFinalIndicator());
403 assertEquals(SVC_REQUEST_ID, actualObject.getSvcRequestId());
406 cacheServiceProvider.getGenericResourceApiServicemodelinfrastructureService(SERVICE_INSTANCE_ID);
407 assertFalse(serviceOptional.isPresent());
412 public void test_postServiceOperationInformation_withActionDeleteServiceInstanceAndSvcActionDeactivate_successfullyUpdateExistingServiceInCache()
415 final HttpEntity<?> httpEntity = new HttpEntity<>(getRequestInput(), getHttpHeaders());
416 final ResponseEntity<OutputRequest> responseEntity =
417 restTemplate.exchange(getUrl(), HttpMethod.POST, httpEntity, OutputRequest.class);
419 assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
420 Optional<GenericResourceApiServicemodelinfrastructureService> serviceOptional =
421 cacheServiceProvider.getGenericResourceApiServicemodelinfrastructureService(SERVICE_INSTANCE_ID);
422 assertTrue(serviceOptional.isPresent());
424 GenericResourceApiServicemodelinfrastructureService service = serviceOptional.get();
425 assertNotNull(service.getServiceInstanceId());
426 assertNotNull(service.getServiceStatus());
427 assertEquals(ASSIGN, service.getServiceStatus().getRpcAction());
429 final HttpEntity<?> entity = new HttpEntity<>(
430 getServiceRequestWithRequestActionDeleteServiceAndSvcActionDeactivateInput(), getHttpHeaders());
431 final ResponseEntity<OutputRequest> deactivateResponseEntity =
432 restTemplate.exchange(getUrl(), HttpMethod.POST, entity, OutputRequest.class);
433 assertEquals(HttpStatus.OK, deactivateResponseEntity.getStatusCode());
435 final OutputRequest actualOutputRequest = deactivateResponseEntity.getBody();
436 assertNotNull(actualOutputRequest);
437 assertNotNull(actualOutputRequest.getOutput());
439 final Output actualObject = actualOutputRequest.getOutput();
441 assertEquals(HTTP_STATUS_OK, actualObject.getResponseCode());
442 assertEquals(Constants.YES, actualObject.getAckFinalIndicator());
443 assertEquals(SVC_REQUEST_ID, actualObject.getSvcRequestId());
446 cacheServiceProvider.getGenericResourceApiServicemodelinfrastructureService(SERVICE_INSTANCE_ID);
447 assertTrue(serviceOptional.isPresent());
448 service = serviceOptional.get();
449 assertNotNull(service.getServiceStatus());
450 assertEquals(DEACTIVATE, service.getServiceStatus().getRpcAction());
454 private HttpHeaders getHttpHeaders() {
455 return TestUtils.getHttpHeaders(userCredentials.getUsers().iterator().next().getUsername());
458 private String getUrl() {
459 return "http://localhost:" + port + Constants.OPERATIONS_URL + SERVICE_TOPOLOGY_OPERATION_URL;
462 private String getVnfUrl() {
463 return "http://localhost:" + port + Constants.OPERATIONS_URL + VNF_TOPOLOGY_OPERATION_URL;
467 public void after() {
468 cacheServiceProvider.clearAll();