From 1b0033ac8a578730ba95e48f7a7ab73e49380b51 Mon Sep 17 00:00:00 2001 From: "Boslet, Cory" Date: Tue, 20 Oct 2020 11:38:11 -0400 Subject: Removed audit code Updated to error on inventory therefore no longer need audit Removed the audit UT test from source Removed the audit from the task services. Updated the BB unit test to not have audit anymore Changed robots to fix for create inventory. Delete the vnfc by id after each robot Create pserver in aai that ci is using Continue to fix robot test for heat bridge Continue to fix robots due to heatbridge enabled More changes to simulator to account for heatbridge for replace scenrios Added get resources scenrio for heatbridge Added header and added version to simulator Added correct response file and header for base module id Fixed the remaining failing service instance robots Changed to get tenant id else where when null Fixed the macro robots for heatbridge and getting resources Added scenrios that are still needed for heatbridge Added to connect when already exist and missing relationships Updated unit test to account for change to code. Issue-ID: SO-3316 Signed-off-by: Benjamin, Max (mb388a) Change-Id: I8cefebd91261fcb8ff03d582afb48517dd34625a --- .../BuildingBlock/ActivateVfModuleBB.bpmn | 208 +--------- .../subprocess/BuildingBlock/DeleteVfModuleBB.bpmn | 455 +++------------------ .../bpmn/subprocess/ActivateVfModuleBBTest.java | 29 +- .../infrastructure/vfmodule/CreateVFModule.java | 6 +- 4 files changed, 92 insertions(+), 606 deletions(-) (limited to 'bpmn') diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ActivateVfModuleBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ActivateVfModuleBB.bpmn index 01caf38610..383fd27b56 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ActivateVfModuleBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ActivateVfModuleBB.bpmn @@ -2,14 +2,13 @@ - SequenceFlow_0ieafii + Flow_1hz7ga1 - SequenceFlow_0xsp0pv - SequenceFlow_1b63lv4 + Flow_1hz7ga1 SequenceFlow_1a495wm @@ -29,64 +28,7 @@ - - - SequenceFlow_0ghzwlo - SequenceFlow_0xndboi - - - SequenceFlow_0xndboi - SequenceFlow_0l8684g - - - - ${execution.getVariable("auditInventoryNeeded") == true} - - - SequenceFlow_0ieafii - SequenceFlow_1xqyur9 - - - - - - SequenceFlow_19gbhlj - - - - SequenceFlow_0l4jzc5 - - - - - SequenceFlow_19gbhlj - SequenceFlow_0l4jzc5 - - - - SequenceFlow_1xqyur9 - SequenceFlow_07ybdik - SequenceFlow_0ghzwlo - - - SequenceFlow_07ybdik - Flow_1c5mrjc - SequenceFlow_1b63lv4 - - - - SequenceFlow_0l8684g - Flow_1c5mrjc - Flow_02xnvmz - - - - ${execution.getVariable("auditIsSuccessful") == false} - - - Flow_02xnvmz - - + @@ -94,167 +36,51 @@ - + - - - - - - - - + - + - + - - + + - + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteVfModuleBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteVfModuleBB.bpmn index 87e0b883a9..9a33a3e4bf 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteVfModuleBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteVfModuleBB.bpmn @@ -1,11 +1,11 @@ - + - SequenceFlow_1oeootm + Flow_02lmh6f - SequenceFlow_028rmiu + Flow_02lmh6f SequenceFlow_08tvhtf @@ -29,9 +29,8 @@ SequenceFlow_08tvhtf - SequenceFlow_02lpx87 + Flow_0hlvlw2 - SequenceFlow_0h607z0 @@ -51,7 +50,7 @@ - SequenceFlow_0sy2nky + Flow_0n2pqrr SequenceFlow_0xyu3pk @@ -69,496 +68,176 @@ SequenceFlow_0khqfnc SequenceFlow_0yuz21z - - ${execution.getVariable("auditInventoryNeeded") == true} - - - - SequenceFlow_1oeootm - SequenceFlow_10af0fk - - - SequenceFlow_0f5ljoh - SequenceFlow_0hpj2mm - - - SequenceFlow_032jv5j - SequenceFlow_1iulltd - - - - SequenceFlow_1fhst92 - - - SequenceFlow_0xuodpy - SequenceFlow_1fhst92 - - - - - SequenceFlow_0xuodpy - - - - - SequenceFlow_1i9ft2r + Flow_0plbl7p - SequenceFlow_179btn2 + Flow_0n2pqrr - - ${execution.getVariable("auditIsSuccessful") == false || execution.getVariable("auditIsSuccessful") == true} - - - ${execution.getVariable("auditIsSuccessful") == false} - - - SequenceFlow_0hpj2mm - SequenceFlow_17cd9e2 - SequenceFlow_1gdyk9j - - - SequenceFlow_1gdyk9j - - - - SequenceFlow_10af0fk - SequenceFlow_032jv5j - SequenceFlow_1bt1p2u - - - SequenceFlow_1bt1p2u - SequenceFlow_0dzf7hz - SequenceFlow_1bq9g02 - - - - - - SequenceFlow_1iulltd - SequenceFlow_0dzf7hz - - - - - - - - SequenceFlow_1bq9g02 - SequenceFlow_0mtzl4z - SequenceFlow_028rmiu - - - SequenceFlow_02lpx87 - SequenceFlow_13mlz57 - SequenceFlow_14bu4ys - - - - SequenceFlow_0mtzl4z - SequenceFlow_0f5ljoh - SequenceFlow_1gjwivp - - - ${execution.getVariable("auditInventoryNeeded") == true} - - - SequenceFlow_17cd9e2 - SequenceFlow_1gjwivp - SequenceFlow_13mlz57 - - - - SequenceFlow_179btn2 - SequenceFlow_0sy2nky + SequenceFlow_1i9ft2r + Flow_0plbl7p - - SequenceFlow_14bu4ys + Flow_0hlvlw2 SequenceFlow_1i9ft2r - + + + + + - + - + - + - - + + - + - + - - - - - - - - - + - + - + - - + + - + - - + + - - + + - - - - + + - + - + - - - - - + + - + - - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - + + - - - - - - - + + + - - - - - - - - - - - - - - + + + - - - - - - - + + + - - - - - - + + + - - - - - - - - + + + diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVfModuleBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVfModuleBBTest.java index 6f89f3c738..558e785e94 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVfModuleBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVfModuleBBTest.java @@ -22,12 +22,9 @@ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.doThrow; import java.io.IOException; -import java.util.List; import org.camunda.bpm.engine.delegate.BpmnError; -import org.camunda.bpm.engine.externaltask.LockedExternalTask; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Before; import org.junit.Test; @@ -47,20 +44,10 @@ public class ActivateVfModuleBBTest extends BaseBPMNTest { public void sunnyDay() throws InterruptedException, IOException { mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateVfModuleBB", variables); - List tasks = externalTaskService.fetchAndLock(100, "externalWorkerId") - .topic("InventoryAddAudit", 60L * 1000L).execute(); - while (!tasks.isEmpty()) { - for (LockedExternalTask task : tasks) { - externalTaskService.complete(task.getId(), "externalWorkerId"); - } - tasks = externalTaskService.fetchAndLock(100, "externalWorkerId").topic("InventoryAddAudit", 60L * 1000L) - .execute(); - } assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("ActivateVfModuleBB_Start", "ExclusiveGateway_1v8bmbu", - "Setup_AAI_Inventory_Audit", "Audit_AAI_Inventory", "ActivateVfModule", "CallActivity_sdncHandler", - "UpdateVfModuleActiveStatus", "ActivateVfModuleBB_End"); + assertThat(pi).isStarted().hasPassedInOrder("ActivateVfModuleBB_Start", "ActivateVfModule", + "CallActivity_sdncHandler", "UpdateVfModuleActiveStatus", "ActivateVfModuleBB_End"); assertThat(pi).isEnded(); } @@ -70,19 +57,9 @@ public class ActivateVfModuleBBTest extends BaseBPMNTest { doThrow(BpmnError.class).when(aaiUpdateTasks) .updateOrchestrationStatusActivateVfModule(any(BuildingBlockExecution.class)); ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateVfModuleBB", variables); - List tasks = externalTaskService.fetchAndLock(100, "externalWorkerId") - .topic("InventoryAddAudit", 60L * 1000L).execute(); - while (!tasks.isEmpty()) { - for (LockedExternalTask task : tasks) { - externalTaskService.complete(task.getId(), "externalWorkerId"); - } - tasks = externalTaskService.fetchAndLock(100, "externalWorkerId").topic("InventoryAddAudit", 60L * 1000L) - .execute(); - } assertThat(pi).isNotNull().isStarted() - .hasPassedInOrder("ActivateVfModuleBB_Start", "ExclusiveGateway_1v8bmbu", "Setup_AAI_Inventory_Audit", - "Audit_AAI_Inventory", "ActivateVfModule", "UpdateVfModuleActiveStatus") + .hasPassedInOrder("ActivateVfModuleBB_Start", "ActivateVfModule", "UpdateVfModuleActiveStatus") .hasNotPassed("ActivateVfModuleBB_End"); } } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/vfmodule/CreateVFModule.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/vfmodule/CreateVFModule.java index f7c42b97e9..b706be92cb 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/vfmodule/CreateVFModule.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/vfmodule/CreateVFModule.java @@ -44,7 +44,11 @@ public class CreateVFModule { CloudInformation cloudInformation = new CloudInformation(); cloudInformation.setOwner(gBBInput.getCloudRegion().getCloudOwner()); cloudInformation.setRegionId(gBBInput.getCloudRegion().getLcpCloudRegionId()); - cloudInformation.setTenantId(gBBInput.getTenant().getTenantId()); + String tenantId = gBBInput.getTenant().getTenantId(); + if (tenantId == null) { + tenantId = gBBInput.getCloudRegion().getTenantId(); + } + cloudInformation.setTenantId(tenantId); cloudInformation.setTenantName(gBBInput.getTenant().getTenantName()); cloudInformation.setTenantContext(gBBInput.getTenant().getTenantContext()); cloudInformation.setTemplateInstanceId(execution.getVariable("heatStackId")); -- cgit 1.2.3-korg