From eaef24e96c1ce95195845258ce0a304ab9c0c21a Mon Sep 17 00:00:00 2001 From: "Boslet, Cory" Date: Wed, 17 Jul 2019 13:36:05 -0400 Subject: add query stack data and populate table step Need to check if audit is enabled first in the delete record task Updates to audit delete redeisgn and data to table Various updates to logging, audit object, added tag to query, updated tag value. Updated write method to make sure an entry for this heat stack doesnt already exist to avoid duplicate entrys Updated unit test to account for get query Added so that id is not hidden from query results Updated the was delete is done plus minor updates. Updated delete method to use resttemplate instead of bowman client Combined the write and get stack data task into the external tasks. Removed the task to delete the stack data from db Updates to junit request id so its not a random id for test Updated service tasks in att BB to call external task Update to be a real uuid format due to failing unit test Updated fields to protected and updated unit test Issue-ID: SO-2111 Signed-off-by: Benjamin, Max (mb388a) Change-Id: I8f479a046cf837403f60c330ed6ad8bc08a9c82f --- .../subprocess/BuildingBlock/DeleteVfModuleBB.bpmn | 393 ++++++++++++--------- .../bpmn/subprocess/DeleteVfModuleBBTest.java | 27 +- 2 files changed, 247 insertions(+), 173 deletions(-) (limited to 'bpmn/so-bpmn-building-blocks/src') 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 33335ab2c4..ca0f8452cf 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 @@ -2,13 +2,12 @@ - SequenceFlow_1537yw5 + SequenceFlow_1oeootm - - SequenceFlow_1n8gab5 + + SequenceFlow_028rmiu SequenceFlow_08tvhtf - SequenceFlow_01vfwtp SequenceFlow_09l7pcg @@ -70,44 +69,22 @@ SequenceFlow_0khqfnc SequenceFlow_0yuz21z - - - SequenceFlow_1537yw5 - SequenceFlow_1n8gab5 - SequenceFlow_1v3jgqe - - + - - - SequenceFlow_1v3jgqe - SequenceFlow_1odt2wt + SequenceFlow_1oeootm + SequenceFlow_10af0fk - - - - - SequenceFlow_1swistn - SequenceFlow_0qfmmgt + + SequenceFlow_0f5ljoh + SequenceFlow_0hpj2mm SequenceFlow_032jv5j - SequenceFlow_1swistn + SequenceFlow_1iulltd - - - SequenceFlow_1odt2wt - SequenceFlow_032jv5j - SequenceFlow_1mgunf3 - - - SequenceFlow_1mgunf3 - SequenceFlow_17cd9e2 - SequenceFlow_1ut7n32 - SequenceFlow_1fhst92 @@ -120,7 +97,7 @@ SequenceFlow_0xuodpy - + @@ -132,19 +109,14 @@ SequenceFlow_179btn2 - + - - SequenceFlow_02lpx87 - SequenceFlow_1ut7n32 - SequenceFlow_14bu4ys - - SequenceFlow_0qfmmgt + SequenceFlow_0hpj2mm SequenceFlow_17cd9e2 SequenceFlow_1gdyk9j @@ -152,6 +124,54 @@ 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 + + + + + + SequenceFlow_17cd9e2 + SequenceFlow_1gjwivp + SequenceFlow_13mlz57 + + + @@ -164,40 +184,33 @@ - + - - - - - - - - - + + - + - + - + - + - - - + + + - + @@ -234,9 +247,9 @@ - + - + @@ -279,101 +292,29 @@ - - - - - - - - - - - - - - - - - + + + - - - - - - - - + - - + + - - - - - - - - - - + - + - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - + @@ -409,9 +350,9 @@ - + - + @@ -421,30 +362,26 @@ - - - + + + - + - - + + + + - + - - - - - - - + - + @@ -454,11 +391,143 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteVfModuleBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteVfModuleBBTest.java index d9166c9138..47d0ad9b7f 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteVfModuleBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteVfModuleBBTest.java @@ -46,18 +46,20 @@ public class DeleteVfModuleBBTest extends BaseBPMNTest { mockSubprocess("VnfAdapter", "Mocked VnfAdapter", "GenericStub"); ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteVfModuleBB", variables); List tasks = externalTaskService.fetchAndLock(100, "externalWorkerId") - .topic("InventoryDeleteAudit", 60L * 1000L).execute(); + .topic("InventoryDeleteAudit", 60L * 1000L).topic("InventoryQueryAudit", 60L * 1000L).execute(); while (!tasks.isEmpty()) { for (LockedExternalTask task : tasks) { externalTaskService.complete(task.getId(), "externalWorkerId"); } tasks = externalTaskService.fetchAndLock(100, "externalWorkerId").topic("InventoryDeleteAudit", 60L * 1000L) - .execute(); + .topic("InventoryQueryAudit", 60L * 1000L).execute(); } assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassed("DeleteVfModuleBB_Start", "ExclusiveGateway_0xrgzm7", - "ExclusiveGateway_1yvh16a", "Check_Audit", "Setup_Audit_Variable", "Audit_Inventory", - "DeleteVfModuleVnfAdapter", "VnfAdapter", "DeleteNetworkPolicies", "UpdateVnfIpv4OamAddress", + assertThat(pi).isStarted().hasPassed("DeleteVfModuleBB_Start", "Check_Audit", "auditEnabledCheck", + "Setup_Audit_Variable", "Setup_Audit_Variable", "aicQueryStack", "ExclusiveGateway_1t9q2jl", + "ExclusiveGateway_1naduhl", "ExclusiveGateway_13fhmpf", "DeleteVfModuleVnfAdapter", "VnfAdapter", + "Audit_Inventory", "ExclusiveGateway_1yvh16a", "auditSuccessfulCheck", "ExclusiveGateway_01wvywu", + "ExclusiveGateway_1yvh16a", "DeleteNetworkPolicies", "UpdateVnfIpv4OamAddress", "UpdateVnfManagementV6Address", "UpdateVfModuleContrailServiceInstanceFqdn", "UpdateVfModuleHeatStackId", "UpdateVfModuleDeleteStatus", "DeleteVfModuleBB_End"); assertThat(pi).isEnded(); @@ -68,19 +70,22 @@ public class DeleteVfModuleBBTest extends BaseBPMNTest { doThrow(BpmnError.class).when(vnfAdapterDeleteTasks).deleteVfModule(any(BuildingBlockExecution.class)); ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteVfModuleBB", variables); List tasks = externalTaskService.fetchAndLock(100, "externalWorkerId") - .topic("InventoryDeleteAudit", 60L * 1000L).execute(); + .topic("InventoryDeleteAudit", 60L * 1000L).topic("InventoryQueryAudit", 60L * 1000L).execute(); while (!tasks.isEmpty()) { for (LockedExternalTask task : tasks) { externalTaskService.complete(task.getId(), "externalWorkerId"); } tasks = externalTaskService.fetchAndLock(100, "externalWorkerId").topic("InventoryDeleteAudit", 60L * 1000L) - .execute(); + .topic("InventoryQueryAudit", 60L * 1000L).execute(); } assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassed("DeleteVfModuleBB_Start", "DeleteVfModuleVnfAdapter").hasNotPassed( - "VnfAdapter", "DeleteNetworkPolicies", "UpdateVnfIpv4OamAddress", "UpdateVnfManagementV6Address", - "UpdateVfModuleContrailServiceInstanceFqdn", "UpdateVfModuleHeatStackId", "UpdateVfModuleDeleteStatus", - "DeleteVfModuleBB_End"); + assertThat(pi).isStarted() + .hasPassed("DeleteVfModuleBB_Start", "Check_Audit", "auditEnabledCheck", "Setup_Audit_Variable", + "Setup_Audit_Variable", "aicQueryStack", "ExclusiveGateway_1t9q2jl", "ExclusiveGateway_1naduhl", + "ExclusiveGateway_13fhmpf") + .hasNotPassed("VnfAdapter", "DeleteNetworkPolicies", "UpdateVnfIpv4OamAddress", + "UpdateVnfManagementV6Address", "UpdateVfModuleContrailServiceInstanceFqdn", + "UpdateVfModuleHeatStackId", "UpdateVfModuleDeleteStatus", "DeleteVfModuleBB_End"); assertThat(pi).isEnded(); } } -- cgit 1.2.3-korg