2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.so.bpmn.infrastructure.aai.tasks;
23 import static org.junit.Assert.assertEquals;
24 import static org.mockito.Matchers.any;
25 import static org.mockito.Matchers.eq;
26 import static org.mockito.Mockito.doNothing;
27 import static org.mockito.Mockito.doReturn;
28 import static org.mockito.Mockito.doThrow;
29 import static org.mockito.Mockito.mock;
30 import static org.mockito.Mockito.spy;
31 import static org.mockito.Mockito.times;
32 import static org.mockito.Mockito.verify;
33 import static org.mockito.Mockito.when;
35 import java.util.HashMap;
37 import org.camunda.bpm.engine.delegate.BpmnError;
38 import org.hamcrest.Matchers;
39 import org.junit.Before;
40 import org.junit.Test;
41 import org.mockito.Mockito;
42 import org.onap.so.adapters.nwrest.CreateNetworkResponse;
43 import org.onap.so.bpmn.BaseTaskTest;
44 import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
45 import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration;
46 import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
47 import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network;
48 import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
49 import org.onap.so.bpmn.servicedecomposition.bbobjects.Subnet;
50 import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
51 import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup;
52 import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf;
53 import org.onap.so.db.catalog.beans.OrchestrationStatus;
54 import org.springframework.beans.factory.annotation.Autowired;
56 public class AAIUpdateTasksTest extends BaseTaskTest{
58 private AAIUpdateTasks aaiUpdateTasks;
60 private L3Network network;
61 private ServiceInstance serviceInstance;
62 private VfModule vfModule;
63 private GenericVnf genericVnf;
64 private VolumeGroup volumeGroup;
65 private CloudRegion cloudRegion;
66 private Configuration configuration;
67 private Subnet subnet;
70 public void before() {
71 serviceInstance = setServiceInstance();
72 genericVnf = setGenericVnf();
73 vfModule = setVfModule();
74 volumeGroup = setVolumeGroup();
75 cloudRegion = setCloudRegion();
76 network = setL3Network();
77 configuration = setConfiguration();
78 subnet = buildSubnet();
82 public void updateOrchestrationStatusAssignedServiceTest() throws Exception {
83 doNothing().when(aaiServiceInstanceResources).updateOrchestrationStatusServiceInstance(serviceInstance, OrchestrationStatus.ASSIGNED);
85 aaiUpdateTasks.updateOrchestrationStatusAssignedService(execution);
87 verify(aaiServiceInstanceResources, times(1)).updateOrchestrationStatusServiceInstance(serviceInstance, OrchestrationStatus.ASSIGNED);
91 public void updateOrchestrationStatusAssignedServiceExceptionTest() throws Exception {
92 expectedException.expect(BpmnError.class);
94 doThrow(Exception.class).when(aaiServiceInstanceResources).updateOrchestrationStatusServiceInstance(serviceInstance, OrchestrationStatus.ASSIGNED);
96 aaiUpdateTasks.updateOrchestrationStatusAssignedService(execution);
100 public void updateOrchestrationStatusActiveServiceTest() throws Exception {
101 doNothing().when(aaiServiceInstanceResources).updateOrchestrationStatusServiceInstance(serviceInstance, OrchestrationStatus.ACTIVE);
103 aaiUpdateTasks.updateOrchestrationStatusActiveService(execution);
105 verify(aaiServiceInstanceResources, times(1)).updateOrchestrationStatusServiceInstance(serviceInstance, OrchestrationStatus.ACTIVE);
109 public void updateOrchestrationStatusActiveServiceExceptionTest() throws Exception {
110 expectedException.expect(BpmnError.class);
112 doThrow(Exception.class).when(aaiServiceInstanceResources).updateOrchestrationStatusServiceInstance(serviceInstance, OrchestrationStatus.ACTIVE);
114 aaiUpdateTasks.updateOrchestrationStatusActiveService(execution);
118 public void updateOrchestrationStatusAssignedVnfTest() throws Exception {
119 doNothing().when(aaiVnfResources).updateOrchestrationStatusVnf(genericVnf, OrchestrationStatus.ASSIGNED);
121 aaiUpdateTasks.updateOrchestrationStatusAssignedVnf(execution);
123 verify(aaiVnfResources, times(1)).updateOrchestrationStatusVnf(genericVnf, OrchestrationStatus.ASSIGNED);
127 public void updateOrchestrationStatusAssignedVnfExceptionTest() throws Exception {
128 expectedException.expect(BpmnError.class);
130 doThrow(Exception.class).when(aaiVnfResources).updateOrchestrationStatusVnf(genericVnf, OrchestrationStatus.ASSIGNED);
132 aaiUpdateTasks.updateOrchestrationStatusAssignedVnf(execution);
136 public void updateOrchestrationStatusActiveVnfTest() throws Exception {
137 doNothing().when(aaiVnfResources).updateOrchestrationStatusVnf(genericVnf, OrchestrationStatus.ACTIVE);
139 aaiUpdateTasks.updateOrchestrationStatusActiveVnf(execution);
141 verify(aaiVnfResources, times(1)).updateOrchestrationStatusVnf(genericVnf, OrchestrationStatus.ACTIVE);
145 public void updateOrchestrationStatusActiveVnfExceptionTest() throws Exception {
146 expectedException.expect(BpmnError.class);
148 doThrow(Exception.class).when(aaiVnfResources).updateOrchestrationStatusVnf(genericVnf, OrchestrationStatus.ACTIVE);
150 aaiUpdateTasks.updateOrchestrationStatusActiveVnf(execution);
154 public void updateOrchestrationStatusAssignVfModuleTest() throws Exception {
155 doNothing().when(aaiVfModuleResources).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.ASSIGNED);
156 aaiUpdateTasks.updateOrchestrationStatusAssignedVfModule(execution);
157 verify(aaiVfModuleResources, times(1)).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.ASSIGNED);
158 assertEquals("", vfModule.getHeatStackId());
162 public void updateOrchestrationStatusAssignVfModuleExceptionTest() throws Exception {
163 doThrow(Exception.class).when(aaiVfModuleResources).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.ASSIGNED);
165 expectedException.expect(BpmnError.class);
167 aaiUpdateTasks.updateOrchestrationStatusAssignedVfModule(execution);
171 public void updateOrchestrationStatusAssignedOrPendingActivationVfModuleNoMultiStageTest() throws Exception {
172 ModelInfoGenericVnf modelInfoGenericVnf = new ModelInfoGenericVnf();
173 modelInfoGenericVnf.setMultiStageDesign("false");
174 genericVnf.setModelInfoGenericVnf(modelInfoGenericVnf);
175 doNothing().when(aaiVfModuleResources).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.ASSIGNED);
176 aaiUpdateTasks.updateOrchestrationStatusAssignedOrPendingActivationVfModule(execution);
177 verify(aaiVfModuleResources, times(1)).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.ASSIGNED);
178 assertEquals("", vfModule.getHeatStackId());
182 public void updateOrchestrationStatusAssignedOrPendingActivationVfModuleWithMultiStageTest() throws Exception {
183 ModelInfoGenericVnf modelInfoGenericVnf = new ModelInfoGenericVnf();
184 modelInfoGenericVnf.setMultiStageDesign("true");
185 genericVnf.setModelInfoGenericVnf(modelInfoGenericVnf);
186 doNothing().when(aaiVfModuleResources).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.PENDING_ACTIVATION);
187 aaiUpdateTasks.updateOrchestrationStatusAssignedOrPendingActivationVfModule(execution);
188 verify(aaiVfModuleResources, times(1)).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.PENDING_ACTIVATION);
189 assertEquals("", vfModule.getHeatStackId());
193 public void updateOrchestrationStatusAssignedOrPendingActivationVfModuleExceptionTest() throws Exception {
194 doThrow(Exception.class).when(aaiVfModuleResources).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.ASSIGNED);
196 expectedException.expect(BpmnError.class);
198 aaiUpdateTasks.updateOrchestrationStatusAssignedOrPendingActivationVfModule(execution);
202 public void updateOrchestrationStatusCreatedVfModuleTest() throws Exception {
203 doNothing().when(aaiVfModuleResources).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.CREATED);
204 aaiUpdateTasks.updateOrchestrationStatusCreatedVfModule(execution);
205 verify(aaiVfModuleResources, times(1)).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.CREATED);
209 public void updateOrchestrationStatusCreatedVfModuleExceptionTest() throws Exception {
210 doThrow(Exception.class).when(aaiVfModuleResources).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.CREATED);
212 expectedException.expect(BpmnError.class);
214 aaiUpdateTasks.updateOrchestrationStatusCreatedVfModule(execution);
218 public void updateOrchestrationStatusPendingActivatefModuleTest() throws Exception {
219 doNothing().when(aaiVfModuleResources).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.PENDING_ACTIVATION);
221 aaiUpdateTasks.updateOrchestrationStatusPendingActivationVfModule(execution);
223 verify(aaiVfModuleResources, times(1)).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.PENDING_ACTIVATION);
227 public void updateOrchestrationStatusPendingActivatefModuleExceptionTest() throws Exception {
228 doThrow(Exception.class).when(aaiVfModuleResources).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.PENDING_ACTIVATION);
230 expectedException.expect(BpmnError.class);
232 aaiUpdateTasks.updateOrchestrationStatusPendingActivationVfModule(execution);
236 public void updateOrchestrationStatusDectivateVfModuleTest() throws Exception {
237 doNothing().when(aaiVfModuleResources).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.CREATED);
239 aaiUpdateTasks.updateOrchestrationStatusDeactivateVfModule(execution);
241 verify(aaiVfModuleResources, times(1)).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.CREATED);
245 public void updateOrchestrationStatusDectivateVfModuleExceptionTest() throws Exception {
246 doThrow(Exception.class).when(aaiVfModuleResources).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.CREATED);
248 expectedException.expect(BpmnError.class);
250 aaiUpdateTasks.updateOrchestrationStatusDeactivateVfModule(execution);
254 public void updateHeatStackIdVfModuleTest() throws Exception {
255 execution.setVariable("heatStackId", "newHeatStackId");
256 doNothing().when(aaiVfModuleResources).updateHeatStackIdVfModule(vfModule, genericVnf);
258 aaiUpdateTasks.updateHeatStackIdVfModule(execution);
260 verify(aaiVfModuleResources, times(1)).updateHeatStackIdVfModule(vfModule, genericVnf);
261 assertEquals("newHeatStackId", vfModule.getHeatStackId());
265 public void updateHeatStackIdVfModuleExceptionTest() throws Exception {
266 doThrow(Exception.class).when(aaiVfModuleResources).updateHeatStackIdVfModule(vfModule, genericVnf);
268 expectedException.expect(BpmnError.class);
270 aaiUpdateTasks.updateHeatStackIdVfModule(execution);
274 public void updateOrchestrationStatusActiveVolumeGroupTest() throws Exception {
275 doNothing().when(aaiVolumeGroupResources).updateOrchestrationStatusVolumeGroup(volumeGroup, cloudRegion, OrchestrationStatus.ACTIVE);
277 aaiUpdateTasks.updateOrchestrationStatusActiveVolumeGroup(execution);
279 verify(aaiVolumeGroupResources, times(1)).updateOrchestrationStatusVolumeGroup(volumeGroup, cloudRegion, OrchestrationStatus.ACTIVE);
283 public void updateOrchestrationStatusActiveVolumeGroupExceptionTest() throws Exception {
284 expectedException.expect(BpmnError.class);
285 doThrow(Exception.class).when(aaiVolumeGroupResources).updateOrchestrationStatusVolumeGroup(volumeGroup, cloudRegion, OrchestrationStatus.ACTIVE);
286 aaiUpdateTasks.updateOrchestrationStatusActiveVolumeGroup(execution);
290 public void updateOrchestrationStatusCreatedVolumeGroupTest() throws Exception {
291 doNothing().when(aaiVolumeGroupResources).updateOrchestrationStatusVolumeGroup(volumeGroup, cloudRegion, OrchestrationStatus.CREATED);
293 aaiUpdateTasks.updateOrchestrationStatusCreatedVolumeGroup(execution);
295 verify(aaiVolumeGroupResources, times(1)).updateOrchestrationStatusVolumeGroup(volumeGroup, cloudRegion, OrchestrationStatus.CREATED);
299 public void updateOrchestrationStatusCreatedVolumeGroupExceptionTest() throws Exception {
300 expectedException.expect(BpmnError.class);
301 doThrow(Exception.class).when(aaiVolumeGroupResources).updateOrchestrationStatusVolumeGroup(volumeGroup, cloudRegion, OrchestrationStatus.CREATED);
302 aaiUpdateTasks.updateOrchestrationStatusCreatedVolumeGroup(execution);
306 public void test_updateOrchestrationStatusAssignedVolumeGroup() throws Exception {
307 doNothing().when(aaiVolumeGroupResources).updateOrchestrationStatusVolumeGroup(volumeGroup, cloudRegion, OrchestrationStatus.ASSIGNED);
309 aaiUpdateTasks.updateOrchestrationStatusAssignedVolumeGroup(execution);
311 verify(aaiVolumeGroupResources, times(1)).updateOrchestrationStatusVolumeGroup(volumeGroup, cloudRegion, OrchestrationStatus.ASSIGNED);
312 assertEquals("", volumeGroup.getHeatStackId());
316 public void test_updateOrchestrationStatusAssignedVolumeGroup_exception() throws Exception {
317 expectedException.expect(BpmnError.class);
318 doThrow(Exception.class).when(aaiVolumeGroupResources).updateOrchestrationStatusVolumeGroup(volumeGroup, cloudRegion, OrchestrationStatus.ASSIGNED);
319 aaiUpdateTasks.updateOrchestrationStatusAssignedVolumeGroup(execution);
322 public void updateHeatStackIdVolumeGroupTest() throws Exception {
323 execution.setVariable("heatStackId", "newHeatStackId");
324 doNothing().when(aaiVolumeGroupResources).updateHeatStackIdVolumeGroup(volumeGroup, cloudRegion);
326 aaiUpdateTasks.updateHeatStackIdVolumeGroup(execution);
328 verify(aaiVolumeGroupResources, times(1)).updateHeatStackIdVolumeGroup(volumeGroup, cloudRegion);
329 assertEquals("newHeatStackId", volumeGroup.getHeatStackId());
333 public void updateHeatStackIdVolumeGroupExceptionTest() throws Exception {
334 expectedException.expect(BpmnError.class);
335 doThrow(Exception.class).when(aaiVolumeGroupResources).updateHeatStackIdVolumeGroup(volumeGroup, cloudRegion);
336 aaiUpdateTasks.updateHeatStackIdVolumeGroup(execution);
340 public void updateNetworkExceptionTest() throws Exception {
341 expectedException.expect(BpmnError.class);
343 doThrow(Exception.class).when(aaiNetworkResources).updateNetwork(network);
345 aaiUpdateTasks.updateNetwork(execution, OrchestrationStatus.ACTIVE);
349 public void updateOstatusActivedNetworkCollectionTest() throws Exception {
350 doNothing().when(aaiCollectionResources).updateCollection(serviceInstance.getCollection());
351 aaiUpdateTasks.updateOrchestrationStatusActiveNetworkCollection(execution);
352 verify(aaiCollectionResources, times(1)).updateCollection(serviceInstance.getCollection());
356 public void updateOstatusActiveNetworkColectionExceptionTest() throws Exception {
357 expectedException.expect(BpmnError.class);
358 doThrow(Exception.class).when(aaiCollectionResources).updateCollection(serviceInstance.getCollection());
359 aaiUpdateTasks.updateOrchestrationStatusActiveNetworkCollection(execution);
363 public void updateOrchestrationStatusActivateVfModuleTest() throws Exception {
364 doNothing().when(aaiVfModuleResources).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.ACTIVE);
366 aaiUpdateTasks.updateOrchestrationStatusActivateVfModule(execution);
368 verify(aaiVfModuleResources, times(1)).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.ACTIVE);
372 public void updateOrchestrationStatusActivateVfModuleExceptionTest() throws Exception {
373 doThrow(Exception.class).when(aaiVfModuleResources).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.ACTIVE);
375 expectedException.expect(BpmnError.class);
377 aaiUpdateTasks.updateOrchestrationStatusActivateVfModule(execution);
381 public void updateNetworkCreatedTest() throws Exception {
382 CreateNetworkResponse createNetworkResponse = new CreateNetworkResponse();
383 createNetworkResponse.setNetworkFqdn("testNetworkFqdn");
384 createNetworkResponse.setNetworkStackId("testNetworkStackId");
385 HashMap<String, String> subnetMap = new HashMap<String, String>();
386 subnetMap.put("testSubnetId", "testNeutronSubnetId");
387 createNetworkResponse.setSubnetMap(subnetMap);
389 network.getSubnets().add(subnet);
391 execution.setVariable("createNetworkResponse", createNetworkResponse);
393 doNothing().when(aaiNetworkResources).updateNetwork(network);
394 doNothing().when(aaiNetworkResources).updateSubnet(network, subnet);
396 aaiUpdateTasks.updateNetworkCreated(execution);
397 verify(aaiNetworkResources, times(1)).updateNetwork(network);
398 verify(aaiNetworkResources, times(1)).updateSubnet(network, subnet);
400 assertEquals(createNetworkResponse.getNetworkFqdn(), network.getContrailNetworkFqdn());
401 assertEquals(OrchestrationStatus.CREATED, network.getOrchestrationStatus());
402 assertEquals(createNetworkResponse.getNetworkStackId(), network.getHeatStackId());
403 assertEquals(createNetworkResponse.getNeutronNetworkId(), network.getNeutronNetworkId());
404 String neutronSubnetId = createNetworkResponse.getSubnetMap().entrySet().iterator().next().getValue();
405 assertEquals(neutronSubnetId, network.getSubnets().get(0).getNeutronSubnetId());
409 public void updateOrchestrationStatusNetworkTest() {
410 AAIUpdateTasks spy = Mockito.spy(new AAIUpdateTasks());
411 doNothing().when(spy).updateNetwork(eq(execution), any());
412 spy.updateOrchestrationStatusActiveNetwork(execution);
413 verify(spy, times(1)).updateNetwork(execution, OrchestrationStatus.ACTIVE);
414 spy.updateOrchestrationStatusAssignedNetwork(execution);
415 verify(spy, times(1)).updateNetwork(execution, OrchestrationStatus.ASSIGNED);
416 spy.updateOrchestrationStatusCreatedNetwork(execution);
417 verify(spy, times(1)).updateNetwork(execution, OrchestrationStatus.CREATED);
421 public void updateNetworkAAITest() {
423 L3Network spy = spy(new L3Network());
424 L3Network shallowCopy = mock(L3Network.class);
425 Subnet mockSubnet = mock(Subnet.class);
426 Subnet shallowCopySubnet = mock(Subnet.class);
427 when(mockSubnet.shallowCopyId()).thenReturn(shallowCopySubnet);
428 doReturn(shallowCopy).when(spy).shallowCopyId();
430 doNothing().when(aaiNetworkResources).updateNetwork(network);
431 doNothing().when(aaiNetworkResources).updateSubnet(network, subnet);
433 spy.getSubnets().add(mockSubnet);
434 aaiUpdateTasks.updateNetworkAAI(spy, OrchestrationStatus.CREATED);
436 verify(shallowCopy, times(1)).setOrchestrationStatus(OrchestrationStatus.CREATED);
437 verify(spy, times(1)).setOrchestrationStatus(OrchestrationStatus.CREATED);
438 verify(shallowCopySubnet, times(1)).setOrchestrationStatus(OrchestrationStatus.CREATED);
441 public void updateNetworkCreatedkExceptionTest() throws Exception {
442 expectedException.expect(BpmnError.class);
443 doThrow(Exception.class).when(aaiNetworkResources).updateNetwork(network);
444 aaiUpdateTasks.updateNetworkCreated(execution);
448 public void updateObjectNetworkTest() {
449 doNothing().when(aaiNetworkResources).updateNetwork(network);
451 aaiUpdateTasks.updateObjectNetwork(execution);
453 verify(aaiNetworkResources, times(1)).updateNetwork(network);
457 public void updateObjectNetworkExceptionText() {
458 expectedException.expect(BpmnError.class);
460 doThrow(Exception.class).when(aaiNetworkResources).updateNetwork(network);
462 aaiUpdateTasks.updateObjectNetwork(execution);
466 public void test_updateServiceInstance() {
467 doNothing().when(aaiServiceInstanceResources).updateServiceInstance(serviceInstance);
468 aaiUpdateTasks.updateServiceInstance(execution);
469 verify(aaiServiceInstanceResources, times(1)).updateServiceInstance(serviceInstance);
473 public void test_updateServiceInstance_exception() {
474 expectedException.expect(BpmnError.class);
475 doThrow(Exception.class).when(aaiServiceInstanceResources).updateServiceInstance(serviceInstance);
476 aaiUpdateTasks.updateServiceInstance(execution);
480 public void updateObjectVnfTest() {
481 doNothing().when(aaiVnfResources).updateObjectVnf(genericVnf);
483 aaiUpdateTasks.updateObjectVnf(execution);
485 verify(aaiVnfResources, times(1)).updateObjectVnf(genericVnf);
489 public void updateObjectVnfExceptionTest() {
490 expectedException.expect(BpmnError.class);
491 doThrow(Exception.class).when(aaiVnfResources).updateObjectVnf(genericVnf);
492 aaiUpdateTasks.updateObjectVnf(execution);
496 public void updateOrchestrationStatusDeleteVfModuleTest() throws Exception {
497 doNothing().when(aaiVfModuleResources).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.ASSIGNED);
499 aaiUpdateTasks.updateOrchestrationStatusDeleteVfModule(execution);
501 verify(aaiVfModuleResources, times(1)).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.ASSIGNED);
502 assertEquals("", vfModule.getHeatStackId());
506 public void updateModelVfModuleTest() {
507 doNothing().when(aaiVfModuleResources).changeAssignVfModule(vfModule, genericVnf);
508 aaiUpdateTasks.updateModelVfModule(execution);
509 verify(aaiVfModuleResources, times(1)).changeAssignVfModule(vfModule, genericVnf);
513 public void updateModelVfModuleExceptionTest() {
514 expectedException.expect(BpmnError.class);
515 doThrow(Exception.class).when(aaiVfModuleResources).changeAssignVfModule(vfModule, genericVnf);
516 aaiUpdateTasks.updateModelVfModule(execution);
520 public void updateOrchestrationStatusDeactivateFabricConfigurationTest() throws Exception {
521 gBBInput = execution.getGeneralBuildingBlock();
522 doNothing().when(aaiConfigurationResources).updateOrchestrationStatusConfiguration(configuration, OrchestrationStatus.ASSIGNED);
524 aaiUpdateTasks.updateOrchestrationStatusDeactivateFabricConfiguration(execution);
526 verify(aaiConfigurationResources, times(1)).updateOrchestrationStatusConfiguration(configuration, OrchestrationStatus.ASSIGNED);
529 public void updateOrchestrationStatusActivateFabricConfigurationTest() throws Exception {
530 gBBInput = execution.getGeneralBuildingBlock();
531 doNothing().when(aaiConfigurationResources).updateOrchestrationStatusConfiguration(configuration, OrchestrationStatus.ACTIVE);
533 aaiUpdateTasks.updateOrchestrationStatusActivateFabricConfiguration(execution);
535 verify(aaiConfigurationResources, times(1)).updateOrchestrationStatusConfiguration(configuration, OrchestrationStatus.ACTIVE);