From cf90f6988c717eb609f5da7d1aee04c668b21fe9 Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Fri, 10 Aug 2018 17:19:31 -0400 Subject: Casablana bugfixes updated mock in unassignnetworkbbtest instead of base added mock to extract pojos method in unassignnetwork Return gBuildingBlockExecution from calls to VnfAdapter subprocess Correct JUnit data to expect modelInfoVfModule Enable Spring Security for logging of unauthorized/bad credentials errors Fix handling of a case of no VF Modules in a VNF resource. fix populating lookupKeyMap with resource ids removed unnecessary test resources Issue-ID: SO-848 Change-Id: Id89f075dcac4042bf8fb1e207e66d289d079171f Signed-off-by: Benjamin, Max (mb388a) --- .../subprocess/BuildingBlock/CreateVfModuleBB.bpmn | 36 ++++++++++++++------ .../BuildingBlock/CreateVolumeGroupBB.bpmn | 38 +++++++++++++++------- .../subprocess/BuildingBlock/DeleteVfModuleBB.bpmn | 1 + .../BuildingBlock/UnassignNetwork1802BB.bpmn | 29 ++++------------- .../bpmn/subprocess/CreateVfModuleBBTest.java | 23 ++++++++++--- .../bpmn/subprocess/CreateVolumeGroupBBTest.java | 17 ++++++++-- .../bpmn/subprocess/UnassignNetwork1802BBTest.java | 6 ++-- 7 files changed, 98 insertions(+), 52 deletions(-) (limited to 'bpmn/so-bpmn-building-blocks/src') diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateVfModuleBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateVfModuleBB.bpmn index 3d18810e48..abc017c957 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateVfModuleBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateVfModuleBB.bpmn @@ -23,21 +23,27 @@ SequenceFlow_1s4rpyp - + + SequenceFlow_16g4dz0 SequenceFlow_0ecr393 - SequenceFlow_0ecr393 + SequenceFlow_0qqsilv SequenceFlow_1stomxq + + + SequenceFlow_0ecr393 + SequenceFlow_0qqsilv + @@ -58,9 +64,9 @@ - + - + @@ -92,23 +98,33 @@ - + - + - - + + - + - + + + + + + + + + + + diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateVolumeGroupBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateVolumeGroupBB.bpmn index 58a429dcc5..a95dc9ce73 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateVolumeGroupBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateVolumeGroupBB.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_1wz1rfg @@ -14,7 +14,7 @@ - SequenceFlow_06flg6h + SequenceFlow_1d5nux2 SequenceFlow_0mh0v9h @@ -28,11 +28,17 @@ + SequenceFlow_0kfkpbh SequenceFlow_06flg6h - + + + + SequenceFlow_06flg6h + SequenceFlow_1d5nux2 + @@ -52,9 +58,9 @@ - + - + @@ -68,13 +74,13 @@ - + - - + + - + @@ -92,11 +98,21 @@ - + - + + + + + + + + + + + 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 755bfe8126..07d0b18938 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 @@ -24,6 +24,7 @@ + SequenceFlow_08tvhtf SequenceFlow_02lpx87 diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/UnassignNetwork1802BB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/UnassignNetwork1802BB.bpmn index bd6b124175..212e735dd1 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/UnassignNetwork1802BB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/UnassignNetwork1802BB.bpmn @@ -11,18 +11,13 @@ SequenceFlow_1ks8kmt - + - SequenceFlow_1gd5h4c + SequenceFlow_0zaz9o2 SequenceFlow_0mxe1a7 - - - SequenceFlow_0zaz9o2 - SequenceFlow_1gd5h4c - SequenceFlow_0mxe1a7 @@ -32,9 +27,9 @@ - + - + @@ -47,10 +42,10 @@ - - + + - + @@ -70,16 +65,6 @@ - - - - - - - - - - diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/CreateVfModuleBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/CreateVfModuleBBTest.java index a3c6a820bd..a94a4bb89a 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/CreateVfModuleBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/CreateVfModuleBBTest.java @@ -42,6 +42,7 @@ public class CreateVfModuleBBTest extends BaseBPMNTest{ "QueryVfModule", "CreateVfModule", "VnfAdapter", + "UpdateVfModuleHeatStackId", "UpdateVfModuleStatus", "CreateVfModuleBB_End"); assertThat(pi).isEnded(); @@ -54,7 +55,7 @@ public class CreateVfModuleBBTest extends BaseBPMNTest{ assertThat(pi).isNotNull(); assertThat(pi).isStarted() .hasPassedInOrder("CreateVfModuleBB_Start", "QueryVnf") - .hasNotPassed("QueryVfModule", "CreateVfModule", "VnfAdapter", "UpdateVfModuleStatus", "CreateVfModuleBB_End"); + .hasNotPassed("QueryVfModule", "CreateVfModule", "VnfAdapter", "UpdateVfModuleHeatStackId", "UpdateVfModuleStatus", "CreateVfModuleBB_End"); assertThat(pi).isEnded(); } @@ -65,7 +66,7 @@ public class CreateVfModuleBBTest extends BaseBPMNTest{ assertThat(pi).isNotNull(); assertThat(pi).isStarted() .hasPassedInOrder("CreateVfModuleBB_Start", "QueryVnf", "QueryVfModule") - .hasNotPassed("CreateVfModule", "VnfAdapter", "UpdateVfModuleStatus", "CreateVfModuleBB_End"); + .hasNotPassed("CreateVfModule", "VnfAdapter", "UpdateVfModuleHeatStackId", "UpdateVfModuleStatus", "CreateVfModuleBB_End"); assertThat(pi).isEnded(); } @@ -76,10 +77,24 @@ public class CreateVfModuleBBTest extends BaseBPMNTest{ assertThat(pi).isNotNull(); assertThat(pi).isStarted() .hasPassedInOrder("CreateVfModuleBB_Start", "QueryVnf", "QueryVfModule", "CreateVfModule") - .hasNotPassed("VnfAdapter", "UpdateVfModuleStatus", "CreateVfModuleBB_End"); + .hasNotPassed("VnfAdapter", "UpdateVfModuleHeatStackId", "UpdateVfModuleStatus", "CreateVfModuleBB_End"); assertThat(pi).isEnded(); } + @Test + public void rainyDayCreateVfModuleUpdateVfModuleHeatStackIdError_Test() throws Exception { + mockSubprocess("VnfAdapter", "Mocked VnfAdapter", "GenericStub"); + + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks).updateHeatStackIdVfModule(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateVfModuleBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted() + .hasPassedInOrder("CreateVfModuleBB_Start", "QueryVnf", "QueryVfModule", "CreateVfModule", "VnfAdapter", "UpdateVfModuleHeatStackId") + .hasNotPassed("UpdateVfModuleStatus", "CreateVfModuleBB_End"); + assertThat(pi).isEnded(); + + } + @Test public void rainyDayCreateVfModuleUpdateVfModuleStatusError_Test() throws Exception { mockSubprocess("VnfAdapter", "Mocked VnfAdapter", "GenericStub"); @@ -87,7 +102,7 @@ public class CreateVfModuleBBTest extends BaseBPMNTest{ ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateVfModuleBB", variables); assertThat(pi).isNotNull(); assertThat(pi).isStarted() - .hasPassedInOrder("CreateVfModuleBB_Start", "QueryVnf", "QueryVfModule", "CreateVfModule", "VnfAdapter", "UpdateVfModuleStatus") + .hasPassedInOrder("CreateVfModuleBB_Start", "QueryVnf", "QueryVfModule", "CreateVfModule", "VnfAdapter", "UpdateVfModuleHeatStackId", "UpdateVfModuleStatus") .hasNotPassed("CreateVfModuleBB_End"); assertThat(pi).isEnded(); } diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/CreateVolumeGroupBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/CreateVolumeGroupBBTest.java index 980e609e97..eb372fb6a7 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/CreateVolumeGroupBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/CreateVolumeGroupBBTest.java @@ -36,7 +36,7 @@ public class CreateVolumeGroupBBTest extends BaseBPMNTest{ mockSubprocess("VnfAdapter", "Mocked VnfAdapter", "GenericStub"); ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateVolumeGroupBB", variables); assertThat(pi).isNotNull(); - assertThat(pi).isStarted(); + assertThat(pi).isStarted().hasPassedInOrder("CreateVolumeGroupBB_Start", "QueryVfModuleSDNC", "CreateVolumeGroupVnfAdapter", "Vnf_Adapter", "UpdateVolumeGroupHeatStackId", "UpdateVolumeGroupAAI", "CreateVolumeGroupBB_End"); assertThat(pi).isEnded(); assertThat(pi).hasPassedInOrder("CreateVolumeGroupBB_Start", "QueryVfModuleSDNC", "CreateVolumeGroupVnfAdapter", "Vnf_Adapter","UpdateVolumeGroupAAI", "CreateVolumeGroupBB_End"); } @@ -46,7 +46,20 @@ public class CreateVolumeGroupBBTest extends BaseBPMNTest{ doThrow(new BpmnError("7000", "TESTING ERRORS")).when(vnfAdapterCreateTasks).createVolumeGroupRequest(any(BuildingBlockExecution.class)); ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateVolumeGroupBB", variables); assertThat(pi).isNotNull(); - assertThat(pi).isStarted(); + assertThat(pi).isStarted() + .hasPassedInOrder("CreateVolumeGroupBB_Start", "QueryVfModuleSDNC", "CreateVolumeGroupVnfAdapter") + .hasNotPassed("UpdateVolumeGroupHeatStackId", "UpdateVolumeGroupAAI", "CreateVolumeGroupBB_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayCreateVolumeGroupUpdateHeatStackIdError_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiUpdateTasks).updateHeatStackIdVolumeGroup(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateVolumeGroupBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted() + .hasPassedInOrder("CreateVolumeGroupBB_Start", "QueryVfModuleSDNC", "CreateVolumeGroupVnfAdapter", "Vnf_Adapter") + .hasNotPassed("UpdateVolumeGroupAAI", "CreateVolumeGroupBB_End"); assertThat(pi).isEnded(); assertThat(pi).hasPassedInOrder("CreateVolumeGroupBB_Start", "QueryVfModuleSDNC", "CreateVolumeGroupVnfAdapter") .hasNotPassed("Vnf_Adapter", "UpdateVolumeGroupAAI", "CreateVolumeGroupBB_End"); diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/UnassignNetwork1802BBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/UnassignNetwork1802BBTest.java index ad374e3304..2c5381de09 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/UnassignNetwork1802BBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/UnassignNetwork1802BBTest.java @@ -36,7 +36,7 @@ public class UnassignNetwork1802BBTest extends BaseBPMNTest { public void sunnyDayAssignNetwork_Test() throws InterruptedException { ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignNetwork1802BB",variables); assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("Start_UnassignNetworkBB","Task_GetL3NetworkById","Task_VfModuleRelatioship","Task_GetCloudRegionVersion","Task_SNDCUnAssign","End_UnassignNetworkBB"); + assertThat(pi).isStarted().hasPassedInOrder("Start_UnassignNetworkBB","Task_VfModuleRelatioship","Task_GetCloudRegionVersion","Task_SNDCUnAssign","End_UnassignNetworkBB"); assertThat(pi).isEnded(); } @@ -46,8 +46,8 @@ public class UnassignNetwork1802BBTest extends BaseBPMNTest { ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignNetwork1802BB", variables); assertThat(pi).isNotNull(); assertThat(pi).isStarted() - .hasPassedInOrder("Start_UnassignNetworkBB", "Task_GetL3NetworkById", "Task_VfModuleRelatioship") + .hasPassedInOrder("Start_UnassignNetworkBB", "Task_VfModuleRelatioship") .hasNotPassed("End_UnassignNetworkBB"); assertThat(pi).isEnded(); } -} +} \ No newline at end of file -- cgit 1.2.3-korg