From 38f720752af4d4aad8c4e467a288d9048659f688 Mon Sep 17 00:00:00 2001 From: Rob Daugherty Date: Wed, 14 Mar 2018 02:07:32 -0400 Subject: AT&T 1712 and 1802 release code This is code from AT&T's 1712 and 1802 releases. Change-Id: Ie1e85851e94bc66c4d9514a0226c221939531a04 Issue-ID: SO-425 Signed-off-by: Rob Daugherty --- ...CreateGenericAlaCarteServiceInstanceTest.groovy | 8 +- .../scripts/CreateNetworkInstanceTest.groovy | 20 +- .../DeleteCustomE2EServiceInstanceTest.groovy | 3 +- ...DeleteGenericAlaCarteServiceInstanceTest.groovy | 6 +- .../scripts/DeleteNetworkInstanceTest.groovy | 16 +- .../DoCreateNetworkInstanceRollbackTest.groovy | 16 +- .../scripts/DoCreateNetworkInstanceTest.groovy | 447 +++++++++++--- .../scripts/DoCreateVfModuleVolumeV2Test.groovy | 93 +++ .../DoCustomDeleteE2EServiceInstanceTest.groovy | 2 +- .../DoDeleteNetworkInstanceRollbackTest.groovy | 646 ++++++++++----------- .../scripts/DoDeleteNetworkInstanceTest.groovy | 48 +- .../DoUpdateNetworkInstanceRollbackTest.groovy | 630 ++++++++++---------- .../scripts/DoUpdateNetworkInstanceTest.groovy | 182 +++++- .../scripts/UpdateNetworkInstanceTest.groovy | 20 +- .../scripts/CreateVcpeResCustServiceTest.groovy | 5 +- .../scripts/DeleteVcpeResCustServiceTest.groovy | 1 - .../DoCreateAllottedResourceBRGRollbackTest.groovy | 1 - .../scripts/DoCreateAllottedResourceBRGTest.groovy | 1 - .../DoCreateAllottedResourceTXCRollbackTest.groovy | 1 - .../scripts/DoCreateAllottedResourceTXCTest.groovy | 1 - .../scripts/DoDeleteAllottedResourceBRGTest.groovy | 1 - .../scripts/DoDeleteAllottedResourceTXCTest.groovy | 1 - .../mso/bpmn/vcpe/scripts/GroovyTestBase.groovy | 1 - 23 files changed, 1335 insertions(+), 815 deletions(-) create mode 100644 bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeV2Test.groovy (limited to 'bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso') diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericAlaCarteServiceInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericAlaCarteServiceInstanceTest.groovy index e5d9d62392..adab1bf739 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericAlaCarteServiceInstanceTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericAlaCarteServiceInstanceTest.groovy @@ -4,7 +4,7 @@ import org.camunda.bpm.engine.ProcessEngineServices import org.camunda.bpm.engine.RepositoryService import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity import org.camunda.bpm.engine.repository.ProcessDefinition -import org.camunda.bpm.engine.runtime.Execution +import org.camunda.bpm.engine.delegate.DelegateExecution import org.junit.Before import org.junit.Rule import org.junit.Test @@ -110,7 +110,7 @@ class CreateGenericAlaCarteServiceInstanceTest { } - public void initializeVariables(Execution mockExecution) { + public void initializeVariables(DelegateExecution mockExecution) { //verify(mockExecution).setVariable(Prefix + "Success", false) @@ -131,7 +131,7 @@ class CreateGenericAlaCarteServiceInstanceTest { when(mockExecution.getVariable("bpmnRequest")).thenReturn(jsonIncomingRequest) try{ - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) CreateGenericALaCarteServiceInstance createGenericALaCarteServiceInstance = new CreateGenericALaCarteServiceInstance() createGenericALaCarteServiceInstance.preProcessRequest(mockExecution) @@ -157,7 +157,7 @@ class CreateGenericAlaCarteServiceInstanceTest { when(mockExecution.getVariable("mso-request-id")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6") when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4") try{ - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) CreateGenericALaCarteServiceInstance createGenericALaCarteServiceInstance = new CreateGenericALaCarteServiceInstance() createGenericALaCarteServiceInstance.sendSyncResponse(mockExecution) diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateNetworkInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateNetworkInstanceTest.groovy index 13e107e8ad..7c5aec3641 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateNetworkInstanceTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateNetworkInstanceTest.groovy @@ -4,7 +4,7 @@ import org.camunda.bpm.engine.ProcessEngineServices import org.camunda.bpm.engine.RepositoryService import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity import org.camunda.bpm.engine.repository.ProcessDefinition -import org.camunda.bpm.engine.runtime.Execution +import org.camunda.bpm.engine.delegate.DelegateExecution import org.junit.Before import org.junit.Rule import org.junit.Test @@ -120,7 +120,7 @@ String jsonIncomingRequest = } - public void initializeVariables(Execution mockExecution) { + public void initializeVariables(DelegateExecution mockExecution) { verify(mockExecution).setVariable(Prefix + "Success", false) @@ -141,7 +141,7 @@ String jsonIncomingRequest = when(mockExecution.getVariable("bpmnRequest")).thenReturn(jsonIncomingRequest) - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) CreateNetworkInstance CreateNetworkInstance = new CreateNetworkInstance() CreateNetworkInstance.preProcessRequest(mockExecution) @@ -164,7 +164,7 @@ String jsonIncomingRequest = // Initialize prerequisite variables when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) CreateNetworkInstance CreateNetworkInstance = new CreateNetworkInstance() CreateNetworkInstance.getNetworkModelInfo(mockExecution) @@ -185,7 +185,7 @@ String jsonIncomingRequest = when(mockExecution.getVariable("mso-request-id")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6") when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) CreateNetworkInstance CreateNetworkInstance = new CreateNetworkInstance() CreateNetworkInstance.sendSyncResponse(mockExecution) @@ -233,7 +233,7 @@ String jsonIncomingRequest = when(mockExecution.getVariable("URN_mso_adapters_db_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) CreateNetworkInstance CreateNetworkInstance = new CreateNetworkInstance() CreateNetworkInstance.prepareDBRequestError(mockExecution) @@ -254,7 +254,7 @@ String jsonIncomingRequest = when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56") when(mockExecution.getVariable(Prefix + "dbReturnCode")).thenReturn("200") - // postProcessResponse(Execution execution) + // postProcessResponse(DelegateExecution execution) CreateNetworkInstance CreateNetworkInstance = new CreateNetworkInstance() CreateNetworkInstance.prepareCompletion(mockExecution) @@ -284,7 +284,7 @@ String jsonIncomingRequest = //when(mockExecution.getVariable("WorkflowException")).thenReturn(sndcWorkflowException) when(mockExecution.getVariable("WorkflowException")).thenReturn(sndcWorkflowException) - // buildErrorResponse(Execution execution) + // buildErrorResponse(DelegateExecution execution) CreateNetworkInstance CreateNetworkInstance = new CreateNetworkInstance() CreateNetworkInstance.buildErrorResponse(mockExecution) @@ -305,7 +305,7 @@ String jsonIncomingRequest = when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") when(mockExecution.getVariable("CMSO_ResponseCode")).thenReturn("200") - // postProcessResponse(Execution execution) + // postProcessResponse(DelegateExecution execution) CreateNetworkInstance CreateNetworkInstance = new CreateNetworkInstance() CreateNetworkInstance.postProcessResponse(mockExecution) @@ -325,7 +325,7 @@ String jsonIncomingRequest = // Initialize prerequisite variables when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) CreateNetworkInstance CreateNetworkInstance = new CreateNetworkInstance() CreateNetworkInstance.processRollbackData(mockExecution) diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstanceTest.groovy index 8ccb18a625..e2175216c0 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstanceTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstanceTest.groovy @@ -5,9 +5,9 @@ import org.camunda.bpm.engine.ProcessEngineServices import org.camunda.bpm.engine.RepositoryService import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity import org.camunda.bpm.engine.repository.ProcessDefinition -import org.camunda.bpm.engine.runtime.Execution import org.junit.Before import org.junit.BeforeClass +import org.junit.Ignore import org.junit.Rule import org.junit.Test import org.mockito.MockitoAnnotations @@ -76,6 +76,7 @@ class DeleteCustomE2EServiceInstanceTest extends GroovyTestBase { super("DeleteCustomE2EServiceInstance") } @Test + @Ignore // 1802 merge public void preProcessRequestTest () { ExecutionEntity mex = setupMock() def map = setupMap(mex) diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteGenericAlaCarteServiceInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteGenericAlaCarteServiceInstanceTest.groovy index ae25c33a2d..3b0e43957c 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteGenericAlaCarteServiceInstanceTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteGenericAlaCarteServiceInstanceTest.groovy @@ -4,7 +4,7 @@ import org.camunda.bpm.engine.ProcessEngineServices import org.camunda.bpm.engine.RepositoryService import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity import org.camunda.bpm.engine.repository.ProcessDefinition -import org.camunda.bpm.engine.runtime.Execution +import org.camunda.bpm.engine.delegate.DelegateExecution import org.junit.Before import org.junit.Rule import org.junit.Test @@ -67,7 +67,7 @@ class DeleteGenericAlaCarteServiceInstanceTest { } - public void initializeVariables(Execution mockExecution) { + public void initializeVariables(DelegateExecution mockExecution) { verify(mockExecution).setVariable(Prefix + "Success", false) @@ -88,7 +88,7 @@ class DeleteGenericAlaCarteServiceInstanceTest { when(mockExecution.getVariable("bpmnRequest")).thenReturn(jsonIncomingRequest) try { - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DeleteGenericALaCarteServiceInstance deleteGenericALaCarteServiceInstance = new DeleteGenericALaCarteServiceInstance() deleteGenericALaCarteServiceInstance.preProcessRequest(mockExecution) diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteNetworkInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteNetworkInstanceTest.groovy index 304697891f..46a737f3e1 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteNetworkInstanceTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteNetworkInstanceTest.groovy @@ -7,7 +7,7 @@ import org.camunda.bpm.engine.ProcessEngineServices import org.camunda.bpm.engine.RepositoryService import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity import org.camunda.bpm.engine.repository.ProcessDefinition -import org.camunda.bpm.engine.runtime.Execution +import org.camunda.bpm.engine.delegate.DelegateExecution import org.junit.Before import org.junit.Rule import org.junit.Test @@ -197,7 +197,7 @@ String deleteDBRequestErrorString = } - public void initializeVariables (Execution mockExecution) { + public void initializeVariables (DelegateExecution mockExecution) { verify(mockExecution).setVariable(Prefix + "Success", false) @@ -219,7 +219,7 @@ String deleteDBRequestErrorString = // Initialize prerequisite variables when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DeleteNetworkInstance DeleteNetworkInstance = new DeleteNetworkInstance() DeleteNetworkInstance.getNetworkModelInfo(mockExecution) @@ -240,7 +240,7 @@ String deleteDBRequestErrorString = when(mockExecution.getVariable("mso-request-id")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6") when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DeleteNetworkInstance DeleteNetworkInstance = new DeleteNetworkInstance() DeleteNetworkInstance.sendSyncResponse(mockExecution) @@ -282,7 +282,7 @@ String deleteDBRequestErrorString = when(mockExecution.getVariable(Prefix + "source")).thenReturn("PORTAL") when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56") - // postProcessResponse(Execution execution) + // postProcessResponse(DelegateExecution execution) DeleteNetworkInstance DeleteNetworkInstance = new DeleteNetworkInstance() DeleteNetworkInstance.prepareCompletion(mockExecution) @@ -313,7 +313,7 @@ String deleteDBRequestErrorString = when(mockExecution.getVariable("URN_mso_adapters_db_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DeleteNetworkInstance DeleteNetworkInstance = new DeleteNetworkInstance() DeleteNetworkInstance.prepareDBRequestError(mockExecution) @@ -333,7 +333,7 @@ String deleteDBRequestErrorString = when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") when(mockExecution.getVariable("CMSO_ResponseCode")).thenReturn("200") - // postProcessResponse(Execution execution) + // postProcessResponse(DelegateExecution execution) DeleteNetworkInstance DeleteNetworkInstance = new DeleteNetworkInstance() DeleteNetworkInstance.postProcessResponse(mockExecution) @@ -359,7 +359,7 @@ String deleteDBRequestErrorString = when(mockExecution.getVariable("WorkflowException")).thenReturn(sndcWorkflowExceptionObj) when(mockExecution.getVariable(Prefix + "source")).thenReturn("PORTAL") - // buildErrorResponse(Execution execution) + // buildErrorResponse(DelegateExecution execution) DeleteNetworkInstance DeleteNetworkInstance = new DeleteNetworkInstance() DeleteNetworkInstance.buildErrorResponse(mockExecution) diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollbackTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollbackTest.groovy index b22431a660..8c7afc9fbf 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollbackTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollbackTest.groovy @@ -8,7 +8,7 @@ import org.camunda.bpm.engine.RepositoryService import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity import org.camunda.bpm.engine.impl.pvm.process.ProcessDefinitionImpl import org.camunda.bpm.engine.repository.ProcessDefinition -import org.camunda.bpm.engine.runtime.Execution; +import org.camunda.bpm.engine.delegate.DelegateExecution; import org.mockito.MockitoAnnotations import org.mockito.runners.MockitoJUnitRunner import org.mockito.internal.debugging.MockitoDebuggerImpl @@ -89,13 +89,13 @@ class DoCreateNetworkInstanceRollbackTest { 8abc633a-810b-4ca5-8b3a-09511d13a2ce CONTRAIL_EXTERNAL - + invariant-uuid customization-uuid uuid version CONTRAIL_EXTERNAL - + 8abc633a-810b-4ca5-8b3a-09511d13a2ce @@ -137,13 +137,13 @@ class DoCreateNetworkInstanceRollbackTest { 8abc633a-810b-4ca5-8b3a-09511d13a2ce CONTRAIL_EXTERNAL - + invariant-uuid customization-uuid uuid version CONTRAIL_EXTERNAL - + 8abc633a-810b-4ca5-8b3a-09511d13a2ce @@ -165,7 +165,7 @@ class DoCreateNetworkInstanceRollbackTest { } - public void initializeVariables (Execution mockExecution) { + public void initializeVariables (DelegateExecution mockExecution) { verify(mockExecution).setVariable(Prefix + "WorkflowException", null) @@ -216,7 +216,7 @@ class DoCreateNetworkInstanceRollbackTest { when(mockExecution.getVariable("URN_mso_adapters_sdnc_resource_endpoint")).thenReturn("http://localhost:28090/SDNCAdapterRpc") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstanceRollback DoCreateNetworkInstanceRollback = new DoCreateNetworkInstanceRollback() DoCreateNetworkInstanceRollback.preProcessRequest(mockExecution) @@ -242,7 +242,7 @@ class DoCreateNetworkInstanceRollbackTest { when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn(rollbackSDNCRequest) when(mockExecution.getVariable("URN_mso_adapters_network_rest_endpoint")).thenReturn("http://localhost:28090/networks/NetworkAdapter") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstanceRollback DoCreateNetworkInstanceRollback = new DoCreateNetworkInstanceRollback() DoCreateNetworkInstanceRollback.callPONetworkAdapter(mockExecution) diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateNetworkInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateNetworkInstanceTest.groovy index b45dd0bb4e..552a560d10 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateNetworkInstanceTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateNetworkInstanceTest.groovy @@ -14,7 +14,7 @@ import org.camunda.bpm.engine.ProcessEngineServices import org.camunda.bpm.engine.RepositoryService import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity import org.camunda.bpm.engine.repository.ProcessDefinition -import org.camunda.bpm.engine.runtime.Execution +import org.camunda.bpm.engine.delegate.DelegateExecution import org.junit.Before import org.junit.Ignore import org.junit.Rule @@ -427,6 +427,190 @@ class DoCreateNetworkInstanceTest { + + + 49c86598-f766-46f8-84f8-8d1c1b10f9b4 + MNS-25180-L-01-dmz_direct_net_1 + CONTRAIL_EXTERNAL + dmz_direct + Contrail + a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb + 0 + l3-version + pending-create + networkName + false + true + false + + + 57e9a1ff-d14f-4071-a828-b19ae98eb2fc + 107.239.52.1 + 107.239.52.0 + 24 + 4 + pending-create + true + subnetName + true + + + string + 192.10.16.0/24 + 192.10.16.100/24 + ip-address + 1505857301954 + + + string + 192.110.17.0/24 + 192.110.17.110/24 + ip-address + 1505857301954 + + + + + + 57e9a1ff-d14f-4071-a828-b19ae98eb2fc + 107.239.52.1 + 107.239.52.0 + 24 + 4 + pending-create + true + subnetName + true + + + string + 192.10.16.0/24 + 192.10.16.100/24 + ip-address + 1505857301954 + + + + + + + 414 + 4132176 + + + 415 + 4132176 + + + + inner + ctag-version + + + tenant + https://aai-ext1.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/897deadc2b954a6bac6d3c197fb3525e/ + + tenant.tenant-id + 897deadc2b954a6bac6d3c197fb3525e + + + tenant.tenant-name + MSOTest1 + + + + vpn-binding + https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/a290b841-f672-44dd-b9cd-6f8c20d7d8c8/ + + vpn-binding.vpn-id + a290b841-f672-44dd-b9cd-6f8c20d7d8c8 + + + vpn-binding.vpn-name + oam_protected_net_6_MTN5_msotest2 + + + + vpn-binding + https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/24a4b507-853a-4a38-99aa-05fcc54be24d/ + + vpn-binding.vpn-id + 24a4b507-853a-4a38-99aa-05fcc54be24d + + + vpn-binding.vpn-name + oam_protected_net_6_MTN5_msotest1 + + + + + + + + vpn-binding + https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/ + + vpn-binding.vpn-id + 85f015d0-2e32-4c30-96d2-87a1a27f8017 + + + + vpn-binding + https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/ + + vpn-binding.vpn-id + c980a6ef-3b88-49f0-9751-dbad8608d0a6 + + + + tenant + https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/ + + tenant.tenant-id + 7dd5365547234ee8937416c65507d266 + + + + network-policy + https://aai-app-e2e.test.com:8443/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg + + network-policy.network-policy-id + cee6d136-e378-4678-a024-2cd15f0ee0cg + + + + route-table-reference + https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN1 + + route-table-reference.route-table-reference-id + cee6d136-e378-4678-a024-2cd15f0ee0hi + + + + route-table-reference + https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN2 + + route-table-reference.route-table-reference-id + cee6d136-e378-4678-a024-2cd15f0ee0hi + + + + + +""" + +String queryIdAIIResponse_AlaCarte = +""" + + + + + + + + + 49c86598-f766-46f8-84f8-8d1c1b10f9b4 @@ -1357,6 +1541,77 @@ String queryIdAIIResponse_SRIOV = refFQDN1 refFQDN2 + + + + + + 107.239.52.0/24 + true + 107.239.52.1 + 4 + 57e9a1ff-d14f-4071-a828-b19ae98eb2fc + subnetName + true + + 192.10.16.0/24 + 192.10.16.100/24 + + + 192.110.17.0/24 + 192.110.17.110/24 + + + + + + + + 107.239.52.0/24 + true + 107.239.52.1 + 4 + 57e9a1ff-d14f-4071-a828-b19ae98eb2fc + subnetName + true + + 192.10.16.0/24 + 192.10.16.100/24 + + + true + true + false + + 88f65519-9a38-4c4b-8445-9eb4a5a5af56 + f70e927b-6087-4974-9ef8-c5e4d5847ca4 + + messageId_generated + +""" + +String createNetworkRequest_Ipv4 = +""" + RDM2WAGPLCP + 7dd5365547234ee8937416c65507d266 + 49c86598-f766-46f8-84f8-8d1c1b10f9b4 + MNS-25180-L-01-dmz_direct_net_1 + CONTRAIL_EXTERNAL + sn5256d1-5a33-55df-13ab-12abad84e222 + CONTRAIL + + networkName + 414,415 + + + true + false + 13979:105757 + 13979:105757 + GN_EVPN_Test + refFQDN1 + refFQDN2 + @@ -1654,7 +1909,25 @@ String createNetworkRequest_SRIOV = 4 Created true + 1505857301954 subnetName + true + + + string + 192.10.16.0/24 + 192.10.16.100/24 + ip-address + 1505857301954 + + + string + 192.110.17.0/24 + 192.110.17.110/24 + ip-address + 1505857301954 + + 57e9a1ff-d14f-4071-a828-b19ae98eb2fc @@ -1665,7 +1938,18 @@ String createNetworkRequest_SRIOV = 4 Created true + 1505857301954 subnetName + true + + + string + 192.10.16.0/24 + 192.10.16.100/24 + ip-address + 1505857301954 + + @@ -2085,12 +2369,12 @@ String assignRpcSDNCRequest = a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb MSO-dev-service-type - + fcc85cb0-ad74-45d7-a5a1-17c8744fdb71 36a3a8ea-49a6-4ac8-b06c-89a54544b9b6 1.0 HNGW Protected OAM - + f70e927b-6087-4974-9ef8-c5e4d5847ca4 globalId_45678905678 MSO_1610_dev @@ -2098,13 +2382,13 @@ String assignRpcSDNCRequest = networkId CONTRAIL_EXTERNAL - + sn5256d1-5a33-55df-13ab-12abad84e764 sn5256d1-5a33-55df-13ab-12abad84e222 sn5256d1-5a33-55df-13ab-12abad84e111 1 CONTRAIL_EXTERNAL - + MNS-25180-L-01-dmz_direct_net_1 @@ -2139,12 +2423,12 @@ String activateSDNCRequest = a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb MSO-dev-service-type - + fcc85cb0-ad74-45d7-a5a1-17c8744fdb71 36a3a8ea-49a6-4ac8-b06c-89a54544b9b6 1.0 HNGW Protected OAM - + f70e927b-6087-4974-9ef8-c5e4d5847ca4 globalId_45678905678 MSO_1610_dev @@ -2152,13 +2436,13 @@ String activateSDNCRequest = networkId CONTRAIL_EXTERNAL - + sn5256d1-5a33-55df-13ab-12abad84e764 sn5256d1-5a33-55df-13ab-12abad84e222 sn5256d1-5a33-55df-13ab-12abad84e111 1 CONTRAIL_EXTERNAL - + MNS-25180-L-01-dmz_direct_net_1 @@ -2232,12 +2516,12 @@ String sdncRpcRollbackRequest = a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb MSO-dev-service-type - + fcc85cb0-ad74-45d7-a5a1-17c8744fdb71 36a3a8ea-49a6-4ac8-b06c-89a54544b9b6 1.0 HNGW Protected OAM - + f70e927b-6087-4974-9ef8-c5e4d5847ca4 globalId_45678905678 MSO_1610_dev @@ -2245,13 +2529,13 @@ String sdncRpcRollbackRequest = 8abc633a-810b-4ca5-8b3a-09511d13a2ce CONTRAIL_EXTERNAL - + sn5256d1-5a33-55df-13ab-12abad84e764 sn5256d1-5a33-55df-13ab-12abad84e222 sn5256d1-5a33-55df-13ab-12abad84e111 1 CONTRAIL_EXTERNAL - + MNS-25180-L-01-dmz_direct_net_1 @@ -2286,12 +2570,12 @@ String sdncActivateRollbackRequest = a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb MSO-dev-service-type - + fcc85cb0-ad74-45d7-a5a1-17c8744fdb71 36a3a8ea-49a6-4ac8-b06c-89a54544b9b6 1.0 HNGW Protected OAM - + f70e927b-6087-4974-9ef8-c5e4d5847ca4 globalId_45678905678 MSO_1610_dev @@ -2299,13 +2583,13 @@ String sdncActivateRollbackRequest = 8abc633a-810b-4ca5-8b3a-09511d13a2ce CONTRAIL_EXTERNAL - + sn5256d1-5a33-55df-13ab-12abad84e764 sn5256d1-5a33-55df-13ab-12abad84e222 sn5256d1-5a33-55df-13ab-12abad84e111 1 CONTRAIL_EXTERNAL - + MNS-25180-L-01-dmz_direct_net_1 @@ -2461,13 +2745,13 @@ String sdncAdapterWorkflowAssignResponse = 8abc633a-810b-4ca5-8b3a-09511d13a2ce CONTRAIL_EXTERNAL - + invariant-uuid customization-uuid uuid version CONTRAIL_EXTERNAL - + 8abc633a-810b-4ca5-8b3a-09511d13a2ce @@ -2508,13 +2792,13 @@ String sdncAdapterWorkflowAssignResponse = 8abc633a-810b-4ca5-8b3a-09511d13a2ce CONTRAIL_EXTERNAL - + invariant-uuid customization-uuid uuid version CONTRAIL_EXTERNAL - + 8abc633a-810b-4ca5-8b3a-09511d13a2ce @@ -2535,7 +2819,7 @@ String sdncAdapterWorkflowAssignResponse = } - public void initializeVariables (Execution mockExecution) { + public void initializeVariables (DelegateExecution mockExecution) { verify(mockExecution).setVariable(Prefix + "networkRequest", "") verify(mockExecution).setVariable(Prefix + "rollbackEnabled", null) @@ -2695,7 +2979,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable("URN_mso_adapters_sdnc_resource_endpoint")).thenReturn("http://localhost:8090/SDNCAdapterRpc") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.preProcessRequest(mockExecution) @@ -2756,7 +3040,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable("URN_mso_adapters_network_rest_endpoint")).thenReturn("http://localhost:8090/networks/NetworkAdapter") when(mockExecution.getVariable("URN_mso_adapters_sdnc_resource_endpoint")).thenReturn("http://localhost:8090/SDNCAdapterRpc") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.preProcessRequest(mockExecution) @@ -2787,7 +3071,7 @@ String sdncAdapterWorkflowAssignResponse = } @Test - //@Ignore + @Ignore // 1802 merge public void preProcessRequest_XML_NetworkRequest() { println "************ preProcessRequest_Payload ************* " @@ -2810,7 +3094,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable("URN_mso_adapters_network_rest_endpoint")).thenReturn("http://localhost:8090/networks/NetworkAdapter") when(mockExecution.getVariable("URN_mso_adapters_sdnc_resource_endpoint")).thenReturn("http://localhost:8090/SDNCAdapterRpc") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.preProcessRequest(mockExecution) @@ -2862,7 +3146,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true") when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.prepareCreateNetworkRequest(mockExecution) @@ -2900,7 +3184,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true") when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.prepareCreateNetworkRequest(mockExecution) @@ -2911,7 +3195,7 @@ String sdncAdapterWorkflowAssignResponse = // verify set prefix = Prefix + "" verify(mockExecution).setVariable("prefix", Prefix) - verify(mockExecution).setVariable(Prefix + "createNetworkRequest", createNetworkRequest) + verify(mockExecution).setVariable(Prefix + "createNetworkRequest", createNetworkRequest_Ipv4) } @@ -2923,7 +3207,7 @@ String sdncAdapterWorkflowAssignResponse = ExecutionEntity mockExecution = setupMock() // Initialize prerequisite variables when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedJSONNetworkRequest) - when(mockExecution.getVariable(Prefix + "queryIdAAIResponse")).thenReturn(queryIdAIIResponse) + when(mockExecution.getVariable(Prefix + "queryIdAAIResponse")).thenReturn(queryIdAIIResponse_AlaCarte) when(mockExecution.getVariable(Prefix + "cloudRegionPo")).thenReturn("RDM2WAGPLCP") when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("messageId_generated") when(mockExecution.getVariable(Prefix + "source")).thenReturn("VID") @@ -2937,7 +3221,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true") when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.prepareCreateNetworkRequest(mockExecution) @@ -2974,7 +3258,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true") when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.prepareCreateNetworkRequest(mockExecution) @@ -3009,7 +3293,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable("GENGSI_siResourceLink")).thenReturn("https://aai-int1.test.com:8443/aai/v8/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/6d4eb22a-82f1-4257-9f80-4176262cfe69/") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.prepareSDNCRequest(mockExecution) @@ -3038,7 +3322,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable("GENGSI_siResourceLink")).thenReturn("https://aai-int1.test.com:8443/aai/v8/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/VIRTUAL%20USP/service-instances/service-instance/6d4eb22a-82f1-4257-9f80-4176262cfe69/") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.prepareSDNCRequest(mockExecution) @@ -3067,7 +3351,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") when(mockExecution.getVariable("GENGSI_siResourceLink")).thenReturn("https://aai-int1.test.com:8443/aai/v8/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/6d4eb22a-82f1-4257-9f80-4176262cfe69/") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.prepareRpcSDNCRequest(mockExecution) @@ -3096,7 +3380,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") when(mockExecution.getVariable("GENGSI_siResourceLink")).thenReturn("https://aai-int1.test.com:8443/aai/v8/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/6d4eb22a-82f1-4257-9f80-4176262cfe69/") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.prepareSDNCRollbackRequest(mockExecution) @@ -3125,7 +3409,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") when(mockExecution.getVariable("GENGSI_siResourceLink")).thenReturn("https://aai-int1.test.com:8443/aai/v8/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/6d4eb22a-82f1-4257-9f80-4176262cfe69/") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.prepareRpcSDNCActivateRequest(mockExecution) @@ -3156,7 +3440,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") when(mockExecution.getVariable("GENGSI_siResourceLink")).thenReturn("https://aai-int1.test.com:8443/aai/v8/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/6d4eb22a-82f1-4257-9f80-4176262cfe69/") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.prepareRpcSDNCRollbackRequest(mockExecution) @@ -3186,7 +3470,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") when(mockExecution.getVariable("GENGSI_siResourceLink")).thenReturn("https://aai-int1.test.com:8443/aai/v8/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/6d4eb22a-82f1-4257-9f80-4176262cfe69/") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.prepareRpcSDNCActivateRollback(mockExecution) @@ -3219,7 +3503,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.callRESTQueryAAINetworkName(mockExecution) @@ -3255,7 +3539,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.callRESTQueryAAINetworkName(mockExecution) @@ -3276,7 +3560,7 @@ String sdncAdapterWorkflowAssignResponse = println "************ callRESTQueryAAINetworkId ************* " WireMock.reset(); - MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml", "1"); + MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml", "all"); ExecutionEntity mockExecution = setupMock() when(mockExecution.getVariable(Prefix + "assignSDNCResponse")).thenReturn(sdncAdapterWorkflowAssignResponse) @@ -3290,7 +3574,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.callRESTQueryAAINetworkId(mockExecution) @@ -3299,7 +3583,7 @@ String sdncAdapterWorkflowAssignResponse = //preDebugger.printInvocations(mockExecution) verify(mockExecution).setVariable("prefix", Prefix) - verify(mockExecution).setVariable(Prefix + "queryIdAAIRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/49c86598-f766-46f8-84f8-8d1c1b10f9b4"+"?depth=1") + verify(mockExecution).setVariable(Prefix + "queryIdAAIRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/49c86598-f766-46f8-84f8-8d1c1b10f9b4"+"?depth=all") verify(mockExecution).setVariable(Prefix + "aaiIdReturnCode", "200") } @@ -3326,7 +3610,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution) @@ -3363,7 +3647,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution) @@ -3400,7 +3684,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution) @@ -3439,7 +3723,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution) @@ -3456,6 +3740,39 @@ String sdncAdapterWorkflowAssignResponse = } + @Test + //@Ignore + public void callRESTQueryAAINetworkVpnBindingList_200() { + + println "************ callRESTQueryAAINetworkVpnBinding_200 ************* " + + WireMock.reset(); + MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBindingList_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017"); + MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBindingList_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6"); + + ExecutionEntity mockExecution = setupMock() + when(mockExecution.getVariable(Prefix + "queryIdAAIResponse")).thenReturn(queryIdAIIResponse) // v6 + when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6") + when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090") + when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_vpn_binding_uri")).thenReturn("/aai/v8/network/vpn-bindings/vpn-binding") + when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") + when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/') + when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") + when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") + + // preProcessRequest(DelegateExecution execution) + DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() + DoCreateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution) + + verify(mockExecution).setVariable("prefix", Prefix) + verify(mockExecution).setVariable(Prefix + "vpnCount", 2) + verify(mockExecution).setVariable(Prefix + "vpnBindings", ['/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/', '/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/']) + // the last vpnBinding value is saved. + verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIRequest", "http://localhost:8090/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017?depth=all") + verify(mockExecution, atLeast(2)).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200") + + } + @Test //@Ignore public void callRESTQueryAAINetworkVpnBinding_TestScenario01_200() { @@ -3477,7 +3794,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution) @@ -3517,7 +3834,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution) @@ -3557,7 +3874,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution) @@ -3594,7 +3911,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.callRESTQueryAAINetworkPolicy(mockExecution) @@ -3633,7 +3950,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.callRESTQueryAAINetworkTableRef(mockExecution) @@ -3657,7 +3974,7 @@ String sdncAdapterWorkflowAssignResponse = println "************ callRESTReQueryAAINetworkId ************* " WireMock.reset(); - MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml", "1"); + MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml", "all"); ExecutionEntity mockExecution = setupMock() when(mockExecution.getVariable(Prefix + "networkId")).thenReturn("49c86598-f766-46f8-84f8-8d1c1b10f9b4") @@ -3672,7 +3989,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.callRESTReQueryAAINetworkId(mockExecution) @@ -3681,7 +3998,7 @@ String sdncAdapterWorkflowAssignResponse = //preDebugger.printInvocations(mockExecution) verify(mockExecution).setVariable("prefix", Prefix) - verify(mockExecution).setVariable(Prefix + "requeryIdAAIRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/49c86598-f766-46f8-84f8-8d1c1b10f9b4"+"?depth=1") + verify(mockExecution).setVariable(Prefix + "requeryIdAAIRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/49c86598-f766-46f8-84f8-8d1c1b10f9b4"+"?depth=all") verify(mockExecution).setVariable(Prefix + "aaiRequeryIdReturnCode", "200") } @@ -3693,7 +4010,7 @@ String sdncAdapterWorkflowAssignResponse = println "************ callRESTUpdateContrailAAINetwork ************* " WireMock.reset(); - MockPutNetworkIdWithDepth("CreateNetworkV2/createNetwork_updateContrail_AAIResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "1"); + MockPutNetworkIdWithDepth("CreateNetworkV2/createNetwork_updateContrail_AAIResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "all"); ExecutionEntity mockExecution = setupMock() when(mockExecution.getVariable(Prefix + "networkId")).thenReturn("49c86598-f766-46f8-84f8-8d1c1b10f9b4") @@ -3709,7 +4026,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.callRESTUpdateContrailAAINetwork(mockExecution) @@ -3718,7 +4035,7 @@ String sdncAdapterWorkflowAssignResponse = //preDebugger.printInvocations(mockExecution) verify(mockExecution).setVariable("prefix", Prefix) - verify(mockExecution).setVariable(Prefix + "updateContrailAAIUrlRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/49c86598-f766-46f8-84f8-8d1c1b10f9b4"+"?depth=1") + verify(mockExecution).setVariable(Prefix + "updateContrailAAIUrlRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/49c86598-f766-46f8-84f8-8d1c1b10f9b4"+"?depth=all") verify(mockExecution).setVariable(Prefix + "updateContrailAAIPayloadRequest", updateContrailAAIPayloadRequest) verify(mockExecution).setVariable(Prefix + "aaiUpdateContrailReturnCode", "200") //verify(mockExecution).setVariable(Prefix + "updateContrailAAIResponse", updateContrailAAIResponse) @@ -3733,7 +4050,7 @@ String sdncAdapterWorkflowAssignResponse = println "************ callRESTUpdateContrailAAINetwork ************* " WireMock.reset(); - MockPutNetworkIdWithDepth("CreateNetworkV2/createNetwork_updateContrail_AAIResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "1"); + MockPutNetworkIdWithDepth("CreateNetworkV2/createNetwork_updateContrail_AAIResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "all"); ExecutionEntity mockExecution = setupMock() when(mockExecution.getVariable(Prefix + "networkId")).thenReturn("49c86598-f766-46f8-84f8-8d1c1b10f9b4") @@ -3749,7 +4066,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.callRESTUpdateContrailAAINetwork(mockExecution) @@ -3758,7 +4075,7 @@ String sdncAdapterWorkflowAssignResponse = //preDebugger.printInvocations(mockExecution) verify(mockExecution).setVariable("prefix", Prefix) - verify(mockExecution).setVariable(Prefix + "updateContrailAAIUrlRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/49c86598-f766-46f8-84f8-8d1c1b10f9b4"+"?depth=1") + verify(mockExecution).setVariable(Prefix + "updateContrailAAIUrlRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/49c86598-f766-46f8-84f8-8d1c1b10f9b4"+"?depth=all") verify(mockExecution).setVariable(Prefix + "updateContrailAAIPayloadRequest", updateContrailAAIPayloadRequest_segmentation) verify(mockExecution).setVariable(Prefix + "aaiUpdateContrailReturnCode", "200") //verify(mockExecution).setVariable(Prefix + "updateContrailAAIResponse", updateContrailAAIResponse) @@ -3929,7 +4246,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn(rollbackNetworkRequest) when(mockExecution.getVariable("WorkflowException")).thenReturn(workflowException) - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.prepareRollbackData(mockExecution) @@ -3953,7 +4270,7 @@ String sdncAdapterWorkflowAssignResponse = when(mockExecution.getVariable(Prefix + "rollbackActivateSDNCRequest")).thenReturn(sdncActivateRollbackRequest) - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.postProcessResponse(mockExecution) @@ -3985,4 +4302,4 @@ String sdncAdapterWorkflowAssignResponse = return mockExecution } -} +} \ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeV2Test.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeV2Test.groovy new file mode 100644 index 0000000000..2d58c7af69 --- /dev/null +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeV2Test.groovy @@ -0,0 +1,93 @@ +package org.openecomp.mso.bpmn.infrastructure.scripts + +import static org.junit.Assert.*; +import static org.mockito.Mockito.* + +import org.camunda.bpm.engine.delegate.DelegateExecution +import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity +import org.mockito.ArgumentCaptor +import org.mockito.MockitoAnnotations +import org.mockito.runners.MockitoJUnitRunner +import org.openecomp.mso.bpmn.common.scripts.MsoGroovyTest +import org.openecomp.mso.bpmn.common.scripts.MsoUtils +import org.junit.Before +import org.junit.Ignore; +import org.junit.Test +import org.junit.runner.RunWith + + +@RunWith(MockitoJUnitRunner.class) +class DoCreateVfModuleVolumeV2Test extends MsoGroovyTest { + + def String volumeRollbackRequest = """ + + + 171907d6-cdf0-4e08-953d-81ee104005a7 + {{VOLUMEGROUPSTACKID}} + mtwnj1a + c2141e3fcae940fcb4797ec9115e5a7a + true + + 230fd6ac-2a39-4be4-9b1e-7b7e1cc039b5 + 88c871d6-be09-4982-8490-96b1d243fb34 + + 9a5a91e8-3b79-463c-81c3-874a78f5b567 + + true + 9a5a91e8-3b79-463c-81c3-874a78f5b567 + http://msobpel-app-e2e.ecomp.cci.att.com:8080/mso/WorkflowMessage/VNFAResponse/9a5a91e8-3b79-463c-81c3-874a78f5b567 + + """ + + def String volumeRollbackRequestWithStackId = """ + + + 171907d6-cdf0-4e08-953d-81ee104005a7 + mdt22avrr_volume01/0f1aaae8-efe3-45ce-83e1-bfad01db58d8 + mtwnj1a + c2141e3fcae940fcb4797ec9115e5a7a + true + + 230fd6ac-2a39-4be4-9b1e-7b7e1cc039b5 + 88c871d6-be09-4982-8490-96b1d243fb34 + + 9a5a91e8-3b79-463c-81c3-874a78f5b567 + + true + 9a5a91e8-3b79-463c-81c3-874a78f5b567 + http://msobpel-app-e2e.ecomp.cci.att.com:8080/mso/WorkflowMessage/VNFAResponse/9a5a91e8-3b79-463c-81c3-874a78f5b567 + + """ + + + + @Before + public void init() + { + MockitoAnnotations.initMocks(this) + } + + @Test + @Ignore // 1802 merge + public void testBuildRollbackVolumeGroupRequestXml() { + DoCreateVfModuleVolumeV2 process = new DoCreateVfModuleVolumeV2() + String xml = process.buildRollbackVolumeGroupRequestXml( + "171907d6-cdf0-4e08-953d-81ee104005a7", // volumeGroupId + "mtwnj1a", // cloudSiteId + "c2141e3fcae940fcb4797ec9115e5a7a", // tenantId + "230fd6ac-2a39-4be4-9b1e-7b7e1cc039b5", // requestId + "88c871d6-be09-4982-8490-96b1d243fb34", // serviceInstanceId + "9a5a91e8-3b79-463c-81c3-874a78f5b567", // messageId + "http://msobpel-app-e2e.ecomp.cci.att.com:8080/mso/WorkflowMessage/VNFAResponse/9a5a91e8-3b79-463c-81c3-874a78f5b567") // notificationUrl + + assertEquals(volumeRollbackRequest.replaceAll("\\s", ""), xml.replaceAll("\\s", "")) + } + + + @Test + public void testUpdateRollbackVolumeGroupRequestXml() { + DoCreateVfModuleVolumeV2 process = new DoCreateVfModuleVolumeV2() + String updatedXml = process.updateRollbackVolumeGroupRequestXml(volumeRollbackRequest, "mdt22avrr_volume01/0f1aaae8-efe3-45ce-83e1-bfad01db58d8") + assertEquals(volumeRollbackRequestWithStackId.replaceAll("\\s", ""), updatedXml.replaceAll("\\s", "")) + } +} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstanceTest.groovy index 2cf09fe144..5b5a70006a 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstanceTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstanceTest.groovy @@ -138,6 +138,6 @@ class DoCustomDeleteE2EServiceInstanceTest extends GroovyTestBase { when(mex.getVariable("GENGS_siResourceLink")).thenReturn("/service-subscription/e2eserviceInstance/delete/service-instances/") when(mex.getVariable("globalSubscriberId")).thenReturn("4993921112123") when(mex.getVariable("GENGS_service")).thenReturn("test3434") - when(mex.getVariable("URN_mso_openecomp_adapters_db_endpoint")).thenReturn("http://localhost:8080/mso") + when(mex.getVariable("URN_mso_adapters_openecomp_db_endpoint")).thenReturn("http://localhost:8080/mso") } } diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollbackTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollbackTest.groovy index bdfd415440..1dcd733c8a 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollbackTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollbackTest.groovy @@ -1,323 +1,323 @@ -package org.openecomp.mso.bpmn.infrastructure.scripts - -import static org.mockito.Mockito.* - -import org.camunda.bpm.engine.delegate.BpmnError -import org.camunda.bpm.engine.ProcessEngineServices -import org.camunda.bpm.engine.RepositoryService -import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity -import org.camunda.bpm.engine.impl.pvm.process.ProcessDefinitionImpl -import org.camunda.bpm.engine.repository.ProcessDefinition -import org.camunda.bpm.engine.runtime.Execution; -import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner -import org.mockito.internal.debugging.MockitoDebuggerImpl -import org.openecomp.mso.bpmn.common.scripts.MsoUtils -import org.openecomp.mso.bpmn.core.WorkflowException -import org.junit.Before -import org.junit.Rule; -import org.junit.Test -import org.junit.Ignore -import org.junit.runner.RunWith - -import static org.junit.Assert.*; - -import com.github.tomakehurst.wiremock.client.WireMock; -import com.github.tomakehurst.wiremock.junit.WireMockRule; - -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import org.apache.commons.lang3.* - - -@RunWith(MockitoJUnitRunner.class) -class DoDeleteNetworkInstanceRollbackTest { - - @Rule - public WireMockRule wireMockRule = new WireMockRule(8090); - - def utils = new MsoUtils() - String Prefix="DELNWKIR_" - - - String rollbackNetworkRequest = - """ - - MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641 - c4f4e878-cde0-4b15-ae9a-bda857759cea - - CONTRAIL_EXTERNAL - true - 7dd5365547234ee8937416c65507d266 - RDM2WAGPLCP - - 1ef47428-cade-45bd-a103-0751e8b2deb0 - - - -""" - - String rollbackDeActivateSDNCRequest = - """ - - 88f65519-9a38-4c4b-8445-9eb4a5a5af56 - f70e927b-6087-4974-9ef8-c5e4d5847ca4 - activate - network-topology-operation - sdncCallback - generic-resource - - - - 88f65519-9a38-4c4b-8445-9eb4a5a5af56 - CreateNetworkInstance - VID - - - - - - a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb - MSO-dev-service-type - f70e927b-6087-4974-9ef8-c5e4d5847ca4 - MSO_1610_dev - - - 8abc633a-810b-4ca5-8b3a-09511d13a2ce - CONTRAIL_EXTERNAL - - invariant-uuid - customization-uuid - uuid - version - CONTRAIL_EXTERNAL - - - - 8abc633a-810b-4ca5-8b3a-09511d13a2ce - CONTRAIL_EXTERNAL - MNS-25180-L-01-dmz_direct_net_1 - 7dd5365547234ee8937416c65507d266 - RDM2WAGPLCP - - -""" - - String rollbackSDNCRequest = - """ - - 88f65519-9a38-4c4b-8445-9eb4a5a5af56 - f70e927b-6087-4974-9ef8-c5e4d5847ca4 - rollback - network-topology-operation - sdncCallback - - - - 88f65519-9a38-4c4b-8445-9eb4a5a5af56 - CreateNetworkInstance - VID - - - - - - a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb - MSO-dev-service-type - f70e927b-6087-4974-9ef8-c5e4d5847ca4 - MSO_1610_dev - - - 8abc633a-810b-4ca5-8b3a-09511d13a2ce - CONTRAIL_EXTERNAL - - invariant-uuid - customization-uuid - uuid - version - CONTRAIL_EXTERNAL - - - - 8abc633a-810b-4ca5-8b3a-09511d13a2ce - CONTRAIL_EXTERNAL - MNS-25180-L-01-dmz_direct_net_1 - 7dd5365547234ee8937416c65507d266 - RDM2WAGPLCP - - -""" - -// - - - - - - - - - - - @Before - public void init() - { - MockitoAnnotations.initMocks(this) - - } - - public void initializeVariables (Execution mockExecution) { - - verify(mockExecution).setVariable(Prefix + "WorkflowException", null) - - verify(mockExecution).setVariable(Prefix + "rollbackDeactivateSDNCRequest", null) - verify(mockExecution).setVariable(Prefix + "rollbackDeactivateSDNCResponse", "") - verify(mockExecution).setVariable(Prefix + "rollbackDeactivateSDNCReturnCode", "") - - verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", null) - verify(mockExecution).setVariable(Prefix + "rollbackNetworkResponse", "") - verify(mockExecution).setVariable(Prefix + "rollbackNetworkReturnCode", "") - - verify(mockExecution).setVariable(Prefix + "Success", false) - verify(mockExecution).setVariable(Prefix + "fullRollback", false) - - } - - @Test - //@Ignore - public void preProcessRequest() { - - println "************ preProcessRequest ************* " - - WorkflowException workflowException = new WorkflowException("DoCreateNetworkInstance", 2500, "Received error from Network Adapter: JBWEB000065: HTTP Status 500.") - Map rollbackData = new HashMap(); - rollbackData.put("rollbackDeactivateSDNCRequest", rollbackDeActivateSDNCRequest) - rollbackData.put("rollbackNetworkRequest", rollbackNetworkRequest) - rollbackData.put("rollbackSDNCRequest", rollbackSDNCRequest) - - ExecutionEntity mockExecution = setupMock() - // Initialize prerequisite variables - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "") - when(mockExecution.getVariable("WorkflowException")).thenReturn(workflowException) - when(mockExecution.getVariable("rollbackData")).thenReturn(rollbackData) - when(mockExecution.getVariable("sdncVersion")).thenReturn("1702") - - when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B") - when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") - - when(mockExecution.getVariable("URN_mso_adapters_sdnc_endpoint")).thenReturn("http://localhost:8090/SDNCAdapter") - when(mockExecution.getVariable("URN_mso_adapters_network_rest_endpoint")).thenReturn("http://localhost:8090/networks/NetworkAdapter") - when(mockExecution.getVariable("URN_mso_adapters_sdnc_resource_endpoint")).thenReturn("http://localhost:8090/SDNCAdapterRpc") - - - // preProcessRequest(Execution execution) - DoDeleteNetworkInstanceRollback DoDeleteNetworkInstanceRollback = new DoDeleteNetworkInstanceRollback() - DoDeleteNetworkInstanceRollback.preProcessRequest(mockExecution) - - //verify variable initialization - initializeVariables(mockExecution) - - verify(mockExecution).getVariable("isDebugLogEnabled") - verify(mockExecution).setVariable("prefix", Prefix) - - } - - - @Test - //@Ignore - public void validateRollbackResponses_Good() { - - WorkflowException workflowException = new WorkflowException("DoDeleteNetworkInstanceRollback", 2500, "AAI Update Contrail Failed. Error 404.") - WorkflowException expectedWorkflowException = new WorkflowException("DoDeleteNetworkInstanceRollback", 2500, "AAI Update Contrail Failed. Error 404. + SNDC deactivate rollback completed. + PO Network rollback completed. + SNDC unassign rollback completed.") - - println "************ validateRollbackResponses_Good() ************* " - ExecutionEntity mockExecution = setupMock() - // Initialize prerequisite variables - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "") - - when(mockExecution.getVariable(Prefix + "rollbackDeactivateSDNCRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackDeactivateSDNCReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackDeactivateSDNCResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackNetworkReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackNetworkResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackSDNCReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackSDNCResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "WorkflowException")).thenReturn(workflowException) - when(mockExecution.getVariable(Prefix + "fullRollback")).thenReturn(false) - - DoDeleteNetworkInstanceRollback DoDeleteNetworkInstanceRollback = new DoDeleteNetworkInstanceRollback() - DoDeleteNetworkInstanceRollback.validateRollbackResponses(mockExecution) - - // verify set prefix = Prefix + "" - verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix) - verify(mockExecution, atLeast(1)).setVariable("rolledBack", true) - verify(mockExecution, atLeast(1)).setVariable("wasDeleted", true) - verify(mockExecution).setVariable("WorkflowException", refEq(expectedWorkflowException, any(WorkflowException.class))) - //verify(mockExecution).setVariable("WorkflowException", expectedWorkflowException) - } - - @Test - //@Ignore - public void validateRollbackResponses_FullRollback() { - - Map rollbackData = new HashMap(); - rollbackData.put("rollbackDeactivateSDNCRequest", rollbackDeActivateSDNCRequest) - rollbackData.put("rollbackNetworkRequest", rollbackNetworkRequest) - rollbackData.put("rollbackSDNCRequest", rollbackSDNCRequest) - - println "************ validateRollbackResponses_FullRollback() ************* " - ExecutionEntity mockExecution = setupMock() - // Initialize prerequisite variables - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "") - - when(mockExecution.getVariable(Prefix + "rollbackDeactivateSDNCRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackDeactivateSDNCReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackDeactivateSDNCResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackNetworkReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackNetworkResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackSDNCReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackSDNCResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "WorkflowException")).thenReturn(null) - when(mockExecution.getVariable(Prefix + "fullRollback")).thenReturn(true) - when(mockExecution.getVariable("rollbackData")).thenReturn(rollbackData) - - DoDeleteNetworkInstanceRollback DoDeleteNetworkInstanceRollback = new DoDeleteNetworkInstanceRollback() - DoDeleteNetworkInstanceRollback.validateRollbackResponses(mockExecution) - - // verify set prefix = Prefix + "" - verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix) - verify(mockExecution, atLeast(1)).setVariable("rollbackSuccessful", true) - verify(mockExecution, atLeast(1)).setVariable("rollbackError", false) - - } - - - private ExecutionEntity setupMock() { - - ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class) - when(mockProcessDefinition.getKey()).thenReturn("DoDeleteNetworkInstanceRollback") - RepositoryService mockRepositoryService = mock(RepositoryService.class) - when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition) - when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("DoDeleteNetworkInstanceRollback") - when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100") - ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class) - when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService) - - ExecutionEntity mockExecution = mock(ExecutionEntity.class) - // Initialize prerequisite variables - - when(mockExecution.getId()).thenReturn("100") - when(mockExecution.getProcessDefinitionId()).thenReturn("DoDeleteNetworkInstanceRollback") - when(mockExecution.getProcessInstanceId()).thenReturn("DoDeleteNetworkInstanceRollback") - when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices) - when(mockExecution.getProcessEngineServices().getRepositoryService().getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(mockProcessDefinition) - - return mockExecution - } - -} +package org.openecomp.mso.bpmn.infrastructure.scripts + +import static org.mockito.Mockito.* + +import org.camunda.bpm.engine.delegate.BpmnError +import org.camunda.bpm.engine.ProcessEngineServices +import org.camunda.bpm.engine.RepositoryService +import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity +import org.camunda.bpm.engine.impl.pvm.process.ProcessDefinitionImpl +import org.camunda.bpm.engine.repository.ProcessDefinition +import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.mockito.MockitoAnnotations +import org.mockito.runners.MockitoJUnitRunner +import org.mockito.internal.debugging.MockitoDebuggerImpl +import org.openecomp.mso.bpmn.common.scripts.MsoUtils +import org.openecomp.mso.bpmn.core.WorkflowException +import org.junit.Before +import org.junit.Rule; +import org.junit.Test +import org.junit.Ignore +import org.junit.runner.RunWith + +import static org.junit.Assert.*; + +import com.github.tomakehurst.wiremock.client.WireMock; +import com.github.tomakehurst.wiremock.junit.WireMockRule; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +import org.apache.commons.lang3.* + + +@RunWith(MockitoJUnitRunner.class) +class DoDeleteNetworkInstanceRollbackTest { + + @Rule + public WireMockRule wireMockRule = new WireMockRule(8090); + + def utils = new MsoUtils() + String Prefix="DELNWKIR_" + + + String rollbackNetworkRequest = + """ + + MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641 + c4f4e878-cde0-4b15-ae9a-bda857759cea + + CONTRAIL_EXTERNAL + true + 7dd5365547234ee8937416c65507d266 + RDM2WAGPLCP + + 1ef47428-cade-45bd-a103-0751e8b2deb0 + + + +""" + + String rollbackDeActivateSDNCRequest = + """ + + 88f65519-9a38-4c4b-8445-9eb4a5a5af56 + f70e927b-6087-4974-9ef8-c5e4d5847ca4 + activate + network-topology-operation + sdncCallback + generic-resource + + + + 88f65519-9a38-4c4b-8445-9eb4a5a5af56 + CreateNetworkInstance + VID + + + + + + a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb + MSO-dev-service-type + f70e927b-6087-4974-9ef8-c5e4d5847ca4 + MSO_1610_dev + + + 8abc633a-810b-4ca5-8b3a-09511d13a2ce + CONTRAIL_EXTERNAL + + invariant-uuid + customization-uuid + uuid + version + CONTRAIL_EXTERNAL + + + + 8abc633a-810b-4ca5-8b3a-09511d13a2ce + CONTRAIL_EXTERNAL + MNS-25180-L-01-dmz_direct_net_1 + 7dd5365547234ee8937416c65507d266 + RDM2WAGPLCP + + +""" + + String rollbackSDNCRequest = + """ + + 88f65519-9a38-4c4b-8445-9eb4a5a5af56 + f70e927b-6087-4974-9ef8-c5e4d5847ca4 + rollback + network-topology-operation + sdncCallback + + + + 88f65519-9a38-4c4b-8445-9eb4a5a5af56 + CreateNetworkInstance + VID + + + + + + a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb + MSO-dev-service-type + f70e927b-6087-4974-9ef8-c5e4d5847ca4 + MSO_1610_dev + + + 8abc633a-810b-4ca5-8b3a-09511d13a2ce + CONTRAIL_EXTERNAL + + invariant-uuid + customization-uuid + uuid + version + CONTRAIL_EXTERNAL + + + + 8abc633a-810b-4ca5-8b3a-09511d13a2ce + CONTRAIL_EXTERNAL + MNS-25180-L-01-dmz_direct_net_1 + 7dd5365547234ee8937416c65507d266 + RDM2WAGPLCP + + +""" + +// - - - - - - - - + + + @Before + public void init() + { + MockitoAnnotations.initMocks(this) + + } + + public void initializeVariables (DelegateExecution mockExecution) { + + verify(mockExecution).setVariable(Prefix + "WorkflowException", null) + + verify(mockExecution).setVariable(Prefix + "rollbackDeactivateSDNCRequest", null) + verify(mockExecution).setVariable(Prefix + "rollbackDeactivateSDNCResponse", "") + verify(mockExecution).setVariable(Prefix + "rollbackDeactivateSDNCReturnCode", "") + + verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", null) + verify(mockExecution).setVariable(Prefix + "rollbackNetworkResponse", "") + verify(mockExecution).setVariable(Prefix + "rollbackNetworkReturnCode", "") + + verify(mockExecution).setVariable(Prefix + "Success", false) + verify(mockExecution).setVariable(Prefix + "fullRollback", false) + + } + + @Test + //@Ignore + public void preProcessRequest() { + + println "************ preProcessRequest ************* " + + WorkflowException workflowException = new WorkflowException("DoCreateNetworkInstance", 2500, "Received error from Network Adapter: JBWEB000065: HTTP Status 500.") + Map rollbackData = new HashMap(); + rollbackData.put("rollbackDeactivateSDNCRequest", rollbackDeActivateSDNCRequest) + rollbackData.put("rollbackNetworkRequest", rollbackNetworkRequest) + rollbackData.put("rollbackSDNCRequest", rollbackSDNCRequest) + + ExecutionEntity mockExecution = setupMock() + // Initialize prerequisite variables + when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") + when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "") + when(mockExecution.getVariable("WorkflowException")).thenReturn(workflowException) + when(mockExecution.getVariable("rollbackData")).thenReturn(rollbackData) + when(mockExecution.getVariable("sdncVersion")).thenReturn("1702") + + when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B") + when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") + + when(mockExecution.getVariable("URN_mso_adapters_sdnc_endpoint")).thenReturn("http://localhost:8090/SDNCAdapter") + when(mockExecution.getVariable("URN_mso_adapters_network_rest_endpoint")).thenReturn("http://localhost:8090/networks/NetworkAdapter") + when(mockExecution.getVariable("URN_mso_adapters_sdnc_resource_endpoint")).thenReturn("http://localhost:8090/SDNCAdapterRpc") + + + // preProcessRequest(DelegateExecution execution) + DoDeleteNetworkInstanceRollback DoDeleteNetworkInstanceRollback = new DoDeleteNetworkInstanceRollback() + DoDeleteNetworkInstanceRollback.preProcessRequest(mockExecution) + + //verify variable initialization + initializeVariables(mockExecution) + + verify(mockExecution).getVariable("isDebugLogEnabled") + verify(mockExecution).setVariable("prefix", Prefix) + + } + + + @Test + //@Ignore + public void validateRollbackResponses_Good() { + + WorkflowException workflowException = new WorkflowException("DoDeleteNetworkInstanceRollback", 2500, "AAI Update Contrail Failed. Error 404.") + WorkflowException expectedWorkflowException = new WorkflowException("DoDeleteNetworkInstanceRollback", 2500, "AAI Update Contrail Failed. Error 404. + SNDC deactivate rollback completed. + PO Network rollback completed. + SNDC unassign rollback completed.") + + println "************ validateRollbackResponses_Good() ************* " + ExecutionEntity mockExecution = setupMock() + // Initialize prerequisite variables + when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") + when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "") + + when(mockExecution.getVariable(Prefix + "rollbackDeactivateSDNCRequest")).thenReturn("Good") + when(mockExecution.getVariable(Prefix + "rollbackDeactivateSDNCReturnCode")).thenReturn("200") + when(mockExecution.getVariable(Prefix + "rollbackDeactivateSDNCResponse")).thenReturn("GoodResponse") + when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn("Good") + when(mockExecution.getVariable(Prefix + "rollbackNetworkReturnCode")).thenReturn("200") + when(mockExecution.getVariable(Prefix + "rollbackNetworkResponse")).thenReturn("GoodResponse") + when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn("Good") + when(mockExecution.getVariable(Prefix + "rollbackSDNCReturnCode")).thenReturn("200") + when(mockExecution.getVariable(Prefix + "rollbackSDNCResponse")).thenReturn("GoodResponse") + when(mockExecution.getVariable(Prefix + "WorkflowException")).thenReturn(workflowException) + when(mockExecution.getVariable(Prefix + "fullRollback")).thenReturn(false) + + DoDeleteNetworkInstanceRollback DoDeleteNetworkInstanceRollback = new DoDeleteNetworkInstanceRollback() + DoDeleteNetworkInstanceRollback.validateRollbackResponses(mockExecution) + + // verify set prefix = Prefix + "" + verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix) + verify(mockExecution, atLeast(1)).setVariable("rolledBack", true) + verify(mockExecution, atLeast(1)).setVariable("wasDeleted", true) + verify(mockExecution).setVariable("WorkflowException", refEq(expectedWorkflowException, any(WorkflowException.class))) + //verify(mockExecution).setVariable("WorkflowException", expectedWorkflowException) + } + + @Test + //@Ignore + public void validateRollbackResponses_FullRollback() { + + Map rollbackData = new HashMap(); + rollbackData.put("rollbackDeactivateSDNCRequest", rollbackDeActivateSDNCRequest) + rollbackData.put("rollbackNetworkRequest", rollbackNetworkRequest) + rollbackData.put("rollbackSDNCRequest", rollbackSDNCRequest) + + println "************ validateRollbackResponses_FullRollback() ************* " + ExecutionEntity mockExecution = setupMock() + // Initialize prerequisite variables + when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") + when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "") + + when(mockExecution.getVariable(Prefix + "rollbackDeactivateSDNCRequest")).thenReturn("Good") + when(mockExecution.getVariable(Prefix + "rollbackDeactivateSDNCReturnCode")).thenReturn("200") + when(mockExecution.getVariable(Prefix + "rollbackDeactivateSDNCResponse")).thenReturn("GoodResponse") + when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn("Good") + when(mockExecution.getVariable(Prefix + "rollbackNetworkReturnCode")).thenReturn("200") + when(mockExecution.getVariable(Prefix + "rollbackNetworkResponse")).thenReturn("GoodResponse") + when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn("Good") + when(mockExecution.getVariable(Prefix + "rollbackSDNCReturnCode")).thenReturn("200") + when(mockExecution.getVariable(Prefix + "rollbackSDNCResponse")).thenReturn("GoodResponse") + when(mockExecution.getVariable(Prefix + "WorkflowException")).thenReturn(null) + when(mockExecution.getVariable(Prefix + "fullRollback")).thenReturn(true) + when(mockExecution.getVariable("rollbackData")).thenReturn(rollbackData) + + DoDeleteNetworkInstanceRollback DoDeleteNetworkInstanceRollback = new DoDeleteNetworkInstanceRollback() + DoDeleteNetworkInstanceRollback.validateRollbackResponses(mockExecution) + + // verify set prefix = Prefix + "" + verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix) + verify(mockExecution, atLeast(1)).setVariable("rollbackSuccessful", true) + verify(mockExecution, atLeast(1)).setVariable("rollbackError", false) + + } + + + private ExecutionEntity setupMock() { + + ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class) + when(mockProcessDefinition.getKey()).thenReturn("DoDeleteNetworkInstanceRollback") + RepositoryService mockRepositoryService = mock(RepositoryService.class) + when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition) + when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("DoDeleteNetworkInstanceRollback") + when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100") + ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class) + when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService) + + ExecutionEntity mockExecution = mock(ExecutionEntity.class) + // Initialize prerequisite variables + + when(mockExecution.getId()).thenReturn("100") + when(mockExecution.getProcessDefinitionId()).thenReturn("DoDeleteNetworkInstanceRollback") + when(mockExecution.getProcessInstanceId()).thenReturn("DoDeleteNetworkInstanceRollback") + when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices) + when(mockExecution.getProcessEngineServices().getRepositoryService().getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(mockProcessDefinition) + + return mockExecution + } + +} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceTest.groovy index f1dbb4b768..bc00123121 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceTest.groovy @@ -10,7 +10,7 @@ import org.camunda.bpm.engine.ProcessEngineServices import org.camunda.bpm.engine.RepositoryService import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity import org.camunda.bpm.engine.repository.ProcessDefinition -import org.camunda.bpm.engine.runtime.Execution +import org.camunda.bpm.engine.delegate.DelegateExecution import org.junit.Before import org.junit.Ignore import org.junit.Rule @@ -858,12 +858,12 @@ String aaiResponseWithRelationship = a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb MSO-dev-service-type - + fcc85cb0-ad74-45d7-a5a1-17c8744fdb71 36a3a8ea-49a6-4ac8-b06c-89a54544b9b6 1.0 HNGW Protected OAM - + f70e927b-6087-4974-9ef8-c5e4d5847ca4 globalId_45678905678 @@ -871,13 +871,13 @@ String aaiResponseWithRelationship = networkId CONTRAIL_EXTERNAL - + sn5256d1-5a33-55df-13ab-12abad84e764 sn5256d1-5a33-55df-13ab-12abad84e222 sn5256d1-5a33-55df-13ab-12abad84e111 1 CONTRAIL_EXTERNAL - + MNS-25180-L-01-dmz_direct_net_1 @@ -912,12 +912,12 @@ String aaiResponseWithRelationship = a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb MSO-dev-service-type - + fcc85cb0-ad74-45d7-a5a1-17c8744fdb71 36a3a8ea-49a6-4ac8-b06c-89a54544b9b6 1.0 HNGW Protected OAM - + f70e927b-6087-4974-9ef8-c5e4d5847ca4 globalId_45678905678 @@ -925,13 +925,13 @@ String aaiResponseWithRelationship = bdc5efe8-404a-409b-85f6-0dcc9eebae30 CONTRAIL_EXTERNAL - + sn5256d1-5a33-55df-13ab-12abad84e764 sn5256d1-5a33-55df-13ab-12abad84e222 sn5256d1-5a33-55df-13ab-12abad84e111 1 CONTRAIL_EXTERNAL - + MNS-25180-L-01-dmz_direct_net_1 @@ -1225,7 +1225,7 @@ String sdncAdapterWorkflowFormattedResponse_404 = } - public void initializeVariables (Execution mockExecution) { + public void initializeVariables (DelegateExecution mockExecution) { verify(mockExecution).setVariable(Prefix + "networkRequest", "") verify(mockExecution).setVariable(Prefix + "isSilentSuccess", false) @@ -1302,7 +1302,7 @@ String sdncAdapterWorkflowFormattedResponse_404 = when(mockExecution.getVariable("URN_mso_rollback")).thenReturn("true") when(mockExecution.getVariable("sdncVersion")).thenReturn("1610") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance() try { DoDeleteNetworkInstance.preProcessRequest(mockExecution) @@ -1367,7 +1367,7 @@ String sdncAdapterWorkflowFormattedResponse_404 = when(mockExecution.getVariable("URN_mso_rollback")).thenReturn("true") when(mockExecution.getVariable("sdncVersion")).thenReturn("1610") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance() DoDeleteNetworkInstance.preProcessRequest(mockExecution) @@ -1547,7 +1547,7 @@ String sdncAdapterWorkflowFormattedResponse_404 = when(mockExecution.getVariable("GENGSI_siResourceLink")).thenReturn(null) when(mockExecution.getVariable(Prefix + "deactivateSDNCResponse")).thenReturn(sdncAdapterWorkflowFormattedResponse) - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance() DoDeleteNetworkInstance.prepareRpcSDNCDeactivateRollback(mockExecution) @@ -1568,7 +1568,7 @@ String sdncAdapterWorkflowFormattedResponse_404 = println "************ callRESTQueryAAI ************* " WireMock.reset(); - MockGetNetworkByIdWithDepth("bdc5efe8-404a-409b-85f6-0dcc9eebae30", "DeleteNetworkV2/deleteNetworkAAIResponse_Success.xml", "1"); + MockGetNetworkByIdWithDepth("bdc5efe8-404a-409b-85f6-0dcc9eebae30", "DeleteNetworkV2/deleteNetworkAAIResponse_Success.xml", "all"); ExecutionEntity mockExecution = setupMock() when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedNetworkRequest) @@ -1586,7 +1586,7 @@ String sdncAdapterWorkflowFormattedResponse_404 = DoDeleteNetworkInstance.callRESTQueryAAI(mockExecution) verify(mockExecution).setVariable("prefix", Prefix) - verify(mockExecution).setVariable(Prefix + "queryAAIRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/bdc5efe8-404a-409b-85f6-0dcc9eebae30"+"?depth=1") + verify(mockExecution).setVariable(Prefix + "queryAAIRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/bdc5efe8-404a-409b-85f6-0dcc9eebae30"+"?depth=all") verify(mockExecution).setVariable(Prefix + "aaiReturnCode", "200") //verify(mockExecution).setVariable(Prefix + "queryAAIResponse", aaiResponse) @@ -1602,7 +1602,7 @@ String sdncAdapterWorkflowFormattedResponse_404 = println "************ callRESTQueryAAI ************* " WireMock.reset(); - MockGetNetworkByIdWithDepth("bdc5efe8-404a-409b-85f6-0dcc9eebae30", "DeleteNetworkV2/deleteNetworkAAIResponse_withRelationship_Success.xml", "1"); + MockGetNetworkByIdWithDepth("bdc5efe8-404a-409b-85f6-0dcc9eebae30", "DeleteNetworkV2/deleteNetworkAAIResponse_withRelationship_Success.xml", "all"); ExecutionEntity mockExecution = setupMock() when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedNetworkRequest) @@ -1620,7 +1620,7 @@ String sdncAdapterWorkflowFormattedResponse_404 = DoDeleteNetworkInstance.callRESTQueryAAI(mockExecution) verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix) - verify(mockExecution).setVariable(Prefix + "queryAAIRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/bdc5efe8-404a-409b-85f6-0dcc9eebae30"+"?depth=1") + verify(mockExecution).setVariable(Prefix + "queryAAIRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/bdc5efe8-404a-409b-85f6-0dcc9eebae30"+"?depth=all") verify(mockExecution).setVariable(Prefix + "aaiReturnCode", "200") //verify(mockExecution).setVariable(Prefix + "queryAAIResponse", aaiResponseWithRelationship) @@ -1636,7 +1636,7 @@ String sdncAdapterWorkflowFormattedResponse_404 = println "************ callRESTQueryAAI ************* " WireMock.reset(); - MockGetNetworkByIdWithDepth("bdc5efe8-404a-409b-85f6-0dcc9eebae30", "DeleteNetworkV2/deleteNetworkAAIResponse_Success.xml", "1"); + MockGetNetworkByIdWithDepth("bdc5efe8-404a-409b-85f6-0dcc9eebae30", "DeleteNetworkV2/deleteNetworkAAIResponse_Success.xml", "all"); ExecutionEntity mockExecution = setupMock() when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedNetworkRequest) @@ -1654,7 +1654,7 @@ String sdncAdapterWorkflowFormattedResponse_404 = DoDeleteNetworkInstance.callRESTQueryAAI(mockExecution) verify(mockExecution).setVariable("prefix", Prefix) - verify(mockExecution).setVariable(Prefix + "queryAAIRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/bdc5efe8-404a-409b-85f6-0dcc9eebae30"+ "?depth=1") + verify(mockExecution).setVariable(Prefix + "queryAAIRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/bdc5efe8-404a-409b-85f6-0dcc9eebae30"+ "?depth=all") verify(mockExecution).setVariable(Prefix + "aaiReturnCode", "200") //verify(mockExecution).setVariable(Prefix + "queryAAIResponse", aaiResponse) @@ -1715,7 +1715,7 @@ String sdncAdapterWorkflowFormattedResponse_404 = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance() DoDeleteNetworkInstance.callRESTQueryAAICloudRegion(mockExecution) @@ -1748,7 +1748,7 @@ String sdncAdapterWorkflowFormattedResponse_404 = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance() DoDeleteNetworkInstance.callRESTQueryAAICloudRegion(mockExecution) @@ -1864,7 +1864,7 @@ String sdncAdapterWorkflowFormattedResponse_404 = when(mockExecution.getVariable(Prefix + "source")).thenReturn("PORTAL") when(mockExecution.getVariable(Prefix + "isException")).thenReturn(false) - // postProcessResponse(Execution execution) + // postProcessResponse(DelegateExecution execution) DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance() DoDeleteNetworkInstance.postProcessResponse(mockExecution) @@ -1892,7 +1892,7 @@ String sdncAdapterWorkflowFormattedResponse_404 = when(mockExecution.getVariable(Prefix + "rollbackDeactivateSDNCRequest")).thenReturn(sdncAdapaterDeactivateRollback) when(mockExecution.getVariable("WorkflowException")).thenReturn(workflowException) - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance() DoDeleteNetworkInstance.prepareRollbackData(mockExecution) @@ -1926,4 +1926,4 @@ String sdncAdapterWorkflowFormattedResponse_404 = } -} +} \ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollbackTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollbackTest.groovy index f4b1a87dd2..09f1cfb982 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollbackTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollbackTest.groovy @@ -1,315 +1,315 @@ -package org.openecomp.mso.bpmn.infrastructure.scripts - -import static org.mockito.Mockito.* - -import org.camunda.bpm.engine.delegate.BpmnError -import org.camunda.bpm.engine.ProcessEngineServices -import org.camunda.bpm.engine.RepositoryService -import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity -import org.camunda.bpm.engine.impl.pvm.process.ProcessDefinitionImpl -import org.camunda.bpm.engine.repository.ProcessDefinition -import org.camunda.bpm.engine.runtime.Execution; -import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner -import org.mockito.internal.debugging.MockitoDebuggerImpl -import org.openecomp.mso.bpmn.common.scripts.MsoUtils -import org.openecomp.mso.bpmn.core.WorkflowException -import org.junit.Before -import org.junit.Rule; -import org.junit.Test -import org.junit.Ignore -import org.junit.runner.RunWith - -import static org.junit.Assert.*; - -import com.github.tomakehurst.wiremock.client.WireMock; -import com.github.tomakehurst.wiremock.junit.WireMockRule; - -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; -import org.apache.commons.lang3.* - - -@RunWith(MockitoJUnitRunner.class) -class DoUpdateNetworkInstanceRollbackTest { - - @Rule - public WireMockRule wireMockRule = new WireMockRule(28090); - - def utils = new MsoUtils() - String Prefix="UPDNETIR_" - - - String rollbackNetworkRequest = - """ - - MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641 - c4f4e878-cde0-4b15-ae9a-bda857759cea - - CONTRAIL_EXTERNAL - true - 7dd5365547234ee8937416c65507d266 - RDM2WAGPLCP - - 1ef47428-cade-45bd-a103-0751e8b2deb0 - - - -""" - - String rollbackActivateSDNCRequest = - """ - - 88f65519-9a38-4c4b-8445-9eb4a5a5af56 - f70e927b-6087-4974-9ef8-c5e4d5847ca4 - rollback - network-topology-operation - sdncCallback - generic-resource - - - - 88f65519-9a38-4c4b-8445-9eb4a5a5af56 - CreateNetworkInstance - VID - - - - - - a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb - MSO-dev-service-type - f70e927b-6087-4974-9ef8-c5e4d5847ca4 - MSO_1610_dev - - - 8abc633a-810b-4ca5-8b3a-09511d13a2ce - CONTRAIL_EXTERNAL - - invariant-uuid - customization-uuid - uuid - version - CONTRAIL_EXTERNAL - - - - 8abc633a-810b-4ca5-8b3a-09511d13a2ce - CONTRAIL_EXTERNAL - MNS-25180-L-01-dmz_direct_net_1 - 7dd5365547234ee8937416c65507d266 - RDM2WAGPLCP - - -""" - - String rollbackSDNCRequest = - """ - - 88f65519-9a38-4c4b-8445-9eb4a5a5af56 - f70e927b-6087-4974-9ef8-c5e4d5847ca4 - rollback - network-topology-operation - sdncCallback - generic-resource - - - - 88f65519-9a38-4c4b-8445-9eb4a5a5af56 - CreateNetworkInstance - VID - - - - - - a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb - MSO-dev-service-type - f70e927b-6087-4974-9ef8-c5e4d5847ca4 - MSO_1610_dev - - - 8abc633a-810b-4ca5-8b3a-09511d13a2ce - CONTRAIL_EXTERNAL - - invariant-uuid - customization-uuid - uuid - version - CONTRAIL_EXTERNAL - - - - 8abc633a-810b-4ca5-8b3a-09511d13a2ce - CONTRAIL_EXTERNAL - MNS-25180-L-01-dmz_direct_net_1 - 7dd5365547234ee8937416c65507d266 - RDM2WAGPLCP - - -""" - -// - - - - - - - - - - - @Before - public void init() - { - MockitoAnnotations.initMocks(this) - - } - - public void initializeVariables (Execution mockExecution) { - - verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", null) - verify(mockExecution).setVariable(Prefix + "rollbackSDNCRequest", null) - verify(mockExecution).setVariable(Prefix + "WorkflowException", null) - - verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", "") - verify(mockExecution).setVariable(Prefix + "rollbackNetworkResponse", "") - verify(mockExecution).setVariable(Prefix + "rollbackNetworkReturnCode", "") - - verify(mockExecution).setVariable(Prefix + "rollbackSDNCRequest", "") - verify(mockExecution).setVariable(Prefix + "rollbackSDNCResponse", "") - verify(mockExecution).setVariable(Prefix + "rollbackSDNCReturnCode", "") - - verify(mockExecution).setVariable(Prefix + "Success", false) - verify(mockExecution).setVariable(Prefix + "fullRollback", false) - - - } - - @Test - //@Ignore - public void preProcessRequest() { - - println "************ preProcessRequest ************* " - - WorkflowException workflowException = new WorkflowException("DoUpdateNetworkInstanceRollback", 2500, "Received error from Network Adapter: JBWEB000065: HTTP Status 500.") - Map rollbackData = new HashMap(); - rollbackData.put("rollbackSDNCRequest", rollbackSDNCRequest) - rollbackData.put("rollbackNetworkRequest", rollbackNetworkRequest) - - ExecutionEntity mockExecution = setupMock() - // Initialize prerequisite variables - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "") - when(mockExecution.getVariable("WorkflowException")).thenReturn(workflowException) - when(mockExecution.getVariable("rollbackData")).thenReturn(rollbackData) - when(mockExecution.getVariable("sdncVersion")).thenReturn("1610") - when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B") - when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") - - when(mockExecution.getVariable("URN_mso_adapters_sdnc_endpoint")).thenReturn("http://localhost:28090/SDNCAdapter") - when(mockExecution.getVariable("URN_mso_adapters_network_rest_endpoint")).thenReturn("http://localhost:28090/networks/NetworkAdapter") - when(mockExecution.getVariable("URN_mso_adapters_sdnc_resource_endpoint")).thenReturn("http://localhost:28090/SDNCAdapterRpc") - - - // preProcessRequest(Execution execution) - DoUpdateNetworkInstanceRollback DoUpdateNetworkInstanceRollback = new DoUpdateNetworkInstanceRollback() - DoUpdateNetworkInstanceRollback.preProcessRequest(mockExecution) - - verify(mockExecution).getVariable("isDebugLogEnabled") - verify(mockExecution).setVariable("prefix", Prefix) - - //verify variable initialization - initializeVariables(mockExecution) - - } - - - @Test - @Ignore - public void validateRollbackResponses_Good() { - - WorkflowException workflowException = new WorkflowException("DoUpdateNetworkInstanceRollback", 2500, "AAI Update Contrail Failed. Error 404.") - WorkflowException expectedWorkflowException = new WorkflowException("DoUpdateNetworkInstanceRollback", 2500, "AAI Update Contrail Failed. Error 404. + SNDC activate rollback completed. + PO Network rollback completed. + SNDC assign rollback completed.") - - println "************ validateRollbackResponses_Good() ************* " - ExecutionEntity mockExecution = setupMock() - // Initialize prerequisite variables - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "") - when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackNetworkReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackNetworkResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "rollbackSDNCReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackSDNCResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "WorkflowException")).thenReturn(workflowException) - when(mockExecution.getVariable(Prefix + "fullRollback")).thenReturn(false) - - DoUpdateNetworkInstanceRollback DoUpdateNetworkInstanceRollback = new DoUpdateNetworkInstanceRollback() - DoUpdateNetworkInstanceRollback.validateRollbackResponses(mockExecution) - - // verify set prefix = Prefix + "" - verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix) - verify(mockExecution, atLeast(1)).setVariable("rolledBack", true) - verify(mockExecution, atLeast(1)).setVariable("wasDeleted", true) - verify(mockExecution).setVariable("WorkflowException", refEq(expectedWorkflowException, any(WorkflowException.class))) - //verify(mockExecution).setVariable("WorkflowException", expectedWorkflowException) - } - - @Test - //@Ignore - public void validateRollbackResponses_FullRollback() { - - Map rollbackData = new HashMap(); - rollbackData.put("rollbackSDNCRequest", rollbackSDNCRequest) - rollbackData.put("rollbackNetworkRequest", rollbackNetworkRequest) - - println "************ validateRollbackResponses_FullRollback() ************* " - ExecutionEntity mockExecution = setupMock() - // Initialize prerequisite variables - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("prefix")).thenReturn(Prefix) - when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackNetworkReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackNetworkResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "rollbackSDNCReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackSDNCResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "WorkflowException")).thenReturn(null) - when(mockExecution.getVariable(Prefix + "fullRollback")).thenReturn(true) - when(mockExecution.getVariable("rollbackData")).thenReturn(rollbackData) - - DoUpdateNetworkInstanceRollback DoUpdateNetworkInstanceRollback = new DoUpdateNetworkInstanceRollback() - DoUpdateNetworkInstanceRollback.validateRollbackResponses(mockExecution) - - // verify set prefix = Prefix + "" - verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix) - verify(mockExecution, atLeast(1)).setVariable("rollbackSuccessful", true) - verify(mockExecution, atLeast(1)).setVariable("rollbackError", false) - - } - - - private ExecutionEntity setupMock() { - - ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class) - when(mockProcessDefinition.getKey()).thenReturn("DoUpdateNetworkInstanceRollback") - RepositoryService mockRepositoryService = mock(RepositoryService.class) - when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition) - when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("DoUpdateNetworkInstanceRollback") - when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100") - ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class) - when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService) - - ExecutionEntity mockExecution = mock(ExecutionEntity.class) - // Initialize prerequisite variables - - when(mockExecution.getId()).thenReturn("100") - when(mockExecution.getProcessDefinitionId()).thenReturn("DoUpdateNetworkInstanceRollback") - when(mockExecution.getProcessInstanceId()).thenReturn("DoUpdateNetworkInstanceRollback") - when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices) - when(mockExecution.getProcessEngineServices().getRepositoryService().getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(mockProcessDefinition) - - return mockExecution - } - -} +package org.openecomp.mso.bpmn.infrastructure.scripts + +import static org.mockito.Mockito.* + +import org.camunda.bpm.engine.delegate.BpmnError +import org.camunda.bpm.engine.ProcessEngineServices +import org.camunda.bpm.engine.RepositoryService +import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity +import org.camunda.bpm.engine.impl.pvm.process.ProcessDefinitionImpl +import org.camunda.bpm.engine.repository.ProcessDefinition +import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.mockito.MockitoAnnotations +import org.mockito.runners.MockitoJUnitRunner +import org.mockito.internal.debugging.MockitoDebuggerImpl +import org.openecomp.mso.bpmn.common.scripts.MsoUtils +import org.openecomp.mso.bpmn.core.WorkflowException +import org.junit.Before +import org.junit.Rule; +import org.junit.Test +import org.junit.Ignore +import org.junit.runner.RunWith + +import static org.junit.Assert.*; + +import com.github.tomakehurst.wiremock.client.WireMock; +import com.github.tomakehurst.wiremock.junit.WireMockRule; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.apache.commons.lang3.* + + +@RunWith(MockitoJUnitRunner.class) +class DoUpdateNetworkInstanceRollbackTest { + + @Rule + public WireMockRule wireMockRule = new WireMockRule(28090); + + def utils = new MsoUtils() + String Prefix="UPDNETIR_" + + + String rollbackNetworkRequest = + """ + + MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641 + c4f4e878-cde0-4b15-ae9a-bda857759cea + + CONTRAIL_EXTERNAL + true + 7dd5365547234ee8937416c65507d266 + RDM2WAGPLCP + + 1ef47428-cade-45bd-a103-0751e8b2deb0 + + + +""" + + String rollbackActivateSDNCRequest = + """ + + 88f65519-9a38-4c4b-8445-9eb4a5a5af56 + f70e927b-6087-4974-9ef8-c5e4d5847ca4 + rollback + network-topology-operation + sdncCallback + generic-resource + + + + 88f65519-9a38-4c4b-8445-9eb4a5a5af56 + CreateNetworkInstance + VID + + + + + + a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb + MSO-dev-service-type + f70e927b-6087-4974-9ef8-c5e4d5847ca4 + MSO_1610_dev + + + 8abc633a-810b-4ca5-8b3a-09511d13a2ce + CONTRAIL_EXTERNAL + + invariant-uuid + customization-uuid + uuid + version + CONTRAIL_EXTERNAL + + + + 8abc633a-810b-4ca5-8b3a-09511d13a2ce + CONTRAIL_EXTERNAL + MNS-25180-L-01-dmz_direct_net_1 + 7dd5365547234ee8937416c65507d266 + RDM2WAGPLCP + + +""" + + String rollbackSDNCRequest = + """ + + 88f65519-9a38-4c4b-8445-9eb4a5a5af56 + f70e927b-6087-4974-9ef8-c5e4d5847ca4 + rollback + network-topology-operation + sdncCallback + generic-resource + + + + 88f65519-9a38-4c4b-8445-9eb4a5a5af56 + CreateNetworkInstance + VID + + + + + + a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb + MSO-dev-service-type + f70e927b-6087-4974-9ef8-c5e4d5847ca4 + MSO_1610_dev + + + 8abc633a-810b-4ca5-8b3a-09511d13a2ce + CONTRAIL_EXTERNAL + + invariant-uuid + customization-uuid + uuid + version + CONTRAIL_EXTERNAL + + + + 8abc633a-810b-4ca5-8b3a-09511d13a2ce + CONTRAIL_EXTERNAL + MNS-25180-L-01-dmz_direct_net_1 + 7dd5365547234ee8937416c65507d266 + RDM2WAGPLCP + + +""" + +// - - - - - - - - + + + @Before + public void init() + { + MockitoAnnotations.initMocks(this) + + } + + public void initializeVariables (DelegateExecution mockExecution) { + + verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", null) + verify(mockExecution).setVariable(Prefix + "rollbackSDNCRequest", null) + verify(mockExecution).setVariable(Prefix + "WorkflowException", null) + + verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", "") + verify(mockExecution).setVariable(Prefix + "rollbackNetworkResponse", "") + verify(mockExecution).setVariable(Prefix + "rollbackNetworkReturnCode", "") + + verify(mockExecution).setVariable(Prefix + "rollbackSDNCRequest", "") + verify(mockExecution).setVariable(Prefix + "rollbackSDNCResponse", "") + verify(mockExecution).setVariable(Prefix + "rollbackSDNCReturnCode", "") + + verify(mockExecution).setVariable(Prefix + "Success", false) + verify(mockExecution).setVariable(Prefix + "fullRollback", false) + + + } + + @Test + //@Ignore + public void preProcessRequest() { + + println "************ preProcessRequest ************* " + + WorkflowException workflowException = new WorkflowException("DoUpdateNetworkInstanceRollback", 2500, "Received error from Network Adapter: JBWEB000065: HTTP Status 500.") + Map rollbackData = new HashMap(); + rollbackData.put("rollbackSDNCRequest", rollbackSDNCRequest) + rollbackData.put("rollbackNetworkRequest", rollbackNetworkRequest) + + ExecutionEntity mockExecution = setupMock() + // Initialize prerequisite variables + when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") + when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "") + when(mockExecution.getVariable("WorkflowException")).thenReturn(workflowException) + when(mockExecution.getVariable("rollbackData")).thenReturn(rollbackData) + when(mockExecution.getVariable("sdncVersion")).thenReturn("1610") + when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B") + when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") + + when(mockExecution.getVariable("URN_mso_adapters_sdnc_endpoint")).thenReturn("http://localhost:28090/SDNCAdapter") + when(mockExecution.getVariable("URN_mso_adapters_network_rest_endpoint")).thenReturn("http://localhost:28090/networks/NetworkAdapter") + when(mockExecution.getVariable("URN_mso_adapters_sdnc_resource_endpoint")).thenReturn("http://localhost:28090/SDNCAdapterRpc") + + + // preProcessRequest(DelegateExecution execution) + DoUpdateNetworkInstanceRollback DoUpdateNetworkInstanceRollback = new DoUpdateNetworkInstanceRollback() + DoUpdateNetworkInstanceRollback.preProcessRequest(mockExecution) + + verify(mockExecution).getVariable("isDebugLogEnabled") + verify(mockExecution).setVariable("prefix", Prefix) + + //verify variable initialization + initializeVariables(mockExecution) + + } + + + @Test + @Ignore + public void validateRollbackResponses_Good() { + + WorkflowException workflowException = new WorkflowException("DoUpdateNetworkInstanceRollback", 2500, "AAI Update Contrail Failed. Error 404.") + WorkflowException expectedWorkflowException = new WorkflowException("DoUpdateNetworkInstanceRollback", 2500, "AAI Update Contrail Failed. Error 404. + SNDC activate rollback completed. + PO Network rollback completed. + SNDC assign rollback completed.") + + println "************ validateRollbackResponses_Good() ************* " + ExecutionEntity mockExecution = setupMock() + // Initialize prerequisite variables + when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") + when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "") + when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn("Good") + when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn("Good") + when(mockExecution.getVariable(Prefix + "rollbackNetworkReturnCode")).thenReturn("200") + when(mockExecution.getVariable(Prefix + "rollbackNetworkResponse")).thenReturn("GoodResponse") + when(mockExecution.getVariable(Prefix + "rollbackSDNCReturnCode")).thenReturn("200") + when(mockExecution.getVariable(Prefix + "rollbackSDNCResponse")).thenReturn("GoodResponse") + when(mockExecution.getVariable(Prefix + "WorkflowException")).thenReturn(workflowException) + when(mockExecution.getVariable(Prefix + "fullRollback")).thenReturn(false) + + DoUpdateNetworkInstanceRollback DoUpdateNetworkInstanceRollback = new DoUpdateNetworkInstanceRollback() + DoUpdateNetworkInstanceRollback.validateRollbackResponses(mockExecution) + + // verify set prefix = Prefix + "" + verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix) + verify(mockExecution, atLeast(1)).setVariable("rolledBack", true) + verify(mockExecution, atLeast(1)).setVariable("wasDeleted", true) + verify(mockExecution).setVariable("WorkflowException", refEq(expectedWorkflowException, any(WorkflowException.class))) + //verify(mockExecution).setVariable("WorkflowException", expectedWorkflowException) + } + + @Test + //@Ignore + public void validateRollbackResponses_FullRollback() { + + Map rollbackData = new HashMap(); + rollbackData.put("rollbackSDNCRequest", rollbackSDNCRequest) + rollbackData.put("rollbackNetworkRequest", rollbackNetworkRequest) + + println "************ validateRollbackResponses_FullRollback() ************* " + ExecutionEntity mockExecution = setupMock() + // Initialize prerequisite variables + when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") + when(mockExecution.getVariable("prefix")).thenReturn(Prefix) + when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn("Good") + when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn("Good") + when(mockExecution.getVariable(Prefix + "rollbackNetworkReturnCode")).thenReturn("200") + when(mockExecution.getVariable(Prefix + "rollbackNetworkResponse")).thenReturn("GoodResponse") + when(mockExecution.getVariable(Prefix + "rollbackSDNCReturnCode")).thenReturn("200") + when(mockExecution.getVariable(Prefix + "rollbackSDNCResponse")).thenReturn("GoodResponse") + when(mockExecution.getVariable(Prefix + "WorkflowException")).thenReturn(null) + when(mockExecution.getVariable(Prefix + "fullRollback")).thenReturn(true) + when(mockExecution.getVariable("rollbackData")).thenReturn(rollbackData) + + DoUpdateNetworkInstanceRollback DoUpdateNetworkInstanceRollback = new DoUpdateNetworkInstanceRollback() + DoUpdateNetworkInstanceRollback.validateRollbackResponses(mockExecution) + + // verify set prefix = Prefix + "" + verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix) + verify(mockExecution, atLeast(1)).setVariable("rollbackSuccessful", true) + verify(mockExecution, atLeast(1)).setVariable("rollbackError", false) + + } + + + private ExecutionEntity setupMock() { + + ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class) + when(mockProcessDefinition.getKey()).thenReturn("DoUpdateNetworkInstanceRollback") + RepositoryService mockRepositoryService = mock(RepositoryService.class) + when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition) + when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("DoUpdateNetworkInstanceRollback") + when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100") + ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class) + when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService) + + ExecutionEntity mockExecution = mock(ExecutionEntity.class) + // Initialize prerequisite variables + + when(mockExecution.getId()).thenReturn("100") + when(mockExecution.getProcessDefinitionId()).thenReturn("DoUpdateNetworkInstanceRollback") + when(mockExecution.getProcessInstanceId()).thenReturn("DoUpdateNetworkInstanceRollback") + when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices) + when(mockExecution.getProcessEngineServices().getRepositoryService().getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(mockProcessDefinition) + + return mockExecution + } + +} \ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceTest.groovy index 08088dd544..e84d031275 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceTest.groovy @@ -12,7 +12,7 @@ import org.camunda.bpm.engine.ProcessEngineServices import org.camunda.bpm.engine.RepositoryService import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity import org.camunda.bpm.engine.repository.ProcessDefinition -import org.camunda.bpm.engine.runtime.Execution +import org.camunda.bpm.engine.delegate.DelegateExecution import org.junit.Before import org.junit.Rule import org.junit.Test @@ -507,6 +507,29 @@ String expectedNetworkInputsMissingNetworkId = pending-update true subnetName + true + + + 400d286b-7e44-4514-b9b3-f70f7360ff32 + 172.20.1.0/24 + 10.102.200.1 + ip-address + 1505857300987 + + + 6f038013-8b15-4eb8-914b-507489fbc8ee + 10.102.0.0/16 + 10.102.200.1 + ip-address + 1505857301151 + + + 8811c5f8-f1ed-4fa0-a505-e1be60396e28 + 192.168.2.0/25 + 10.102.200.1 + 1505857301954 + + @@ -518,6 +541,15 @@ String expectedNetworkInputsMissingNetworkId = pending-delete true subnetName + true + + + 400d286b-7e44-4514-b9b3-f70f7360ff32 + 172.20.1.0/24 + 10.102.200.1 + 1505857300987 + + @@ -979,6 +1011,19 @@ String expectedNetworkInputsMissingNetworkId = 4 57e9a1ff-d14f-4071-a828-b19ae98eb2fc subnetName + true + + 172.20.1.0/24 + 10.102.200.1 + + + 10.102.0.0/16 + 10.102.200.1 + + + 192.168.2.0/25 + 10.102.200.1 + true true @@ -1024,6 +1069,19 @@ String updateNetworkRequest_noPhysicalName = 4 57e9a1ff-d14f-4071-a828-b19ae98eb2fc subnetName + true + + 172.20.1.0/24 + 10.102.200.1 + + + 10.102.0.0/16 + 10.102.200.1 + + + 192.168.2.0/25 + 10.102.200.1 + true true @@ -1148,7 +1206,32 @@ String updateNetworkRequest_noPhysicalName = 4 Active true + 1505857300987 subnetName + true + + + 400d286b-7e44-4514-b9b3-f70f7360ff32 + 172.20.1.0/24 + 10.102.200.1 + ip-address + 1505857300987 + + + 6f038013-8b15-4eb8-914b-507489fbc8ee + 10.102.0.0/16 + 10.102.200.1 + ip-address + 1505857301151 + + + 8811c5f8-f1ed-4fa0-a505-e1be60396e28 + 192.168.2.0/25 + 10.102.200.1 + + 1505857301954 + + @@ -1505,13 +1588,13 @@ String rollbackSDNCRequest = 8abc633a-810b-4ca5-8b3a-09511d13a2ce CONTRAIL_EXTERNAL - + invariant-uuid customization-uuid uuid version CONTRAIL_EXTERNAL - + 8abc633a-810b-4ca5-8b3a-09511d13a2ce @@ -1550,7 +1633,7 @@ String rollbackNetworkRequest = } - public void initializeVariables (Execution mockExecution) { + public void initializeVariables (DelegateExecution mockExecution) { verify(mockExecution).setVariable(Prefix + "messageId", "") verify(mockExecution).setVariable("BasicAuthHeaderValuePO", "") @@ -1665,7 +1748,7 @@ String rollbackNetworkRequest = when(mockExecution.getVariable("URN_mso_rollback")).thenReturn("true") when(mockExecution.getVariable("disableRollback")).thenReturn("true") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance() DoUpdateNetworkInstance.preProcessRequest(mockExecution) @@ -1727,7 +1810,7 @@ String rollbackNetworkRequest = when(mockExecution.getVariable("URN_mso_adapters_network_rest_endpoint")).thenReturn("http://localhost:8090/networks/NetworkAdapter") when(mockExecution.getVariable("URN_mso_adapters_sdnc_resource_endpoint")).thenReturn("http://localhost:8090/SDNCAdapterRpc") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance() DoUpdateNetworkInstance.preProcessRequest(mockExecution) @@ -1779,7 +1862,7 @@ String rollbackNetworkRequest = when(mockExecution.getVariable("URN_mso_rollback")).thenReturn("true") when(mockExecution.getVariable("disableRollback")).thenReturn("true") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance() try { DoUpdateNetworkInstance.preProcessRequest(mockExecution) @@ -1835,7 +1918,7 @@ String rollbackNetworkRequest = when(mockExecution.getVariable("URN_mso_rollback")).thenReturn("true") when(mockExecution.getVariable("disableRollback")).thenReturn("true") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance() try { DoUpdateNetworkInstance.preProcessRequest(mockExecution) @@ -1884,7 +1967,7 @@ String rollbackNetworkRequest = when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance() DoUpdateNetworkInstance.prepareUpdateNetworkRequest(mockExecution) @@ -1921,7 +2004,7 @@ String rollbackNetworkRequest = when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance() DoUpdateNetworkInstance.prepareUpdateNetworkRequest(mockExecution) @@ -1954,7 +2037,7 @@ String rollbackNetworkRequest = when(mockExecution.getVariable("GENGSI_siResourceLink")).thenReturn("https://aai-int1.test.com:8443/aai/v8/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/6d4eb22a-82f1-4257-9f80-4176262cfe69/") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance() DoUpdateNetworkInstance.prepareSDNCRequest(mockExecution) @@ -1984,7 +2067,7 @@ String rollbackNetworkRequest = when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") when(mockExecution.getVariable("GENGSI_siResourceLink")).thenReturn("https://aai-int1.test.com:8443/aai/v8/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/6d4eb22a-82f1-4257-9f80-4176262cfe69/") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance() DoUpdateNetworkInstance.prepareSDNCRollbackRequest(mockExecution) @@ -2001,7 +2084,7 @@ String rollbackNetworkRequest = println "************ callRESTQueryAAINetworkId ************* " WireMock.reset(); - MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "UpdateNetworkV2/updateNetwork_queryNetworkId_AAIResponse_Success.xml", "1"); + MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "UpdateNetworkV2/updateNetwork_queryNetworkId_AAIResponse_Success.xml", "all"); ExecutionEntity mockExecution = setupMock() when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest) @@ -2013,7 +2096,7 @@ String rollbackNetworkRequest = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance() DoUpdateNetworkInstance.callRESTQueryAAINetworkId(mockExecution) @@ -2022,7 +2105,7 @@ String rollbackNetworkRequest = //preDebugger.printInvocations(mockExecution) verify(mockExecution).setVariable("prefix", Prefix + "") - verify(mockExecution).setVariable(Prefix + "queryIdAAIRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/49c86598-f766-46f8-84f8-8d1c1b10f9b4"+"?depth=1") + verify(mockExecution).setVariable(Prefix + "queryIdAAIRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/49c86598-f766-46f8-84f8-8d1c1b10f9b4"+"?depth=all") verify(mockExecution).setVariable(Prefix + "aaiIdReturnCode", "200") } @@ -2047,7 +2130,7 @@ String rollbackNetworkRequest = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance() DoUpdateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution) @@ -2082,7 +2165,7 @@ String rollbackNetworkRequest = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance() DoUpdateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution) @@ -2117,7 +2200,7 @@ String rollbackNetworkRequest = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance() DoUpdateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution) @@ -2155,7 +2238,7 @@ String rollbackNetworkRequest = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance() DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution) @@ -2172,6 +2255,41 @@ String rollbackNetworkRequest = } + @Test + //@Ignore + public void callRESTQueryAAINetworkVpnBindingList_200() { + + println "************ callRESTQueryAAINetworkVpnBinding_200 ************* " + + WireMock.reset(); + MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBindingList_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017"); + MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBindingList_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6"); + + ExecutionEntity mockExecution = setupMock() + when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse) // v6 + when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6") + when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090") + when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8") + when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_vpn_binding_uri")).thenReturn("/aai/v8/network/vpn-bindings/vpn-binding") + when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") + when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/') + when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") + when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") + + // preProcessRequest(DelegateExecution execution) + DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance() + DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution) + + verify(mockExecution).setVariable("prefix", Prefix + "") + verify(mockExecution).setVariable(Prefix + "vpnCount", 2) + verify(mockExecution).setVariable(Prefix + "vpnBindings", ['/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/', '/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/']) + // the last vpnBinding value is saved. + verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIRequest", "http://localhost:8090/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017?depth=all") + verify(mockExecution, atLeast(2)).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200") + + } + + @Test //@Ignore public void callRESTQueryAAINetworkVpnBinding_TestScenario01_200() { @@ -2192,7 +2310,7 @@ String rollbackNetworkRequest = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance() DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution) @@ -2230,7 +2348,7 @@ String rollbackNetworkRequest = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance() DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution) @@ -2269,7 +2387,7 @@ String rollbackNetworkRequest = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance() DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution) @@ -2305,7 +2423,7 @@ String rollbackNetworkRequest = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance() DoUpdateNetworkInstance.callRESTQueryAAINetworkTableRef(mockExecution) @@ -2342,7 +2460,7 @@ String rollbackNetworkRequest = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance() DoUpdateNetworkInstance.callRESTQueryAAINetworkPolicy(mockExecution) @@ -2367,7 +2485,7 @@ String rollbackNetworkRequest = println "************ callRESTReQueryAAINetworkId ************* " WireMock.reset(); - MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "UpdateNetworkV2/updateNetwork_queryNetworkId_AAIResponse_Success.xml", "1"); + MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "UpdateNetworkV2/updateNetwork_queryNetworkId_AAIResponse_Success.xml", "all"); ExecutionEntity mockExecution = setupMock() when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest) @@ -2380,7 +2498,7 @@ String rollbackNetworkRequest = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance() DoUpdateNetworkInstance.callRESTReQueryAAINetworkId(mockExecution) @@ -2389,7 +2507,7 @@ String rollbackNetworkRequest = //preDebugger.printInvocations(mockExecution) verify(mockExecution).setVariable("prefix", Prefix + "") - verify(mockExecution).setVariable(Prefix + "requeryIdAAIRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/49c86598-f766-46f8-84f8-8d1c1b10f9b4"+"?depth=1") + verify(mockExecution).setVariable(Prefix + "requeryIdAAIRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/49c86598-f766-46f8-84f8-8d1c1b10f9b4"+"?depth=all") verify(mockExecution).setVariable(Prefix + "aaiRequeryIdReturnCode", "200") } @@ -2402,7 +2520,7 @@ String rollbackNetworkRequest = println "************ callRESTUpdateContrailAAINetwork ************* " WireMock.reset(); - MockPutNetworkIdWithDepth("UpdateNetworkV2/updateNetwork_updateContrail_AAIResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "1"); + MockPutNetworkIdWithDepth("UpdateNetworkV2/updateNetwork_updateContrail_AAIResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "all"); ExecutionEntity mockExecution = setupMock() when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest) @@ -2417,7 +2535,7 @@ String rollbackNetworkRequest = when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance() DoUpdateNetworkInstance.callRESTUpdateContrailAAINetwork(mockExecution) @@ -2426,7 +2544,7 @@ String rollbackNetworkRequest = //preDebugger.printInvocations(mockExecution) verify(mockExecution).setVariable("prefix", Prefix + "") - verify(mockExecution).setVariable(Prefix + "updateContrailAAIUrlRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/49c86598-f766-46f8-84f8-8d1c1b10f9b4"+"?depth=1") + verify(mockExecution).setVariable(Prefix + "updateContrailAAIUrlRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/49c86598-f766-46f8-84f8-8d1c1b10f9b4"+"?depth=all") verify(mockExecution).setVariable(Prefix + "updateContrailAAIPayloadRequest", updateContrailAAIPayloadRequest) verify(mockExecution).setVariable(Prefix + "aaiUpdateContrailReturnCode", "200") //verify(mockExecution).setVariable(Prefix + "updateContrailAAIResponse", updateContrailAAIResponse) @@ -2564,7 +2682,7 @@ String rollbackNetworkRequest = when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn(rollbackNetworkRequest) when(mockExecution.getVariable("WorkflowException")).thenReturn(workflowException) - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance() DoUpdateNetworkInstance.prepareRollbackData(mockExecution) @@ -2588,7 +2706,7 @@ String rollbackNetworkRequest = when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest) when(mockExecution.getVariable("mso-request-id")).thenReturn("requestId") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance() DoUpdateNetworkInstance.postProcessResponse(mockExecution) diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/UpdateNetworkInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/UpdateNetworkInstanceTest.groovy index e987d59805..4c77a04701 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/UpdateNetworkInstanceTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/UpdateNetworkInstanceTest.groovy @@ -6,7 +6,7 @@ import org.camunda.bpm.engine.ProcessEngineServices import org.camunda.bpm.engine.RepositoryService import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity import org.camunda.bpm.engine.repository.ProcessDefinition -import org.camunda.bpm.engine.runtime.Execution +import org.camunda.bpm.engine.delegate.DelegateExecution import org.junit.Before import org.junit.Ignore import org.junit.Rule @@ -125,7 +125,7 @@ String jsonIncomingRequest = } - public void initializeVariables(Execution mockExecution) { + public void initializeVariables(DelegateExecution mockExecution) { verify(mockExecution).setVariable(Prefix + "source", "") verify(mockExecution).setVariable(Prefix + "Success", false) @@ -148,7 +148,7 @@ String jsonIncomingRequest = when(mockExecution.getVariable("URN_mso_adapters_db_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) UpdateNetworkInstance UpdateNetworkInstance = new UpdateNetworkInstance() UpdateNetworkInstance.preProcessRequest(mockExecution) @@ -171,7 +171,7 @@ String jsonIncomingRequest = // Initialize prerequisite variables when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) UpdateNetworkInstance UpdateNetworkInstance = new UpdateNetworkInstance() UpdateNetworkInstance.getNetworkModelInfo(mockExecution) @@ -192,7 +192,7 @@ String jsonIncomingRequest = when(mockExecution.getVariable("mso-request-id")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6") when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) UpdateNetworkInstance UpdateNetworkInstance = new UpdateNetworkInstance() UpdateNetworkInstance.sendSyncResponse(mockExecution) @@ -241,7 +241,7 @@ String jsonIncomingRequest = when(mockExecution.getVariable("URN_mso_adapters_db_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) UpdateNetworkInstance UpdateNetworkInstance = new UpdateNetworkInstance() UpdateNetworkInstance.prepareDBRequestError(mockExecution) @@ -262,7 +262,7 @@ String jsonIncomingRequest = when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56") when(mockExecution.getVariable(Prefix + "dbReturnCode")).thenReturn("200") - // postProcessResponse(Execution execution) + // postProcessResponse(DelegateExecution execution) UpdateNetworkInstance UpdateNetworkInstance = new UpdateNetworkInstance() UpdateNetworkInstance.prepareCompletion(mockExecution) @@ -292,7 +292,7 @@ String jsonIncomingRequest = //when(mockExecution.getVariable("WorkflowException")).thenReturn(sndcWorkflowException) when(mockExecution.getVariable("WorkflowException")).thenReturn(sndcWorkflowException) - // buildErrorResponse(Execution execution) + // buildErrorResponse(DelegateExecution execution) UpdateNetworkInstance UpdateNetworkInstance = new UpdateNetworkInstance() UpdateNetworkInstance.buildErrorResponse(mockExecution) @@ -313,7 +313,7 @@ String jsonIncomingRequest = when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") when(mockExecution.getVariable("CMSO_ResponseCode")).thenReturn("200") - // postProcessResponse(Execution execution) + // postProcessResponse(DelegateExecution execution) UpdateNetworkInstance UpdateNetworkInstance = new UpdateNetworkInstance() UpdateNetworkInstance.postProcessResponse(mockExecution) @@ -333,7 +333,7 @@ String jsonIncomingRequest = // Initialize prerequisite variables when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - // preProcessRequest(Execution execution) + // preProcessRequest(DelegateExecution execution) UpdateNetworkInstance UpdateNetworkInstance = new UpdateNetworkInstance() UpdateNetworkInstance.processRollbackData(mockExecution) diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustServiceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustServiceTest.groovy index 7a494db998..2c9d591399 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustServiceTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustServiceTest.groovy @@ -24,7 +24,6 @@ import org.camunda.bpm.engine.ProcessEngineServices import org.camunda.bpm.engine.RepositoryService import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity import org.camunda.bpm.engine.repository.ProcessDefinition -import org.camunda.bpm.engine.runtime.Execution import org.junit.Before import org.junit.BeforeClass import org.junit.Rule @@ -84,7 +83,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase { // ***** preProcessRequest ***** @Test - // @Ignore + @Ignore // 1802 merge public void preProcessRequest() { ExecutionEntity mex = setupMock() def map = setupMap(mex) @@ -133,7 +132,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase { } @Test - // @Ignore + @Ignore // 1802 merge public void preProcessRequest_EmptyParts() { ExecutionEntity mex = setupMock() def map = setupMap(mex) diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustServiceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustServiceTest.groovy index af56f34bce..fdc470f16d 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustServiceTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustServiceTest.groovy @@ -24,7 +24,6 @@ import org.camunda.bpm.engine.ProcessEngineServices import org.camunda.bpm.engine.RepositoryService import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity import org.camunda.bpm.engine.repository.ProcessDefinition -import org.camunda.bpm.engine.runtime.Execution import org.junit.Before import org.junit.BeforeClass import org.junit.Rule diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollbackTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollbackTest.groovy index bbe9d52225..71c0f8b511 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollbackTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollbackTest.groovy @@ -24,7 +24,6 @@ import org.camunda.bpm.engine.ProcessEngineServices import org.camunda.bpm.engine.RepositoryService import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity import org.camunda.bpm.engine.repository.ProcessDefinition -import org.camunda.bpm.engine.runtime.Execution import org.junit.Before import org.junit.BeforeClass import org.junit.Rule diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy index acc6970dd1..c8afb228a9 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy @@ -24,7 +24,6 @@ import org.camunda.bpm.engine.ProcessEngineServices import org.camunda.bpm.engine.RepositoryService import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity import org.camunda.bpm.engine.repository.ProcessDefinition -import org.camunda.bpm.engine.runtime.Execution import org.junit.Before import org.junit.BeforeClass import org.junit.Rule diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollbackTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollbackTest.groovy index 02352cf6af..9b4283bb82 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollbackTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollbackTest.groovy @@ -24,7 +24,6 @@ import org.camunda.bpm.engine.ProcessEngineServices import org.camunda.bpm.engine.RepositoryService import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity import org.camunda.bpm.engine.repository.ProcessDefinition -import org.camunda.bpm.engine.runtime.Execution import org.junit.Before import org.junit.BeforeClass import org.junit.Rule diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCTest.groovy index 2de6e44a2f..e1fc143576 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCTest.groovy @@ -24,7 +24,6 @@ import org.camunda.bpm.engine.ProcessEngineServices import org.camunda.bpm.engine.RepositoryService import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity import org.camunda.bpm.engine.repository.ProcessDefinition -import org.camunda.bpm.engine.runtime.Execution import org.junit.Before import org.junit.BeforeClass import org.junit.Rule diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRGTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRGTest.groovy index 4e62a566a7..14c382eb39 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRGTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRGTest.groovy @@ -24,7 +24,6 @@ import org.camunda.bpm.engine.ProcessEngineServices import org.camunda.bpm.engine.RepositoryService import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity import org.camunda.bpm.engine.repository.ProcessDefinition -import org.camunda.bpm.engine.runtime.Execution import org.junit.Before import org.junit.BeforeClass import org.junit.Rule diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXCTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXCTest.groovy index 33273c55a6..115f298062 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXCTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXCTest.groovy @@ -24,7 +24,6 @@ import org.camunda.bpm.engine.ProcessEngineServices import org.camunda.bpm.engine.RepositoryService import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity import org.camunda.bpm.engine.repository.ProcessDefinition -import org.camunda.bpm.engine.runtime.Execution import org.junit.Before import org.junit.BeforeClass import org.junit.Rule diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/GroovyTestBase.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/GroovyTestBase.groovy index 01ca53ba97..ef67a75d10 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/GroovyTestBase.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/GroovyTestBase.groovy @@ -24,7 +24,6 @@ import org.camunda.bpm.engine.ProcessEngineServices import org.camunda.bpm.engine.RepositoryService import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity import org.camunda.bpm.engine.repository.ProcessDefinition -import org.camunda.bpm.engine.runtime.Execution import org.junit.Before import org.junit.BeforeClass import org.junit.Rule -- cgit 1.2.3-korg