From 2ff435b28384a066017b690cf8a876a2cdd52d29 Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Fri, 12 Oct 2018 14:03:02 -0400 Subject: Bug fixes for casablanca Updated builder to use String.format Added exception specifically for issues interacting with requestdbadapter Updated exception message and added junit test case Added case to handle when homing is not called during assign vnf. include network ID for completion handler Added exception handling for saving to requestdb added null check to mdc and interceptors to sdnc cxf confirm subnet map is not null in adapter response shallow copy subnet before AAI udpate update AAIObjectType to use uriTemplate extract subnet data from adapter response update correct AAIObjectType for subnet query update subnet(s) in AAI on network create completion updated how request db is set to failure in workflowA updated in and out mapping to be generalBuildingBlock change source out mapping to generalBuildingBlock Use explicit conversion to JSON to read cloudConfiguration settings. Use explicit conversion to JSON to read cloudConfiguration settings. Correct the name of DeleteVfModuleBB subprocess. Write the returned value from Homing to gBBInput updated unit test coverage for update network sync subnet status with network update Added WorkflowException to out mapping which will trigger an exception to be thrown when populated. Correct the payload for HealthCheck APP-C Action to remove escaping and change parameter name. Added WorkflowException to out mapping which will trigger an exception to be thrown when populated. Commit a change that was not staged in previous commit updated arguments to getConstructor method forgot to extract throwable from Optional object added throwable constructor to createException fixed broken unit test and added a new test and method set the network technology in the network request remove namespace from added networkId payload element - Updated SDWan test case to check the database to make sure the VNFCustomization object exist. - Updated code to only loop in iNotif.getResources() for VF resources, all others are unnecessary and were causing issues with the Service object. - Removed modifiedHeatTemplate variable since this isn't needed in the ONAP code base. Make sure vnfResponseCode variable is set to 200 when VNF is correctly retrieved from A&AI. VRR VRRCreateVfModule - send availability_zone to SDNC Infra Assign request Safeguard the retrieval of Boolean setting for isRollbackEnabled. Set isRollbackEnabled to opposite of suppressRollback early on in the execution. Reverse suppressRollback value to pass as backout parameter to VNF Adapter Add the exceptions to the calls to aai client queries Correct retrieval of the object from Optional for A&AI queries. Change-Id: I7d22e621b0316c14ce61bd51a9d5753473622697 Issue-ID: SO-1134 Signed-off-by: Benjamin, Max (mb388a) --- .../so/bpmn/common/scripts/CompleteMsoProcessTest.groovy | 16 +++++++++++++++- .../org/onap/so/bpmn/appc/payload/PayloadClientTest.java | 4 ++-- .../tasks/BBInputSetupMapperLayerTest.java | 2 +- .../GeneralBuildingBlockCMExpected.json | 2 +- 4 files changed, 19 insertions(+), 5 deletions(-) (limited to 'bpmn/MSOCommonBPMN/src/test') diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/CompleteMsoProcessTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/CompleteMsoProcessTest.groovy index 8ac8f25eb1..4b0c33ab99 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/CompleteMsoProcessTest.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/CompleteMsoProcessTest.groovy @@ -57,6 +57,19 @@ class CompleteMsoProcessTest { UCPELayer3ServiceActivateV1 """ + + private String completeMsoNetworkProcessRequest = """ + + + bd631913-cfc6-488b-ba22-6b98504f703d + CREATE + VID + + Resource Completed Successfully + bd631913-cfc6-488b-ba22-6b98504f703d + BPMN Network action: CREATE + """ @Test public void testPreProcessRequest() { @@ -117,7 +130,7 @@ class CompleteMsoProcessTest { Resource Completed Successfully COMPLETE 100 - + bd631913-cfc6-488b-ba22-6b98504f703d """ @@ -130,6 +143,7 @@ class CompleteMsoProcessTest { when(mockExecution.getVariable("CMSO_mso-bpel-name")).thenReturn("BPEL") when(mockExecution.getVariable("mso.adapters.db.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC"); when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7"); + when(mockExecution.getVariable("CompleteMsoProcessRequest")).thenReturn(completeMsoNetworkProcessRequest); CompleteMsoProcess completeMsoProcess = new CompleteMsoProcess() completeMsoProcess.setUpdateDBstatustoSuccessPayload(mockExecution) diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/appc/payload/PayloadClientTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/appc/payload/PayloadClientTest.java index a08d8ca25d..20c69fafe3 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/appc/payload/PayloadClientTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/appc/payload/PayloadClientTest.java @@ -66,8 +66,8 @@ public class PayloadClientTest { @Test public void healthCheckFormatTest() throws Exception { - String payloadResult = "{\\\"request-parameters\\\":{\\\"vnf-host-ip-address\\\":\\\"vnfHostIpAddress1\\\"}}"; - Optional payloadClient = PayloadClient.healthCheckFormat("vnfName1", "vnfHostIpAddress1"); + String payloadResult = "{\"request-parameters\":{\"host-ip-address\":\"hostIpAddress1\"}}"; + Optional payloadClient = PayloadClient.healthCheckFormat("vnfName1", "hostIpAddress1"); assertEquals(payloadResult, payloadClient.get()); } diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayerTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayerTest.java index e5138b394c..94dbbf427c 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayerTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayerTest.java @@ -549,7 +549,7 @@ public class BBInputSetupMapperLayerTest { @Test public void testMapOrchestrationContext() throws IOException { OrchestrationContext expected = new OrchestrationContext(); - expected.setIsRollbackEnabled(false); + expected.setIsRollbackEnabled(true); RequestDetails requestDetails = mapper.readValue(new File(RESOURCE_PATH + "RequestDetailsInput_mapReqContext.json"), RequestDetails.class); diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockCMExpected.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockCMExpected.json index d3698771bf..60dd880040 100644 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockCMExpected.json +++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockCMExpected.json @@ -10,7 +10,7 @@ "configurationParameters": [] }, "orchContext": { - "is-rollback-enabled": true + "is-rollback-enabled": false }, "cloudRegion": { "lcp-cloud-region-id" : "myRegionId", -- cgit 1.2.3-korg