summaryrefslogtreecommitdiffstats
path: root/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2017-10-11 11:49:51 -0400
committerJim Hahn <jrh3@att.com>2017-10-11 11:49:51 -0400
commit015b92c3d96fb42f80b018fdf8f639f1cf3298c3 (patch)
treef96f2e944d456809702041bc9f9ef653ba061216 /bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp
parentf86960874497f005079c9e595b5e9e2eb0a815d1 (diff)
Add junit test coverage and fix bugs in VCPE
Added additional junit tests for VCPE and fixed bugs that were found while testing. Change-Id: Icb6a0c936a16b775ff553c11cb07a4348bd9ebfc Issue-ID: SO-210 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp')
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/AbstractTestBase.java41
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/CreateVcpeResCustServiceTest.java832
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DeleteVcpeResCustServiceTest.java297
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGRollbackTest.java283
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGTest.java226
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceTXCRollbackTest.java283
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceTXCTest.java239
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoDeleteAllottedResourceBRGTest.java106
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoDeleteAllottedResourceTXCTest.java106
9 files changed, 1723 insertions, 690 deletions
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/AbstractTestBase.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/AbstractTestBase.java
new file mode 100644
index 0000000000..e7b80f12ab
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/AbstractTestBase.java
@@ -0,0 +1,41 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.openecomp.mso.bpmn.vcpe;
+
+import org.openecomp.mso.bpmn.common.WorkflowTest;
+
+public class AbstractTestBase extends WorkflowTest {
+
+
+ public static final String CUST = "SDN-ETHERNET-INTERNET";
+ public static final String SVC = "123456789";
+ public static final String INST = "MIS%252F1604%252F0026%252FSW_INTERNET";
+ public static final String PARENT_INST = "MIS%252F1604%252F0027%252FSW_INTERNET";
+ public static final String ARID = "arId-1";
+ public static final String ARVERS = "1490627351232";
+
+ public static final String DEC_INST = "MIS%2F1604%2F0026%2FSW_INTERNET";
+ public static final String DEC_PARENT_INST = "MIS%2F1604%2F0027%2FSW_INTERNET";
+
+ public static final String VAR_SUCCESS_IND = "SuccessIndicator";
+ public static final String VAR_WFEX = "SavedWorkflowException1";
+ public static final String VAR_RESP_CODE = "CMSO_ResponseCode";
+ public static final String VAR_COMP_REQ = "CompleteMsoProcessRequest";
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/CreateVcpeResCustServiceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/CreateVcpeResCustServiceTest.java
index a94dc85d06..8f94187f48 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/CreateVcpeResCustServiceTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/CreateVcpeResCustServiceTest.java
@@ -1,4 +1,4 @@
-/*-
+/*
* ============LICENSE_START=======================================================
* ONAP - SO
* ================================================================================
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,24 +17,22 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.mso.bpmn.vcpe;
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
-import static com.github.tomakehurst.wiremock.client.WireMock.post;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteAllottedResource;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetCustomer;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutAllottedResource;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutGenericVnf;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutServiceInstance;
import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.MockGetServiceResourcesCatalogData;
import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
-// TODO: uncomment when Homing BB is merged
-// import static org.openecomp.mso.bpmn.mock.StubResponseSNIRO.mockSNIRO;
import java.io.IOException;
import java.util.HashMap;
@@ -42,569 +40,335 @@ import java.util.Map;
import java.util.UUID;
import org.camunda.bpm.engine.test.Deployment;
-import org.junit.Ignore;
import org.junit.Test;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse;
+import org.openecomp.mso.bpmn.common.BPMNUtil;
import org.openecomp.mso.bpmn.mock.FileUtil;
-public class CreateVcpeResCustServiceTest extends WorkflowTest {
+public class CreateVcpeResCustServiceTest extends AbstractTestBase {
+ private static final String PROCNAME = "CreateVcpeResCustService";
+ private static final String Prefix = "CVRCS_";
+
private final CallbackSet callbacks = new CallbackSet();
private final String request;
public CreateVcpeResCustServiceTest() throws IOException {
- callbacks.put("assign", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyAssignCallback.xml"));
- callbacks.put("query", FileUtil.readResourceFile("__files/VCPE/SDNCTopologyQueryCallbackNetworkInstance.xml"));
- callbacks.put("activate", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyActivateCallback.xml"));
- callbacks.put("vnfCreate", FileUtil.readResourceFile("__files/VCPE/VfModularity/VNFAdapterRestCreateCallback.xml"));
- callbacks.put("create", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyCreateCallback.xml"));
- callbacks.put("queryTXC", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceTXC/SDNCTopologyQueryCallback.xml"));
- callbacks.put("queryBRG", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceBRG/SDNCTopologyQueryCallback.xml"));
-
- callbacks.put("sniro", JSON, "SNIROResponse", FileUtil.readResourceFile("__files/BuildingBlocks/sniroCallback2AR1Vnf"));
- callbacks.put("sniro2", JSON, "SNIROResponse", FileUtil.readResourceFile("__files/BuildingBlocks/sniroCallback2AR1Vnf2Net"));
- callbacks.put("sniroNoSol", JSON, "SNIROResponse", FileUtil.readResourceFile("__files/BuildingBlocks/sniroCallbackNoSolutionFound"));
- callbacks.put("sniroPolicyEx", JSON, "SNIROResponse", FileUtil.readResourceFile("__files/BuildingBlocks/sniroCallbackPolicyException"));
- callbacks.put("sniroServiceEx", JSON, "SNIROResponse", FileUtil.readResourceFile("__files/BuildingBlocks/sniroCallbackServiceException"));
-
- request = FileUtil.readResourceFile("__files/VCPE/request.json");
+ callbacks.put("assign", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyAssignCallback.xml"));
+ callbacks.put("create", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyCreateCallback.xml"));
+ callbacks.put("activate", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyActivateCallback.xml"));
+ callbacks.put("queryTXC", FileUtil.readResourceFile("__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryTXCCallback.xml"));
+ callbacks.put("queryBRG", FileUtil.readResourceFile("__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryBRGCallback.xml"));
+ callbacks.put("deactivate", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeactivateCallback.xml"));
+ callbacks.put("delete", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeleteCallback.xml"));
+ callbacks.put("unassign", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyUnassignCallback.xml"));
+
+ request = FileUtil.readResourceFile("__files/VCPE/CreateVcpeResCustService/requestNoSIName.json");
}
+
+ @Test
+ @Deployment(resources = {
+ "process/CreateVcpeResCustService.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/GenericPutService.bpmn",
+ "subprocess/BuildingBlock/DecomposeService.bpmn",
+ "subprocess/DoCreateServiceInstance.bpmn",
+ "subprocess/DoCreateAllottedResourceTXC.bpmn",
+ "subprocess/DoCreateAllottedResourceBRG.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+
+ // stubs
+ "VCPE/stubprocess/Homing.bpmn",
+ "VCPE/stubprocess/DoCreateVnfAndModules.bpmn"})
+
+ public void testCreateVcpeResCustService_Success() throws Exception {
+
+ MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "2", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json");
+ MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json");
+ MockGetCustomer(CUST, "VCPE/CreateVcpeResCustService/getCustomer.xml");
+
+ // TODO: the SI should NOT have to be URL-encoded yet again!
+ MockPutServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
+
+ MockNodeQueryServiceInstanceById(INST, "GenericFlows/getSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
+ MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
+ MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
+ MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
+
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ Map<String, Object> variables = setupVariables();
+ String businessKey = UUID.randomUUID().toString();
+ invokeAsyncProcess(PROCNAME, "v1", businessKey, request, variables);
+
+ // for SI
+ injectSDNCCallbacks(callbacks, "assign");
+
+ // for TXC
+ injectSDNCCallbacks(callbacks, "assign");
+ injectSDNCCallbacks(callbacks, "create");
+ injectSDNCCallbacks(callbacks, "activate");
+ injectSDNCCallbacks(callbacks, "queryTXC");
+
+ // for BRG
+ injectSDNCCallbacks(callbacks, "assign");
+ injectSDNCCallbacks(callbacks, "create");
+ injectSDNCCallbacks(callbacks, "activate");
+ injectSDNCCallbacks(callbacks, "queryBRG");
+
+ waitForProcessEnd(businessKey, 10000);
-// /**
-// * End-to-End flow - Unit test for CreateVcpeResCustService.bpmn
-// * - String input & String response
-// */
-//
-// @Test
-// @Ignore
-// @Deployment(resources = {"process/CreateVcpeResCustService.bpmn",
-// "subprocess/DoCreateServiceInstance.bpmn",
-// "subprocess/DoCreateServiceInstanceRollback.bpmn",
-// "subprocess/DoCreateNetworkInstance.bpmn",
-// "subprocess/DoCreateNetworkInstanceRollback.bpmn",
-// "subprocess/DoCreateVnfAndModules.bpmn",
-// "subprocess/DoCreateAllottedResourceTXC.bpmn",
-// "subprocess/DoCreateAllottedResourceTXCRollback.bpmn",
-// "subprocess/DoCreateAllottedResourceBRG.bpmn",
-// "subprocess/DoCreateAllottedResourceBRGRollback.bpmn",
-// "subprocess/BuildingBlock/DecomposeService.bpmn",
-// "subprocess/BuildingBlock/Homing.bpmn",
-// "subprocess/GenericGetService.bpmn",
-// "subprocess/GenericPutService.bpmn",
-// "subprocess/SDNCAdapterV1.bpmn",
-// "subprocess/DoCreateVnf.bpmn",
-// "subprocess/GenericGetVnf.bpmn",
-// "subprocess/GenericPutVnf.bpmn",
-// "subprocess/FalloutHandler.bpmn",
-// "subprocess/GenericDeleteService.bpmn",
-// "subprocess/ReceiveWorkflowMessage.bpmn",
-// "subprocess/CompleteMsoProcess.bpmn"})
-//
-// public void invokeCreateServiceInstanceInfra_Success() throws Exception {
-//
-// logStart();
-//
-// // setup simulators
-// //MockGetCustomer_VCPE();
-// MockGetCustomer("MCBH-1610", "VCPE/getCustomer.xml");
-// //MockGetNetworkCatalogData_VCPE();
-// MockGetNetworkCatalogData("uuid-miu-svc-011-abcdef", "2", "VCPE/getCatalogNetworkData.json");
-// //MockGetVnfCatalogData_VCPE();
-// MockGetVnfCatalogData("uuid-miu-svc-011-abcdef", "2", "VCPE/getCatalogVnfData.json");
-// //MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "VCPE/getCatalogServiceResourcesData.json");
-// MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "VCPE/getCatalogServiceResourcesDataNoNetworkVnf.json");
-// MockGetServiceInstanceById_VCPE();
-// MockPutServiceInstance_VCPE();
-//
-// //SDNC Adapter Mocks
-// mockSDNCAdapterRest();
-// mockSDNCAdapter();
-//
-// //from CreateNetworkInstanceTest
-// sdncAdapterNetworkTopologySimulator_CreateNetworkV2();
-// MockNetworkAdapterResponse_CreateSuccessV2();
-// MockAAIResponse_queryName_CreateNetwork_404V2(); // 'network-name' not in AAI , Ok to Create.
-// MockAAIResponse_cloudRegion25_Success();
-// MockAAIResponse_queryId_CreateNetwork_SuccessV2();
-// MockAAIResponse_queryVpnBinding_CreateNetwork_SuccessV2();
-// MockAAIResponse_queryVpnBinding2_CreateNetwork_SuccessV2();
-// MockAAIResponse_queryNetworkPolicy_CreateNetwork_SuccessV2();
-// MockAAIResponse_queryNetworkTableRef_CreateNetwork_SuccessV2();
-// MockAAIResponse_updateContrail_CreateNetwork_SuccessV2();
-// MockDBUpdate_Success();
-// MocksAAIResponse_queryNetworkInstance_CreateNetwork_Success();
-//
-// //network AAI Mocks
-// MockGetNetworkById("680b7453-0ec4-4d96-b355-280d981d418f", "VCPE/getNetwork.xml");
-// MockGetNetworkById("444a701a-6419-45b2-aa52-b45a1b719cf6", "VCPE/getNetwork.xml");
-// MockGetNetworkById("cf82a73f-de7f-4f84-8dfc-16a487c63a36", "VCPE/getNetwork.xml");
-// MockPutNetwork("680b7453-0ec4-4d96-b355-280d981d418f");
-// MockPutNetwork("cf82a73f-de7f-4f84-8dfc-16a487c63a36");
-//
-// MockPutGenericVnf("9c61db87-345c-49ae-ac80-472211df5deb");
-//
-// mockSNIRO();
-//
-// String businessKey = UUID.randomUUID().toString();
-//// String createVfModuleRequest =
-//// FileUtil.readResourceFile("__files/VCPE/CreateVfModule_VID_request.json");
-//
-// Map<String, Object> variables = setupVariablesObjectMap();
-//
-// TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVcpeResCustService",
-// "v1", businessKey, getRequest(), variables);
-//
-// WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
-//
-// String responseBody = response.getResponse();
-// System.out.println("Workflow (Synch) Response:\n" + responseBody);
-//
-// injectSDNCCallbacks(callbacks, "assign, query");
-// injectSDNCCallbacks(callbacks, "activate");
-//
-// // TODO add appropriate assertions
-//
-// waitForProcessEnd(businessKey, 10000);
-// checkVariable(businessKey, "CreateVcpeResCustServiceSuccessIndicator", true);
-//
-// logEnd();
-// }
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ System.out.println("workflowException:\n" + workflowException);
+
+ String completionReq = BPMNUtil.getVariable(processEngineRule, PROCNAME, Prefix+VAR_COMP_REQ);
+ System.out.println("completionReq:\n" + completionReq);
+
+ assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, PROCNAME+VAR_SUCCESS_IND));
+ assertEquals("200", BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_RESP_CODE));
+ assertEquals(null, workflowException);
+ assertTrue(completionReq.indexOf("request-id>testRequestId<") >= 0);
+ assertTrue(completionReq.indexOf("action>CREATE<") >= 0);
+ assertTrue(completionReq.indexOf("source>VID<") >= 0);
+
+ assertEquals("1", BPMNUtil.getVariable(processEngineRule, PROCNAME, Prefix+"VnfsCreatedCount"));
+ }
+ @Test
+ @Deployment(resources = {
+ "process/CreateVcpeResCustService.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/GenericPutService.bpmn",
+ "subprocess/BuildingBlock/DecomposeService.bpmn",
+ "subprocess/DoCreateServiceInstance.bpmn",
+ "subprocess/DoCreateAllottedResourceTXC.bpmn",
+ "subprocess/DoCreateAllottedResourceBRG.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+
+ // stubs
+ "VCPE/stubprocess/Homing.bpmn",
+ "VCPE/stubprocess/DoCreateVnfAndModules.bpmn"})
- /**
- * TEST Decompose + Homing - Unit test for CreateVcpeResCustService.bpmn
- * - String input & String response
- */
+ public void testCreateVcpeResCustService_NoParts() throws Exception {
- @Test
-// TODO: run this test when Homing BB is merged
- @Ignore
- @Deployment(resources = {"process/CreateVcpeResCustService.bpmn",
- "subprocess/DoCreateServiceInstance.bpmn",
- "subprocess/DoCreateServiceInstanceRollback.bpmn",
- "subprocess/DoCreateNetworkInstance.bpmn",
- "subprocess/DoCreateNetworkInstanceRollback.bpmn",
- "subprocess/BuildingBlock/DecomposeService.bpmn",
- "subprocess/BuildingBlock/Homing.bpmn",
- "subprocess/GenericGetService.bpmn",
- "subprocess/GenericPutService.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/DoCreateVnf.bpmn",
- "subprocess/GenericGetVnf.bpmn",
- "subprocess/GenericPutVnf.bpmn",
- "subprocess/FalloutHandler.bpmn",
- "subprocess/GenericDeleteService.bpmn",
- "subprocess/DoCreateAllottedResourceBRG.bpmn",
- "subprocess/DoCreateAllottedResourceBRGRollback.bpmn",
- "subprocess/DoCreateAllottedResourceTXC.bpmn",
- "subprocess/DoCreateAllottedResourceTXCRollback.bpmn",
- "subprocess/CompleteMsoProcess.bpmn"})
-
- public void invokeDecompositionHomingCreateServiceInstanceNetwork() throws Exception {
-
- logStart();
-
- // setup simulators
- MockGetCustomer("MCBH-1610", "VCPE/getCustomer.xml");
-
- MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "2", "VCPE/getCatalogVcpe.json");
-
-// MockPutServiceInstance_VCPE();
-
-// MockGetNetworkByIdWithDepth("680b7453-0ec4-4d96-b355-280d981d418f", "VCPE/CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml", "1");
-// MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "VCPE/CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml", "1");
-
- MockPutGenericVnf("39ae1b77-4edd-4e94-846a-d087a35a2260");
-
- // stuff to satisfy TXC & BRG subflows
- MockNodeQueryServiceInstanceById("MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getSIUrlById.xml");
- MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
- MockNodeQueryServiceInstanceById("MIS%252F1604%252F0027%252FSW_INTERNET", "GenericFlows/getParentSIUrlById.xml");
- MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0027%252FSW_INTERNET", "GenericFlows/getParentServiceInstance.xml");
- MockPutAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0027%252FSW_INTERNET", "arId-1");
- MockPatchAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0027%252FSW_INTERNET", "arId-1");
+ MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "2", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesNoData.json");
+ MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesNoData.json");
+ MockGetCustomer(CUST, "VCPE/CreateVcpeResCustService/getCustomer.xml");
- mockSDNCAdapter(200);
+ // TODO: the SI should NOT have to be URL-encoded yet again!
+ MockPutServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
+
+ MockNodeQueryServiceInstanceById(INST, "GenericFlows/getSIUrlById.xml");
+ MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
+ MockNodeQueryServiceInstanceById(PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
+ MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
+
+ // TODO: should these really be PARENT_INST, or should they be INST?
+ MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
+ MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
+ mockSDNCAdapter(200);
mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ Map<String, Object> variables = setupVariables();
-// TODO: uncomment when Homing BB is merged
-// mockSNIRO();
+ String businessKey = UUID.randomUUID().toString();
+ invokeAsyncProcess(PROCNAME, "v1", businessKey, request, variables);
+
+ // for SI
+ injectSDNCCallbacks(callbacks, "assign");
+
+ waitForProcessEnd(businessKey, 10000);
- //Below works for Homing/Sniro
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ System.out.println("workflowException:\n" + workflowException);
+
+ String completionReq = BPMNUtil.getVariable(processEngineRule, PROCNAME, Prefix+VAR_COMP_REQ);
+ System.out.println("completionReq:\n" + completionReq);
- Map<String, Object> variables = setupVariablesObjectMap();
+ assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, PROCNAME+VAR_SUCCESS_IND));
+ assertEquals("200", BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_RESP_CODE));
+ assertEquals(null, workflowException);
+ assertTrue(completionReq.indexOf("request-id>testRequestId<") >= 0);
+ assertTrue(completionReq.indexOf("action>CREATE<") >= 0);
+ assertTrue(completionReq.indexOf("source>VID<") >= 0);
- String businessKey = UUID.randomUUID().toString();
- TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVcpeResCustService",
- "v1", businessKey, request, variables);
-
- WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
+ assertEquals("0", BPMNUtil.getVariable(processEngineRule, PROCNAME, Prefix+"VnfsCreatedCount"));
+ }
+
+ @Test
+ @Deployment(resources = {
+ "process/CreateVcpeResCustService.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/GenericPutService.bpmn",
+ "subprocess/BuildingBlock/DecomposeService.bpmn",
+ "subprocess/DoCreateServiceInstance.bpmn",
+ "subprocess/DoCreateAllottedResourceBRG.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+
+ // this stub will trigger a fault
+ "VCPE/stubprocess/DoCreateAllottedResourceTXC.bpmn",
+
+ // stubs
+ "VCPE/stubprocess/Homing.bpmn",
+ "VCPE/stubprocess/DoCreateVnfAndModules.bpmn"})
+
+ public void testCreateVcpeResCustService_Fault_NoRollback() throws Exception {
+
+ MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "2", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json");
+ MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json");
+ MockGetCustomer(CUST, "VCPE/CreateVcpeResCustService/getCustomer.xml");
+
+ // TODO: the SI should NOT have to be URL-encoded yet again!
+ MockPutServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
- String responseBody = response.getResponse();
- System.out.println("Workflow (Synch) Response:\n" + responseBody);
+ MockNodeQueryServiceInstanceById(INST, "GenericFlows/getSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
+ MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
+ MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
+ MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
- injectWorkflowMessages(callbacks, "sniro");
- injectSDNCCallbacks(callbacks, "assign, create, activate, queryTXC");
- injectSDNCCallbacks(callbacks, "assign, create, activate, queryBRG");
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ Map<String, Object> variables = setupVariables();
+ String req = FileUtil.readResourceFile("__files/VCPE/CreateVcpeResCustService/requestNoSINameNoRollback.json");
+
+ String businessKey = UUID.randomUUID().toString();
+ invokeAsyncProcess(PROCNAME, "v1", businessKey, req, variables);
+
+ // for SI
+ injectSDNCCallbacks(callbacks, "assign");
+
waitForProcessEnd(businessKey, 10000);
- checkVariable(businessKey, "CreateVcpeResCustServiceSuccessIndicator", true);
- logEnd();
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ System.out.println("workflowException:\n" + workflowException);
+
+ String completionReq = BPMNUtil.getVariable(processEngineRule, PROCNAME, Prefix+VAR_COMP_REQ);
+ System.out.println("completionReq:\n" + completionReq);
+
+ assertEquals(null, BPMNUtil.getVariable(processEngineRule, PROCNAME, PROCNAME+VAR_SUCCESS_IND));
+ assertEquals(null, BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_RESP_CODE));
+ assertNotNull(workflowException);
+
+ BPMNUtil.assertNoProcessInstance(processEngineRule, "DoCreateAllottedResourceBRGRollback");
+ BPMNUtil.assertNoProcessInstance(processEngineRule, "DoCreateVnfAndModulesRollback");
+ BPMNUtil.assertNoProcessInstance(processEngineRule, "DoCreateAllottedResourceTXCRollback");
}
+ @Test
+ @Deployment(resources = {
+ "process/CreateVcpeResCustService.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/GenericPutService.bpmn",
+ "subprocess/BuildingBlock/DecomposeService.bpmn",
+ "subprocess/DoCreateServiceInstance.bpmn",
+ "subprocess/DoCreateAllottedResourceTXC.bpmn",
+ "subprocess/DoCreateAllottedResourceTXCRollback.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+
+ // this stub will trigger a fault
+ "VCPE/stubprocess/DoCreateAllottedResourceBRG.bpmn",
+
+ // stubs
+ "VCPE/stubprocess/DoCreateAllottedResourceBRGRollback.bpmn",
+ "VCPE/stubprocess/DoCreateVnfAndModulesRollback.bpmn",
+ "VCPE/stubprocess/DoCreateServiceInstanceRollback.bpmn",
+ "VCPE/stubprocess/Homing.bpmn",
+ "VCPE/stubprocess/DoCreateVnfAndModules.bpmn"})
- /**
- * TEST Decompose + Homing - Unit test for CreateVcpeResCustService.bpmn
- * - String input & String response
- */
-
-// @Test
-// @Deployment(resources = {"process/CreateVcpeResCustService.bpmn",
-// "subprocess/DoCreateServiceInstance.bpmn",
-// "subprocess/DoCreateServiceInstanceRollback.bpmn",
-// "subprocess/DoCreateNetworkInstance.bpmn",
-// "subprocess/DoCreateNetworkInstanceRollback.bpmn",
-// "subprocess/BuildingBlock/DecomposeService.bpmn",
-// "subprocess/BuildingBlock/Homing.bpmn",
-// "subprocess/DoCreateAllottedResourceTXC.bpmn",
-// "subprocess/DoCreateAllottedResourceTXCRollback.bpmn",
-// "subprocess/DoCreateAllottedResourceBRG.bpmn",
-// "subprocess/DoCreateAllottedResourceBRGRollback.bpmn",
-// "subprocess/GenericGetService.bpmn",
-// "subprocess/GenericPutService.bpmn",
-// "subprocess/SDNCAdapterV1.bpmn",
-// "subprocess/DoCreateVnf.bpmn",
-// "subprocess/GenericGetVnf.bpmn",
-// "subprocess/GenericPutVnf.bpmn",
-// "subprocess/FalloutHandler.bpmn",
-// "subprocess/GenericDeleteService.bpmn",
-// "subprocess/ReceiveWorkflowMessage.bpmn",
-// "subprocess/CompleteMsoProcess.bpmn"})
-//
-// public void invokeDecompositionHomingCreateServiceInstanceARs() throws Exception {
-//
-// logStart();
-//
-// // setup simulators
-// MockGetCustomer("MCBH-1610", "VCPE/getCustomer.xml");
-//
-// MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "VCPE/getCatalogServiceResourcesDataServiceAllotted.json");
-//
-// MockPutServiceInstance_VCPE();
-// //network AAI Mocks
-// MockGetNetworkById("cf82a73f-de7f-4f84-8dfc-16a487c63a36", "VCPE/getNetwork.xml");
-// MockPutNetwork("cf82a73f-de7f-4f84-8dfc-16a487c63a36");
-//
-// MockNodeQueryServiceInstanceById("c763d462-dfe4-4577-9706-fa3a9db640be", "VCPE/getSIUrlById.xml");
-//
-// mockSDNCAdapter();
-//
-// MockNodeQueryServiceInstanceById("MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getSIUrlById.xml");
-// MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET");
-// MockPutAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "arId-1");
-// MockPutAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET_in-use", "arId-1");
-// MockPatchAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET_in-use", "arId-1");
-//
-//
-// MockDBUpdateVfModule();
-//
-// mockSNIRO();
-//
-// String businessKey = UUID.randomUUID().toString();
-//
-// //Below works for Homing/Sniro
-//
-// Map<String, Object> variables = setupVariablesObjectMap();
-// TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVcpeResCustService", "v1", businessKey, getRequest(), variables);
-// WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
-// String responseBody = response.getResponse();
-// System.out.println("Workflow (Synch) Response:\n" + responseBody);
-//
-// //Below is from CreateVcpeResCustService
-//// Map<String, String> variables = setupVariables();
-//// WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CreateVcpeResCustService", variables);
-//// waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
-//// String workflowResp = BPMNUtil.getVariable(processEngineRule, "CreateVcpeResCustService", "WorkflowResponse");
-//
-// injectWorkflowMessages(callbacks, "sniro");
-// // TODO add appropriate assertions
-// injectSDNCCallbacks(callbacks, "assign, query, create, activate, queryTXC, assign, create, activate, queryBRG");
-// waitForProcessEnd(businessKey, 10000);
-//
-//// checkVariable(businessKey, "CreateVcpeResCustServiceSuccessIndicator", true);
-//
-// logEnd();
-// }
-//
-//
-// /**
-// * TEST Decompose + Homing - Unit test for CreateVcpeResCustService.bpmn
-// * - String input & String response
-// */
-//
-// @Test
-// //@Ignore
-// @Deployment(resources = {"process/CreateVcpeResCustService.bpmn",
-// "subprocess/DoCreateServiceInstance.bpmn",
-// "subprocess/DoCreateServiceInstanceRollback.bpmn",
-// "subprocess/DoCreateNetworkInstance.bpmn",
-// "subprocess/DoCreateNetworkInstanceRollback.bpmn",
-// "subprocess/BuildingBlock/DecomposeService.bpmn",
-// "subprocess/BuildingBlock/Homing.bpmn",
-// "subprocess/DoCreateVnfAndModules.bpmn",
-// "subprocess/DoCreateVnfAndModulesRollback.bpmn",
-// "subprocess/DoCreateAllottedResourceTXC.bpmn",
-// "subprocess/DoCreateAllottedResourceTXCRollback.bpmn",
-// "subprocess/DoCreateAllottedResourceBRG.bpmn",
-// "subprocess/DoCreateAllottedResourceBRGRollback.bpmn",
-// "subprocess/GenericGetService.bpmn",
-// "subprocess/GenericPutService.bpmn",
-// "subprocess/SDNCAdapterV1.bpmn",
-// "subprocess/DoCreateVnf.bpmn",
-// "subprocess/GenericGetVnf.bpmn",
-// "subprocess/GenericPutVnf.bpmn",
-// "subprocess/FalloutHandler.bpmn",
-// "subprocess/GenericDeleteService.bpmn",
-// "subprocess/ReceiveWorkflowMessage.bpmn",
-// "subprocess/CompleteMsoProcess.bpmn"})
-//
-// public void invokeDecompositionHomingCreateServiceVnf() throws Exception {
-//
-// logStart();
-//
-// // setup simulators
-// MockGetCustomer("MCBH-1610", "VCPE/getCustomer.xml");
-//
-// MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "VCPE/getCatalogServiceResourcesServiceVnf.json");
-//
-// MockPutServiceInstance_VCPE();
-// //network AAI Mocks
-// MockGetNetworkById("cf82a73f-de7f-4f84-8dfc-16a487c63a36", "VCPE/getNetwork.xml");
-// MockPutNetwork("cf82a73f-de7f-4f84-8dfc-16a487c63a36");
-//
-// MockNodeQueryServiceInstanceById("c763d462-dfe4-4577-9706-fa3a9db640be", "VCPE/getSIUrlById.xml");
-//
-//
-// MockNodeQueryServiceInstanceById("MIS%2F1604%2F0026%2FSW_INTERNET", "GenericFlows/getSIUrlByIdVcpe.xml");
-// MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET");
-// MockGetGenericVnfById_404("testVnfId");
-// MockPutGenericVnf(".*");
-// MockAAIVfModule();
-// MockPatchGenericVnf("skask");
-// MockPatchVfModuleId("skask", ".*");
-// MockSDNCAdapterVfModule();
-// MockVNFAdapterRestVfModule();
-// MockDBUpdateVfModule();
-//
-//
-// mockSDNCAdapter();
-// //mockSDNCAdapterRest();
-//
-// //MockSDNCAdapterServiceInstanceModule();
-//
-// //mockSDNCAdapterTopology("CreateNetworkV2mock/sdncCreateNetworkTopologyRsrcAssignResponse.xml", "SvcAction>assign");
-//
-// MockDBUpdateVfModule();
-//
-// mockSNIRO();
-//
-// String businessKey = UUID.randomUUID().toString();
-//
-// //Below works for Homing/Sniro
-//
-// Map<String, Object> variables = setupVariablesObjectMap();
-// TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVcpeResCustService", "v1", businessKey, getRequest(), variables);
-// WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
-// String responseBody = response.getResponse();
-// System.out.println("Workflow (Synch) Response:\n" + responseBody);
-//
-// //Below is from CreateVcpeResCustService
-//// Map<String, String> variables = setupVariables();
-//// WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CreateVcpeResCustService", variables);
-//// waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
-//// String workflowResp = BPMNUtil.getVariable(processEngineRule, "CreateVcpeResCustService", "WorkflowResponse");
-//
-// injectWorkflowMessages(callbacks, "sniro");
-// // TODO add appropriate assertions
-// injectSDNCCallbacks(callbacks, "assign, query");
-// waitForProcessEnd(businessKey, 10000);
-//
-//// checkVariable(businessKey, "CreateVcpeResCustServiceSuccessIndicator", true);
-//
-// logEnd();
-// }
-//
-//
-// /**
-// * TEST Decompose + Homing - Unit test for CreateVcpeResCustService.bpmn
-// * - String input & String response
-// */
-//
-// @Test
-// //@Ignore
-// @Deployment(resources = {"process/CreateVcpeResCustService.bpmn",
-// "subprocess/DoCreateServiceInstance.bpmn",
-// "subprocess/DoCreateServiceInstanceRollback.bpmn",
-// "subprocess/DoCreateNetworkInstance.bpmn",
-// "subprocess/DoCreateNetworkInstanceRollback.bpmn",
-// "subprocess/BuildingBlock/DecomposeService.bpmn",
-// "subprocess/BuildingBlock/Homing.bpmn",
-// "subprocess/DoCreateVnfAndModules.bpmn",
-// "subprocess/DoCreateVnfAndModulesRollback.bpmn",
-// "subprocess/DoCreateAllottedResourceTXC.bpmn",
-// "subprocess/DoCreateAllottedResourceTXCRollback.bpmn",
-// "subprocess/DoCreateAllottedResourceBRG.bpmn",
-// "subprocess/DoCreateAllottedResourceBRGRollback.bpmn",
-// "subprocess/GenericGetService.bpmn",
-// "subprocess/GenericPutService.bpmn",
-// "subprocess/SDNCAdapterV1.bpmn",
-// "subprocess/DoCreateVnf.bpmn",
-// "subprocess/GenericGetVnf.bpmn",
-// "subprocess/GenericPutVnf.bpmn",
-// "subprocess/FalloutHandler.bpmn",
-// "subprocess/GenericDeleteService.bpmn",
-// "subprocess/ReceiveWorkflowMessage.bpmn",
-// "subprocess/CompleteMsoProcess.bpmn"})
-//
-// public void invokeCreateAll() throws Exception {
-//
-// logStart();
-//
-// // setup simulators
-// MockGetCustomer("MCBH-1610", "VCPE/getCustomer.xml");
-//
-// MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "VCPE/getCatalogServiceResourcesData.json");
-//
-// MockPutServiceInstance_VCPE();
-// //network AAI Mocks
-// MockGetNetworkById("cf82a73f-de7f-4f84-8dfc-16a487c63a36", "VCPE/getNetwork.xml");
-// MockPutNetwork("cf82a73f-de7f-4f84-8dfc-16a487c63a36");
-//
-// MockNodeQueryServiceInstanceById("c763d462-dfe4-4577-9706-fa3a9db640be", "VCPE/getSIUrlById.xml");
-//
-// MockGetNetworkByIdWithDepth("680b7453-0ec4-4d96-b355-280d981d418f", "VCPE/CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml", "1");
-// MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "VCPE/CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml", "1");
-// MockNetworkAdapterPost("CreateNetworkV2/createNetworkResponse_Success.xml", "VCPE/createNetworkRequest");
-// MockGetNetworkVpnBindingWithDepth("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017", "all");
-// MockGetNetworkVpnBindingWithDepth("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6", "all");
-// MockGetNetworkPolicyWithDepth("CreateNetworkV2/createNetwork_queryNetworkPolicy_AAIResponse_Success.xml", "cee6d136-e378-4678-a024-2cd15f0ee0cg", "all");
-// MockGetNetworkTableReferenceWithDepth("CreateNetworkV2/createNetwork_queryNetworkTableRef1_AAIResponse_Success.xml", "refFQDN1", "all");
-// MockGetNetworkTableReferenceWithDepth("CreateNetworkV2/createNetwork_queryNetworkTableRef1_AAIResponse_Success.xml", "refFQDN2", "all");
-// MockPutNetworkIdWithDepth("CreateNetworkV2/createNetwork_updateContrail_AAIResponse_Success.xml", "680b7453-0ec4-4d96-b355-280d981d418f", "1");
-// MockPutNetworkIdWithDepth("CreateNetworkV2/createNetwork_updateContrail_AAIResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "1");
-//
-//
-// MockNodeQueryServiceInstanceById("MIS%2F1604%2F0026%2FSW_INTERNET", "GenericFlows/getSIUrlByIdVcpe.xml");
-// MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET");
-// MockGetGenericVnfById_404("testVnfId");
-// MockPutGenericVnf(".*");
-// MockAAIVfModule();
-// MockPatchGenericVnf("skask");
-// MockPatchVfModuleId("skask", ".*");
-// MockSDNCAdapterVfModule();
-// MockVNFAdapterRestVfModule();
-// MockDBUpdateVfModule();
-//
-//
-// mockSDNCAdapter();
-// //mockSDNCAdapterRest();
-//
-// //MockSDNCAdapterServiceInstanceModule();
-//
-// //mockSDNCAdapterTopology("CreateNetworkV2mock/sdncCreateNetworkTopologyRsrcAssignResponse.xml", "SvcAction>assign");
-//
-// MockDBUpdateVfModule();
-//
-// mockSNIRO();
-//
-// String businessKey = UUID.randomUUID().toString();
-//
-// //Below works for Homing/Sniro
-//
-// Map<String, Object> variables = setupVariablesObjectMap();
-// TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVcpeResCustService", "v1", businessKey, getRequest(), variables);
-// WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
-// String responseBody = response.getResponse();
-// System.out.println("Workflow (Synch) Response:\n" + responseBody);
-//
-// //Below is from CreateVcpeResCustService
-//// Map<String, String> variables = setupVariables();
-//// WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CreateVcpeResCustService", variables);
-//// waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
-//// String workflowResp = BPMNUtil.getVariable(processEngineRule, "CreateVcpeResCustService", "WorkflowResponse");
-//
-// injectWorkflowMessages(callbacks, "sniro");
-// // TODO add appropriate assertions
-// injectSDNCCallbacks(callbacks, "assign, query");
-// waitForProcessEnd(businessKey, 10000);
-//
-//// checkVariable(businessKey, "CreateVcpeResCustServiceSuccessIndicator", true);
-//
-// logEnd();
-// }
+ public void testCreateVcpeResCustService_Fault_Rollback() throws Exception {
+
+ MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "2", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json");
+ MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json");
+ MockGetCustomer(CUST, "VCPE/CreateVcpeResCustService/getCustomer.xml");
+
+ // TODO: the SI should NOT have to be URL-encoded yet again!
+ MockPutServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
+
+ MockNodeQueryServiceInstanceById(INST, "GenericFlows/getSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
+ MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
+ MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/CreateVcpeResCustService/arGetById.xml");
+ MockGetAllottedResource(CUST, SVC, PARENT_INST, ARID, "VCPE/CreateVcpeResCustService/arGetById.xml");
+ MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
+ MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
+ MockDeleteAllottedResource(CUST, SVC, PARENT_INST, ARID, ARVERS);
+
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ Map<String, Object> variables = setupVariables();
+
+ String businessKey = UUID.randomUUID().toString();
+ invokeAsyncProcess(PROCNAME, "v1", businessKey, request, variables);
+
+ // for SI
+ injectSDNCCallbacks(callbacks, "assign");
+
+ // for TXC
+ injectSDNCCallbacks(callbacks, "assign");
+ injectSDNCCallbacks(callbacks, "create");
+ injectSDNCCallbacks(callbacks, "activate");
+ injectSDNCCallbacks(callbacks, "queryTXC");
+
+ // BRG is a stub so don't need SDNC callbacks
+
+ // for TXC rollback
+ injectSDNCCallbacks(callbacks, "deactivate");
+ injectSDNCCallbacks(callbacks, "delete");
+ injectSDNCCallbacks(callbacks, "unassign");
+
+ waitForProcessEnd(businessKey, 10000);
+
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ System.out.println("workflowException:\n" + workflowException);
+
+ String completionReq = BPMNUtil.getVariable(processEngineRule, PROCNAME, Prefix+VAR_COMP_REQ);
+ System.out.println("completionReq:\n" + completionReq);
+
+ assertEquals(null, BPMNUtil.getVariable(processEngineRule, PROCNAME, PROCNAME+VAR_SUCCESS_IND));
+ assertEquals(null, BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_RESP_CODE));
+ assertEquals(null, completionReq);
+ assertNotNull(workflowException);
+
+ BPMNUtil.assertAnyProcessInstanceFinished(processEngineRule, "DoCreateAllottedResourceBRGRollback");
+ BPMNUtil.assertAnyProcessInstanceFinished(processEngineRule, "DoCreateVnfAndModulesRollback");
+ BPMNUtil.assertAnyProcessInstanceFinished(processEngineRule, "DoCreateAllottedResourceTXCRollback");
+ }
// *****************
// Utility Section
// *****************
// Success Scenario
- private Map<String, Object> setupVariablesObjectMap() {
+ private Map<String, Object> setupVariables() {
Map<String, Object> variables = new HashMap<>();
variables.put("requestId", "testRequestId");
variables.put("request-id", "testRequestId");
- variables.put("CREVAS_testServiceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4"); // assigned for testing
- variables.put("serviceInstanceId", "c763d462-dfe4-4577-9706-fa3a9db640be");// unit test
- variables.put("sourceNetworkId", "c763d462-dfe4-4577-9706-fa3a9db640be");// unit test
- variables.put("networkId", "c763d462-dfe4-4577-9706-fa3a9db640be");// unit test
- variables.put("sourceNetworkRole", "whoknows");// unit test
- variables.put("allottedResourceId", "arId-1");
+ variables.put("serviceInstanceId", DEC_INST);
+ variables.put("allottedResourceId", ARID);
variables.put("junitSleepMs", "5");
return variables;
}
-
-// private Map<String, String> setupVariables() {
-// Map<String, String> variables = new HashMap<String, String>();
-// variables.put("bpmnRequest", getRequest());
-// variables.put("mso-request-id", "testRequestId");
-// variables.put("CREVAS_testServiceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4"); // assigned for testing
-// variables.put("serviceInstanceId", "c763d462-dfe4-4577-9706-fa3a9db640be");// unit test
-// variables.put("sourceNetworkId", "c763d462-dfe4-4577-9706-fa3a9db640be");// unit test
-// variables.put("sourceNetworkRole", "whoknows");// unit test
-// variables.put("allottedResourceId", "arId-1");
-// variables.put("junitSleepMs", "5");
-// return variables;
-//
-// }
-
- // start of mocks used locally and by other VF Module unit tests
- public static void MockSDNCAdapterVfModule() {
- // simplified the implementation to return "success" for all requests
- stubFor(post(urlEqualTo("/SDNCAdapter"))
-// .withRequestBody(containing("SvcInstanceId><"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("VfModularity/StandardSDNCSynchResponse.xml")));
-// stubFor(post(urlEqualTo("/SDNCAdapter"))
-// .withRequestBody(containing("vnf-type>STMTN"))
-// .willReturn(aResponse()
-// .withStatus(200)
-// .withHeader("Content-Type", "text/xml")
-// .withBodyFile("VfModularity/StandardSDNCSynchResponse.xml")));
-// stubFor(post(urlEqualTo("/SDNCAdapter"))
-// .withRequestBody(containing("SvcAction>query"))
-// .willReturn(aResponse()
-// .withStatus(200)
-// .withHeader("Content-Type", "text/xml")
-// .withBodyFile("VfModularity/StandardSDNCSynchResponse.xml")));
- }
-
-
-
-
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DeleteVcpeResCustServiceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DeleteVcpeResCustServiceTest.java
new file mode 100644
index 0000000000..88b6464de0
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DeleteVcpeResCustServiceTest.java
@@ -0,0 +1,297 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.openecomp.mso.bpmn.vcpe;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteAllottedResource;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockQueryAllottedResourceById;
+import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
+import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import org.camunda.bpm.engine.test.Deployment;
+import org.junit.Test;
+import org.openecomp.mso.bpmn.common.BPMNUtil;
+import org.openecomp.mso.bpmn.mock.FileUtil;
+
+import com.github.tomakehurst.wiremock.stubbing.Scenario;
+
+public class DeleteVcpeResCustServiceTest extends AbstractTestBase {
+
+ private static final String PROCNAME = "DeleteVcpeResCustService";
+ private static final String Prefix = "DVRCS_";
+ private static final String AR_BRG_ID = "ar-brgB";
+ private static final String AR_TXC_ID = "ar-txcA";
+
+ private final CallbackSet callbacks = new CallbackSet();
+ private final String request;
+
+ public DeleteVcpeResCustServiceTest() throws IOException {
+ callbacks.put("deactivate", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeactivateCallback.xml"));
+ callbacks.put("delete", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeleteCallback.xml"));
+ callbacks.put("unassign", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyUnassignCallback.xml"));
+
+ request = FileUtil.readResourceFile("__files/VCPE/DeleteVcpeResCustService/request.json");
+ }
+
+ @Test
+ @Deployment(resources = {
+ "process/DeleteVcpeResCustService.bpmn",
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/GenericDeleteService.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoDeleteServiceInstance.bpmn",
+ "subprocess/DoDeleteAllottedResourceBRG.bpmn",
+ "subprocess/DoDeleteAllottedResourceTXC.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+
+ // stubs
+ "VCPE/stubprocess/DoDeleteVnfAndModules.bpmn"})
+
+ public void testDeleteVcpeResCustService_Success() throws Exception {
+
+ MockNodeQueryServiceInstanceById(INST, "GenericFlows/getSIUrlById.xml");
+
+ // TODO: use INST instead of DEC_INST
+ /*
+ * Seems to be a bug in GenericDeleteService (or its subflows) as they
+ * fail to URL-encode the SI id before performing the query so we'll
+ * add a stub for that case, too.
+ */
+ MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml");
+
+ /*
+ * cannot use MockGetServiceInstance(), because we need to return
+ * different responses as we traverse through the flow
+ */
+
+ // initially, the SI includes the ARs
+ stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + CUST + "/service-subscriptions/service-subscription/" + SVC + "/service-instances/service-instance/" + INST))
+ .inScenario("SI retrieval")
+ .whenScenarioStateIs(Scenario.STARTED)
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("VCPE/DeleteVcpeResCustService/getSI.xml"))
+ .willSetStateTo("ARs Deleted"));
+
+ // once the ARs have been deleted, the SI should be empty
+ stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + CUST + "/service-subscriptions/service-subscription/" + SVC + "/service-instances/service-instance/" + INST))
+ .inScenario("SI retrieval")
+ .whenScenarioStateIs("ARs Deleted")
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("VCPE/DeleteVcpeResCustService/getSIAfterDelArs.xml")));
+
+ // for BRG
+ MockQueryAllottedResourceById(AR_BRG_ID, "VCPE/DeleteVcpeResCustService/getBRGArUrlById.xml");
+ MockGetAllottedResource(CUST, SVC, INST, AR_BRG_ID, "VCPE/DeleteVcpeResCustService/arGetBRGById.xml");
+ MockPatchAllottedResource(CUST, SVC, INST, AR_BRG_ID);
+ MockDeleteAllottedResource(CUST, SVC, INST, AR_BRG_ID, ARVERS);
+
+ // for TXC
+ MockQueryAllottedResourceById(AR_TXC_ID, "VCPE/DeleteVcpeResCustService/getTXCArUrlById.xml");
+ MockGetAllottedResource(CUST, SVC, INST, AR_TXC_ID, "VCPE/DeleteVcpeResCustService/arGetTXCById.xml");
+ MockPatchAllottedResource(CUST, SVC, INST, AR_TXC_ID);
+ MockDeleteAllottedResource(CUST, SVC, INST, AR_TXC_ID, ARVERS);
+
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ Map<String, Object> variables = setupVariables();
+
+ String businessKey = UUID.randomUUID().toString();
+ invokeAsyncProcess(PROCNAME, "v1", businessKey, request, variables);
+
+ // for BRG
+ injectSDNCCallbacks(callbacks, "deactivate");
+ injectSDNCCallbacks(callbacks, "delete");
+ injectSDNCCallbacks(callbacks, "unassign");
+
+ // for TXC
+ injectSDNCCallbacks(callbacks, "deactivate");
+ injectSDNCCallbacks(callbacks, "delete");
+ injectSDNCCallbacks(callbacks, "unassign");
+
+ // for SI
+ injectSDNCCallbacks(callbacks, "deactivate");
+ injectSDNCCallbacks(callbacks, "delete");
+
+ waitForProcessEnd(businessKey, 10000);
+
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ System.out.println("workflowException:\n" + workflowException);
+
+ String completionReq = BPMNUtil.getVariable(processEngineRule, PROCNAME, Prefix+VAR_COMP_REQ);
+ System.out.println("completionReq:\n" + completionReq);
+
+ assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, PROCNAME+VAR_SUCCESS_IND));
+ assertEquals("200", BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_RESP_CODE));
+ assertEquals(null, workflowException);
+ assertTrue(completionReq.indexOf("<request-id>testRequestId<") >= 0);
+ assertTrue(completionReq.indexOf("<action>DELETE<") >= 0);
+ assertTrue(completionReq.indexOf("<source>VID<") >= 0);
+
+ assertEquals("2", BPMNUtil.getVariable(processEngineRule, PROCNAME, Prefix+"vnfsDeletedCount"));
+
+ BPMNUtil.assertAnyProcessInstanceFinished(processEngineRule, "DoDeleteVnfAndModules");
+ }
+
+ @Test
+ @Deployment(resources = {
+ "process/DeleteVcpeResCustService.bpmn",
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/GenericDeleteService.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoDeleteServiceInstance.bpmn",
+ "subprocess/DoDeleteAllottedResourceBRG.bpmn",
+ "subprocess/DoDeleteAllottedResourceTXC.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+
+ // stubs
+ "VCPE/stubprocess/DoDeleteVnfAndModules.bpmn"})
+
+ public void testDeleteVcpeResCustService_NoBRG_NoTXC_NoVNF() throws Exception {
+
+ MockNodeQueryServiceInstanceById(INST, "GenericFlows/getSIUrlById.xml");
+
+ // TODO: use INST instead of DEC_INST
+ /*
+ * Seems to be a bug in GenericDeleteService (or its subflows) as they
+ * fail to URL-encode the SI id before performing the query so we'll
+ * add a stub for that case, too.
+ */
+ MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml");
+
+ MockGetServiceInstance(CUST, SVC, INST, "VCPE/DeleteVcpeResCustService/getSIAfterDelArs.xml");
+
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ Map<String, Object> variables = setupVariables();
+
+ String businessKey = UUID.randomUUID().toString();
+ invokeAsyncProcess(PROCNAME, "v1", businessKey, request, variables);
+
+ // for SI
+ injectSDNCCallbacks(callbacks, "deactivate");
+ injectSDNCCallbacks(callbacks, "delete");
+
+ waitForProcessEnd(businessKey, 10000);
+
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ System.out.println("workflowException:\n" + workflowException);
+
+ String completionReq = BPMNUtil.getVariable(processEngineRule, PROCNAME, Prefix+VAR_COMP_REQ);
+ System.out.println("completionReq:\n" + completionReq);
+
+ assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, PROCNAME+VAR_SUCCESS_IND));
+ assertEquals("200", BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_RESP_CODE));
+ assertEquals(null, workflowException);
+ assertTrue(completionReq.indexOf("<request-id>testRequestId<") >= 0);
+ assertTrue(completionReq.indexOf("<action>DELETE<") >= 0);
+ assertTrue(completionReq.indexOf("<source>VID<") >= 0);
+
+ assertEquals("0", BPMNUtil.getVariable(processEngineRule, PROCNAME, Prefix+"vnfsDeletedCount"));
+
+ BPMNUtil.assertNoProcessInstance(processEngineRule, "DoDeleteVnfAndModules");
+ }
+
+ @Test
+ @Deployment(resources = {
+ "process/DeleteVcpeResCustService.bpmn",
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/GenericDeleteService.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoDeleteServiceInstance.bpmn",
+ "subprocess/DoDeleteAllottedResourceBRG.bpmn",
+ "subprocess/DoDeleteAllottedResourceTXC.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+
+ // stubs
+ "VCPE/stubprocess/DoDeleteVnfAndModules.bpmn"})
+
+ public void testDeleteVcpeResCustService_Fault() throws Exception {
+
+ MockNodeQueryServiceInstanceById(INST, "GenericFlows/getSIUrlById.xml");
+
+ // TODO: use INST instead of DEC_INST
+ /*
+ * Seems to be a bug in GenericDeleteService (or its subflows) as they
+ * fail to URL-encode the SI id before performing the query so we'll
+ * add a stub for that case, too.
+ */
+ MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml");
+
+ MockGetServiceInstance(CUST, SVC, INST, "VCPE/DeleteVcpeResCustService/getSIAfterDelArs.xml");
+
+ // generate failure
+ mockSDNCAdapter(404);
+
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ Map<String, Object> variables = setupVariables();
+
+ String businessKey = UUID.randomUUID().toString();
+ invokeAsyncProcess(PROCNAME, "v1", businessKey, request, variables);
+
+ waitForProcessEnd(businessKey, 10000);
+
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ System.out.println("workflowException:\n" + workflowException);
+
+ String completionReq = BPMNUtil.getVariable(processEngineRule, PROCNAME, Prefix+VAR_COMP_REQ);
+ System.out.println("completionReq:\n" + completionReq);
+
+ assertEquals(null, BPMNUtil.getVariable(processEngineRule, PROCNAME, PROCNAME+VAR_SUCCESS_IND));
+ assertEquals(null, BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_RESP_CODE));
+ assertNotNull(workflowException);
+ }
+
+ private Map<String, Object> setupVariables() throws UnsupportedEncodingException {
+ Map<String, Object> variables = new HashMap<>();
+ variables.put("isDebugLogEnabled", "true");
+ variables.put("requestId", "testRequestId");
+ variables.put("serviceInstanceId", DEC_INST);
+ variables.put("sdncVersion", "1802");
+ variables.put("serviceInstanceName", "some-junk-name");
+ return variables;
+ }
+
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGRollbackTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGRollbackTest.java
index f5c3775273..0407e172e2 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGRollbackTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGRollbackTest.java
@@ -1,4 +1,4 @@
-/*-
+/*
* ============LICENSE_START=======================================================
* ONAP - SO
* ================================================================================
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,13 +17,12 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
-/*
- * © 2014 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property.
- */
package org.openecomp.mso.bpmn.vcpe;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteAllottedResource;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource;
@@ -36,23 +35,22 @@ import java.util.Map;
import java.util.UUID;
import org.camunda.bpm.engine.test.Deployment;
-import org.junit.Assert;
import org.junit.Test;
import org.openecomp.mso.bpmn.common.BPMNUtil;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
import org.openecomp.mso.bpmn.core.RollbackData;
import org.openecomp.mso.bpmn.mock.FileUtil;
-public class DoCreateAllottedResourceBRGRollbackTest extends WorkflowTest {
+public class DoCreateAllottedResourceBRGRollbackTest extends AbstractTestBase {
+ private static final String PROCNAME = "DoCreateAllottedResourceBRGRollback";
private static final String RbType = "DCARBRG_";
private final CallbackSet callbacks = new CallbackSet();
public DoCreateAllottedResourceBRGRollbackTest() throws IOException {
- callbacks.put("deactivate", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyDeactivateCallback.xml"));
- callbacks.put("delete", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyDeleteCallback.xml"));
- callbacks.put("unassign", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyUnassignCallback.xml"));
+ callbacks.put("deactivate", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeactivateCallback.xml"));
+ callbacks.put("delete", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeleteCallback.xml"));
+ callbacks.put("unassign", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyUnassignCallback.xml"));
}
@Test
@@ -60,11 +58,11 @@ public class DoCreateAllottedResourceBRGRollbackTest extends WorkflowTest {
"subprocess/SDNCAdapterV1.bpmn",
"subprocess/FalloutHandler.bpmn",
"subprocess/DoCreateAllottedResourceBRGRollback.bpmn"})
- public void testDoCreateAllottedResourceBRGRollback_success() throws Exception {
+ public void testDoCreateAllottedResourceBRGRollback_Success() throws Exception {
- MockGetAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "arId-1", "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml");
- MockPatchAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "arId-1");
- MockDeleteAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "arId-1", "1490627351232");
+ MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml");
+ MockPatchAllottedResource(CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
mockSDNCAdapter(200);
mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
@@ -72,7 +70,7 @@ public class DoCreateAllottedResourceBRGRollbackTest extends WorkflowTest {
Map<String, Object> variables = new HashMap<>();
setVariablesSuccess(variables, "testRequestId1");
- invokeSubProcess("DoCreateAllottedResourceBRGRollback", businessKey, variables);
+ invokeSubProcess(PROCNAME, businessKey, variables);
injectSDNCCallbacks(callbacks, "deactivate");
injectSDNCCallbacks(callbacks, "delete");
@@ -80,37 +78,268 @@ public class DoCreateAllottedResourceBRGRollbackTest extends WorkflowTest {
waitForProcessEnd(businessKey, 10000);
- Assert.assertTrue(isProcessEnded(businessKey));
- String workflowException = BPMNUtil.getVariable(processEngineRule, "DoCreateAllottedResourceBRGRollback", "WorkflowException");
+ assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
System.out.println("workflowException:\n" + workflowException);
assertEquals(null, workflowException);
+ assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack"));
+ assertNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError"));
}
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoCreateAllottedResourceBRGRollback.bpmn"})
+ public void testDoCreateAllottedResourceBRGRollback_skipRollback() throws Exception {
+
+ MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml");
+ MockPatchAllottedResource(CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ RollbackData rollbackData = setVariablesSuccess(variables, "testRequestId1");
+
+ rollbackData.put(RbType, "rollbackAAI", "false");
+ rollbackData.put(RbType, "rollbackSDNCassign", "false");
+
+ invokeSubProcess(PROCNAME, businessKey, variables);
- private void setVariablesSuccess(Map<String, Object> variables, String requestId) {
+ waitForProcessEnd(businessKey, 10000);
+
+ assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ System.out.println("workflowException:\n" + workflowException);
+ assertEquals(null, workflowException);
+ assertEquals(null, BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack"));
+ assertNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError"));
+ }
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoCreateAllottedResourceBRGRollback.bpmn"})
+ public void testDoCreateAllottedResourceBRGRollback_DoNotRollBack() throws Exception {
+
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ RollbackData rollbackData = setVariablesSuccess(variables, "testRequestId1");
+
+ // this will cause "rollbackSDNC" to be set to false
+ rollbackData.put(RbType, "rollbackSDNCassign", "false");
+
+ invokeSubProcess(PROCNAME, businessKey, variables);
+
+ waitForProcessEnd(businessKey, 10000);
+
+ assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ System.out.println("workflowException:\n" + workflowException);
+ assertEquals(null, workflowException);
+ assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack"));
+ assertNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError"));
+ }
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoCreateAllottedResourceBRGRollback.bpmn"})
+ public void testDoCreateAllottedResourceBRGRollback_NoDeactivate() throws Exception {
+
+ MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml");
+ MockPatchAllottedResource(CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ RollbackData rollbackData = setVariablesSuccess(variables, "testRequestId1");
+
+ rollbackData.put(RbType, "rollbackSDNCactivate", "false");
+
+ invokeSubProcess(PROCNAME, businessKey, variables);
+
+ injectSDNCCallbacks(callbacks, "delete");
+ injectSDNCCallbacks(callbacks, "unassign");
+
+ waitForProcessEnd(businessKey, 10000);
+
+ assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ System.out.println("workflowException:\n" + workflowException);
+ assertEquals(null, workflowException);
+ assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack"));
+ assertNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError"));
+ }
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoCreateAllottedResourceBRGRollback.bpmn"})
+ public void testDoCreateAllottedResourceBRGRollback_NoDelete() throws Exception {
+
+ MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml");
+ MockPatchAllottedResource(CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ RollbackData rollbackData = setVariablesSuccess(variables, "testRequestId1");
+
+ rollbackData.put(RbType, "rollbackSDNCcreate", "false");
+
+ invokeSubProcess(PROCNAME, businessKey, variables);
+
+ injectSDNCCallbacks(callbacks, "deactivate");
+ injectSDNCCallbacks(callbacks, "unassign");
+
+ waitForProcessEnd(businessKey, 10000);
+
+ assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ System.out.println("workflowException:\n" + workflowException);
+ assertEquals(null, workflowException);
+ assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack"));
+ assertNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError"));
+ }
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoCreateAllottedResourceBRGRollback.bpmn"})
+ public void testDoCreateAllottedResourceBRGRollback_NoUnassign() throws Exception {
+
+ MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml");
+ MockPatchAllottedResource(CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ RollbackData rollbackData = setVariablesSuccess(variables, "testRequestId1");
+
+ rollbackData.put(RbType, "rollbackSDNCassign", "false");
+
+ /*
+ * Note: if assign == false then the flow/script will set
+ * "skipRollback" to false, which will cause ALL of the SDNC steps
+ * to be skipped, not just the unassign step.
+ */
+
+ invokeSubProcess(PROCNAME, businessKey, variables);
+
+ waitForProcessEnd(businessKey, 10000);
+
+ assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ System.out.println("workflowException:\n" + workflowException);
+ assertEquals(null, workflowException);
+ assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack"));
+ assertNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError"));
+ }
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoCreateAllottedResourceBRGRollback.bpmn"})
+ public void testDoCreateAllottedResourceBRGRollback_SubProcessError() throws Exception {
+
+ MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml");
+ MockPatchAllottedResource(CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ mockSDNCAdapter(404);
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ setVariablesSuccess(variables, "testRequestId1");
+
+ invokeSubProcess(PROCNAME, businessKey, variables);
+
+ waitForProcessEnd(businessKey, 10000);
+
+ assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ System.out.println("workflowException:\n" + workflowException);
+ assertEquals(null, workflowException);
+ assertEquals("false", BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack"));
+ assertNotNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError"));
+ }
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoCreateAllottedResourceBRGRollback.bpmn"})
+ public void testDoCreateAllottedResourceBRGRollback_JavaException() throws Exception {
+
+ MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml");
+ MockPatchAllottedResource(CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ setVariablesSuccess(variables, "testRequestId1");
+
+ variables.put("rollbackData", "string instead of rollback data");
+
+ invokeSubProcess(PROCNAME, businessKey, variables);
+
+ waitForProcessEnd(businessKey, 10000);
+
+ assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ System.out.println("workflowException:\n" + workflowException);
+ assertEquals(null, workflowException);
+ assertEquals("false", BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack"));
+ assertNotNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError"));
+ }
+
+ private RollbackData setVariablesSuccess(Map<String, Object> variables, String requestId) {
variables.put("isDebugLogEnabled", "true");
variables.put("failNotFound", "true");
variables.put("msoRequestId", requestId);
variables.put("mso-request-id", "requestId");
- variables.put("allottedResourceId", "arId-1");
+ variables.put("allottedResourceId", ARID);
+
+ variables.put("serviceInstanceId", DEC_INST);
+ variables.put("parentServiceInstanceId", DEC_PARENT_INST);
- variables.put("serviceInstanceId", "MIS%252F1604%252F0026%252FSW_INTERNET");
- variables.put("parentServiceInstanceId","MIS%252F1604%252F0026%252FSW_INTERNET");
RollbackData rollbackData = new RollbackData();
- rollbackData.put(RbType, "serviceInstanceId", "MIS%252F1604%252F0026%252FSW_INTERNET");
- rollbackData.put(RbType, "serviceSubscriptionType", "123456789");
+ rollbackData.put(RbType, "serviceInstanceId", DEC_INST);
+ rollbackData.put(RbType, "serviceSubscriptionType", SVC);
rollbackData.put(RbType, "disablerollback", "false");
rollbackData.put(RbType, "rollbackAAI", "true");
rollbackData.put(RbType, "rollbackSDNCassign", "true");
rollbackData.put(RbType, "rollbackSDNCactivate", "true");
rollbackData.put(RbType, "rollbackSDNCcreate", "true");
- rollbackData.put(RbType, "aaiARPath", "http://localhost:28090/aai/v9/business/customers/customer/SDN-ETHERNET-INTERNET/service-subscriptions/service-subscription/123456789/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET/allotted-resources/allotted-resource/arId-1");
+ rollbackData.put(RbType, "aaiARPath", "http://localhost:28090/aai/v9/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID);
rollbackData.put(RbType, "sdncActivateRollbackReq", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncActivateRollbackReq.xml"));
rollbackData.put(RbType, "sdncCreateRollbackReq", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncCreateRollbackReq.xml"));
rollbackData.put(RbType, "sdncAssignRollbackReq", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncAssignRollbackReq.xml"));
variables.put("rollbackData",rollbackData);
+
+ return rollbackData;
}
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGTest.java
index 4f7b32b340..5b6f74fc7d 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGTest.java
@@ -1,4 +1,4 @@
-/*-
+/*
* ============LICENSE_START=======================================================
* ONAP - SO
* ================================================================================
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,13 +17,11 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
-/*
- * © 2014 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property.
- */
package org.openecomp.mso.bpmn.vcpe;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource;
@@ -40,18 +38,18 @@ import org.camunda.bpm.engine.test.Deployment;
import org.junit.Assert;
import org.junit.Test;
import org.openecomp.mso.bpmn.common.BPMNUtil;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
import org.openecomp.mso.bpmn.mock.FileUtil;
-public class DoCreateAllottedResourceBRGTest extends WorkflowTest {
+public class DoCreateAllottedResourceBRGTest extends AbstractTestBase {
+ private static final String PROCNAME = "DoCreateAllottedResourceBRG";
private final CallbackSet callbacks = new CallbackSet();
public DoCreateAllottedResourceBRGTest() throws IOException {
- callbacks.put("assign", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyAssignCallback.xml"));
- callbacks.put("create", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyCreateCallback.xml"));
- callbacks.put("activate", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyActivateCallback.xml"));
+ callbacks.put("assign", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyAssignCallback.xml"));
+ callbacks.put("create", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyCreateCallback.xml"));
+ callbacks.put("activate", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyActivateCallback.xml"));
callbacks.put("query", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceBRG/SDNCTopologyQueryCallback.xml"));
}
@@ -62,14 +60,21 @@ public class DoCreateAllottedResourceBRGTest extends WorkflowTest {
"subprocess/FalloutHandler.bpmn",
"subprocess/DoCreateAllottedResourceBRG.bpmn",
"subprocess/DoCreateAllottedResourceBRGRollback.bpmn"})
- public void testDoCreateAllottedResourceBRG_success() throws Exception{
-
- MockNodeQueryServiceInstanceById("MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getSIUrlById.xml");
- MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
- MockNodeQueryServiceInstanceById("MIS%252F1604%252F0027%252FSW_INTERNET", "GenericFlows/getParentSIUrlById.xml");
- MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0027%252FSW_INTERNET", "GenericFlows/getParentServiceInstance.xml");
- MockPutAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0027%252FSW_INTERNET", "arId-1");
- MockPatchAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0027%252FSW_INTERNET", "arId-1");
+ public void testDoCreateAllottedResourceBRG_Success() throws Exception{
+
+ // TODO: use INST instead of DEC_INST
+ /*
+ * should be INST instead of DEC_INST, but AAI utilities appear to
+ * have a bug in that they don't URL-encode the SI id before using
+ * it in the query
+ */
+ MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
+
+ MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
+ MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
+ MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
mockSDNCAdapter(200);
mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
@@ -77,7 +82,7 @@ public class DoCreateAllottedResourceBRGTest extends WorkflowTest {
Map<String, Object> variables = new HashMap<>();
setVariablesSuccess(variables, "testRequestId123");
- invokeSubProcess("DoCreateAllottedResourceBRG", businessKey, variables);
+ invokeSubProcess(PROCNAME, businessKey, variables);
injectSDNCCallbacks(callbacks, "assign");
injectSDNCCallbacks(callbacks, "create");
@@ -87,14 +92,178 @@ public class DoCreateAllottedResourceBRGTest extends WorkflowTest {
waitForProcessEnd(businessKey, 10000);
Assert.assertTrue(isProcessEnded(businessKey));
- String allotedResourceName = BPMNUtil.getVariable(processEngineRule, "DoCreateAllottedResourceBRG", "allotedResourceName");
- String workflowException = BPMNUtil.getVariable(processEngineRule, "DoCreateAllottedResourceBRG", "WorkflowException");
- assertEquals("namefromrequest", allotedResourceName);
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
assertEquals(null, workflowException);
+
+ assertEquals("namefromrequest", BPMNUtil.getVariable(processEngineRule, PROCNAME, "allotedResourceName"));
+ }
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoCreateAllottedResourceBRG.bpmn",
+ "subprocess/DoCreateAllottedResourceBRGRollback.bpmn"})
+ public void testDoCreateAllottedResourceBRG_NoSI() throws Exception{
+
+ // TODO: use INST instead of DEC_INST
+ /*
+ * should be INST instead of DEC_INST, but AAI utilities appear to
+ * have a bug in that they don't URL-encode the SI id before using
+ * it in the query
+ */
+ MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getNotFound.xml");
+ MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
+
+ MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
+ MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
+ MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ setVariablesSuccess(variables, "testRequestId123");
+
+ invokeSubProcess(PROCNAME, businessKey, variables);
+
+ waitForProcessEnd(businessKey, 10000);
+
+ Assert.assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ assertNotNull(workflowException);
+
+ assertEquals(null, BPMNUtil.getVariable(processEngineRule, PROCNAME, "allotedResourceName"));
+ }
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoCreateAllottedResourceBRG.bpmn",
+ "subprocess/DoCreateAllottedResourceBRGRollback.bpmn"})
+ public void testDoCreateAllottedResourceBRG_ActiveAr() throws Exception{
+
+ // TODO: use INST instead of DEC_INST
+ /*
+ * should be INST instead of DEC_INST, but AAI utilities appear to
+ * have a bug in that they don't URL-encode the SI id before using
+ * it in the query
+ */
+ MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
+
+ MockGetServiceInstance(CUST, SVC, INST, "VCPE/DoCreateAllottedResourceBRG/getSIandAR.xml");
+ MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRG/getArBrg2.xml");
+ MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
+ MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
+ MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ setVariablesSuccess(variables, "testRequestId123");
+
+ variables.put("failExists", "false");
+
+ invokeSubProcess(PROCNAME, businessKey, variables);
+
+ injectSDNCCallbacks(callbacks, "query");
+
+ waitForProcessEnd(businessKey, 10000);
+
+ Assert.assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ assertEquals(null, workflowException);
+
+ assertEquals("namefromrequest", BPMNUtil.getVariable(processEngineRule, PROCNAME, "allotedResourceName"));
+ }
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoCreateAllottedResourceBRG.bpmn",
+ "subprocess/DoCreateAllottedResourceBRGRollback.bpmn"})
+ public void testDoCreateAllottedResourceBRG_NoParentSI() throws Exception{
+
+ // TODO: use INST instead of DEC_INST
+ /*
+ * should be INST instead of DEC_INST, but AAI utilities appear to
+ * have a bug in that they don't URL-encode the SI id before using
+ * it in the query
+ */
+ MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getNotFound.xml");
+
+ MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
+ MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
+ MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ setVariablesSuccess(variables, "testRequestId123");
+
+ invokeSubProcess(PROCNAME, businessKey, variables);
+
+ waitForProcessEnd(businessKey, 10000);
+
+ Assert.assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ assertNotNull(workflowException);
+
+ assertEquals(null, BPMNUtil.getVariable(processEngineRule, PROCNAME, "allotedResourceName"));
+ }
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoCreateAllottedResourceBRG.bpmn",
+ "subprocess/DoCreateAllottedResourceBRGRollback.bpmn"})
+ public void testDoCreateAllottedResourceBRG_SubProcessError() throws Exception{
+
+ // TODO: use INST instead of DEC_INST
+ /*
+ * should be INST instead of DEC_INST, but AAI utilities appear to
+ * have a bug in that they don't URL-encode the SI id before using
+ * it in the query
+ */
+ MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
+
+ MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
+ MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
+ MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
+ mockSDNCAdapter(404);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ setVariablesSuccess(variables, "testRequestId123");
+
+ invokeSubProcess(PROCNAME, businessKey, variables);
+
+ waitForProcessEnd(businessKey, 10000);
+
+ Assert.assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ assertNotNull(workflowException);
+
+ assertEquals(null, BPMNUtil.getVariable(processEngineRule, PROCNAME, "allotedResourceName"));
}
private void setVariablesSuccess(Map<String, Object> variables, String requestId) {
- // TODO: need all of these?
variables.put("isDebugLogEnabled", "true");
variables.put("failExists", "true");
variables.put("disableRollback", "true");
@@ -104,14 +273,15 @@ public class DoCreateAllottedResourceBRGTest extends WorkflowTest {
variables.put("sourceNetworkRole", "snRole");
variables.put("allottedResourceRole", "txc");
variables.put("allottedResourceType", "BRG");
- variables.put("allottedResourceId", "arId-1");
+ variables.put("allottedResourceId", ARID);
variables.put("vni", "BRG");
variables.put("vgmuxBearerIP", "bearerip");
variables.put("brgWanMacAddress", "wanmac");
variables.put("junitSleepMs", "5");
+
+ variables.put("serviceInstanceId", DEC_INST);
+ variables.put("parentServiceInstanceId", DEC_PARENT_INST);
- variables.put("serviceInstanceId", "MIS%252F1604%252F0026%252FSW_INTERNET");
- variables.put("parentServiceInstanceId","MIS%252F1604%252F0027%252FSW_INTERNET");
variables.put("serviceChainServiceInstanceId", "scsiId");
String arModelInfo = "{ "+ "\"modelType\": \"allotted-resource\"," +
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceTXCRollbackTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceTXCRollbackTest.java
index a887f72db0..cdce56ee63 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceTXCRollbackTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceTXCRollbackTest.java
@@ -1,4 +1,4 @@
-/*-
+/*
* ============LICENSE_START=======================================================
* ONAP - SO
* ================================================================================
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,13 +17,12 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
-/*
- * © 2014 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property.
- */
package org.openecomp.mso.bpmn.vcpe;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteAllottedResource;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource;
@@ -36,23 +35,22 @@ import java.util.Map;
import java.util.UUID;
import org.camunda.bpm.engine.test.Deployment;
-import org.junit.Assert;
import org.junit.Test;
import org.openecomp.mso.bpmn.common.BPMNUtil;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
import org.openecomp.mso.bpmn.core.RollbackData;
import org.openecomp.mso.bpmn.mock.FileUtil;
-public class DoCreateAllottedResourceTXCRollbackTest extends WorkflowTest {
+public class DoCreateAllottedResourceTXCRollbackTest extends AbstractTestBase {
+ private static final String PROCNAME = "DoCreateAllottedResourceTXCRollback";
private static final String RbType = "DCARTXC_";
private final CallbackSet callbacks = new CallbackSet();
public DoCreateAllottedResourceTXCRollbackTest() throws IOException {
- callbacks.put("deactivate", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyDeactivateCallback.xml"));
- callbacks.put("delete", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyDeleteCallback.xml"));
- callbacks.put("unassign", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyUnassignCallback.xml"));
+ callbacks.put("deactivate", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeactivateCallback.xml"));
+ callbacks.put("delete", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeleteCallback.xml"));
+ callbacks.put("unassign", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyUnassignCallback.xml"));
}
@Test
@@ -60,11 +58,11 @@ public class DoCreateAllottedResourceTXCRollbackTest extends WorkflowTest {
"subprocess/SDNCAdapterV1.bpmn",
"subprocess/FalloutHandler.bpmn",
"subprocess/DoCreateAllottedResourceTXCRollback.bpmn"})
- public void testDoCreateAllottedResourceTXCRollback_success() throws Exception{
+ public void testDoCreateAllottedResourceTXCRollback_Success() throws Exception {
- MockGetAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "arId-1", "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml");
- MockPatchAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "arId-1");
- MockDeleteAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "arId-1", "1490627351232");
+ MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml");
+ MockPatchAllottedResource(CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
mockSDNCAdapter(200);
mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
@@ -72,7 +70,7 @@ public class DoCreateAllottedResourceTXCRollbackTest extends WorkflowTest {
Map<String, Object> variables = new HashMap<>();
setVariablesSuccess(variables, "testRequestId1");
- invokeSubProcess("DoCreateAllottedResourceTXCRollback", businessKey, variables);
+ invokeSubProcess(PROCNAME, businessKey, variables);
injectSDNCCallbacks(callbacks, "deactivate");
injectSDNCCallbacks(callbacks, "delete");
@@ -80,37 +78,268 @@ public class DoCreateAllottedResourceTXCRollbackTest extends WorkflowTest {
waitForProcessEnd(businessKey, 10000);
- Assert.assertTrue(isProcessEnded(businessKey));
- String workflowException = BPMNUtil.getVariable(processEngineRule, "DoCreateAllottedResourceTXCRollback", "WorkflowException");
+ assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
System.out.println("workflowException:\n" + workflowException);
assertEquals(null, workflowException);
+ assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack"));
+ assertNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError"));
}
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoCreateAllottedResourceTXCRollback.bpmn"})
+ public void testDoCreateAllottedResourceTXCRollback_skipRollback() throws Exception {
+
+ MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml");
+ MockPatchAllottedResource(CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ RollbackData rollbackData = setVariablesSuccess(variables, "testRequestId1");
+
+ rollbackData.put(RbType, "rollbackAAI", "false");
+ rollbackData.put(RbType, "rollbackSDNCassign", "false");
+
+ invokeSubProcess(PROCNAME, businessKey, variables);
- private void setVariablesSuccess(Map<String, Object> variables, String requestId) {
+ waitForProcessEnd(businessKey, 10000);
+
+ assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ System.out.println("workflowException:\n" + workflowException);
+ assertEquals(null, workflowException);
+ assertEquals(null, BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack"));
+ assertNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError"));
+ }
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoCreateAllottedResourceTXCRollback.bpmn"})
+ public void testDoCreateAllottedResourceTXCRollback_DoNotRollBack() throws Exception {
+
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ RollbackData rollbackData = setVariablesSuccess(variables, "testRequestId1");
+
+ // this will cause "rollbackSDNC" to be set to false
+ rollbackData.put(RbType, "rollbackSDNCassign", "false");
+
+ invokeSubProcess(PROCNAME, businessKey, variables);
+
+ waitForProcessEnd(businessKey, 10000);
+
+ assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ System.out.println("workflowException:\n" + workflowException);
+ assertEquals(null, workflowException);
+ assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack"));
+ assertNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError"));
+ }
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoCreateAllottedResourceTXCRollback.bpmn"})
+ public void testDoCreateAllottedResourceTXCRollback_NoDeactivate() throws Exception {
+
+ MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml");
+ MockPatchAllottedResource(CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ RollbackData rollbackData = setVariablesSuccess(variables, "testRequestId1");
+
+ rollbackData.put(RbType, "rollbackSDNCactivate", "false");
+
+ invokeSubProcess(PROCNAME, businessKey, variables);
+
+ injectSDNCCallbacks(callbacks, "delete");
+ injectSDNCCallbacks(callbacks, "unassign");
+
+ waitForProcessEnd(businessKey, 10000);
+
+ assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ System.out.println("workflowException:\n" + workflowException);
+ assertEquals(null, workflowException);
+ assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack"));
+ assertNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError"));
+ }
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoCreateAllottedResourceTXCRollback.bpmn"})
+ public void testDoCreateAllottedResourceTXCRollback_NoDelete() throws Exception {
+
+ MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml");
+ MockPatchAllottedResource(CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ RollbackData rollbackData = setVariablesSuccess(variables, "testRequestId1");
+
+ rollbackData.put(RbType, "rollbackSDNCcreate", "false");
+
+ invokeSubProcess(PROCNAME, businessKey, variables);
+
+ injectSDNCCallbacks(callbacks, "deactivate");
+ injectSDNCCallbacks(callbacks, "unassign");
+
+ waitForProcessEnd(businessKey, 10000);
+
+ assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ System.out.println("workflowException:\n" + workflowException);
+ assertEquals(null, workflowException);
+ assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack"));
+ assertNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError"));
+ }
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoCreateAllottedResourceTXCRollback.bpmn"})
+ public void testDoCreateAllottedResourceTXCRollback_NoUnassign() throws Exception {
+
+ MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml");
+ MockPatchAllottedResource(CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ RollbackData rollbackData = setVariablesSuccess(variables, "testRequestId1");
+
+ rollbackData.put(RbType, "rollbackSDNCassign", "false");
+
+ /*
+ * Note: if assign == false then the flow/script will set
+ * "skipRollback" to false, which will cause ALL of the SDNC steps
+ * to be skipped, not just the unassign step.
+ */
+
+ invokeSubProcess(PROCNAME, businessKey, variables);
+
+ waitForProcessEnd(businessKey, 10000);
+
+ assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ System.out.println("workflowException:\n" + workflowException);
+ assertEquals(null, workflowException);
+ assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack"));
+ assertNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError"));
+ }
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoCreateAllottedResourceTXCRollback.bpmn"})
+ public void testDoCreateAllottedResourceTXCRollback_SubProcessError() throws Exception {
+
+ MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml");
+ MockPatchAllottedResource(CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ mockSDNCAdapter(404);
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ setVariablesSuccess(variables, "testRequestId1");
+
+ invokeSubProcess(PROCNAME, businessKey, variables);
+
+ waitForProcessEnd(businessKey, 10000);
+
+ assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ System.out.println("workflowException:\n" + workflowException);
+ assertEquals(null, workflowException);
+ assertEquals("false", BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack"));
+ assertNotNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError"));
+ }
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoCreateAllottedResourceTXCRollback.bpmn"})
+ public void testDoCreateAllottedResourceTXCRollback_JavaException() throws Exception {
+
+ MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml");
+ MockPatchAllottedResource(CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ setVariablesSuccess(variables, "testRequestId1");
+
+ variables.put("rollbackData", "string instead of rollback data");
+
+ invokeSubProcess(PROCNAME, businessKey, variables);
+
+ waitForProcessEnd(businessKey, 10000);
+
+ assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ System.out.println("workflowException:\n" + workflowException);
+ assertEquals(null, workflowException);
+ assertEquals("false", BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack"));
+ assertNotNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError"));
+ }
+
+ private RollbackData setVariablesSuccess(Map<String, Object> variables, String requestId) {
variables.put("isDebugLogEnabled", "true");
variables.put("failNotFound", "true");
variables.put("msoRequestId", requestId);
variables.put("mso-request-id", "requestId");
- variables.put("allottedResourceId", "arId-1");
+ variables.put("allottedResourceId", ARID);
+
+ variables.put("serviceInstanceId", DEC_INST);
+ variables.put("parentServiceInstanceId", DEC_PARENT_INST);
- variables.put("serviceInstanceId", "MIS%252F1604%252F0026%252FSW_INTERNET");
- variables.put("parentServiceInstanceId","MIS%252F1604%252F0026%252FSW_INTERNET");
RollbackData rollbackData = new RollbackData();
- rollbackData.put(RbType, "serviceInstanceId", "MIS%252F1604%252F0026%252FSW_INTERNET");
- rollbackData.put(RbType, "serviceSubscriptionType", "123456789");
+ rollbackData.put(RbType, "serviceInstanceId", DEC_INST);
+ rollbackData.put(RbType, "serviceSubscriptionType", SVC);
rollbackData.put(RbType, "disablerollback", "false");
rollbackData.put(RbType, "rollbackAAI", "true");
rollbackData.put(RbType, "rollbackSDNCassign", "true");
rollbackData.put(RbType, "rollbackSDNCactivate", "true");
rollbackData.put(RbType, "rollbackSDNCcreate", "true");
- rollbackData.put(RbType, "aaiARPath", "http://localhost:28090/aai/v9/business/customers/customer/SDN-ETHERNET-INTERNET/service-subscriptions/service-subscription/123456789/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET/allotted-resources/allotted-resource/arId-1");
+ rollbackData.put(RbType, "aaiARPath", "http://localhost:28090/aai/v9/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID);
rollbackData.put(RbType, "sdncActivateRollbackReq", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncActivateRollbackReq.xml"));
rollbackData.put(RbType, "sdncCreateRollbackReq", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncCreateRollbackReq.xml"));
rollbackData.put(RbType, "sdncAssignRollbackReq", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncAssignRollbackReq.xml"));
variables.put("rollbackData",rollbackData);
+
+ return rollbackData;
}
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceTXCTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceTXCTest.java
index 42704bfe97..4323ccae1a 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceTXCTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceTXCTest.java
@@ -1,4 +1,4 @@
-/*-
+/*
* ============LICENSE_START=======================================================
* ONAP - SO
* ================================================================================
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,13 +17,11 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
-/*
- * © 2014 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property.
- */
package org.openecomp.mso.bpmn.vcpe;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource;
@@ -40,18 +38,18 @@ import org.camunda.bpm.engine.test.Deployment;
import org.junit.Assert;
import org.junit.Test;
import org.openecomp.mso.bpmn.common.BPMNUtil;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
import org.openecomp.mso.bpmn.mock.FileUtil;
-public class DoCreateAllottedResourceTXCTest extends WorkflowTest {
+public class DoCreateAllottedResourceTXCTest extends AbstractTestBase {
+ private static final String PROCNAME = "DoCreateAllottedResourceTXC";
private final CallbackSet callbacks = new CallbackSet();
public DoCreateAllottedResourceTXCTest() throws IOException {
- callbacks.put("assign", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyAssignCallback.xml"));
- callbacks.put("create", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyCreateCallback.xml"));
- callbacks.put("activate", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyActivateCallback.xml"));
+ callbacks.put("assign", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyAssignCallback.xml"));
+ callbacks.put("create", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyCreateCallback.xml"));
+ callbacks.put("activate", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyActivateCallback.xml"));
callbacks.put("query", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceTXC/SDNCTopologyQueryCallback.xml"));
}
@@ -62,22 +60,29 @@ public class DoCreateAllottedResourceTXCTest extends WorkflowTest {
"subprocess/FalloutHandler.bpmn",
"subprocess/DoCreateAllottedResourceTXC.bpmn",
"subprocess/DoCreateAllottedResourceTXCRollback.bpmn"})
- public void testDoCreateAllottedResourceTXC_success() throws Exception{
-
- MockNodeQueryServiceInstanceById("MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getSIUrlById.xml");
- MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
- MockNodeQueryServiceInstanceById("MIS%252F1604%252F0027%252FSW_INTERNET", "GenericFlows/getParentSIUrlById.xml");
- MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0027%252FSW_INTERNET", "GenericFlows/getParentServiceInstance.xml");
- MockPutAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0027%252FSW_INTERNET", "arId-1");
- MockPatchAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0027%252FSW_INTERNET", "arId-1");
+ public void testDoCreateAllottedResourceTXC_Success() throws Exception{
+
+ // TODO: use INST instead of DEC_INST
+ /*
+ * should be INST instead of DEC_INST, but AAI utilities appear to
+ * have a bug in that they don't URL-encode the SI id before using
+ * it in the query
+ */
+ MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
+
+ MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
+ MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
+ MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
mockSDNCAdapter(200);
mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> variables = new HashMap<>();
setVariablesSuccess(variables, "testRequestId123");
- invokeSubProcess("DoCreateAllottedResourceTXC", businessKey, variables);
+ invokeSubProcess(PROCNAME, businessKey, variables);
injectSDNCCallbacks(callbacks, "assign");
injectSDNCCallbacks(callbacks, "create");
@@ -87,13 +92,186 @@ public class DoCreateAllottedResourceTXCTest extends WorkflowTest {
waitForProcessEnd(businessKey, 10000);
Assert.assertTrue(isProcessEnded(businessKey));
- String workflowException = BPMNUtil.getVariable(processEngineRule, "DoCreateAllottedResourceTXC", "WorkflowException");
- System.out.println("workflowException:\n" + workflowException);
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ assertEquals(null, workflowException);
+
+ assertEquals("namefromrequest", BPMNUtil.getVariable(processEngineRule, PROCNAME, "allotedResourceName"));
+ assertEquals("my-vni", BPMNUtil.getVariable(processEngineRule, PROCNAME, "vni"));
+ assertEquals("my-bearer-ip", BPMNUtil.getVariable(processEngineRule, PROCNAME, "vgmuxBearerIP"));
+ assertEquals("my-lan-ip", BPMNUtil.getVariable(processEngineRule, PROCNAME, "vgmuxLanIP"));
+ }
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoCreateAllottedResourceTXC.bpmn",
+ "subprocess/DoCreateAllottedResourceTXCRollback.bpmn"})
+ public void testDoCreateAllottedResourceTXC_NoSI() throws Exception{
+
+ // TODO: use INST instead of DEC_INST
+ /*
+ * should be INST instead of DEC_INST, but AAI utilities appear to
+ * have a bug in that they don't URL-encode the SI id before using
+ * it in the query
+ */
+ MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getNotFound.xml");
+ MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
+
+ MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
+ MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
+ MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ setVariablesSuccess(variables, "testRequestId123");
+
+ invokeSubProcess(PROCNAME, businessKey, variables);
+
+ waitForProcessEnd(businessKey, 10000);
+
+ Assert.assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ assertNotNull(workflowException);
+
+ assertEquals(null, BPMNUtil.getVariable(processEngineRule, PROCNAME, "allotedResourceName"));
+ }
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoCreateAllottedResourceTXC.bpmn",
+ "subprocess/DoCreateAllottedResourceTXCRollback.bpmn"})
+ public void testDoCreateAllottedResourceTXC_ActiveAr() throws Exception{
+
+ // TODO: use INST instead of DEC_INST
+ /*
+ * should be INST instead of DEC_INST, but AAI utilities appear to
+ * have a bug in that they don't URL-encode the SI id before using
+ * it in the query
+ */
+ MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
+
+ MockGetServiceInstance(CUST, SVC, INST, "VCPE/DoCreateAllottedResourceTXC/getSIandAR.xml");
+ MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc2.xml");
+ MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
+ MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
+ MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ setVariablesSuccess(variables, "testRequestId123");
+
+ variables.put("failExists", "false");
+
+ invokeSubProcess(PROCNAME, businessKey, variables);
+
+ injectSDNCCallbacks(callbacks, "query");
+
+ waitForProcessEnd(businessKey, 10000);
+
+ Assert.assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
assertEquals(null, workflowException);
- logEnd();
+
+ assertEquals("namefromrequest", BPMNUtil.getVariable(processEngineRule, PROCNAME, "allotedResourceName"));
+ assertEquals("my-vni", BPMNUtil.getVariable(processEngineRule, PROCNAME, "vni"));
+ assertEquals("my-bearer-ip", BPMNUtil.getVariable(processEngineRule, PROCNAME, "vgmuxBearerIP"));
+ assertEquals("my-lan-ip", BPMNUtil.getVariable(processEngineRule, PROCNAME, "vgmuxLanIP"));
+ }
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoCreateAllottedResourceTXC.bpmn",
+ "subprocess/DoCreateAllottedResourceTXCRollback.bpmn"})
+ public void testDoCreateAllottedResourceTXC_NoParentSI() throws Exception{
+
+ // TODO: use INST instead of DEC_INST
+ /*
+ * should be INST instead of DEC_INST, but AAI utilities appear to
+ * have a bug in that they don't URL-encode the SI id before using
+ * it in the query
+ */
+ MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml");
+
+ MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getNotFound.xml");
+
+ MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
+ MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
+ MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ setVariablesSuccess(variables, "testRequestId123");
+
+ invokeSubProcess(PROCNAME, businessKey, variables);
+
+ waitForProcessEnd(businessKey, 10000);
+
+ Assert.assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ assertNotNull(workflowException);
+
+ assertEquals(null, BPMNUtil.getVariable(processEngineRule, PROCNAME, "allotedResourceName"));
+ }
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoCreateAllottedResourceTXC.bpmn",
+ "subprocess/DoCreateAllottedResourceTXCRollback.bpmn"})
+ public void testDoCreateAllottedResourceTXC_SubProcessError() throws Exception{
+
+ // TODO: use INST instead of DEC_INST
+ /*
+ * should be INST instead of DEC_INST, but AAI utilities appear to
+ * have a bug in that they don't URL-encode the SI id before using
+ * it in the query
+ */
+ MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
+
+ MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
+ MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
+ MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
+ mockSDNCAdapter(404);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ setVariablesSuccess(variables, "testRequestId123");
+
+ invokeSubProcess(PROCNAME, businessKey, variables);
+
+ waitForProcessEnd(businessKey, 10000);
+
+ Assert.assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ assertNotNull(workflowException);
+
+ assertEquals(null, BPMNUtil.getVariable(processEngineRule, PROCNAME, "allotedResourceName"));
}
private void setVariablesSuccess(Map<String, Object> variables, String requestId) {
+ // TODO: need all of these?
variables.put("isDebugLogEnabled", "true");
variables.put("failExists", "true");
variables.put("disableRollback", "true");
@@ -101,14 +279,15 @@ public class DoCreateAllottedResourceTXCTest extends WorkflowTest {
variables.put("mso-request-id", "requestId");
variables.put("sourceNetworkId", "snId");
variables.put("sourceNetworkRole", "snRole");
- variables.put("allottedResourceRole", "txc");
- variables.put("allottedResourceType", "TunnelXConn");
- variables.put("allottedResourceId", "arId-1");
+ variables.put("allottedResourceRole", "brg");
+ variables.put("allottedResourceType", "TXC");
+ variables.put("allottedResourceId", ARID);
variables.put("brgWanMacAddress", "wanmac");
variables.put("junitSleepMs", "5");
+
+ variables.put("serviceInstanceId", DEC_INST);
+ variables.put("parentServiceInstanceId", DEC_PARENT_INST);
- variables.put("serviceInstanceId", "MIS%252F1604%252F0026%252FSW_INTERNET");
- variables.put("parentServiceInstanceId","MIS%252F1604%252F0027%252FSW_INTERNET");
variables.put("serviceChainServiceInstanceId", "scsiId");
String arModelInfo = "{ "+ "\"modelType\": \"allotted-resource\"," +
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoDeleteAllottedResourceBRGTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoDeleteAllottedResourceBRGTest.java
index 46f5da46b3..03972da789 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoDeleteAllottedResourceBRGTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoDeleteAllottedResourceBRGTest.java
@@ -1,4 +1,4 @@
-/*-
+/*
* ============LICENSE_START=======================================================
* ONAP - SO
* ================================================================================
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,13 +17,10 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
-/*
- * © 2014 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property.
- */
package org.openecomp.mso.bpmn.vcpe;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteAllottedResource;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource;
@@ -38,20 +35,22 @@ import java.util.UUID;
import org.camunda.bpm.engine.test.Deployment;
import org.junit.Assert;
+import org.junit.Ignore;
import org.junit.Test;
import org.openecomp.mso.bpmn.common.BPMNUtil;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
import org.openecomp.mso.bpmn.mock.FileUtil;
-public class DoDeleteAllottedResourceBRGTest extends WorkflowTest {
+public class DoDeleteAllottedResourceBRGTest extends AbstractTestBase {
+ private static final String PROCNAME = "DoDeleteAllottedResourceBRG";
private final CallbackSet callbacks = new CallbackSet();
public DoDeleteAllottedResourceBRGTest() throws IOException {
- callbacks.put("deactivate", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyDeactivateCallback.xml"));
- callbacks.put("delete", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyDeleteCallback.xml"));
- callbacks.put("unassign", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyUnassignCallback.xml"));
+ callbacks.put("deactivate", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeactivateCallback.xml"));
+ callbacks.put("deactivateNF", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeactivateCallbackNotFound.xml"));
+ callbacks.put("delete", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeleteCallback.xml"));
+ callbacks.put("unassign", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyUnassignCallback.xml"));
}
@Test
@@ -59,12 +58,12 @@ public class DoDeleteAllottedResourceBRGTest extends WorkflowTest {
"subprocess/SDNCAdapterV1.bpmn",
"subprocess/FalloutHandler.bpmn",
"subprocess/DoDeleteAllottedResourceBRG.bpmn"})
- public void testDoDeleteAllottedResourceBRG_success() throws Exception {
+ public void testDoDeleteAllottedResourceBRG_Success() throws Exception {
- MockQueryAllottedResourceById("arId-1", "GenericFlows/getARUrlById.xml");
- MockGetAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "arId-1", "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml");
- MockPatchAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "arId-1");
- MockDeleteAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "arId-1", "1490627351232");
+ MockQueryAllottedResourceById(ARID, "GenericFlows/getARUrlById.xml");
+ MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml");
+ MockPatchAllottedResource(CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
mockSDNCAdapter(200);
mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
@@ -72,7 +71,7 @@ public class DoDeleteAllottedResourceBRGTest extends WorkflowTest {
Map<String, Object> variables = new HashMap<>();
setVariablesSuccess(variables, "testRequestId1");
- invokeSubProcess("DoDeleteAllottedResourceBRG", businessKey, variables);
+ invokeSubProcess(PROCNAME, businessKey, variables);
injectSDNCCallbacks(callbacks, "deactivate");
injectSDNCCallbacks(callbacks, "delete");
@@ -81,20 +80,83 @@ public class DoDeleteAllottedResourceBRGTest extends WorkflowTest {
waitForProcessEnd(businessKey, 10000);
Assert.assertTrue(isProcessEnded(businessKey));
- String workflowException = BPMNUtil.getVariable(processEngineRule, "DoDeleteAllottedResourceBRG", "WorkflowException");
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
System.out.println("workflowException:\n" + workflowException);
assertEquals(null, workflowException);
}
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoDeleteAllottedResourceBRG.bpmn"})
+ public void testDoDeleteAllottedResourceBRG_ARNotInSDNC() throws Exception {
+
+ MockQueryAllottedResourceById(ARID, "GenericFlows/getARUrlById.xml");
+ MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml");
+ MockPatchAllottedResource(CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ setVariablesSuccess(variables, "testRequestId1");
+
+ variables.put("failNotFound", "false");
+
+ invokeSubProcess(PROCNAME, businessKey, variables);
+
+ injectSDNCCallbacks(callbacks, "deactivateNF");
+
+ waitForProcessEnd(businessKey, 10000);
+
+ Assert.assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ System.out.println("workflowException:\n" + workflowException);
+ assertEquals(null, workflowException);
+ }
+
+ // TODO - exception is not caught
+ @Test
+ @Ignore
+ @Deployment(resources = {
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoDeleteAllottedResourceBRG.bpmn"})
+ public void testDoDeleteAllottedResourceBRG_SubProcessError() throws Exception {
+
+ MockQueryAllottedResourceById(ARID, "GenericFlows/getARUrlById.xml");
+ MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml");
+ MockPatchAllottedResource(CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ mockSDNCAdapter(500);
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ setVariablesSuccess(variables, "testRequestId1");
+
+ invokeSubProcess(PROCNAME, businessKey, variables);
+
+ waitForProcessEnd(businessKey, 10000);
+
+ Assert.assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ System.out.println("workflowException:\n" + workflowException);
+ assertNotNull(workflowException);
+ }
private void setVariablesSuccess(Map<String, Object> variables, String requestId) {
variables.put("isDebugLogEnabled", "true");
variables.put("failNotFound", "true");
variables.put("msoRequestId", requestId);
variables.put("mso-request-id", "requestId");
- variables.put("allottedResourceId", "arId-1");
+ variables.put("allottedResourceId", ARID);
- variables.put("serviceInstanceId", "MIS%252F1604%252F0026%252FSW_INTERNET");
- variables.put("parentServiceInstanceId","MIS%252F1604%252F0026%252FSW_INTERNET");
+ variables.put("serviceInstanceId", DEC_INST);
+ variables.put("parentServiceInstanceId", DEC_PARENT_INST);
}
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoDeleteAllottedResourceTXCTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoDeleteAllottedResourceTXCTest.java
index 48e1349633..2b0364c3c9 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoDeleteAllottedResourceTXCTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoDeleteAllottedResourceTXCTest.java
@@ -1,4 +1,4 @@
-/*-
+/*
* ============LICENSE_START=======================================================
* ONAP - SO
* ================================================================================
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,13 +17,10 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
-/*
- * © 2014 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property.
- */
package org.openecomp.mso.bpmn.vcpe;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteAllottedResource;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource;
@@ -38,20 +35,22 @@ import java.util.UUID;
import org.camunda.bpm.engine.test.Deployment;
import org.junit.Assert;
+import org.junit.Ignore;
import org.junit.Test;
import org.openecomp.mso.bpmn.common.BPMNUtil;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
import org.openecomp.mso.bpmn.mock.FileUtil;
-public class DoDeleteAllottedResourceTXCTest extends WorkflowTest {
+public class DoDeleteAllottedResourceTXCTest extends AbstractTestBase {
+ private static final String PROCNAME = "DoDeleteAllottedResourceTXC";
private final CallbackSet callbacks = new CallbackSet();
public DoDeleteAllottedResourceTXCTest() throws IOException {
- callbacks.put("deactivate", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyDeactivateCallback.xml"));
- callbacks.put("delete", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyDeleteCallback.xml"));
- callbacks.put("unassign", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyUnassignCallback.xml"));
+ callbacks.put("deactivate", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeactivateCallback.xml"));
+ callbacks.put("deactivateNF", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeactivateCallbackNotFound.xml"));
+ callbacks.put("delete", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeleteCallback.xml"));
+ callbacks.put("unassign", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyUnassignCallback.xml"));
}
@Test
@@ -59,12 +58,12 @@ public class DoDeleteAllottedResourceTXCTest extends WorkflowTest {
"subprocess/SDNCAdapterV1.bpmn",
"subprocess/FalloutHandler.bpmn",
"subprocess/DoDeleteAllottedResourceTXC.bpmn"})
- public void testDoDeleteAllottedResourceTXC_success() throws Exception {
+ public void testDoDeleteAllottedResourceTXC_Success() throws Exception {
- MockQueryAllottedResourceById("arId-1", "GenericFlows/getARUrlById.xml");
- MockGetAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "arId-1", "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml");
- MockPatchAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "arId-1");
- MockDeleteAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "arId-1", "1490627351232");
+ MockQueryAllottedResourceById(ARID, "GenericFlows/getARUrlById.xml");
+ MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml");
+ MockPatchAllottedResource(CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
mockSDNCAdapter(200);
mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
@@ -72,7 +71,7 @@ public class DoDeleteAllottedResourceTXCTest extends WorkflowTest {
Map<String, Object> variables = new HashMap<>();
setVariablesSuccess(variables, "testRequestId1");
- invokeSubProcess("DoDeleteAllottedResourceTXC", businessKey, variables);
+ invokeSubProcess(PROCNAME, businessKey, variables);
injectSDNCCallbacks(callbacks, "deactivate");
injectSDNCCallbacks(callbacks, "delete");
@@ -81,20 +80,83 @@ public class DoDeleteAllottedResourceTXCTest extends WorkflowTest {
waitForProcessEnd(businessKey, 10000);
Assert.assertTrue(isProcessEnded(businessKey));
- String workflowException = BPMNUtil.getVariable(processEngineRule, "DoDeleteAllottedResourceTXC", "WorkflowException");
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
System.out.println("workflowException:\n" + workflowException);
assertEquals(null, workflowException);
}
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoDeleteAllottedResourceTXC.bpmn"})
+ public void testDoDeleteAllottedResourceTXC_ARNotInSDNC() throws Exception {
+
+ MockQueryAllottedResourceById(ARID, "GenericFlows/getARUrlById.xml");
+ MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml");
+ MockPatchAllottedResource(CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ setVariablesSuccess(variables, "testRequestId1");
+
+ variables.put("failNotFound", "false");
+
+ invokeSubProcess(PROCNAME, businessKey, variables);
+
+ injectSDNCCallbacks(callbacks, "deactivateNF");
+
+ waitForProcessEnd(businessKey, 10000);
+
+ Assert.assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ System.out.println("workflowException:\n" + workflowException);
+ assertEquals(null, workflowException);
+ }
+
+ // TODO - exception is not caught
+ @Test
+ @Ignore
+ @Deployment(resources = {
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoDeleteAllottedResourceTXC.bpmn"})
+ public void testDoDeleteAllottedResourceTXC_SubProcessError() throws Exception {
+
+ MockQueryAllottedResourceById(ARID, "GenericFlows/getARUrlById.xml");
+ MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml");
+ MockPatchAllottedResource(CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ mockSDNCAdapter(500);
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ setVariablesSuccess(variables, "testRequestId1");
+
+ invokeSubProcess(PROCNAME, businessKey, variables);
+
+ waitForProcessEnd(businessKey, 10000);
+
+ Assert.assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX);
+ System.out.println("workflowException:\n" + workflowException);
+ assertNotNull(workflowException);
+ }
private void setVariablesSuccess(Map<String, Object> variables, String requestId) {
variables.put("isDebugLogEnabled", "true");
variables.put("failNotFound", "true");
variables.put("msoRequestId", requestId);
variables.put("mso-request-id", "requestId");
- variables.put("allottedResourceId", "arId-1");
+ variables.put("allottedResourceId", ARID);
- variables.put("serviceInstanceId", "MIS%252F1604%252F0026%252FSW_INTERNET");
- variables.put("parentServiceInstanceId","MIS%252F1604%252F0026%252FSW_INTERNET");
+ variables.put("serviceInstanceId", DEC_INST);
+ variables.put("parentServiceInstanceId", DEC_PARENT_INST);
}
}