summaryrefslogtreecommitdiffstats
path: root/bpmn/MSOInfrastructureBPMN/src/test
diff options
context:
space:
mode:
authorArthur Martella <amartell@research.att.com>2017-09-08 13:27:46 -0400
committerArthur Martella <amartell@research.att.com>2017-09-08 13:32:24 -0400
commit62cd6aaaf74aa91ee0037c0e155c8e7284f07567 (patch)
tree68c0c53c9156f5aa3c6b3599ac940770f986633d /bpmn/MSOInfrastructureBPMN/src/test
parentfa1a211d28a912892fcd888569df033900eb01ee (diff)
1710 Rebase - Second Attempt
This commit rebases changes from openecomp-mso/internal-staging-1710 up to and including this codecloud commit: 54483fc6606ddb1591a2e9da61bff8712325f924 Wed Sep 6 18:12:56 2017 -0400 Rebasing was done on a branch on top of this commit in so/master in ONAP: 93fbdfbe46104f8859d4754040f979cb7997c157 Thu Sep 7 16:42:59 2017 +0000 Change-Id: I4ad9abf40da32bf5bdca43e868b8fa2dbcd9dc59 Issue-id: SO-107 Signed-off-by: Arthur Martella <amartell@research.att.com>
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/test')
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateNetworkInstanceTest.groovy360
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVfModuleVolumeInfraV1Test.groovy11
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteNetworkInstanceTest.groovy397
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteVfModuleVolumeInfraV1Test.groovy4
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollbackTest.groovy349
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateNetworkInstanceTest.groovy3988
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeV1Test.groovy218
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollbackTest.groovy323
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceTest.groovy1929
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollbackTest.groovy315
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceTest.groovy2625
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/UpdateNetworkInstanceTest.groovy368
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateGenericALaCarteServiceInstanceTest.java109
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateNetworkInstanceTest.java645
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleVolumeInfraV1Test.java72
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVnfInfraTest.java3
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteGenericALaCarteServiceInstanceTest.java91
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteNetworkInstanceTest.java321
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateSIRollbackTest.java179
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstanceTest.java98
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleRollbackTest.java3
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleTest.java172
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleVolumeV1Test.java351
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleVolumeV2Test.java220
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfAndModulesRollbackTest.java405
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfAndModulesTest.java354
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfTest.java15
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteServiceInstanceTest.java88
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleFromVnfTest.java157
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleTest.java11
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleVolumeV2Test.java198
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVnfAndModulesTest.java190
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoUpdateVfModuleTest.java130
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoUpdateVnfAndModulesTest.java206
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/ReplaceVnfInfraTest.java259
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateNetworkInstanceTest.java468
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleInfraV2Test.java119
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVnfInfraTest.java174
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/AAI/AAI_genericVnfsByVnfId.json329
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/AAI/AAI_pserverByVnfId.json72
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2mock/sdncCreateNetworkTopologyRsrcAssignResponse.xml17
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2mock/sdncCreateNetworkTopologySimResponse.xml19
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request.json16
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request_noreqparm.json6
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_queryVolumeName_AAIResponse_Success.xml1
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_HasVfModRelationship.xml62
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModule_VID_request.json18
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModule_VID_request_noPreloads.json18
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DBUpdateResponse.xml4
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2mock/sdncDeleteNetworkTopologySimResponse.xml19
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2mock/sdncDeleteNetworkTopologySimResponse_noExtraTag.xml17
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteVfModuleCallbackResponse.xml21
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteVfModuleVolumeInfraV1/deleteVfModuleVolume_VID_request_st.json2
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/createVfModuleVolume_VID_request.json6
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModule_getVnfResponse.xml26
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getSINoRelations.xml6
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getSIUrlByIdVipr.xml7
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/CreateVnfInfraRequest.json11
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/DeleteVnfInfraRequestCascadeDelete.json10
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/ReplaceVnf_VID_request.json49
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/UpdateVfModule_VID_request.json28
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/UpdateVnf_VID_request.json49
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/Policy/policyAbortResponse.json1
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/Policy/policySkipResponse.json1
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_Success.xml4
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/updateVfModuleVolume_VID_request.json14
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/updateVfModuleVolume_VID_request_2.json14
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/vf_module_aai_response.xml4
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/getCatalogServiceResourcesDataForReplaceVnfInfra.json93
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/getCatalogServiceResourcesDataForUpdateVnfInfra.json105
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/serviceDecompositionATMFW.json110
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/DBUpdateResponse.xml2
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/GenerateVfModuleName_AAIResponse_Success.xml2
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/GenericVnf.xml2
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallback.xml2
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallbackVfModule.xml2
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallbackVfModuleNoVnf.xml81
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallbackVnf.xml82
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VfModule-lukewarm.xml2
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VfModule-new.xml2
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VfModule-supercool.xml2
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/mso.bpmn.urn.properties38
82 files changed, 16619 insertions, 682 deletions
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
new file mode 100644
index 0000000000..13e107e8ad
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateNetworkInstanceTest.groovy
@@ -0,0 +1,360 @@
+package org.openecomp.mso.bpmn.infrastructure.scripts
+
+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.Rule
+import org.junit.Test
+import org.mockito.MockitoAnnotations
+import org.openecomp.mso.bpmn.common.scripts.MsoUtils
+import org.openecomp.mso.bpmn.core.WorkflowException
+
+import static org.junit.Assert.*;
+import static org.mockito.Mockito.*
+
+import com.github.tomakehurst.wiremock.junit.WireMockRule
+
+class CreateNetworkInstanceTest {
+
+ @Rule
+ public WireMockRule wireMockRule = new WireMockRule(8090);
+
+ String Prefix="CRENI_"
+ def utils = new MsoUtils()
+
+ String createDBRequestError =
+"""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <ns:updateInfraRequest xmlns:ns="http://org.openecomp.mso/requestsdb">
+ <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
+ <lastModifiedBy>BPMN</lastModifiedBy>
+ <statusMessage>Received error from SDN-C: No availability zone available</statusMessage>
+ <responseBody></responseBody>
+ <requestStatus>FAILED</requestStatus>
+ <vnfOutputs>&lt;network-id&gt;&lt;/network-id&gt;&lt;network-name&gt;&lt;/network-names&gt;</vnfOutputs>
+ </ns:updateInfraRequest>
+ </soapenv:Body>
+ </soapenv:Envelope>"""
+
+ String falloutHandlerRequest =
+ """<aetgt:FalloutHandlerRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:ns="http://org.openecomp/mso/request/types/v1"
+ xmlns:wfsch="http://org.openecomp/mso/workflow/schema/v1">
+ <request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
+ <request-id>b69c9054-da09-4a2c-adf5-51042b62bfac</request-id>
+ <action>CREATE</action>
+ <source>VID</source>
+ </request-info>
+ <aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">
+ <aetgt:ErrorMessage>Received error from SDN-C: No availability zone available.</aetgt:ErrorMessage>
+ <aetgt:ErrorCode>5300</aetgt:ErrorCode>
+ </aetgt:WorkflowException>
+ </aetgt:FalloutHandlerRequest>"""
+
+ String completeMsoProcessRequest =
+ """<aetgt:MsoCompletionRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:ns="http://org.openecomp/mso/request/types/v1"
+ xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
+ <request-info>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <action>CREATE</action>
+ <source>VID</source>
+ </request-info>
+ <aetgt:status-message>Network has been created successfully.</aetgt:status-message>
+ <aetgt:mso-bpel-name>BPMN Network action: CREATE</aetgt:mso-bpel-name>
+</aetgt:MsoCompletionRequest>"""
+
+
+String jsonIncomingRequest =
+"""{ "requestDetails": {
+ "modelInfo": {
+ "modelType": "networkTyp",
+ "modelId": "modelId",
+ "modelNameVersionId": "modelNameVersionId",
+ "modelName": "CONTRAIL_EXTERNAL",
+ "modelVersion": "1"
+ },
+ "cloudConfiguration": {
+ "lcpCloudRegionId": "RDM2WAGPLCP",
+ "tenantId": "7dd5365547234ee8937416c65507d266"
+ },
+ "requestInfo": {
+ "instanceName": "MNS-25180-L-01-dmz_direct_net_1",
+ "source": "VID",
+ "callbackUrl": "",
+ "suppressRollback": true,
+ "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"
+ },
+ "relatedInstanceList": [
+ {
+ "relatedInstance": {
+ "instanceId": "f70e927b-6087-4974-9ef8-c5e4d5847ca4",
+ "modelInfo": {
+ "modelType": "serviceT",
+ "modelId": "modelI",
+ "modelNameVersionId": "modelNameVersionI",
+ "modelName": "modleNam",
+ "modelVersion": "1"
+ }
+ }
+ }
+ ],
+ "requestParameters": {
+ "userParams": [
+ {
+ "name": "someUserParam1",
+ "value": "someValue1"
+ }
+ ]
+ }
+ }}"""
+
+ @Before
+ public void init()
+ {
+ MockitoAnnotations.initMocks(this)
+
+ }
+
+ public void initializeVariables(Execution mockExecution) {
+
+ verify(mockExecution).setVariable(Prefix + "Success", false)
+
+ verify(mockExecution).setVariable(Prefix + "CompleteMsoProcessRequest", "")
+ verify(mockExecution).setVariable(Prefix + "FalloutHandlerRequest", "")
+ verify(mockExecution).setVariable(Prefix + "isSilentSuccess", false)
+
+ }
+
+ @Test
+ //@Ignore
+ public void preProcessRequest() {
+
+ println "************ preProcessRequest() ************* "
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("bpmnRequest")).thenReturn(jsonIncomingRequest)
+
+
+ // preProcessRequest(Execution execution)
+ CreateNetworkInstance CreateNetworkInstance = new CreateNetworkInstance()
+ CreateNetworkInstance.preProcessRequest(mockExecution)
+
+ verify(mockExecution).getVariable("isDebugLogEnabled")
+ verify(mockExecution).setVariable("prefix", Prefix)
+
+ initializeVariables(mockExecution)
+ //verify(mockExecution).setVariable(Prefix + "Success", false)
+
+ }
+
+
+ @Test
+ //@Ignore
+ public void getNetworkModelInfo() {
+
+ println "************ getNetworkModelInfo() ************* "
+
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+
+ // preProcessRequest(Execution execution)
+ CreateNetworkInstance CreateNetworkInstance = new CreateNetworkInstance()
+ CreateNetworkInstance.getNetworkModelInfo(mockExecution)
+
+ verify(mockExecution).getVariable("isDebugLogEnabled")
+ verify(mockExecution).setVariable("prefix", Prefix)
+
+ }
+
+ @Test
+ //@Ignore
+ public void sendSyncResponse() {
+
+ println "************ sendSyncResponse ************* "
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("isAsyncProcess")).thenReturn(true)
+ 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)
+ CreateNetworkInstance CreateNetworkInstance = new CreateNetworkInstance()
+ CreateNetworkInstance.sendSyncResponse(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable("CreateNetworkInstanceResponseCode", "202")
+
+ }
+
+ @Test
+ //@Ignore
+ public void sendSyncError() {
+
+ println "************ sendSyncError ************* "
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("isAsyncProcess")).thenReturn(true)
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
+ when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+
+ CreateNetworkInstance CreateNetworkInstance = new CreateNetworkInstance()
+ CreateNetworkInstance.sendSyncError(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable("CreateNetworkInstanceResponseCode", "500")
+
+ }
+
+ @Test
+ //@Ignore
+ public void prepareDBRequestError() {
+
+ println "************ prepareDBRequestError ************* "
+
+ WorkflowException sndcWorkflowException = new WorkflowException("CreateNetworkInstance", 500, "Received error from SDN-C: No availability zone available")
+
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("WorkflowException")).thenReturn(sndcWorkflowException)
+ //when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable(Prefix + "requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("networkId")).thenReturn("")
+ when(mockExecution.getVariable("networkName")).thenReturn("")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("URN_mso_adapters_db_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
+ when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
+
+ // preProcessRequest(Execution execution)
+ CreateNetworkInstance CreateNetworkInstance = new CreateNetworkInstance()
+ CreateNetworkInstance.prepareDBRequestError(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "createDBRequest", createDBRequestError)
+
+ }
+
+
+ @Test
+ //@Ignore
+ public void prepareCompletion() {
+
+ println "************ postProcessResponse ************* "
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable(Prefix + "dbReturnCode")).thenReturn("200")
+
+ // postProcessResponse(Execution execution)
+ CreateNetworkInstance CreateNetworkInstance = new CreateNetworkInstance()
+ CreateNetworkInstance.prepareCompletion(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "Success", true)
+ verify(mockExecution).setVariable(Prefix + "CompleteMsoProcessRequest", completeMsoProcessRequest)
+
+ }
+
+ @Test
+ //@Ignore
+ public void buildErrorResponse() {
+
+ println "************ buildErrorResponse ************* "
+
+
+ WorkflowException sndcWorkflowException = new WorkflowException("CreateNetworkInstance", 5300, "Received error from SDN-C: No availability zone available.")
+
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("b69c9054-da09-4a2c-adf5-51042b62bfac")
+ //when(mockExecution.getVariable("WorkflowException")).thenReturn(sndcWorkflowException)
+ when(mockExecution.getVariable("WorkflowException")).thenReturn(sndcWorkflowException)
+
+ // buildErrorResponse(Execution execution)
+ CreateNetworkInstance CreateNetworkInstance = new CreateNetworkInstance()
+ CreateNetworkInstance.buildErrorResponse(mockExecution)
+
+ verify(mockExecution, atLeast(1)).setVariable("prefix", "CRENI_")
+ verify(mockExecution).setVariable(Prefix + "FalloutHandlerRequest", falloutHandlerRequest)
+
+ //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
+ //debugger.printInvocations(mockExecution)
+
+ }
+
+ @Test
+ //@Ignore
+ public void postProcessResponse() {
+
+ println "************ postProcessResponse() ************* "
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("CMSO_ResponseCode")).thenReturn("200")
+
+ // postProcessResponse(Execution execution)
+ CreateNetworkInstance CreateNetworkInstance = new CreateNetworkInstance()
+ CreateNetworkInstance.postProcessResponse(mockExecution)
+
+ //verify(mockExecution).getVariable("isDebugLogEnabled")
+ //verify(mockExecution).setVariable("prefix", Prefix)
+
+ verify(mockExecution).setVariable(Prefix + "Success", true)
+
+ }
+
+ @Test
+ //@Ignore
+ public void processRollbackData() {
+
+ println "************ callDBCatalog() ************* "
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+
+ // preProcessRequest(Execution execution)
+ CreateNetworkInstance CreateNetworkInstance = new CreateNetworkInstance()
+ CreateNetworkInstance.processRollbackData(mockExecution)
+
+ verify(mockExecution).getVariable("isDebugLogEnabled")
+ verify(mockExecution).setVariable("prefix", Prefix)
+
+ }
+
+ private ExecutionEntity setupMock() {
+
+ ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class)
+ when(mockProcessDefinition.getKey()).thenReturn("CreateNetworkInstance")
+ RepositoryService mockRepositoryService = mock(RepositoryService.class)
+ when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition)
+ when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("CreateNetworkInstance")
+ 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("CreateNetworkInstance")
+ when(mockExecution.getProcessInstanceId()).thenReturn("CreateNetworkInstance")
+ 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/CreateVfModuleVolumeInfraV1Test.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVfModuleVolumeInfraV1Test.groovy
index 4f5375719f..0cf97922ae 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVfModuleVolumeInfraV1Test.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVfModuleVolumeInfraV1Test.groovy
@@ -27,10 +27,11 @@ 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.junit.Before
+import org.junit.Ignore;
import org.junit.Test
import org.junit.runner.RunWith
-import org.openecomp.mso.bpmn.common.scripts.MsoGroovyTest;
@RunWith(MockitoJUnitRunner.class)
@@ -64,8 +65,8 @@ class CreateVfModuleVolumeInfraV1Test extends MsoGroovyTest {
"instanceId": "{service-instance-id}",
"modelInfo": {
"modelType": "service",
- "modelId": "ff3514e3-5a33-55df-13ab-12abad84e7ff",
- "modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
+ "modelInvariantUuid": "ff5256d1-5a33-55df-13ab-12abad84e7ff",
+ "modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
"modelName": "Test",
"modelVersion": "2.0"
}
@@ -79,7 +80,7 @@ class CreateVfModuleVolumeInfraV1Test extends MsoGroovyTest {
"modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
"modelName": "vSAMP12",
"modelVersion": "1",
- "modelCustomizationName": "vSAMP12"
+ "modelInstanceName": "vSAMP12"
}
}
}
@@ -162,6 +163,7 @@ class CreateVfModuleVolumeInfraV1Test extends MsoGroovyTest {
@Test
+ @Ignore
public void testPreProcessRequest() {
ExecutionEntity mockExecution = setupMock('CreateVfModuleVolumeInfraV1')
@@ -171,6 +173,7 @@ class CreateVfModuleVolumeInfraV1Test extends MsoGroovyTest {
when(mockExecution.getVariable("serviceInstanceId")).thenReturn('')
when(mockExecution.getVariable("vnfId")).thenReturn('test-vnf-id')
when(mockExecution.getVariable("mso-request-id")).thenReturn('1234')
+ when(mockExecution.getVariable("URN_mso_rollback")).thenReturn('true')
CreateVfModuleVolumeInfraV1 createVfModuleVolumeInfraV1 = new CreateVfModuleVolumeInfraV1()
createVfModuleVolumeInfraV1.preProcessRequest(mockExecution, 'true')
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
new file mode 100644
index 0000000000..304697891f
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteNetworkInstanceTest.groovy
@@ -0,0 +1,397 @@
+package org.openecomp.mso.bpmn.infrastructure.scripts
+
+import static org.mockito.Mockito.*
+
+import org.apache.commons.lang3.*
+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.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.MockitoAnnotations
+import org.mockito.runners.MockitoJUnitRunner
+import org.openecomp.mso.bpmn.common.scripts.MsoUtils
+import org.openecomp.mso.bpmn.core.WorkflowException
+
+import com.github.tomakehurst.wiremock.junit.WireMockRule
+
+
+@RunWith(MockitoJUnitRunner.class)
+class DeleteNetworkInstanceTest {
+
+ @Rule
+ public WireMockRule wireMockRule = new WireMockRule(8090);
+
+ String Prefix="DELNI_"
+ def utils = new MsoUtils()
+
+ String falloutHandlerRequest =
+ """<aetgt:FalloutHandlerRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:ns="http://org.openecomp/mso/request/types/v1"
+ xmlns:wfsch="http://org.openecomp/mso/workflow/schema/v1">
+ <request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
+ <request-id>b69c9054-da09-4a2c-adf5-51042b62bfac</request-id>
+ <action>DELETE</action>
+ <source>PORTAL</source>
+ </request-info>
+ <aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">
+ <aetgt:ErrorMessage>Received error from SDN-C: No availability zone available</aetgt:ErrorMessage>
+ <aetgt:ErrorCode>5300</aetgt:ErrorCode>
+ <aetgt:SourceSystemErrorCode>200</aetgt:SourceSystemErrorCode>
+</aetgt:WorkflowException>
+ </aetgt:FalloutHandlerRequest>"""
+
+ String falloutHandlerRequestObj =
+ """<aetgt:FalloutHandlerRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:ns="http://org.openecomp/mso/request/types/v1"
+ xmlns:wfsch="http://org.openecomp/mso/workflow/schema/v1">
+ <request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
+ <request-id>b69c9054-da09-4a2c-adf5-51042b62bfac</request-id>
+ <action>DELETE</action>
+ <source>PORTAL</source>
+ </request-info>
+ <aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">
+ <aetgt:ErrorMessage>Received error from SDN-C: No availability zone available</aetgt:ErrorMessage>
+ <aetgt:ErrorCode>7000</aetgt:ErrorCode>
+ </aetgt:WorkflowException>
+ </aetgt:FalloutHandlerRequest>"""
+
+ String completeMsoProcessRequest =
+ """<aetgt:MsoCompletionRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:ns="http://org.openecomp/mso/request/types/v1"
+ xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
+ <request-info>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <action>DELETE</action>
+ <source>VID</source>
+ </request-info>
+ <aetgt:status-message>Network has been deleted successfully.</aetgt:status-message>
+ <aetgt:mso-bpel-name>BPMN Network action: DELETE</aetgt:mso-bpel-name>
+</aetgt:MsoCompletionRequest>"""
+
+String deleteDBRequest =
+"""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:ns="http://org.openecomp.mso/requestsdb">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <ns:updateInfraRequest>
+ <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
+ <lastModifiedBy>BPMN</lastModifiedBy>
+ <statusMessage>Network successfully deleted.</statusMessage>
+ <responseBody/>
+ <requestStatus>COMPLETED</requestStatus>
+ <progress>100</progress>
+ <vnfOutputs>&lt;network-outputs xmlns="http://org.openecomp/mso/infra/vnf-request/v1" xmlns:aetgt="http://org.openecomp/mso/infra/vnf-request/v1" xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"/&gt;</vnfOutputs>
+ </ns:updateInfraRequest>
+ </soapenv:Body>
+</soapenv:Envelope>"""
+
+String deleteDBRequestErrorObj =
+"""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <ns:updateInfraRequest xmlns:ns="http://org.openecomp.mso/requestsdb">
+ <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
+ <lastModifiedBy>BPMN</lastModifiedBy>
+ <statusMessage>Received error from SDN-C: No availability zone available</statusMessage>
+ <responseBody></responseBody>
+ <requestStatus>FAILED</requestStatus>
+ <progress></progress>
+ <vnfOutputs>&lt;network-outputs xmlns="http://org.openecomp/mso/infra/vnf-request/v1" xmlns:aetgt="http://org.openecomp/mso/infra/vnf-request/v1" xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"/&gt;</vnfOutputs>
+ </ns:updateInfraRequest>
+ </soapenv:Body>
+ </soapenv:Envelope>"""
+
+String deleteDBRequestErrorString =
+"""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <ns:updateInfraRequest xmlns:ns="http://org.openecomp.mso/requestsdb">
+ <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
+ <lastModifiedBy>BPMN</lastModifiedBy>
+ <statusMessage>Received error from SDN-C: No availability zone available</statusMessage>
+ <responseBody></responseBody>
+ <requestStatus>FAILED</requestStatus>
+ <progress></progress>
+ <vnfOutputs>&lt;network-outputs xmlns="http://org.openecomp/mso/infra/vnf-request/v1" xmlns:aetgt="http://org.openecomp/mso/infra/vnf-request/v1" xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"/&gt;</vnfOutputs>
+ </ns:updateInfraRequest>
+ </soapenv:Body>
+ </soapenv:Envelope>"""
+
+ String jsonIncomingRequest =
+ """{ "requestDetails": {
+ "modelInfo": {
+ "modelType": "networkTyp",
+ "modelId": "modelId",
+ "modelNameVersionId": "modelNameVersionId",
+ "modelName": "CONTRAIL_EXTERNAL",
+ "modelVersion": "1"
+ },
+ "cloudConfiguration": {
+ "lcpCloudRegionId": "RDM2WAGPLCP",
+ "tenantId": "7dd5365547234ee8937416c65507d266"
+ },
+ "requestInfo": {
+ "instanceName": "MNS-25180-L-01-dmz_direct_net_1",
+ "source": "VID",
+ "callbackUrl": "",
+ "suppressRollback": true,
+ "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"
+ },
+ "relatedInstanceList": [
+ {
+ "relatedInstance": {
+ "instanceId": "f70e927b-6087-4974-9ef8-c5e4d5847ca4",
+ "modelInfo": {
+ "modelType": "serviceT",
+ "modelId": "modelI",
+ "modelNameVersionId": "modelNameVersionI",
+ "modelName": "modleNam",
+ "modelVersion": "1"
+ }
+ }
+ }
+ ],
+ "requestParameters": {
+ "userParams": [
+ {
+ "name": "someUserParam1",
+ "value": "someValue1"
+ }
+ ]
+ }
+ }}"""
+
+// - - - - - - - -
+
+
+ @Before
+ public void init()
+ {
+ MockitoAnnotations.initMocks(this)
+ }
+
+ @Test
+ //@Ignore
+ public void preProcessRequest() {
+
+ println "************ preProcessRequest_Payload ************* "
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("bpmnRequest")).thenReturn(jsonIncomingRequest)
+
+ DeleteNetworkInstance DeleteNetworkInstance = new DeleteNetworkInstance()
+ DeleteNetworkInstance.preProcessRequest(mockExecution)
+
+ verify(mockExecution).getVariable("isDebugLogEnabled")
+ verify(mockExecution).setVariable("prefix", Prefix)
+
+ //verify variable initialization
+ initializeVariables(mockExecution)
+
+
+ }
+
+ public void initializeVariables (Execution mockExecution) {
+
+
+ verify(mockExecution).setVariable(Prefix + "Success", false)
+
+ verify(mockExecution).setVariable(Prefix + "CompleteMsoProcessRequest", "")
+ verify(mockExecution).setVariable(Prefix + "FalloutHandlerRequest", "")
+ verify(mockExecution).setVariable(Prefix + "isSilentSuccess", false)
+
+ }
+
+
+ @Test
+ //@Ignore
+ public void getNetworkModelInfo() {
+
+ println "************ getNetworkModelInfo() ************* "
+
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+
+ // preProcessRequest(Execution execution)
+ DeleteNetworkInstance DeleteNetworkInstance = new DeleteNetworkInstance()
+ DeleteNetworkInstance.getNetworkModelInfo(mockExecution)
+
+ verify(mockExecution).getVariable("isDebugLogEnabled")
+ verify(mockExecution).setVariable("prefix", Prefix)
+
+ }
+
+ @Test
+ //@Ignore
+ public void sendSyncResponse() {
+
+ println "************ sendSyncResponse ************* "
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("isAsyncProcess")).thenReturn(true)
+ 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)
+ DeleteNetworkInstance DeleteNetworkInstance = new DeleteNetworkInstance()
+ DeleteNetworkInstance.sendSyncResponse(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable("DeleteNetworkInstanceResponseCode", "202")
+
+ }
+
+
+ @Test
+ //@Ignore
+ public void sendSyncError() {
+
+ println "************ sendSyncError ************* "
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("isAsyncProcess")).thenReturn(true)
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
+ when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+
+ DeleteNetworkInstance DeleteNetworkInstance = new DeleteNetworkInstance()
+ DeleteNetworkInstance.sendSyncError(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable("DeleteNetworkInstanceResponseCode", "500")
+
+ }
+
+
+ @Test
+ //@Ignore
+ public void prepareCompletion() {
+
+ println "************ postProcessResponse ************* "
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "source")).thenReturn("PORTAL")
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+
+ // postProcessResponse(Execution execution)
+ DeleteNetworkInstance DeleteNetworkInstance = new DeleteNetworkInstance()
+ DeleteNetworkInstance.prepareCompletion(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(mockExecution)
+
+ verify(mockExecution).getVariable("isDebugLogEnabled")
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "CompleteMsoProcessRequest", completeMsoProcessRequest)
+
+ }
+
+
+ @Test
+ //@Ignore
+ public void prepareDBRequestError() {
+
+ println "************ prepareDBRequestError ************* "
+
+ WorkflowException sndcWorkflowExceptionObj = new WorkflowException("CreateNetworkV2", 500, "Received error from SDN-C: No availability zone available")
+
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable(Prefix + "requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("WorkflowException")).thenReturn(sndcWorkflowExceptionObj)
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("URN_mso_adapters_db_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
+ when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
+
+ // preProcessRequest(Execution execution)
+ DeleteNetworkInstance DeleteNetworkInstance = new DeleteNetworkInstance()
+ DeleteNetworkInstance.prepareDBRequestError(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "deleteDBRequest", deleteDBRequestErrorObj)
+
+ }
+
+
+ @Test
+ //@Ignore
+ public void postProcessResponse() {
+
+ println "************ postProcessResponse ************* "
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("CMSO_ResponseCode")).thenReturn("200")
+
+ // postProcessResponse(Execution execution)
+ DeleteNetworkInstance DeleteNetworkInstance = new DeleteNetworkInstance()
+ DeleteNetworkInstance.postProcessResponse(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "Success", true)
+
+
+ }
+
+
+ @Test
+ //@Ignore
+ public void buildErrorResponse_FalloutHandlerRequest() {
+
+ println "************ buildErrorResponse ************* "
+
+ WorkflowException sndcWorkflowExceptionObj = new WorkflowException("DeleteNetworkInstance", 7000, "Received error from SDN-C: No availability zone available")
+
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("b69c9054-da09-4a2c-adf5-51042b62bfac")
+ when(mockExecution.getVariable("WorkflowException")).thenReturn(sndcWorkflowExceptionObj)
+ when(mockExecution.getVariable(Prefix + "source")).thenReturn("PORTAL")
+
+ // buildErrorResponse(Execution execution)
+ DeleteNetworkInstance DeleteNetworkInstance = new DeleteNetworkInstance()
+ DeleteNetworkInstance.buildErrorResponse(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "Success", false)
+ verify(mockExecution).setVariable(Prefix + "FalloutHandlerRequest", falloutHandlerRequestObj)
+
+ }
+
+
+ private ExecutionEntity setupMock() {
+
+ ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class)
+ when(mockProcessDefinition.getKey()).thenReturn("DeleteNetworkInstance")
+ RepositoryService mockRepositoryService = mock(RepositoryService.class)
+ when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition)
+ when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("DeleteNetworkInstance")
+ 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("DeleteNetworkInstance")
+ when(mockExecution.getProcessInstanceId()).thenReturn("DeleteNetworkInstance")
+ 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/DeleteVfModuleVolumeInfraV1Test.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteVfModuleVolumeInfraV1Test.groovy
index 2e6b35eaba..fac156e86d 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteVfModuleVolumeInfraV1Test.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteVfModuleVolumeInfraV1Test.groovy
@@ -26,6 +26,7 @@ import static org.mockito.Mockito.*
import org.apache.commons.lang3.*
import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
import org.junit.Before
+import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.MockitoAnnotations
@@ -121,11 +122,14 @@ class DeleteVfModuleVolumeInfraV1Test extends MsoGroovyTest {
}
@Test
+ //@Ignore
public void testPrepareDbRequest() {
ExecutionEntity mockExecution = setupMock('DeleteVfModuleVolumeInfraV1')
when(mockExecution.getVariable("DELVfModVol_requestId")).thenReturn('TEST-REQUEST-ID-0123')
when(mockExecution.getVariable("DELVfModVol_volumeOutputs")).thenReturn('')
+ when(mockExecution.getVariable("URN_mso_adapters_db_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
+ when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
DeleteVfModuleVolumeInfraV1 myproc = new DeleteVfModuleVolumeInfraV1()
myproc.prepareDBRequest(mockExecution, 'true')
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
new file mode 100644
index 0000000000..2bb88632db
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollbackTest.groovy
@@ -0,0 +1,349 @@
+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.openecomp.mso.bpmn.mock.StubResponseNetworkAdapter.MockNetworkAdapterRestRollbackDelete;
+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 DoCreateNetworkInstanceRollbackTest {
+
+ @Rule
+ public WireMockRule wireMockRule = new WireMockRule(28090);
+
+ def utils = new MsoUtils()
+ String Prefix="CRENWKIR_"
+
+
+ String rollbackNetworkRequest =
+ """<NetworkAdapter:rollbackNetwork xmlns:NetworkAdapter="http://org.openecomp.mso/network">
+ <rollback>
+ <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
+ <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
+ <networkStackId/>
+ <networkType>CONTRAIL_EXTERNAL</networkType>
+ <networkCreated>true</networkCreated>
+ <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
+ <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
+ <msoRequest>
+ <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId>
+ <serviceInstanceId/>
+ </msoRequest>
+ </rollback>
+</NetworkAdapter:rollbackNetwork>"""
+
+ String rollbackActivateSDNCRequest =
+ """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:ns5="http://org.openecomp/mso/request/types/v1"
+ xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>rollback</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
+ <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
+ </sdncadapter:RequestHeader>
+ <aetgt:SDNCRequestData>
+ <request-information>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <request-action>CreateNetworkInstance</request-action>
+ <source>VID</source>
+ <notification-url/>
+ <order-number/>
+ <order-version/>
+ </request-information>
+ <service-information>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <service-type>MSO-dev-service-type</service-type>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ <subscriber-name>MSO_1610_dev</subscriber-name>
+ </service-information>
+ <network-information>
+ <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <ecomp-model-information>
+ <model-invariant-uuid>invariant-uuid</model-invariant-uuid>
+ <model-customization-uuid>customization-uuid</model-customization-uuid>
+ <model-uuid>uuid</model-uuid>
+ <model-version>version</model-version>
+ <model-name>CONTRAIL_EXTERNAL</model-name>
+ </ecomp-model-information>
+ </network-information>
+ <network-request-information>
+ <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <tenant>7dd5365547234ee8937416c65507d266</tenant>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ </network-request-information>
+ </aetgt:SDNCRequestData>
+</aetgt:SDNCAdapterWorkflowRequest>"""
+
+ String rollbackSDNCRequest =
+ """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:ns5="http://org.openecomp/mso/request/types/v1"
+ xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>rollback</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
+ <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
+ </sdncadapter:RequestHeader>
+ <aetgt:SDNCRequestData>
+ <request-information>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <request-action>CreateNetworkInstance</request-action>
+ <source>VID</source>
+ <notification-url/>
+ <order-number/>
+ <order-version/>
+ </request-information>
+ <service-information>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <service-type>MSO-dev-service-type</service-type>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ <subscriber-name>MSO_1610_dev</subscriber-name>
+ </service-information>
+ <network-information>
+ <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <ecomp-model-information>
+ <model-invariant-uuid>invariant-uuid</model-invariant-uuid>
+ <model-customization-uuid>customization-uuid</model-customization-uuid>
+ <model-uuid>uuid</model-uuid>
+ <model-version>version</model-version>
+ <model-name>CONTRAIL_EXTERNAL</model-name>
+ </ecomp-model-information>
+ </network-information>
+ <network-request-information>
+ <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <tenant>7dd5365547234ee8937416c65507d266</tenant>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ </network-request-information>
+ </aetgt:SDNCRequestData>
+</aetgt:SDNCAdapterWorkflowRequest>"""
+
+// - - - - - - - -
+
+
+ @Before
+ public void init()
+ {
+ MockitoAnnotations.initMocks(this)
+
+ }
+
+ public void initializeVariables (Execution mockExecution) {
+
+ verify(mockExecution).setVariable(Prefix + "WorkflowException", null)
+
+ verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", null)
+ verify(mockExecution).setVariable(Prefix + "rollbackNetworkResponse", "")
+ verify(mockExecution).setVariable(Prefix + "rollbackNetworkReturnCode", "")
+
+ verify(mockExecution).setVariable(Prefix + "rollbackSDNCRequest", null)
+ verify(mockExecution).setVariable(Prefix + "rollbackSDNCResponse", "")
+ verify(mockExecution).setVariable(Prefix + "rollbackSDNCReturnCode", "")
+
+ verify(mockExecution).setVariable(Prefix + "rollbackActivateSDNCRequest", null)
+ verify(mockExecution).setVariable(Prefix + "rollbackActivateSDNCResponse", "")
+ verify(mockExecution).setVariable(Prefix + "rollbackActivateSDNCReturnCode", "")
+
+ verify(mockExecution).setVariable(Prefix + "Success", false)
+ verify(mockExecution).setVariable(Prefix + "fullRollback", false)
+ verify(mockExecution).setVariable(Prefix + "networkId", "")
+ verify(mockExecution).setVariable(Prefix + "urlRollbackPoNetwork", "")
+
+ }
+
+ @Test
+ //@Ignore
+ public void preProcessRequest() {
+
+ println "************ preProcessRequest ************* "
+
+ WorkflowException workflowException = new WorkflowException("DoCreateNetworkInstance", 2500, "Received error from Network Adapter: JBWEB000065: HTTP Status 500.")
+ Map<String, String> rollbackData = new HashMap<String, String>();
+ rollbackData.put("rollbackSDNCRequest", rollbackSDNCRequest)
+ rollbackData.put("rollbackActivateSDNCRequest", rollbackActivateSDNCRequest)
+ 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("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: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)
+ DoCreateNetworkInstanceRollback DoCreateNetworkInstanceRollback = new DoCreateNetworkInstanceRollback()
+ DoCreateNetworkInstanceRollback.preProcessRequest(mockExecution)
+
+ verify(mockExecution).getVariable("isDebugLogEnabled")
+ verify(mockExecution).setVariable("prefix", Prefix)
+
+ //verify variable initialization
+ initializeVariables(mockExecution)
+
+ }
+
+ @Test
+ //@Ignore
+ public void callPONetworkAdapter() {
+
+ MockNetworkAdapterRestRollbackDelete("deleteNetworkResponse_Success.xml","8abc633a-810b-4ca5-8b3a-09511d13a2ce");
+
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
+ when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn( rollbackNetworkRequest)
+ 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)
+ DoCreateNetworkInstanceRollback DoCreateNetworkInstanceRollback = new DoCreateNetworkInstanceRollback()
+ DoCreateNetworkInstanceRollback.callPONetworkAdapter(mockExecution)
+
+ verify(mockExecution, atLeast(1)).setVariable(Prefix + "urlRollbackPoNetwork", "http://localhost:28090/networks/NetworkAdapter/8abc633a-810b-4ca5-8b3a-09511d13a2ce/rollback")
+
+ }
+
+ @Test
+ //@Ignore
+ public void validateRollbackResponses_Good() {
+
+ WorkflowException workflowException = new WorkflowException("DoCreateNetworkInstanceRollback", 2500, "AAI Update Contrail Failed. Error 404.")
+ WorkflowException expectedWorkflowException = new WorkflowException("DoCreateNetworkInstanceRollback", 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 + "rollbackActivateSDNCRequest")).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 + "rollbackActivateSDNCReturnCode")).thenReturn("200")
+ when(mockExecution.getVariable(Prefix + "rollbackActivateSDNCResponse")).thenReturn("GoodResponse")
+ when(mockExecution.getVariable(Prefix + "WorkflowException")).thenReturn(workflowException)
+ when(mockExecution.getVariable(Prefix + "fullRollback")).thenReturn(false)
+
+ DoCreateNetworkInstanceRollback DoCreateNetworkInstanceRollback = new DoCreateNetworkInstanceRollback()
+ DoCreateNetworkInstanceRollback.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<String, String> rollbackData = new HashMap<String, String>();
+ rollbackData.put("rollbackSDNCRequest", rollbackSDNCRequest)
+ rollbackData.put("rollbackActivateSDNCRequest", rollbackActivateSDNCRequest)
+ 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 + "rollbackActivateSDNCRequest")).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 + "rollbackActivateSDNCReturnCode")).thenReturn("200")
+ when(mockExecution.getVariable(Prefix + "rollbackActivateSDNCResponse")).thenReturn("GoodResponse")
+ when(mockExecution.getVariable(Prefix + "workflowException")).thenReturn(null)
+ when(mockExecution.getVariable(Prefix + "fullRollback")).thenReturn(true)
+ when(mockExecution.getVariable("rollbackData")).thenReturn(rollbackData)
+
+ DoCreateNetworkInstanceRollback DoCreateNetworkInstanceRollback = new DoCreateNetworkInstanceRollback()
+ DoCreateNetworkInstanceRollback.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("DoCreateNetworkInstanceRollback")
+ RepositoryService mockRepositoryService = mock(RepositoryService.class)
+ when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition)
+ when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("DoCreateNetworkInstanceRollback")
+ 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("DoCreateNetworkInstanceRollback")
+ when(mockExecution.getProcessInstanceId()).thenReturn("DoCreateNetworkInstanceRollback")
+ 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/DoCreateNetworkInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateNetworkInstanceTest.groovy
new file mode 100644
index 0000000000..d0b87b3737
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateNetworkInstanceTest.groovy
@@ -0,0 +1,3988 @@
+package org.openecomp.mso.bpmn.infrastructure.scripts
+
+import static org.mockito.Mockito.*
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkByName;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkByName_404;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkByIdWithDepth;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkCloudRegion;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkCloudRegion_404;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutNetworkIdWithDepth;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkPolicy;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkTableReference;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkVpnBinding;
+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.Ignore
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.MockitoAnnotations
+import org.mockito.runners.MockitoJUnitRunner
+import org.openecomp.mso.bpmn.common.scripts.MsoUtils
+import org.openecomp.mso.bpmn.core.WorkflowException
+
+import com.github.tomakehurst.wiremock.client.WireMock
+import com.github.tomakehurst.wiremock.junit.WireMockRule
+import org.apache.commons.lang3.*
+
+@RunWith(MockitoJUnitRunner.class)
+class DoCreateNetworkInstanceTest {
+
+ @Rule
+ public WireMockRule wireMockRule = new WireMockRule(8090);
+
+ def utils = new MsoUtils()
+ String Prefix="CRENWKI_"
+
+// ---- Start XML Zone ----
+ String xmlIncomingRequest =
+ """<rest:payload contentType="text/xml" xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd">
+ <network-request xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
+ <request-info>
+ <request-id>1ef47428-cade-45bd-a103-0751e8b2deb0</request-id>
+ <action>CREATE</action>
+ <source>PORTAL</source>
+ </request-info>
+ <network-inputs>
+ <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
+ <physicalNetworkName>dvs-slcp3-01</physicalNetworkName>
+ <vlans>3008</vlans>
+ <service-instance-id>MNS-25180-L-01-dmz_direct_net_1</service-instance-id>
+ <backout-on-failure>true</backout-on-failure>
+ </network-inputs>
+ <network-params xmlns:vnfreq="http://org.openecomp/mso/infra/vnf-request/v1">
+ <param xmlns="" xmlns:ns3="http://org.openecomp/mso/infra/vnf-request/v1" name="shared">1</param>
+ <param xmlns="" xmlns:ns3="http://org.openecomp/mso/infra/vnf-request/v1" name="external">0</param>
+ </network-params>
+ </network-request>
+ </rest:payload>"""
+
+ String expectedXMLNetworkRequest =
+"""<rest:payload xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ xmlns:vnfreq="http://org.openecomp/mso/infra/vnf-request/v1"
+ contentType="text/xml">
+ <vnfreq:network-request>
+ <vnfreq:request-info>
+ <vnfreq:request-id>1ef47428-cade-45bd-a103-0751e8b2deb0</vnfreq:request-id>
+ <vnfreq:action>CREATE</vnfreq:action>
+ <vnfreq:source>PORTAL</vnfreq:source>
+ </vnfreq:request-info>
+ <vnfreq:network-inputs>
+ <vnfreq:network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</vnfreq:network-id>
+ <vnfreq:network-name>MNS-25180-L-01-dmz_direct_net_1</vnfreq:network-name>
+ <vnfreq:network-type>CONTRAIL_EXTERNAL</vnfreq:network-type>
+ <vnfreq:service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</vnfreq:service-id>
+ <vnfreq:aic-cloud-region>RDM2WAGPLCP</vnfreq:aic-cloud-region>
+ <vnfreq:tenant-id>7dd5365547234ee8937416c65507d266</vnfreq:tenant-id>
+ <vnfreq:physicalNetworkName>dvs-slcp3-01</vnfreq:physicalNetworkName>
+ <vnfreq:vlans>3008</vnfreq:vlans>
+ <vnfreq:service-instance-id>MNS-25180-L-01-dmz_direct_net_1</vnfreq:service-instance-id>
+ <vnfreq:backout-on-failure>true</vnfreq:backout-on-failure>
+ </vnfreq:network-inputs>
+ <vnfreq:network-params>
+ <param name="shared">1</param>
+ <param name="external">0</param>
+ </vnfreq:network-params>
+ </vnfreq:network-request>
+</rest:payload>"""
+
+ String expectedXMLNetworkInputs =
+"""<vnfreq:network-inputs xmlns:vnfreq="http://org.openecomp/mso/infra/vnf-request/v1">
+ <vnfreq:network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</vnfreq:network-id>
+ <vnfreq:network-name>MNS-25180-L-01-dmz_direct_net_1</vnfreq:network-name>
+ <vnfreq:network-type>CONTRAIL_EXTERNAL</vnfreq:network-type>
+ <vnfreq:service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</vnfreq:service-id>
+ <vnfreq:aic-cloud-region>RDM2WAGPLCP</vnfreq:aic-cloud-region>
+ <vnfreq:tenant-id>7dd5365547234ee8937416c65507d266</vnfreq:tenant-id>
+ <vnfreq:physicalNetworkName>dvs-slcp3-01</vnfreq:physicalNetworkName>
+ <vnfreq:vlans>3008</vnfreq:vlans>
+ <vnfreq:service-instance-id>MNS-25180-L-01-dmz_direct_net_1</vnfreq:service-instance-id>
+ <vnfreq:backout-on-failure>true</vnfreq:backout-on-failure>
+</vnfreq:network-inputs>"""
+
+ String networkXMLOutputs =
+""""""
+
+// ---- End XML Zone ----
+
+// ---- Start JSON Zone ----
+ // JSON format Input
+ String jsonIncomingRequest =
+ """{ "requestDetails": {
+ "modelInfo": {
+ "modelType": "network",
+ "modelCustomizationId": "f21df226-8093-48c3-be7e-0408fcda0422",
+ "modelName": "CONTRAIL_EXTERNAL",
+ "modelVersion": "1.0"
+ },
+ "cloudConfiguration": {
+ "lcpCloudRegionId": "RDM2WAGPLCP",
+ "tenantId": "7dd5365547234ee8937416c65507d266"
+ },
+ "requestInfo": {
+ "instanceName": "MNS-25180-L-01-dmz_direct_net_1",
+ "source": "VID",
+ "callbackUrl": "",
+ "suppressRollback": true,
+ "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"
+ },
+ "relatedInstanceList": [
+ {
+ "relatedInstance": {
+ "instanceId": "f70e927b-6087-4974-9ef8-c5e4d5847ca4",
+ "modelInfo": {
+ "modelType": "serviceT",
+ "modelId": "modelI",
+ "modelNameVersionId": "modelNameVersionI",
+ "modelName": "modleNam",
+ "modelVersion": "1"
+ }
+ }
+ }
+ ],
+ "requestParameters": {
+ "userParams": [
+ {
+ "name": "someUserParam1",
+ "value": "someValue1"
+ }
+ ]
+ }
+ }}"""
+
+ String expectedJSONNetworkRequest =
+ """<network-request xmlns="http://www.w3.org/2001/XMLSchema">
+ <request-info>
+ <request-id>null</request-id>
+ <action>CREATE</action>
+ <source>VID</source>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ </request-info>
+ <network-inputs>
+ <network-id>networkId</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <modelCustomizationId>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationId>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <backout-on-failure>false</backout-on-failure>
+ <sdncVersion>1610</sdncVersion>
+ </network-inputs>
+ <network-params>
+ <param name="some_user_param1">someValue1</param>
+ </network-params>
+</network-request>"""
+
+ String expectedJSONNetworkInputs =
+"""<network-inputs xmlns="http://www.w3.org/2001/XMLSchema">
+ <network-id>networkId</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <modelCustomizationId>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationId>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <backout-on-failure>false</backout-on-failure>
+ <sdncVersion>1610</sdncVersion>
+</network-inputs>"""
+
+ String networkJSONOutputs =
+"""<network-outputs>
+ <network-id>networkId</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ </network-outputs>"""
+
+// ---- End JSON Zone ----
+
+// ---- Start vPIR Zone ----
+ // expectedNetworkRequest
+ String expectedvIPRNetworkRequest =
+ """<network-request xmlns="http://www.w3.org/2001/XMLSchema">
+ <request-info>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <action>CREATE</action>
+ <source>VID</source>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ </request-info>
+ <network-inputs>
+ <network-id>networkId</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <subscription-service-type>MSO-dev-service-type</subscription-service-type>
+ <global-customer-id>globalId_45678905678</global-customer-id>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <backout-on-failure>false</backout-on-failure>
+ <failIfExist>false</failIfExist>
+ <networkModelInfo>
+ <modelName>CONTRAIL_EXTERNAL</modelName>
+ <modelUuid>sn5256d1-5a33-55df-13ab-12abad84e111</modelUuid>
+ <modelInvariantUuid>sn5256d1-5a33-55df-13ab-12abad84e764</modelInvariantUuid>
+ <modelVersion>1</modelVersion>
+ <modelCustomizationUuid>sn5256d1-5a33-55df-13ab-12abad84e222</modelCustomizationUuid>
+ </networkModelInfo>
+ <serviceModelInfo>
+ <modelName>HNGW Protected OAM</modelName>
+ <modelUuid>36a3a8ea-49a6-4ac8-b06c-89a54544b9b6</modelUuid>
+ <modelInvariantUuid>fcc85cb0-ad74-45d7-a5a1-17c8744fdb71</modelInvariantUuid>
+ <modelVersion>1.0</modelVersion>
+ <modelCustomizationUuid/>
+ </serviceModelInfo>
+ <sdncVersion>1702</sdncVersion>
+ </network-inputs>
+ <network-params/>
+</network-request>"""
+
+ String expectedvIPRNetworkInputs =
+"""<network-inputs xmlns="http://www.w3.org/2001/XMLSchema">
+ <network-id>networkId</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <subscription-service-type>MSO-dev-service-type</subscription-service-type>
+ <global-customer-id>globalId_45678905678</global-customer-id>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <backout-on-failure>false</backout-on-failure>
+ <failIfExist>false</failIfExist>
+ <networkModelInfo>
+ <modelName>CONTRAIL_EXTERNAL</modelName>
+ <modelUuid>sn5256d1-5a33-55df-13ab-12abad84e111</modelUuid>
+ <modelInvariantUuid>sn5256d1-5a33-55df-13ab-12abad84e764</modelInvariantUuid>
+ <modelVersion>1</modelVersion>
+ <modelCustomizationUuid>sn5256d1-5a33-55df-13ab-12abad84e222</modelCustomizationUuid>
+ </networkModelInfo>
+ <serviceModelInfo>
+ <modelName>HNGW Protected OAM</modelName>
+ <modelUuid>36a3a8ea-49a6-4ac8-b06c-89a54544b9b6</modelUuid>
+ <modelInvariantUuid>fcc85cb0-ad74-45d7-a5a1-17c8744fdb71</modelInvariantUuid>
+ <modelVersion>1.0</modelVersion>
+ <modelCustomizationUuid/>
+ </serviceModelInfo>
+ <sdncVersion>1702</sdncVersion>
+</network-inputs>"""
+
+ String networkvIPROutputs =
+"""<network-outputs>
+ <network-id>networkId</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ </network-outputs>"""
+
+// ---- End vPIR Zone ----
+
+ String vnfRequestFakeRegion =
+ """<vnfreq:network-request xmlns:vnfreq="http://org.openecomp/mso/infra/vnf-request/v1">
+ <vnfreq:request-info>
+ <vnfreq:request-id>1ef47428-cade-45bd-a103-0751e8b2deb0</vnfreq:request-id>
+ <vnfreq:action>CREATE</vnfreq:action>
+ <vnfreq:source>PORTAL</vnfreq:source>
+ </vnfreq:request-info>
+ <vnfreq:network-inputs>
+ <vnfreq:network-name>MNS-25180-L-01-dmz_direct_net_1</vnfreq:network-name>
+ <vnfreq:network-type>CONTRAIL_EXTERNAL</vnfreq:network-type>
+ <subscriptionServiceType>MSO-dev-service-type</subscriptionServiceType>
+ <vnfreq:service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</vnfreq:service-id>
+ <vnfreq:aic-cloud-region>MDTWNJ21</vnfreq:aic-cloud-region>
+ <vnfreq:tenant-id>7dd5365547234ee8937416c65507d266</vnfreq:tenant-id>
+ </vnfreq:network-inputs>
+ <vnfreq:network-params>
+ <param name="shared">1</param>
+ <param name="external">0</param>
+ </vnfreq:network-params>
+</vnfreq:network-request>"""
+
+ // expectedNetworkRequest
+ String expectedNetworkRequest_Outputs =
+ """<vnfreq:network-request xmlns:vnfreq="http://org.openecomp/mso/infra/vnf-request/v1">
+ <vnfreq:request-info>
+ <vnfreq:request-id>1ef47428-cade-45bd-a103-0751e8b2deb0</vnfreq:request-id>
+ <vnfreq:action>CREATE</vnfreq:action>
+ <vnfreq:source>PORTAL</vnfreq:source>
+ </vnfreq:request-info>
+ <vnfreq:network-inputs>
+ <vnfreq:network-name>MNS-25180-L-01-dmz_direct_net_1</vnfreq:network-name>
+ <vnfreq:network-type>CONTRAIL_EXTERNAL</vnfreq:network-type>
+ <subscriptionServiceType>MSO-dev-service-type</subscriptionServiceType>
+ <vnfreq:service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</vnfreq:service-id>
+ <vnfreq:aic-cloud-region>RDM2WAGPLCP</vnfreq:aic-cloud-region>
+ <vnfreq:tenant-id>7dd5365547234ee8937416c65507d266</vnfreq:tenant-id>
+ </vnfreq:network-inputs>
+ <vnfreq:network-outputs>
+ <vnfreq:network-name>MNS-25180-L-01-dmz_direct_net_1</vnfreq:network-name>
+ <vnfreq:network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</vnfreq:network-id>
+ </vnfreq:network-outputs>
+ <vnfreq:network-params>
+ <param name="shared">1</param>
+ <param name="external">0</param>
+ </vnfreq:network-params>
+</vnfreq:network-request>"""
+
+
+ // expectedNetworkRequest
+ String networkInputs_404 =
+ """<network-inputs xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
+ <network-name>myOwn_Network</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
+ </network-inputs>"""
+
+ String networkInputs =
+ """<network-inputs xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
+ <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
+</network-inputs>"""
+
+
+
+ String queryAAIResponse =
+ """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ statusCode="200">
+ <rest:headers>
+ <rest:header name="Transfer-Encoding" value="chunked"/>
+ <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
+ <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
+ <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
+ <rest:header name="Content-Type" value="application/xml"/>
+ <rest:header name="Server" value="Apache-Coyote/1.1"/>
+ <rest:header name="Cache-Control" value="private"/>
+ </rest:headers>
+ <rest:payload contentType="text/xml">
+ <l3-network xmlns="http://org.openecomp.aai.inventory/v3">
+ <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
+ <network-name>HSL_direct_net_2</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-role>dmz_direct</network-role>
+ <network-technology>contrail</network-technology>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <network-role-instance>0</network-role-instance>
+ <orchestration-status>pending-create</orchestration-status>
+ <subnets>
+ <subnet>
+ <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
+ <gateway-address>107.239.52.1</gateway-address>
+ <network-start-address>107.239.52.0</network-start-address>
+ <cidr-mask>24</cidr-mask>
+ <ip-version>4</ip-version>
+ <orchestration-status>pending-create</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <relationship-list/>
+ </subnet>
+ </subnets>
+ <relationship-list>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>tenant</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
+ <relationship-data>
+ <relationship-key>tenant.tenant-id</relationship-key>
+ <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
+ </relationship-data>
+ </relationship>
+ </relationship-list>
+ </l3-network>
+ </rest:payload>
+</rest:RESTResponse>"""
+
+ String queryIdAIIResponse =
+ """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ statusCode="200">
+ <rest:headers>
+ <rest:header name="Transfer-Encoding" value="chunked"/>
+ <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
+ <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
+ <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
+ <rest:header name="Content-Type" value="application/xml"/>
+ <rest:header name="Server" value="Apache-Coyote/1.1"/>
+ <rest:header name="Cache-Control" value="private"/>
+ </rest:headers>
+ <rest:payload contentType="text/xml">
+ <l3-network xmlns="http://org.openecomp.aai.inventory/v6">
+ <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-role>dmz_direct</network-role>
+ <network-technology>Contrail</network-technology>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <network-role-instance>0</network-role-instance>
+ <resource-version>l3-version</resource-version>
+ <orchestration-status>pending-create</orchestration-status>
+ <physical-network-name>networkName</physical-network-name>
+ <is-provider-network>false</is-provider-network>
+ <is-shared-network>true</is-shared-network>
+ <is-external-network>false</is-external-network>
+ <subnets>
+ <subnet>
+ <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
+ <gateway-address>107.239.52.1</gateway-address>
+ <network-start-address>107.239.52.0</network-start-address>
+ <cidr-mask>24</cidr-mask>
+ <ip-version>4</ip-version>
+ <orchestration-status>pending-create</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <subnet-name>subnetName</subnet-name>
+ <relationship-list/>
+ </subnet>
+ <subnet>
+ <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
+ <gateway-address>107.239.52.1</gateway-address>
+ <network-start-address>107.239.52.0</network-start-address>
+ <cidr-mask>24</cidr-mask>
+ <ip-version>4</ip-version>
+ <orchestration-status>pending-create</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <subnet-name>subnetName</subnet-name>
+ <relationship-list/>
+ </subnet>
+ </subnets>
+ <segmentation-assignments>
+ <segmentation-id>414</segmentation-id>
+ <resource-version>4132176</resource-version>
+ </segmentation-assignments>
+ <segmentation-assignments>
+ <segmentation-id>415</segmentation-id>
+ <resource-version>4132176</resource-version>
+ </segmentation-assignments>
+ <ctag-assignments>
+ <ctag-assignment>
+ <vlan-id-inner>inner</vlan-id-inner>
+ <resource-version>ctag-version</resource-version>
+ <relationship-list>
+ <relationship>
+ <related-to>tenant</related-to>
+ <related-link>https://aai-ext1.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/897deadc2b954a6bac6d3c197fb3525e/</related-link>
+ <relationship-data>
+ <relationship-key>tenant.tenant-id</relationship-key>
+ <relationship-value>897deadc2b954a6bac6d3c197fb3525e</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>tenant.tenant-name</property-key>
+ <property-value>MSOTest1</property-value>
+ </related-to-property>
+ </relationship>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/a290b841-f672-44dd-b9cd-6f8c20d7d8c8/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>a290b841-f672-44dd-b9cd-6f8c20d7d8c8</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>vpn-binding.vpn-name</property-key>
+ <property-value>oam_protected_net_6_MTN5_msotest2</property-value>
+ </related-to-property>
+ </relationship>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/24a4b507-853a-4a38-99aa-05fcc54be24d/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>24a4b507-853a-4a38-99aa-05fcc54be24d</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>vpn-binding.vpn-name</property-key>
+ <property-value>oam_protected_net_6_MTN5_msotest1</property-value>
+ </related-to-property>
+ </relationship>
+ </relationship-list>
+ </ctag-assignment>
+ </ctag-assignments>
+ <relationship-list>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>tenant</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
+ <relationship-data>
+ <relationship-key>tenant.tenant-id</relationship-key>
+ <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>network-policy</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg</related-link>
+ <relationship-data>
+ <relationship-key>network-policy.network-policy-id</relationship-key>
+ <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0cg</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>route-table-reference</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN1</related-link>
+ <relationship-data>
+ <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
+ <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>route-table-reference</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN2</related-link>
+ <relationship-data>
+ <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
+ <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
+ </relationship-data>
+ </relationship>
+ </relationship-list>
+ </l3-network>
+ </rest:payload>
+</rest:RESTResponse>"""
+
+String queryIdAIIResponse_segmentation =
+"""<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ statusCode="200">
+ <rest:headers>
+ <rest:header name="Transfer-Encoding" value="chunked"/>
+ <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
+ <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
+ <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
+ <rest:header name="Content-Type" value="application/xml"/>
+ <rest:header name="Server" value="Apache-Coyote/1.1"/>
+ <rest:header name="Cache-Control" value="private"/>
+ </rest:headers>
+ <rest:payload contentType="text/xml">
+ <l3-network xmlns="http://org.openecomp.aai.inventory/v6">
+ <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-role>dmz_direct</network-role>
+ <network-technology>Contrail</network-technology>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <network-role-instance>0</network-role-instance>
+ <resource-version>l3-version</resource-version>
+ <orchestration-status>pending-create</orchestration-status>
+ <physical-network-name>networkName</physical-network-name>
+ <is-provider-network>false</is-provider-network>
+ <is-shared-network>true</is-shared-network>
+ <is-external-network>false</is-external-network>
+ <subnets>
+ <subnet>
+ <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
+ <gateway-address>107.239.52.1</gateway-address>
+ <network-start-address>107.239.52.0</network-start-address>
+ <cidr-mask>24</cidr-mask>
+ <ip-version>4</ip-version>
+ <orchestration-status>pending-create</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <subnet-name>subnetName</subnet-name>
+ <relationship-list/>
+ </subnet>
+ <subnet>
+ <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
+ <gateway-address>107.239.52.1</gateway-address>
+ <network-start-address>107.239.52.0</network-start-address>
+ <cidr-mask>24</cidr-mask>
+ <ip-version>4</ip-version>
+ <orchestration-status>pending-create</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <subnet-name>subnetName</subnet-name>
+ <relationship-list/>
+ </subnet>
+ </subnets>
+ <segmentation-assignments>
+ <segmentation-assignment>
+ <segmentation-id>1</segmentation-id>
+ <resource-version>1498507569188</resource-version>
+ </segmentation-assignment>
+ </segmentation-assignments>
+ <ctag-assignments>
+ <ctag-assignment>
+ <vlan-id-inner>inner</vlan-id-inner>
+ <resource-version>ctag-version</resource-version>
+ <relationship-list>
+ <relationship>
+ <related-to>tenant</related-to>
+ <related-link>https://aai-ext1.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/897deadc2b954a6bac6d3c197fb3525e/</related-link>
+ <relationship-data>
+ <relationship-key>tenant.tenant-id</relationship-key>
+ <relationship-value>897deadc2b954a6bac6d3c197fb3525e</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>tenant.tenant-name</property-key>
+ <property-value>MSOTest1</property-value>
+ </related-to-property>
+ </relationship>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/a290b841-f672-44dd-b9cd-6f8c20d7d8c8/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>a290b841-f672-44dd-b9cd-6f8c20d7d8c8</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>vpn-binding.vpn-name</property-key>
+ <property-value>oam_protected_net_6_MTN5_msotest2</property-value>
+ </related-to-property>
+ </relationship>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/24a4b507-853a-4a38-99aa-05fcc54be24d/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>24a4b507-853a-4a38-99aa-05fcc54be24d</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>vpn-binding.vpn-name</property-key>
+ <property-value>oam_protected_net_6_MTN5_msotest1</property-value>
+ </related-to-property>
+ </relationship>
+ </relationship-list>
+ </ctag-assignment>
+ </ctag-assignments>
+ <relationship-list>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>tenant</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
+ <relationship-data>
+ <relationship-key>tenant.tenant-id</relationship-key>
+ <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>network-policy</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg</related-link>
+ <relationship-data>
+ <relationship-key>network-policy.network-policy-id</relationship-key>
+ <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0cg</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>route-table-reference</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN1</related-link>
+ <relationship-data>
+ <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
+ <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>route-table-reference</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN2</related-link>
+ <relationship-data>
+ <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
+ <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
+ </relationship-data>
+ </relationship>
+ </relationship-list>
+ </l3-network>
+ </rest:payload>
+</rest:RESTResponse>"""
+
+String queryIdAIIResponse_Ipv4 =
+"""<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ statusCode="200">
+ <rest:headers>
+ <rest:header name="Transfer-Encoding" value="chunked"/>
+ <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
+ <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
+ <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
+ <rest:header name="Content-Type" value="application/xml"/>
+ <rest:header name="Server" value="Apache-Coyote/1.1"/>
+ <rest:header name="Cache-Control" value="private"/>
+ </rest:headers>
+ <rest:payload contentType="text/xml">
+ <l3-network xmlns="http://org.openecomp.aai.inventory/v6">
+ <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-role>dmz_direct</network-role>
+ <network-technology>Contrail</network-technology>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <network-role-instance>0</network-role-instance>
+ <resource-version>l3-version</resource-version>
+ <orchestration-status>pending-create</orchestration-status>
+ <physical-network-name>networkName</physical-network-name>
+ <is-provider-network>false</is-provider-network>
+ <is-shared-network>true</is-shared-network>
+ <is-external-network>false</is-external-network>
+ <subnets>
+ <subnet>
+ <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
+ <gateway-address>107.239.52.1</gateway-address>
+ <network-start-address>107.239.52.0</network-start-address>
+ <cidr-mask>24</cidr-mask>
+ <ip-version>ipv4</ip-version>
+ <orchestration-status>pending-create</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <subnet-name>subnetName</subnet-name>
+ <relationship-list/>
+ </subnet>
+ <subnet>
+ <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
+ <gateway-address>107.239.52.1</gateway-address>
+ <network-start-address>107.239.52.0</network-start-address>
+ <cidr-mask>24</cidr-mask>
+ <ip-version>ipv4</ip-version>
+ <orchestration-status>pending-create</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <subnet-name>subnetName</subnet-name>
+ <relationship-list/>
+ </subnet>
+ </subnets>
+ <segmentation-assignments>
+ <segmentation-id>414</segmentation-id>
+ <resource-version>4132176</resource-version>
+ </segmentation-assignments>
+ <segmentation-assignments>
+ <segmentation-id>415</segmentation-id>
+ <resource-version>4132176</resource-version>
+ </segmentation-assignments>
+ <ctag-assignments>
+ <ctag-assignment>
+ <vlan-id-inner>inner</vlan-id-inner>
+ <resource-version>ctag-version</resource-version>
+ <relationship-list>
+ <relationship>
+ <related-to>tenant</related-to>
+ <related-link>https://aai-ext1.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/897deadc2b954a6bac6d3c197fb3525e/</related-link>
+ <relationship-data>
+ <relationship-key>tenant.tenant-id</relationship-key>
+ <relationship-value>897deadc2b954a6bac6d3c197fb3525e</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>tenant.tenant-name</property-key>
+ <property-value>MSOTest1</property-value>
+ </related-to-property>
+ </relationship>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/a290b841-f672-44dd-b9cd-6f8c20d7d8c8/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>a290b841-f672-44dd-b9cd-6f8c20d7d8c8</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>vpn-binding.vpn-name</property-key>
+ <property-value>oam_protected_net_6_MTN5_msotest2</property-value>
+ </related-to-property>
+ </relationship>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/24a4b507-853a-4a38-99aa-05fcc54be24d/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>24a4b507-853a-4a38-99aa-05fcc54be24d</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>vpn-binding.vpn-name</property-key>
+ <property-value>oam_protected_net_6_MTN5_msotest1</property-value>
+ </related-to-property>
+ </relationship>
+ </relationship-list>
+ </ctag-assignment>
+ </ctag-assignments>
+ <relationship-list>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>tenant</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
+ <relationship-data>
+ <relationship-key>tenant.tenant-id</relationship-key>
+ <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>network-policy</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg</related-link>
+ <relationship-data>
+ <relationship-key>network-policy.network-policy-id</relationship-key>
+ <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0cg</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>route-table-reference</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN1</related-link>
+ <relationship-data>
+ <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
+ <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>route-table-reference</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN2</related-link>
+ <relationship-data>
+ <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
+ <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
+ </relationship-data>
+ </relationship>
+ </relationship-list>
+ </l3-network>
+ </rest:payload>
+</rest:RESTResponse>"""
+
+String queryIdAIIResponse_SRIOV =
+"""<?xml version="1.0" encoding="UTF-8"?>
+<l3-network xmlns="http://org.openecomp.aai.inventory/v8">
+ <network-id>6cb1ae5a-d2db-4eb6-97bf-d52a506a53d8</network-id>
+ <network-name>MSO_TEST_1702_A_HnportalProviderNetwork.HNPortalPROVIDERNETWORK.SR_IOV_Provider2_1_net_17</network-name>
+ <network-type>SR_IOV_Provider2_1</network-type>
+ <network-role>HnportalProviderNetwork.HNPortalPROVIDERNETWORK.SR_IOV_Provider2_1</network-role>
+ <network-technology>AIC_SR_IOV</network-technology>
+ <is-bound-to-vpn>false</is-bound-to-vpn>
+ <service-id/>
+ <resource-version>1487336177672</resource-version>
+ <orchestration-status>PendingCreate</orchestration-status>
+ <persona-model-id>f70d7a32-0ac8-4bd5-a0fb-3c9336540d78</persona-model-id>
+ <persona-model-version>1.0</persona-model-version>
+ <physical-network-name>Physnet21</physical-network-name>
+ <is-provider-network>true</is-provider-network>
+ <is-shared-network>false</is-shared-network>
+ <is-external-network>false</is-external-network>
+ <subnets>
+ <subnet>
+ <subnet-id>10437</subnet-id>
+ <subnet-name>MSO_TEST_1702_A_HnportalProviderNetwork.HNPortalPROVIDERNETWORK.SR_IOV_Provider2_1_net_17_S0</subnet-name>
+ <gateway-address>192.168.6.1</gateway-address>
+ <network-start-address>192.168.6.0</network-start-address>
+ <cidr-mask>26</cidr-mask>
+ <ip-version>4</ip-version>
+ <orchestration-status>PendingCreate</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <dhcp-start>192.168.6.3</dhcp-start>
+ <dhcp-end>192.168.6.62</dhcp-end>
+ <resource-version>1487336177359</resource-version>
+ </subnet>
+ </subnets>
+ <relationship-list>
+ <relationship>
+ <related-to>tenant</related-to>
+ <related-link>https://aai-ext1.test.com:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mtn16/tenants/tenant/6accefef3cb442ff9e644d589fb04107</related-link>
+ <relationship-data>
+ <relationship-key>cloud-region.cloud-owner</relationship-key>
+ <relationship-value>att-aic</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>cloud-region.cloud-region-id</relationship-key>
+ <relationship-value>mtn16</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>tenant.tenant-id</relationship-key>
+ <relationship-value>6accefef3cb442ff9e644d589fb04107</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>tenant.tenant-name</property-key>
+ <property-value>MSO_TEST_1702_A</property-value>
+ </related-to-property>
+ </relationship>
+ <relationship>
+ <related-to>cloud-region</related-to>
+ <related-link>https://aai-ext1.test.com:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mtn16</related-link>
+ <relationship-data>
+ <relationship-key>cloud-region.cloud-owner</relationship-key>
+ <relationship-value>att-aic</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>cloud-region.cloud-region-id</relationship-key>
+ <relationship-value>mtn16</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>cloud-region.owner-defined-type</property-key>
+ <property-value>lcp</property-value>
+ </related-to-property>
+ </relationship>
+ <relationship>
+ <related-to>service-instance</related-to>
+ <related-link>https://aai-ext1.test.com:8443/aai/v8/business/customers/customer/MSO_1610_ST/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/51d8336b-a993-4afe-a5fc-10b3afbd6560</related-link>
+ <relationship-data>
+ <relationship-key>customer.global-customer-id</relationship-key>
+ <relationship-value>MSO_1610_ST</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>service-subscription.service-type</relationship-key>
+ <relationship-value>MSO-dev-service-type</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>service-instance.service-instance-id</relationship-key>
+ <relationship-value>51d8336b-a993-4afe-a5fc-10b3afbd6560</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>service-instance.service-instance-name</property-key>
+ <property-value>HnportalProviderNetwork_17</property-value>
+ </related-to-property>
+ </relationship>
+ </relationship-list>
+</l3-network>"""
+
+ String queryIdAIIResponseTestScenario01 =
+ """<?xml version="1.0" encoding="UTF-8"?>
+<l3-network xmlns="http://org.openecomp.aai.inventory/v7">
+ <network-id>4da55fe4-7a9e-478c-a434-8a98d62265ab</network-id>
+ <network-name>GN_EVPN_direct_net_0_ST1</network-name>
+ <network-type>CONTRAIL30_BASIC</network-type>
+ <network-role>GN_EVPN_direct</network-role>
+ <network-technology>contrail</network-technology>
+ <is-bound-to-vpn>false</is-bound-to-vpn>
+ <service-id>9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <network-role-instance>0</network-role-instance>
+ <resource-version>1465398611</resource-version>
+ <orchestration-status>pending-create</orchestration-status>
+ <physical-network-name>networkName</physical-network-name>
+ <is-provider-network>false</is-provider-network>
+ <is-shared-network>true</is-shared-network>
+ <is-external-network>false</is-external-network>
+ <subnets>
+ <subnet>
+ <subnet-id>cb1a7b47-5428-44c9-89c2-8b17541c3228</subnet-id>
+ <gateway-address>108.239.40.1</gateway-address>
+ <network-start-address>108.239.40.0</network-start-address>
+ <cidr-mask>28</cidr-mask>
+ <ip-version>4</ip-version>
+ <orchestration-status>pending-create</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <dhcp-start>108.239.40.0</dhcp-start>
+ <dhcp-end>108.239.40.0</dhcp-end>
+ <resource-version>1465398611</resource-version>
+ <subnet-name>subnetName</subnet-name>
+ <relationship-list />
+ </subnet>
+ <subnet>
+ <subnet-id>e2cc7c14-90f0-4205-840d-b4e07f04e621</subnet-id>
+ <gateway-address>2606:ae00:2e01:604::1</gateway-address>
+ <network-start-address>2606:ae00:2e01:604::</network-start-address>
+ <cidr-mask>64</cidr-mask>
+ <ip-version>6</ip-version>
+ <orchestration-status>pending-create</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <dhcp-start>2606:ae00:2e01:604::</dhcp-start>
+ <dhcp-end>2606:ae00:2e01:604::</dhcp-end>
+ <resource-version>1465398611</resource-version>
+ <subnet-name>subnetName</subnet-name>
+ <relationship-list />
+ </subnet>
+ </subnets>
+ <ctag-assignments />
+ <segmentation-assignments>
+ <segmentation-id>416</segmentation-id>
+ <resource-version>4132176</resource-version>
+ </segmentation-assignments>
+ <relationship-list>
+ <relationship>
+ <related-to>cloud-region</related-to>
+ <related-link>https://mtanjv9aaas03.aic.cip.com:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/
+ </related-link>
+ <relationship-data>
+ <relationship-key>cloud-region.cloud-region-id</relationship-key>
+ <relationship-value>AAIAIC25</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>cloud-region.cloud-owner</relationship-key>
+ <relationship-value>att-aic</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>cloud-region.owner-defined-type</property-key>
+ <property-value></property-value>
+ </related-to-property>
+ </relationship>
+ <relationship>
+ <related-to>tenant</related-to>
+ <related-link>https://mtanjv9aaas03.aic.cip.com:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/tenants/tenant/4ae1d3446a4c48b2bec44b6cfba06d68/</related-link>
+ <relationship-data>
+ <relationship-key>tenant.tenant-id</relationship-key>
+ <relationship-value>4ae1d3446a4c48b2bec44b6cfba06d68
+ </relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>cloud-region.cloud-owner</relationship-key>
+ <relationship-value>att-aic</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>cloud-region.cloud-region-id</relationship-key>
+ <relationship-value>AAIAIC25</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>tenant.tenant-name</property-key>
+ <property-value>Ruchira Contrail 3.0 test</property-value>
+ </related-to-property>
+ </relationship>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://mtanjv9aaas03.aic.cip.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>9a7b327d9-287aa00-82c4b0-100001</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>vpn-binding.vpn-name</property-key>
+ <property-value>GN_EVPN_direct_net_0_ST1</property-value>
+ </related-to-property>
+ </relationship>
+ <relationship>
+ <related-to>route-table-reference</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN1</related-link>
+ <relationship-data>
+ <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
+ <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>route-table-reference</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN2</related-link>
+ <relationship-data>
+ <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
+ <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
+ </relationship-data>
+ </relationship>
+ </relationship-list>
+</l3-network>"""
+
+ String queryIdAIIResponseVpnNotPresent =
+ """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ statusCode="200">
+ <rest:headers>
+ <rest:header name="Transfer-Encoding" value="chunked"/>
+ <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
+ <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
+ <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
+ <rest:header name="Content-Type" value="application/xml"/>
+ <rest:header name="Server" value="Apache-Coyote/1.1"/>
+ <rest:header name="Cache-Control" value="private"/>
+ </rest:headers>
+ <rest:payload contentType="text/xml">
+ <l3-network xmlns="http://org.openecomp.aai.inventory/v8">
+ <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-role>dmz_direct</network-role>
+ <network-technology>contrail</network-technology>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <network-role-instance>0</network-role-instance>
+ <orchestration-status>pending-create</orchestration-status>
+ <physical-network-name>networkName</physical-network-name>
+ <is-provider-network>false</is-provider-network>
+ <is-shared-network>true</is-shared-network>
+ <is-external-network>false</is-external-network>
+ <subnets>
+ <subnet>
+ <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
+ <gateway-address>107.239.52.1</gateway-address>
+ <network-start-address>107.239.52.0</network-start-address>
+ <cidr-mask>24</cidr-mask>
+ <ip-version>4</ip-version>
+ <orchestration-status>pending-create</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <subnet-name>subnetName</subnet-name>
+ <relationship-list/>
+ </subnet>
+ </subnets>
+ <relationship-list/>
+ </l3-network>
+ </rest:payload>
+</rest:RESTResponse>"""
+
+ String queryNameAIIResponse =
+ """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ statusCode="200">
+ <rest:headers>
+ <rest:header name="Transfer-Encoding" value="chunked"/>
+ <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
+ <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
+ <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
+ <rest:header name="Content-Type" value="application/xml"/>
+ <rest:header name="Server" value="Apache-Coyote/1.1"/>
+ <rest:header name="Cache-Control" value="private"/>
+ </rest:headers>
+ <rest:payload contentType="text/xml">
+ <l3-network xmlns="http://org.openecomp.aai.inventory/v6">
+ <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-role>dmz_direct</network-role>
+ <network-technology>contrail</network-technology>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <network-role-instance>0</network-role-instance>
+ <orchestration-status>pending-create</orchestration-status>
+ <subnets>
+ <subnet>
+ <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
+ <gateway-address>107.239.52.1</gateway-address>
+ <network-start-address>107.239.52.0</network-start-address>
+ <cidr-mask>24</cidr-mask>
+ <ip-version>4</ip-version>
+ <orchestration-status>pending-create</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <relationship-list/>
+ </subnet>
+ </subnets>
+ <relationship-list>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>tenant</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
+ <relationship-data>
+ <relationship-key>tenant.tenant-id</relationship-key>
+ <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
+ </relationship-data>
+ </relationship>
+ </relationship-list>
+ </l3-network>
+ </rest:payload>
+ </rest:RESTResponse>"""
+
+ String queryNameAIIResponseVpnNotPresent =
+ """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ statusCode="200">
+ <rest:headers>
+ <rest:header name="Transfer-Encoding" value="chunked"/>
+ <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
+ <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
+ <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
+ <rest:header name="Content-Type" value="application/xml"/>
+ <rest:header name="Server" value="Apache-Coyote/1.1"/>
+ <rest:header name="Cache-Control" value="private"/>
+ </rest:headers>
+ <rest:payload contentType="text/xml">
+ <l3-network xmlns="http://org.openecomp.aai.inventory/v6>
+ <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-role>dmz_direct</network-role>
+ <network-technology>contrail</network-technology>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <network-role-instance>0</network-role-instance>
+ <orchestration-status>pending-create</orchestration-status>
+ <subnets>
+ <subnet>
+ <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
+ <gateway-address>107.239.52.1</gateway-address>
+ <network-start-address>107.239.52.0</network-start-address>
+ <cidr-mask>24</cidr-mask>
+ <ip-version>4</ip-version>
+ <orchestration-status>pending-create</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <relationship-list/>
+ </subnet>
+ </subnets>
+ </l3-network>
+ </rest:payload>
+ </rest:RESTResponse>"""
+
+ String aaiVpnResponseStub =
+ """<rest:payload xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ xmlns="http://org.openecomp.aai.inventory/v8"
+ contentType="text/xml">
+ <vpn-binding>
+ <global-route-target/>
+ </vpn-binding>
+</rest:payload>"""
+
+ String queryVpnBindingAAIResponse =
+ """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ statusCode="200">
+ <rest:headers>
+ <rest:header name="Transfer-Encoding" value="chunked"/>
+ <rest:header name="Date" value="Mon,14 Mar 2016 20:53:33 GMT"/>
+ <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
+ <rest:header name="X-AAI-TXID"
+ value="mtcnjv9aaas01.mtcnj.aic.cip.com-20160314-20:53:33:487-134392"/>
+ <rest:header name="Content-Type" value="application/xml"/>
+ <rest:header name="Server" value="Apache-Coyote/1.1"/>
+ <rest:header name="Cache-Control" value="private"/>
+ </rest:headers>
+ <rest:payload contentType="text/xml">
+ <vpn-binding xmlns="http://org.openecomp.aai.inventory/v6">
+ <vpn-id>9a7b327d9-287aa00-82c4b0-105757</vpn-id>
+ <vpn-name>GN_EVPN_Test</vpn-name>
+ <global-route-target>13979:105757</global-route-target>
+ <relationship-list>
+ <relationship>
+ <related-to>l3-network</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/689ec39e-c5fc-4462-8db2-4f760763ad28/</related-link>
+ <relationship-data>
+ <relationship-key>l3-network.network-id</relationship-key>
+ <relationship-value>689ec39e-c5fc-4462-8db2-4f760763ad28</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>l3-network</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/1a49396b-19b3-40a4-8792-aa2fbd0f0704/</related-link>
+ <relationship-data>
+ <relationship-key>l3-network.network-id</relationship-key>
+ <relationship-value>1a49396b-19b3-40a4-8792-aa2fbd0f0704</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>l3-network</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/774f3329-3c83-4771-86c7-9e6207cd50fd/</related-link>
+ <relationship-data>
+ <relationship-key>l3-network.network-id</relationship-key>
+ <relationship-value>774f3329-3c83-4771-86c7-9e6207cd50fd</relationship-value>
+ </relationship-data>
+ </relationship>
+ </relationship-list>
+ </vpn-binding>
+ </rest:payload>
+</rest:RESTResponse>"""
+
+ String createDBRequestError01 =
+ """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <ns:updateInfraRequest xmlns:ns="http://org.openecomp.mso/requestsdb">
+ <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
+ <lastModifiedBy>BPMN</lastModifiedBy>
+ <statusMessage>Received error unexpectedly from SDN-C.</statusMessage>
+ <responseBody></responseBody>
+ <requestStatus>FAILED</requestStatus>
+ <vnfOutputs>&lt;network-id&gt;&lt;/network-id&gt;&lt;network-name&gt;&lt;/network-names&gt;</vnfOutputs>
+ </ns:updateInfraRequest>
+ </soapenv:Body>
+ </soapenv:Envelope>"""
+
+ String createDBRequest_Outputs =
+ """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:ns="http://org.openecomp.mso/requestsdb">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <ns:updateInfraRequest>
+ <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
+ <lastModifiedBy>BPMN</lastModifiedBy>
+ <statusMessage>Network successfully created.</statusMessage>
+ <responseBody/>
+ <requestStatus>COMPLETED</requestStatus>
+ <progress>100</progress>
+ <vnfOutputs>&lt;network-id&gt;networkId&lt;/network-id&gt;&lt;network-name&gt;MNS-25180-L-01-dmz_direct_net_1&lt;/network-names&gt;</vnfOutputs>
+ <networkId>networkId</networkId>
+ </ns:updateInfraRequest>
+ </soapenv:Body>
+</soapenv:Envelope>"""
+
+ String createNetworkRequest =
+ """<createNetworkRequest>
+ <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
+ <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
+ <networkId>49c86598-f766-46f8-84f8-8d1c1b10f9b4</networkId>
+ <networkName>MNS-25180-L-01-dmz_direct_net_1</networkName>
+ <networkType>CONTRAIL_EXTERNAL</networkType>
+ <modelCustomizationUuid>sn5256d1-5a33-55df-13ab-12abad84e222</modelCustomizationUuid>
+ <networkTechnology>CONTRAIL</networkTechnology>
+ <providerVlanNetwork>
+ <physicalNetworkName>networkName</physicalNetworkName>
+ <vlans>414,415</vlans>
+ </providerVlanNetwork>
+ <contrailNetwork>
+ <shared>true</shared>
+ <external>false</external>
+ <routeTargets>13979:105757</routeTargets>
+ <routeTargets>13979:105757</routeTargets>
+ <policyFqdns>GN_EVPN_Test</policyFqdns>
+ <routeTableFqdns>refFQDN1</routeTableFqdns>
+ <routeTableFqdns>refFQDN2</routeTableFqdns>
+ </contrailNetwork>
+ <subnets>
+ <allocationPools>
+ <start/>
+ <end/>
+ </allocationPools>
+ <cidr>107.239.52.0/24</cidr>
+ <enableDHCP>true</enableDHCP>
+ <gatewayIp>107.239.52.1</gatewayIp>
+ <ipVersion>4</ipVersion>
+ <subnetId>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnetId>
+ <subnetName>subnetName</subnetName>
+ </subnets>
+ <subnets>
+ <allocationPools>
+ <start/>
+ <end/>
+ </allocationPools>
+ <cidr>107.239.52.0/24</cidr>
+ <enableDHCP>true</enableDHCP>
+ <gatewayIp>107.239.52.1</gatewayIp>
+ <ipVersion>4</ipVersion>
+ <subnetId>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnetId>
+ <subnetName>subnetName</subnetName>
+ </subnets>
+ <skipAAI>true</skipAAI>
+ <backout>true</backout>
+ <failIfExists>false</failIfExists>
+ <msoRequest>
+ <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
+ <serviceInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</serviceInstanceId>
+ </msoRequest>
+ <messageId>messageId_generated</messageId>
+ <notificationUrl/>
+</createNetworkRequest>"""
+
+String createNetworkRequestAlaCarte =
+"""<createNetworkRequest>
+ <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
+ <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
+ <networkId>49c86598-f766-46f8-84f8-8d1c1b10f9b4</networkId>
+ <networkName>MNS-25180-L-01-dmz_direct_net_1</networkName>
+ <networkType>CONTRAIL_EXTERNAL</networkType>
+ <modelCustomizationUuid>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationUuid>
+ <networkTechnology>CONTRAIL</networkTechnology>
+ <providerVlanNetwork>
+ <physicalNetworkName>networkName</physicalNetworkName>
+ <vlans>414,415</vlans>
+ </providerVlanNetwork>
+ <contrailNetwork>
+ <shared>true</shared>
+ <external>false</external>
+ <routeTargets>13979:105757</routeTargets>
+ <routeTargets>13979:105757</routeTargets>
+ <policyFqdns>GN_EVPN_Test</policyFqdns>
+ <routeTableFqdns>refFQDN1</routeTableFqdns>
+ <routeTableFqdns>refFQDN2</routeTableFqdns>
+ </contrailNetwork>
+ <subnets>
+ <allocationPools>
+ <start/>
+ <end/>
+ </allocationPools>
+ <cidr>107.239.52.0/24</cidr>
+ <enableDHCP>true</enableDHCP>
+ <gatewayIp>107.239.52.1</gatewayIp>
+ <ipVersion>4</ipVersion>
+ <subnetId>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnetId>
+ <subnetName>subnetName</subnetName>
+ </subnets>
+ <subnets>
+ <allocationPools>
+ <start/>
+ <end/>
+ </allocationPools>
+ <cidr>107.239.52.0/24</cidr>
+ <enableDHCP>true</enableDHCP>
+ <gatewayIp>107.239.52.1</gatewayIp>
+ <ipVersion>4</ipVersion>
+ <subnetId>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnetId>
+ <subnetName>subnetName</subnetName>
+ </subnets>
+ <skipAAI>true</skipAAI>
+ <backout>true</backout>
+ <failIfExists>false</failIfExists>
+ <networkParams>
+ <some_user_param1>someValue1</some_user_param1>
+ </networkParams>
+ <msoRequest>
+ <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
+ <serviceInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</serviceInstanceId>
+ </msoRequest>
+ <messageId>messageId_generated</messageId>
+ <notificationUrl/>
+</createNetworkRequest>"""
+
+String createNetworkRequest_SRIOV =
+"""<createNetworkRequest>
+ <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
+ <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
+ <networkId>6cb1ae5a-d2db-4eb6-97bf-d52a506a53d8</networkId>
+ <networkName>MSO_TEST_1702_A_HnportalProviderNetwork.HNPortalPROVIDERNETWORK.SR_IOV_Provider2_1_net_17</networkName>
+ <networkType>CONTRAIL_EXTERNAL</networkType>
+ <modelCustomizationUuid>sn5256d1-5a33-55df-13ab-12abad84e222</modelCustomizationUuid>
+ <networkTechnology>AIC_SR_IOV</networkTechnology>
+ <providerVlanNetwork>
+ <physicalNetworkName>Physnet21</physicalNetworkName>
+ <vlans/>
+ </providerVlanNetwork>
+ <subnets>
+ <allocationPools>
+ <start>192.168.6.3</start>
+ <end>192.168.6.62</end>
+ </allocationPools>
+ <cidr>192.168.6.0/26</cidr>
+ <enableDHCP>true</enableDHCP>
+ <gatewayIp>192.168.6.1</gatewayIp>
+ <ipVersion>4</ipVersion>
+ <subnetId>10437</subnetId>
+ <subnetName>MSO_TEST_1702_A_HnportalProviderNetwork.HNPortalPROVIDERNETWORK.SR_IOV_Provider2_1_net_17_S0</subnetName>
+ </subnets>
+ <skipAAI>true</skipAAI>
+ <backout>true</backout>
+ <failIfExists>false</failIfExists>
+ <msoRequest>
+ <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
+ <serviceInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</serviceInstanceId>
+ </msoRequest>
+ <messageId>messageId_generated</messageId>
+ <notificationUrl/>
+</createNetworkRequest>"""
+
+ String createNetworkRequest_noPhysicalName =
+ """<createNetworkRequest>
+ <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
+ <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
+ <networkId>49c86598-f766-46f8-84f8-8d1c1b10f9b4</networkId>
+ <networkName>MNS-25180-L-01-dmz_direct_net_1</networkName>
+ <networkType>CONTRAIL_EXTERNAL</networkType>
+ <networkTechnology>CONTRAIL</networkTechnology>
+ <providerVlanNetwork>
+ <physicalNetworkName>networkName</physicalNetworkName>
+ <vlans>414,415</vlans>
+ </providerVlanNetwork>
+ <contrailNetwork>
+ <shared>true</shared>
+ <external>false</external>
+ <routeTargets>13979:105757</routeTargets>
+ <routeTargets>13979:105757</routeTargets>
+ <policyFqdns>GN_EVPN_Test</policyFqdns>
+ </contrailNetwork>
+ <subnets>
+ <allocationPools>
+ <start/>
+ <end/>
+ </allocationPools>
+ <cidr>107.239.52.0/24</cidr>
+ <enableDHCP>true</enableDHCP>
+ <gatewayIp>107.239.52.1</gatewayIp>
+ <ipVersion>4</ipVersion>
+ <subnetId>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnetId>
+ <subnetName>subnetName</subnetName>
+ </subnets>
+ <subnets>
+ <allocationPools>
+ <start/>
+ <end/>
+ </allocationPools>
+ <cidr>107.239.52.0/24</cidr>
+ <enableDHCP>true</enableDHCP>
+ <gatewayIp>107.239.52.1</gatewayIp>
+ <ipVersion>4</ipVersion>
+ <subnetId>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnetId>
+ <subnetName>subnetName</subnetName>
+ </subnets>
+ <skipAAI>true</skipAAI>
+ <backout>true</backout>
+ <failIfExists>false</failIfExists>
+ <networkParams>
+ <dhcp-enabled>true</dhcp-enabled>
+ <serviceId>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</serviceId>
+ <cidr-mask>true</cidr-mask>
+ <backoutOnFailure>true</backoutOnFailure>
+ <gateway-address>10.10.125.1</gateway-address>
+ </networkParams>
+ <msoRequest>
+ <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
+ <serviceInstanceId>null</serviceInstanceId>
+ </msoRequest>
+ <messageId>messageId_generated</messageId>
+ <notificationUrl/>
+</createNetworkRequest>"""
+
+ String createNetworkResponseREST =
+ """<ns2:createNetworkResponse xmlns:ns2="http://org.openecomp.mso/network">
+ <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
+ <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
+ <networkFqdn>default-domain:MSOTest:GN_EVPN_direct_net_0_ST1</networkFqdn>
+ <networkStackId></networkStackId>
+ <networkCreated>true</networkCreated>
+ <subnetMap>
+ <entry>
+ <key>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</key>
+ <value>bd8e87c6-f4e2-41b8-b0bc-9596aa00cd73</value>
+ </entry>
+ <entry>
+ <key>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</key>
+ <value>bd8e87c6-f4e2-41b8-b0bc-9596aa00cd73</value>
+ </entry>
+ </subnetMap>
+ <rollback>
+ <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
+ <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
+ <networkStackId></networkStackId>
+ <networkType>CONTRAIL_EXTERNAL</networkType>
+ <networkCreated>true</networkCreated>
+ <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
+ <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
+ <msoRequest>
+ <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId>
+ <serviceInstanceId></serviceInstanceId>
+ </msoRequest>
+ </rollback>
+ <messageId>messageId_generated</messageId>
+</ns2:createNetworkResponse>"""
+
+ String createRollbackNetworkRequest =
+ """<rollbackNetworkRequest>
+ <networkRollback>
+ <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
+ <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
+ <networkStackId/>
+ <networkType>CONTRAIL_EXTERNAL</networkType>
+ <networkCreated>true</networkCreated>
+ <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
+ <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
+ <msoRequest>
+ <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId>
+ <serviceInstanceId/>
+ </msoRequest>
+ </networkRollback>
+</rollbackNetworkRequest>"""
+
+ String createNetworkResponse =
+ """<ns2:createNetworkResponse xmlns:ns2="http://org.openecomp.mso/network"
+ xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
+ <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
+ <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
+ <networkStackId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkStackId>
+ <networkFqdn>default-domain:MSOTest:GN_EVPN_direct_net_0_ST1</networkFqdn>
+ <subnetIdMap>
+ <entry>
+ <key>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</key>
+ <value>bd8e87c6-f4e2-41b8-b0bc-9596aa00cd73</value>
+ </entry>
+ </subnetIdMap>
+ <rollback>
+ <cloudId>RDM2WAGPLCP</cloudId>
+ <msoRequest>
+ <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId>
+ <serviceInstanceId/>
+ </msoRequest>
+ <networkCreated>true</networkCreated>
+ <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
+ <networkType>CONTRAIL_EXTERNAL</networkType>
+ <networkUpdated>false</networkUpdated>
+ <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
+ <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
+ </rollback>
+</ns2:createNetworkResponse>"""
+
+ String updateContrailAAIPayloadRequest =
+ """<l3-network xmlns="http://org.openecomp.aai.inventory/v9">
+ <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-role>dmz_direct</network-role>
+ <network-technology>Contrail</network-technology>
+ <neutron-network-id>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutron-network-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <network-role-instance>0</network-role-instance>
+ <resource-version>l3-version</resource-version>
+ <orchestration-status>Created</orchestration-status>
+ <contrail-network-fqdn>default-domain:MSOTest:GN_EVPN_direct_net_0_ST1</contrail-network-fqdn>
+ <physical-network-name>networkName</physical-network-name>
+ <is-provider-network>false</is-provider-network>
+ <is-shared-network>true</is-shared-network>
+ <is-external-network>false</is-external-network>
+ <subnets>
+ <subnet>
+ <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
+ <neutron-subnet-id>bd8e87c6-f4e2-41b8-b0bc-9596aa00cd73</neutron-subnet-id>
+ <gateway-address>107.239.52.1</gateway-address>
+ <network-start-address>107.239.52.0</network-start-address>
+ <cidr-mask>24</cidr-mask>
+ <ip-version>4</ip-version>
+ <orchestration-status>Created</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <subnet-name>subnetName</subnet-name>
+ </subnet>
+ <subnet>
+ <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
+ <neutron-subnet-id>bd8e87c6-f4e2-41b8-b0bc-9596aa00cd73</neutron-subnet-id>
+ <gateway-address>107.239.52.1</gateway-address>
+ <network-start-address>107.239.52.0</network-start-address>
+ <cidr-mask>24</cidr-mask>
+ <ip-version>4</ip-version>
+ <orchestration-status>Created</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <subnet-name>subnetName</subnet-name>
+ </subnet>
+ </subnets>
+ <segmentation-assignments>
+ <segmentation-id>414</segmentation-id>
+ <resource-version>4132176</resource-version>
+ </segmentation-assignments>
+ <segmentation-assignments>
+ <segmentation-id>415</segmentation-id>
+ <resource-version>4132176</resource-version>
+ </segmentation-assignments>
+ <ctag-assignments>
+ <ctag-assignment>
+ <vlan-id-inner>inner</vlan-id-inner>
+ <resource-version>ctag-version</resource-version>
+ <relationship-list>
+ <relationship>
+ <related-to>tenant</related-to>
+ <related-link>https://aai-ext1.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/897deadc2b954a6bac6d3c197fb3525e/</related-link>
+ <relationship-data>
+ <relationship-key>tenant.tenant-id</relationship-key>
+ <relationship-value>897deadc2b954a6bac6d3c197fb3525e</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>tenant.tenant-name</property-key>
+ <property-value>MSOTest1</property-value>
+ </related-to-property>
+ </relationship>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/a290b841-f672-44dd-b9cd-6f8c20d7d8c8/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>a290b841-f672-44dd-b9cd-6f8c20d7d8c8</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>vpn-binding.vpn-name</property-key>
+ <property-value>oam_protected_net_6_MTN5_msotest2</property-value>
+ </related-to-property>
+ </relationship>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/24a4b507-853a-4a38-99aa-05fcc54be24d/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>24a4b507-853a-4a38-99aa-05fcc54be24d</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>vpn-binding.vpn-name</property-key>
+ <property-value>oam_protected_net_6_MTN5_msotest1</property-value>
+ </related-to-property>
+ </relationship>
+ </relationship-list>
+ </ctag-assignment>
+ </ctag-assignments>
+ <relationship-list>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>tenant</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
+ <relationship-data>
+ <relationship-key>tenant.tenant-id</relationship-key>
+ <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>network-policy</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg</related-link>
+ <relationship-data>
+ <relationship-key>network-policy.network-policy-id</relationship-key>
+ <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0cg</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>route-table-reference</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN1</related-link>
+ <relationship-data>
+ <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
+ <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>route-table-reference</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN2</related-link>
+ <relationship-data>
+ <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
+ <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
+ </relationship-data>
+ </relationship>
+ </relationship-list>
+</l3-network>"""
+
+String updateContrailAAIPayloadRequest_segmentation =
+"""<l3-network xmlns="http://org.openecomp.aai.inventory/v9">
+ <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-role>dmz_direct</network-role>
+ <network-technology>Contrail</network-technology>
+ <neutron-network-id>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutron-network-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <network-role-instance>0</network-role-instance>
+ <resource-version>l3-version</resource-version>
+ <orchestration-status>Created</orchestration-status>
+ <contrail-network-fqdn>default-domain:MSOTest:GN_EVPN_direct_net_0_ST1</contrail-network-fqdn>
+ <physical-network-name>networkName</physical-network-name>
+ <is-provider-network>false</is-provider-network>
+ <is-shared-network>true</is-shared-network>
+ <is-external-network>false</is-external-network>
+ <subnets>
+ <subnet>
+ <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
+ <neutron-subnet-id>bd8e87c6-f4e2-41b8-b0bc-9596aa00cd73</neutron-subnet-id>
+ <gateway-address>107.239.52.1</gateway-address>
+ <network-start-address>107.239.52.0</network-start-address>
+ <cidr-mask>24</cidr-mask>
+ <ip-version>4</ip-version>
+ <orchestration-status>Created</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <subnet-name>subnetName</subnet-name>
+ </subnet>
+ <subnet>
+ <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
+ <neutron-subnet-id>bd8e87c6-f4e2-41b8-b0bc-9596aa00cd73</neutron-subnet-id>
+ <gateway-address>107.239.52.1</gateway-address>
+ <network-start-address>107.239.52.0</network-start-address>
+ <cidr-mask>24</cidr-mask>
+ <ip-version>4</ip-version>
+ <orchestration-status>Created</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <subnet-name>subnetName</subnet-name>
+ </subnet>
+ </subnets>
+ <segmentation-assignments>
+ <segmentation-assignment>
+ <segmentation-id>1</segmentation-id>
+ <resource-version>1498507569188</resource-version>
+ </segmentation-assignment>
+ </segmentation-assignments>
+ <ctag-assignments>
+ <ctag-assignment>
+ <vlan-id-inner>inner</vlan-id-inner>
+ <resource-version>ctag-version</resource-version>
+ <relationship-list>
+ <relationship>
+ <related-to>tenant</related-to>
+ <related-link>https://aai-ext1.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/897deadc2b954a6bac6d3c197fb3525e/</related-link>
+ <relationship-data>
+ <relationship-key>tenant.tenant-id</relationship-key>
+ <relationship-value>897deadc2b954a6bac6d3c197fb3525e</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>tenant.tenant-name</property-key>
+ <property-value>MSOTest1</property-value>
+ </related-to-property>
+ </relationship>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/a290b841-f672-44dd-b9cd-6f8c20d7d8c8/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>a290b841-f672-44dd-b9cd-6f8c20d7d8c8</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>vpn-binding.vpn-name</property-key>
+ <property-value>oam_protected_net_6_MTN5_msotest2</property-value>
+ </related-to-property>
+ </relationship>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/24a4b507-853a-4a38-99aa-05fcc54be24d/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>24a4b507-853a-4a38-99aa-05fcc54be24d</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>vpn-binding.vpn-name</property-key>
+ <property-value>oam_protected_net_6_MTN5_msotest1</property-value>
+ </related-to-property>
+ </relationship>
+ </relationship-list>
+ </ctag-assignment>
+ </ctag-assignments>
+ <relationship-list>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>tenant</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
+ <relationship-data>
+ <relationship-key>tenant.tenant-id</relationship-key>
+ <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>network-policy</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg</related-link>
+ <relationship-data>
+ <relationship-key>network-policy.network-policy-id</relationship-key>
+ <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0cg</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>route-table-reference</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN1</related-link>
+ <relationship-data>
+ <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
+ <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>route-table-reference</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN2</related-link>
+ <relationship-data>
+ <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
+ <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
+ </relationship-data>
+ </relationship>
+ </relationship-list>
+</l3-network>"""
+
+ String updateContrailAAIResponse =
+ """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ statusCode="200">
+ <rest:headers>
+ <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
+ <rest:header name="Content-Length" value="0"/>
+ <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
+ <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:551-132672"/>
+ <rest:header name="Server" value="Apache-Coyote/1.1"/>
+ <rest:header name="Cache-Control" value="private"/>
+ </rest:headers>
+</rest:RESTResponse>"""
+
+ String createNetworkErrorResponse =
+ """<createNetworkError>
+ <messageId>680bd458-5ec1-4a16-b77c-509022e53450</messageId><category>INTERNAL</category>
+ <message>400 Bad Request: The server could not comply with the request since it is either malformed or otherwise incorrect., error.type=StackValidationFailed, error.message=Property error: : resources.network.properties: : Unknown Property network_ipam_refs_data</message>
+ <rolledBack>true</rolledBack>
+ </createNetworkError>"""
+
+
+ String networkException500 =
+ """<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:VersionMismatch</faultcode><faultstring>"http://org.openecomp.mso/network", the namespace on the "createNetworkContrail" element, is not a valid SOAP version.</faultstring></soap:Fault></soap:Body></soap:Envelope>"""
+
+ String aaiResponse =
+ """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ statusCode="200">
+ <rest:headers>
+ <rest:header name="Transfer-Encoding" value="chunked"/>
+ <rest:header name="Date" value="Sat,30 Jan 2016 20:09:24 GMT"/>
+ <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
+ <rest:header name="X-AAI-TXID"
+ value="mtcnjv9aaas01.mtcnj.aic.cip.com-20160130-20:09:24:814-165843"/>
+ <rest:header name="Content-Type" value="application/xml"/>
+ <rest:header name="Server" value="Apache-Coyote/1.1"/>
+ <rest:header name="Cache-Control" value="private"/>
+ </rest:headers>
+ <rest:payload contentType="text/xml">
+ <l3-network xmlns="http://org.openecomp.aai.inventory/v3">
+ <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
+ <network-name>HSL_direct_net_2</network-name>
+ <network-type>CONTRAIL_BASIC</network-type>
+ <network-role>HSL_direct</network-role>
+ <network-technology>contrail</network-technology>
+ <neutron-network-id>8bbd3edf-b835-4610-96a2-a5cafa029042</neutron-network-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <orchestration-status>active</orchestration-status>
+ <heat-stack-id>HSL_direct_net_2/57594a56-1c92-4a38-9caa-641c1fa3d4b6</heat-stack-id>
+ <subnets>
+ <subnet>
+ <subnet-id>ea5f2a2c-604f-47ff-a9c5-253ee4f0ef0a</subnet-id>
+ <neutron-subnet-id>5a77fdc2-7789-4649-a1b9-6eaf1db1813a</neutron-subnet-id>
+ <gateway-address>172.16.34.1</gateway-address>
+ <network-start-address>172.16.34.0</network-start-address>
+ <cidr-mask>28</cidr-mask>
+ <ip-version>4</ip-version>
+ <orchestration-status>active</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <relationship-list/>
+ </subnet>
+ </subnets>
+ <relationship-list>
+ <relationship>
+ <related-to>tenant</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v3/cloud-infrastructure/tenants/tenant/e81d842d3e8b45c5a59f57cd76af3aaf/</related-link>
+ <relationship-data>
+ <relationship-key>tenant.tenant-id</relationship-key>
+ <relationship-value>e81d842d3e8b45c5a59f57cd76af3aaf</relationship-value>
+ </relationship-data>
+ </relationship>
+ </relationship-list>
+ </l3-network>
+ </rest:payload>
+ </rest:RESTResponse>"""
+
+ String assignSDNCRequest =
+ """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:ns5="http://org.openecomp/mso/request/types/v1"
+ xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>assign</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
+ </sdncadapter:RequestHeader>
+ <aetgt:SDNCRequestData>
+ <request-information>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <request-action>NetworkActivateRequest</request-action>
+ <source>VID</source>
+ <notification-url/>
+ <order-number/>
+ <order-version/>
+ </request-information>
+ <service-information>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <service-type>MSO-dev-service-type</service-type>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ <subscriber-name>MSO_1610_dev</subscriber-name>
+ </service-information>
+ <network-request-information>
+ <network-id>networkId</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <tenant>7dd5365547234ee8937416c65507d266</tenant>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ </network-request-information>
+ </aetgt:SDNCRequestData>
+</aetgt:SDNCAdapterWorkflowRequest>"""
+
+String assignSDNCRequest_decodeUrlLink =
+"""<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:ns5="http://org.openecomp/mso/request/types/v1"
+ xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>assign</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
+ </sdncadapter:RequestHeader>
+ <aetgt:SDNCRequestData>
+ <request-information>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <request-action>NetworkActivateRequest</request-action>
+ <source>VID</source>
+ <notification-url/>
+ <order-number/>
+ <order-version/>
+ </request-information>
+ <service-information>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <service-type>VIRTUAL USP</service-type>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ <subscriber-name>MSO_1610_dev</subscriber-name>
+ </service-information>
+ <network-request-information>
+ <network-id>networkId</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <tenant>7dd5365547234ee8937416c65507d266</tenant>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ </network-request-information>
+ </aetgt:SDNCRequestData>
+</aetgt:SDNCAdapterWorkflowRequest>"""
+
+String assignRpcSDNCRequest =
+ """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>assign</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
+ <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
+ </sdncadapter:RequestHeader>
+ <aetgt:SDNCRequestData>
+ <request-information>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <request-action>CreateNetworkInstance</request-action>
+ <source>VID</source>
+ <notification-url/>
+ <order-number/>
+ <order-version/>
+ </request-information>
+ <service-information>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <subscription-service-type>MSO-dev-service-type</subscription-service-type>
+ <ecomp-model-information>
+ <model-invariant-uuid>fcc85cb0-ad74-45d7-a5a1-17c8744fdb71</model-invariant-uuid>
+ <model-uuid>36a3a8ea-49a6-4ac8-b06c-89a54544b9b6</model-uuid>
+ <model-version>1.0</model-version>
+ <model-name>HNGW Protected OAM</model-name>
+ </ecomp-model-information>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ <global-customer-id>globalId_45678905678</global-customer-id>
+ <subscriber-name>MSO_1610_dev</subscriber-name>
+ </service-information>
+ <network-information>
+ <network-id>networkId</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <ecomp-model-information>
+ <model-invariant-uuid>sn5256d1-5a33-55df-13ab-12abad84e764</model-invariant-uuid>
+ <model-customization-uuid>sn5256d1-5a33-55df-13ab-12abad84e222</model-customization-uuid>
+ <model-uuid>sn5256d1-5a33-55df-13ab-12abad84e111</model-uuid>
+ <model-version>1</model-version>
+ <model-name>CONTRAIL_EXTERNAL</model-name>
+ </ecomp-model-information>
+ </network-information>
+ <network-request-input>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <tenant>7dd5365547234ee8937416c65507d266</tenant>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <aic-clli/>
+ <network-input-parameters/>
+ </network-request-input>
+ </aetgt:SDNCRequestData>
+</aetgt:SDNCAdapterWorkflowRequest>"""
+
+String activateSDNCRequest =
+"""<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>activate</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
+ <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
+ </sdncadapter:RequestHeader>
+ <aetgt:SDNCRequestData>
+ <request-information>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <request-action>CreateNetworkInstance</request-action>
+ <source>VID</source>
+ <notification-url/>
+ <order-number/>
+ <order-version/>
+ </request-information>
+ <service-information>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <subscription-service-type>MSO-dev-service-type</subscription-service-type>
+ <ecomp-model-information>
+ <model-invariant-uuid>fcc85cb0-ad74-45d7-a5a1-17c8744fdb71</model-invariant-uuid>
+ <model-uuid>36a3a8ea-49a6-4ac8-b06c-89a54544b9b6</model-uuid>
+ <model-version>1.0</model-version>
+ <model-name>HNGW Protected OAM</model-name>
+ </ecomp-model-information>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ <global-customer-id>globalId_45678905678</global-customer-id>
+ <subscriber-name>MSO_1610_dev</subscriber-name>
+ </service-information>
+ <network-information>
+ <network-id>networkId</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <ecomp-model-information>
+ <model-invariant-uuid>sn5256d1-5a33-55df-13ab-12abad84e764</model-invariant-uuid>
+ <model-customization-uuid>sn5256d1-5a33-55df-13ab-12abad84e222</model-customization-uuid>
+ <model-uuid>sn5256d1-5a33-55df-13ab-12abad84e111</model-uuid>
+ <model-version>1</model-version>
+ <model-name>CONTRAIL_EXTERNAL</model-name>
+ </ecomp-model-information>
+ </network-information>
+ <network-request-input>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <tenant>7dd5365547234ee8937416c65507d266</tenant>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <aic-clli/>
+ <network-input-parameters/>
+ </network-request-input>
+ </aetgt:SDNCRequestData>
+</aetgt:SDNCAdapterWorkflowRequest>"""
+
+String assignResponse =
+"""<sdncadapterworkflow:SDNCAdapterWorkflowResponse xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1" xmlns:tag0="http://org.openecomp/workflow/sdnc/adapter/schema/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <sdncadapterworkflow:response-data> <tag0:CallbackHeader> <tag0:RequestId>006927ca-f5a3-47fd-880c-dfcbcd81a093</tag0:RequestId> <tag0:ResponseCode>200</tag0:ResponseCode> <tag0:ResponseMessage>OK</tag0:ResponseMessage> </tag0:CallbackHeader> <tag0:RequestData xsi:type="xs:string"><output xmlns="com:att:sdnctl:vnf"><response-code>200</response-code><svc-request-id>006927ca-f5a3-47fd-880c-dfcbcd81a093</svc-request-id><ack-final-indicator>Y</ack-final-indicator><service-information><subscriber-name>notsurewecare</subscriber-name><service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id><service-instance-id>GN_EVPN_direct_net_0_ST_noGW</service-instance-id></service-information><network-information><network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id></network-information></output></tag0:RequestData> </sdncadapterworkflow:response-data> </sdncadapterworkflow:SDNCAdapterWorkflowResponse>"""
+
+ String sdncRollbackRequest =
+ """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:ns5="http://org.openecomp/mso/request/types/v1"
+ xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>rollback</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
+ </sdncadapter:RequestHeader>
+ <aetgt:SDNCRequestData>
+ <request-information>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <request-action>NetworkActivateRequest</request-action>
+ <source>VID</source>
+ <notification-url/>
+ <order-number/>
+ <order-version/>
+ </request-information>
+ <service-information>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <service-type>MSO-dev-service-type</service-type>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ <subscriber-name>MSO_1610_dev</subscriber-name>
+ </service-information>
+ <network-request-information>
+ <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <tenant>7dd5365547234ee8937416c65507d266</tenant>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ </network-request-information>
+ </aetgt:SDNCRequestData>
+</aetgt:SDNCAdapterWorkflowRequest>"""
+
+String sdncRpcRollbackRequest =
+"""<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>unassign</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
+ <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
+ </sdncadapter:RequestHeader>
+ <aetgt:SDNCRequestData>
+ <request-information>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <request-action>DeleteNetworkInstance</request-action>
+ <source>VID</source>
+ <notification-url/>
+ <order-number/>
+ <order-version/>
+ </request-information>
+ <service-information>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <subscription-service-type>MSO-dev-service-type</subscription-service-type>
+ <ecomp-model-information>
+ <model-invariant-uuid>fcc85cb0-ad74-45d7-a5a1-17c8744fdb71</model-invariant-uuid>
+ <model-uuid>36a3a8ea-49a6-4ac8-b06c-89a54544b9b6</model-uuid>
+ <model-version>1.0</model-version>
+ <model-name>HNGW Protected OAM</model-name>
+ </ecomp-model-information>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ <global-customer-id>globalId_45678905678</global-customer-id>
+ <subscriber-name>MSO_1610_dev</subscriber-name>
+ </service-information>
+ <network-information>
+ <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <ecomp-model-information>
+ <model-invariant-uuid>sn5256d1-5a33-55df-13ab-12abad84e764</model-invariant-uuid>
+ <model-customization-uuid>sn5256d1-5a33-55df-13ab-12abad84e222</model-customization-uuid>
+ <model-uuid>sn5256d1-5a33-55df-13ab-12abad84e111</model-uuid>
+ <model-version>1</model-version>
+ <model-name>CONTRAIL_EXTERNAL</model-name>
+ </ecomp-model-information>
+ </network-information>
+ <network-request-input>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <tenant>7dd5365547234ee8937416c65507d266</tenant>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <aic-clli/>
+ <network-input-parameters/>
+ </network-request-input>
+ </aetgt:SDNCRequestData>
+</aetgt:SDNCAdapterWorkflowRequest>"""
+
+String sdncActivateRollbackRequest =
+"""<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>deactivate</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
+ <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
+ </sdncadapter:RequestHeader>
+ <aetgt:SDNCRequestData>
+ <request-information>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <request-action>DeleteNetworkInstance</request-action>
+ <source>VID</source>
+ <notification-url/>
+ <order-number/>
+ <order-version/>
+ </request-information>
+ <service-information>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <subscription-service-type>MSO-dev-service-type</subscription-service-type>
+ <ecomp-model-information>
+ <model-invariant-uuid>fcc85cb0-ad74-45d7-a5a1-17c8744fdb71</model-invariant-uuid>
+ <model-uuid>36a3a8ea-49a6-4ac8-b06c-89a54544b9b6</model-uuid>
+ <model-version>1.0</model-version>
+ <model-name>HNGW Protected OAM</model-name>
+ </ecomp-model-information>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ <global-customer-id>globalId_45678905678</global-customer-id>
+ <subscriber-name>MSO_1610_dev</subscriber-name>
+ </service-information>
+ <network-information>
+ <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <ecomp-model-information>
+ <model-invariant-uuid>sn5256d1-5a33-55df-13ab-12abad84e764</model-invariant-uuid>
+ <model-customization-uuid>sn5256d1-5a33-55df-13ab-12abad84e222</model-customization-uuid>
+ <model-uuid>sn5256d1-5a33-55df-13ab-12abad84e111</model-uuid>
+ <model-version>1</model-version>
+ <model-name>CONTRAIL_EXTERNAL</model-name>
+ </ecomp-model-information>
+ </network-information>
+ <network-request-input>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <tenant>7dd5365547234ee8937416c65507d266</tenant>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <aic-clli/>
+ <network-input-parameters/>
+ </network-request-input>
+ </aetgt:SDNCRequestData>
+</aetgt:SDNCAdapterWorkflowRequest>"""
+
+ String sdncAdapterWorkflowResponse =
+ """<aetgt:SDNCAdapterWorkflowResponse xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1">
+ <sdncadapterworkflow:response-data>
+<tag0:CallbackHeader xmlns:tag0="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
+ <tag0:RequestId>745b1b50-e39e-4685-9cc8-c71f0bde8bf0</tag0:RequestId>
+ <tag0:ResponseCode>200</tag0:ResponseCode>
+ <tag0:ResponseMessage>OK</tag0:ResponseMessage>
+</tag0:CallbackHeader>
+ <tag0:RequestData xmlns:tag0="http://org.openecomp/workflow/sdnc/adapter/schema/v1"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:type="xs:string">&lt;output xmlns="com:att:sdnctl:vnf"&gt;&lt;svc-request-id&gt;00703dc8-71ff-442d-a4a8-3adc5beef6a9&lt;/svc-request-id&gt;&lt;response-code&gt;200&lt;/response-code&gt;&lt;ack-final-indicator&gt;Y&lt;/ack-final-indicator&gt;&lt;network-information&gt;&lt;network-id&gt;49c86598-f766-46f8-84f8-8d1c1b10f9b4&lt;/network-id&gt;&lt;/network-information&gt;&lt;service-information&gt;&lt;service-type&gt;a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb&lt;/service-type&gt;&lt;service-instance-id&gt;MNS-25180-L-01-dmz_direct_net_1&lt;/service-instance-id&gt;&lt;subscriber-name&gt;notsurewecare&lt;/subscriber-name&gt;&lt;/service-information&gt;&lt;/output&gt;</tag0:RequestData>
+ </sdncadapterworkflow:response-data>
+</aetgt:SDNCAdapterWorkflowResponse>"""
+
+
+ String sdncAdapterWorkflowResponse_Error =
+ """<sdncadapterworkflow:SDNCAdapterWorkflowResponse xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:tag0="http://org.openecomp/workflow/sdnc/adapter/schema/v1"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="com:att:sdnctl:vnf">
+ <sdncadapterworkflow:response-data>
+ <tag0:RequestData xsi:type="xs:string">
+ <output>
+ <response-code>400</response-code>
+ <response-message>Error writing to l3-netework</response-message>
+ <ack-final-indicator>Y</ack-final-indicator>
+ <svc-request-id>c79240d8-34b5-4853-af69-2021928dba00</svc-request-id>
+ </output>
+ </tag0:RequestData>
+ </sdncadapterworkflow:response-data>
+</sdncadapterworkflow:SDNCAdapterWorkflowResponse>"""
+
+ String expected_sdncAdapterWorkflowResponse_Error =
+ """<sdncadapterworkflow:SDNCAdapterWorkflowResponse xmlns="com:att:sdnctl:vnf"
+ xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:tag0="http://org.openecomp/workflow/sdnc/adapter/schema/v1"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <sdncadapterworkflow:response-data>
+ <tag0:RequestData xsi:type="xs:string">
+ <output>
+ <response-code>400</response-code>
+ <response-message>Error writing to l3-netework</response-message>
+ <ack-final-indicator>Y</ack-final-indicator>
+ <svc-request-id>c79240d8-34b5-4853-af69-2021928dba00</svc-request-id>
+ </output>
+ </tag0:RequestData>
+ </sdncadapterworkflow:response-data>
+</sdncadapterworkflow:SDNCAdapterWorkflowResponse>"""
+
+ String sdncAdapterWorkflowFormattedResponse =
+ """<aetgt:SDNCAdapterWorkflowResponse xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns="com:att:sdnctl:vnf">
+ <aetgt:response-data>
+ <output>
+ <svc-request-id>00703dc8-71ff-442d-a4a8-3adc5beef6a9</svc-request-id>
+ <response-code>200</response-code>
+ <ack-final-indicator>Y</ack-final-indicator>
+ <network-information>
+ <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
+ </network-information>
+ <service-information>
+ <service-type>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-type>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ <subscriber-name>notsurewecare</subscriber-name>
+ </service-information>
+ </output>
+ </aetgt:response-data>
+</aetgt:SDNCAdapterWorkflowResponse>"""
+
+String sdncAdapterWorkflowAssignResponse =
+"""<sdncadapterworkflow:SDNCAdapterWorkflowResponse xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:tag0="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <sdncadapterworkflow:response-data>
+ <tag0:CallbackHeader>
+ <tag0:RequestId>79ec9006-3695-4fcc-93a8-be6f9e248beb</tag0:RequestId>
+ <tag0:ResponseCode>200</tag0:ResponseCode>
+ <tag0:ResponseMessage>OK</tag0:ResponseMessage>
+ </tag0:CallbackHeader>
+ <tag0:RequestData xsi:type="xs:string">
+ <output xmlns="com:att:sdnctl:generic-resource">
+ <response-message/>
+ <svc-request-id>79ec9006-3695-4fcc-93a8-be6f9e248beb</svc-request-id>
+ <service-response-information>
+ <instance-id>f805ec2b-b4d8-473e-8325-67f110139e5d</instance-id>
+ </service-response-information>
+ <response-code>200</response-code>
+ <network-response-information>
+ <instance-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</instance-id>
+ <object-path>restconf/config/GENERIC-RESOURCE-API:services/service/f805ec2b-b4d8-473e-8325-67f110139e5d/service-data/networks/network/f7e4db56-aab5-4065-8e65-cec1cd1de24f</object-path>
+ </network-response-information>
+ <ack-final-indicator>Y</ack-final-indicator>
+ </output>
+ </tag0:RequestData>
+ </sdncadapterworkflow:response-data>
+</sdncadapterworkflow:SDNCAdapterWorkflowResponse>"""
+
+ String rollbackNetworkRequest =
+"""<NetworkAdapter:rollbackNetwork xmlns:NetworkAdapter="http://org.openecomp.mso/network">
+ <rollback>
+ <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
+ <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
+ <networkStackId/>
+ <networkType>CONTRAIL_EXTERNAL</networkType>
+ <networkCreated>true</networkCreated>
+ <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
+ <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
+ <msoRequest>
+ <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId>
+ <serviceInstanceId/>
+ </msoRequest>
+ </rollback>
+</NetworkAdapter:rollbackNetwork>"""
+
+ String rollbackActivateSDNCRequest =
+"""<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:ns5="http://org.openecomp/mso/request/types/v1"
+ xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>rollback</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
+ </sdncadapter:RequestHeader>
+ <aetgt:SDNCRequestData>
+ <request-information>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <request-action>CreateNetworkInstance</request-action>
+ <source>VID</source>
+ <notification-url/>
+ <order-number/>
+ <order-version/>
+ </request-information>
+ <service-information>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <service-type>MSO-dev-service-type</service-type>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ <subscriber-name>MSO_1610_dev</subscriber-name>
+ </service-information>
+ <network-information>
+ <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <ecomp-model-information>
+ <model-invariant-uuid>invariant-uuid</model-invariant-uuid>
+ <model-customization-uuid>customization-uuid</model-customization-uuid>
+ <model-uuid>uuid</model-uuid>
+ <model-version>version</model-version>
+ <model-name>CONTRAIL_EXTERNAL</model-name>
+ </ecomp-model-information>
+ </network-information>
+ <network-request-information>
+ <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <tenant>7dd5365547234ee8937416c65507d266</tenant>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ </network-request-information>
+ </aetgt:SDNCRequestData>
+</aetgt:SDNCAdapterWorkflowRequest>"""
+
+ String rollbackSDNCRequest =
+"""<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:ns5="http://org.openecomp/mso/request/types/v1"
+ xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>rollback</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
+ </sdncadapter:RequestHeader>
+ <aetgt:SDNCRequestData>
+ <request-information>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <request-action>CreateNetworkInstance</request-action>
+ <source>VID</source>
+ <notification-url/>
+ <order-number/>
+ <order-version/>
+ </request-information>
+ <service-information>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <service-type>MSO-dev-service-type</service-type>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ <subscriber-name>MSO_1610_dev</subscriber-name>
+ </service-information>
+ <network-information>
+ <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <ecomp-model-information>
+ <model-invariant-uuid>invariant-uuid</model-invariant-uuid>
+ <model-customization-uuid>customization-uuid</model-customization-uuid>
+ <model-uuid>uuid</model-uuid>
+ <model-version>version</model-version>
+ <model-name>CONTRAIL_EXTERNAL</model-name>
+ </ecomp-model-information>
+ </network-information>
+ <network-request-information>
+ <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <tenant>7dd5365547234ee8937416c65507d266</tenant>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ </network-request-information>
+ </aetgt:SDNCRequestData>
+</aetgt:SDNCAdapterWorkflowRequest>"""
+
+// - - - - - - - -
+
+ @Before
+ public void init()
+ {
+ MockitoAnnotations.initMocks(this)
+
+ }
+
+ public void initializeVariables (Execution mockExecution) {
+
+ verify(mockExecution).setVariable(Prefix + "networkRequest", "")
+ verify(mockExecution).setVariable(Prefix + "rollbackEnabled", null)
+ verify(mockExecution).setVariable(Prefix + "networkInputs", "")
+ //verify(mockExecution).setVariable(Prefix + "requestId", "")
+ verify(mockExecution).setVariable(Prefix + "messageId", "")
+ verify(mockExecution).setVariable(Prefix + "source", "")
+ verify(mockExecution).setVariable("BasicAuthHeaderValuePO", "")
+ verify(mockExecution).setVariable("BasicAuthHeaderValueSDNC", "")
+ verify(mockExecution).setVariable(Prefix + "serviceInstanceId","")
+ verify(mockExecution).setVariable("GENGS_type","")
+ verify(mockExecution).setVariable(Prefix + "rsrc_endpoint", null)
+ verify(mockExecution).setVariable(Prefix + "networkOutputs", "")
+ verify(mockExecution).setVariable(Prefix + "networkId","")
+ verify(mockExecution).setVariable(Prefix + "networkName","")
+
+ // AAI query Name
+ verify(mockExecution).setVariable(Prefix + "queryNameAAIRequest","")
+ verify(mockExecution).setVariable(Prefix + "queryNameAAIResponse", "")
+ verify(mockExecution).setVariable(Prefix + "aaiNameReturnCode", "")
+ verify(mockExecution).setVariable(Prefix + "isAAIqueryNameGood", false)
+
+ // AAI query Cloud Region
+ verify(mockExecution).setVariable(Prefix + "queryCloudRegionRequest","")
+ verify(mockExecution).setVariable(Prefix + "queryCloudRegionReturnCode","")
+ verify(mockExecution).setVariable(Prefix + "queryCloudRegionResponse","")
+ verify(mockExecution).setVariable(Prefix + "cloudRegionPo","")
+ verify(mockExecution).setVariable(Prefix + "cloudRegionSdnc","")
+ verify(mockExecution).setVariable(Prefix + "isCloudRegionGood", false)
+
+ // AAI query Id
+ verify(mockExecution).setVariable(Prefix + "queryIdAAIRequest","")
+ verify(mockExecution).setVariable(Prefix + "queryIdAAIResponse", "")
+ verify(mockExecution).setVariable(Prefix + "aaiIdReturnCode", "")
+
+ // AAI query vpn binding
+ verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIRequest","")
+ verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIResponse", "")
+ verify(mockExecution).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "")
+ verify(mockExecution).setVariable(Prefix + "vpnBindings", null)
+ verify(mockExecution).setVariable(Prefix + "vpnCount", 0)
+ verify(mockExecution).setVariable(Prefix + "routeCollection", "")
+
+ // AAI query network policy
+ verify(mockExecution).setVariable(Prefix + "queryNetworkPolicyAAIRequest","")
+ verify(mockExecution).setVariable(Prefix + "queryNetworkPolicyAAIResponse", "")
+ verify(mockExecution).setVariable(Prefix + "aaiQqueryNetworkPolicyReturnCode", "")
+ verify(mockExecution).setVariable(Prefix + "networkPolicyUriList", null)
+ verify(mockExecution).setVariable(Prefix + "networkPolicyCount", 0)
+ verify(mockExecution).setVariable(Prefix + "networkCollection", "")
+
+ // AAI query route table reference
+ verify(mockExecution).setVariable(Prefix + "queryNetworkTableRefAAIRequest","")
+ verify(mockExecution).setVariable(Prefix + "queryNetworkTableRefAAIResponse", "")
+ verify(mockExecution).setVariable(Prefix + "aaiQqueryNetworkTableRefReturnCode", "")
+ verify(mockExecution).setVariable(Prefix + "networkTableRefUriList", null)
+ verify(mockExecution).setVariable(Prefix + "networkTableRefCount", 0)
+ verify(mockExecution).setVariable(Prefix + "tableRefCollection", "")
+
+ // AAI requery Id
+ verify(mockExecution).setVariable(Prefix + "requeryIdAAIRequest","")
+ verify(mockExecution).setVariable(Prefix + "requeryIdAAIResponse", "")
+ verify(mockExecution).setVariable(Prefix + "aaiRequeryIdReturnCode", "")
+
+ // AAI update contrail
+ verify(mockExecution).setVariable(Prefix + "updateContrailAAIUrlRequest","")
+ verify(mockExecution).setVariable(Prefix + "updateContrailAAIPayloadRequest","")
+ verify(mockExecution).setVariable(Prefix + "updateContrailAAIResponse", "")
+ verify(mockExecution).setVariable(Prefix + "aaiUpdateContrailReturnCode", "")
+
+ verify(mockExecution).setVariable(Prefix + "createNetworkRequest", "")
+ verify(mockExecution).setVariable(Prefix + "createNetworkResponse", "")
+ verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", "")
+ //verify(mockExecution).setVariable(Prefix + "rollbackNetworkResponse", "")
+ verify(mockExecution).setVariable(Prefix + "networkReturnCode", "")
+ //verify(mockExecution).setVariable(Prefix + "rollbackNetworkReturnCode", "")
+ verify(mockExecution).setVariable(Prefix + "isNetworkRollbackNeeded", false)
+
+ verify(mockExecution).setVariable(Prefix + "assignSDNCRequest", "")
+ verify(mockExecution).setVariable(Prefix + "assignSDNCResponse", "")
+ verify(mockExecution).setVariable(Prefix + "rollbackSDNCRequest", "")
+ //verify(mockExecution).setVariable(Prefix + "rollbackSDNCResponse", "")
+ verify(mockExecution).setVariable(Prefix + "sdncReturnCode", "")
+ //verify(mockExecution).setVariable(Prefix + "rollbackSDNCReturnCode", "")
+ verify(mockExecution).setVariable(Prefix + "isSdncRollbackNeeded", false)
+ verify(mockExecution).setVariable(Prefix + "sdncResponseSuccess", false)
+
+ verify(mockExecution).setVariable(Prefix + "activateSDNCRequest", "")
+ verify(mockExecution).setVariable(Prefix + "activateSDNCResponse", "")
+ verify(mockExecution).setVariable(Prefix + "rollbackActivateSDNCRequest", "")
+ //verify(mockExecution).setVariable(Prefix + "rollbackActivateSDNCResponse", "")
+ verify(mockExecution).setVariable(Prefix + "sdncActivateReturnCode", "")
+ //verify(mockExecution).setVariable(Prefix + "rollbackActivateSDNCReturnCode", "")
+ verify(mockExecution).setVariable(Prefix + "isSdncActivateRollbackNeeded", false)
+ verify(mockExecution).setVariable(Prefix + "sdncActivateResponseSuccess", false)
+
+ verify(mockExecution).setVariable(Prefix + "orchestrationStatus", "")
+ verify(mockExecution).setVariable(Prefix + "isVnfBindingPresent", false)
+ verify(mockExecution).setVariable(Prefix + "Success", false)
+
+ verify(mockExecution).setVariable(Prefix + "isException", false)
+
+ }
+
+ @Test
+ //@Ignore
+ public void preProcessRequest_vIPR_NetworkRequest() {
+
+ println "************ preProcessRequest_Payload ************* "
+
+ def networkModelInfo = """{"modelUuid": "sn5256d1-5a33-55df-13ab-12abad84e111",
+ "modelName": "CONTRAIL_EXTERNAL",
+ "modelType": "CONTRAIL_EXTERNAL",
+ "modelVersion": "1",
+ "modelCustomizationUuid": "sn5256d1-5a33-55df-13ab-12abad84e222",
+ "modelInvariantUuid": "sn5256d1-5a33-55df-13ab-12abad84e764"
+ }""".trim()
+
+ def serviceModelInfo = """{"modelUuid": "36a3a8ea-49a6-4ac8-b06c-89a54544b9b6",
+ "modelName": "HNGW Protected OAM",
+ "modelType": "service",
+ "modelVersion": "1.0",
+ "modelInvariantUuid": "fcc85cb0-ad74-45d7-a5a1-17c8744fdb71"
+ }""".trim()
+
+
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+
+ // Pre-defined value, testing Only
+ when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ // Inputs:
+ when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("disableRollback")).thenReturn("true")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable("networkId")).thenReturn("networkId") // optional
+ when(mockExecution.getVariable("networkName")).thenReturn("MNS-25180-L-01-dmz_direct_net_1") // optional
+ when(mockExecution.getVariable("productFamilyId")).thenReturn("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb")
+ when(mockExecution.getVariable("networkModelInfo")).thenReturn("CONTRAIL_EXTERNAL")
+ when(mockExecution.getVariable("lcpCloudRegionId")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable("tenantId")).thenReturn("7dd5365547234ee8937416c65507d266")
+ when(mockExecution.getVariable("failIfExists")).thenReturn("false")
+ when(mockExecution.getVariable("networkModelInfo")).thenReturn(networkModelInfo)
+ when(mockExecution.getVariable("serviceModelInfo")).thenReturn(serviceModelInfo)
+ when(mockExecution.getVariable("sdncVersion")).thenReturn("1702")
+ when(mockExecution.getVariable("action")).thenReturn("CREATE")
+ when(mockExecution.getVariable("subscriptionServiceType")).thenReturn("MSO-dev-service-type")
+ when(mockExecution.getVariable("globalSubscriberId")).thenReturn("globalId_45678905678")
+
+ when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
+ when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
+
+ when(mockExecution.getVariable("URN_mso_rollback")).thenReturn("true")
+ 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)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.preProcessRequest(mockExecution)
+
+ verify(mockExecution).getVariable("isDebugLogEnabled")
+ verify(mockExecution).setVariable("prefix", Prefix)
+
+ //verify variable initialization
+ initializeVariables(mockExecution)
+
+ verify(mockExecution).setVariable("action", "CREATE")
+ verify(mockExecution).setVariable(Prefix + "networkId","")
+ verify(mockExecution).setVariable(Prefix + "networkRequest", expectedvIPRNetworkRequest)
+ verify(mockExecution, atLeast(1)).setVariable(Prefix + "rollbackEnabled", false)
+ verify(mockExecution).setVariable(Prefix + "networkInputs", expectedvIPRNetworkInputs)
+ //verify(mockExecution).setVariable(Prefix + "requestId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ //verify(mockExecution).setVariable("mso-service-instance-id", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ verify(mockExecution).setVariable(Prefix + "messageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ verify(mockExecution).setVariable(Prefix + "source", "VID")
+ verify(mockExecution).setVariable("BasicAuthHeaderValuePO", "Basic cGFzc3dvcmQ=")
+ verify(mockExecution).setVariable("BasicAuthHeaderValueSDNC", "Basic cGFzc3dvcmQ=")
+ verify(mockExecution).setVariable(Prefix + "serviceInstanceId","f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ verify(mockExecution, atLeast(1)).setVariable("GENGS_type", "service-instance")
+ //verify(mockExecution, atLeast(1)).setVariable("mso-request-id", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ //verify(mockExecution, atLeast(1)).setVariable("msoRequestId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ //verify(mockExecution).setVariable("mso-service-instance-id","88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ verify(mockExecution).setVariable(Prefix + "networkId","")
+ verify(mockExecution).setVariable(Prefix + "networkOutputs", networkvIPROutputs)
+ verify(mockExecution).setVariable(Prefix + "networkName","")
+
+ }
+
+ @Test
+ //@Ignore
+ public void preProcessRequest_JSON_NetworkRequest() {
+
+ println "************ preProcessRequest_Payload ************* "
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+
+ // Pre-defined value, testing Only
+ when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ // Inputs:
+ // when(mockExecution.getVariable("requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable("requestAction")).thenReturn("CREATE")
+ when(mockExecution.getVariable("networkId")).thenReturn("networkId") // optional
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("bpmnRequest")).thenReturn(jsonIncomingRequest) // JSON format
+ when(mockExecution.getVariable("sdncVersion")).thenReturn("1610") // 1610 default
+ when(mockExecution.getVariable("disableRollback")).thenReturn(true)
+
+ when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
+ when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
+
+ when(mockExecution.getVariable("URN_mso_rollback")).thenReturn("true")
+ 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)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.preProcessRequest(mockExecution)
+
+ verify(mockExecution).getVariable("isDebugLogEnabled")
+ verify(mockExecution).setVariable("prefix", Prefix)
+
+ //verify variable initialization
+ initializeVariables(mockExecution)
+
+ verify(mockExecution).setVariable("action", "CREATE")
+ verify(mockExecution).setVariable(Prefix + "networkRequest", expectedJSONNetworkRequest)
+ verify(mockExecution).setVariable(Prefix + "rollbackEnabled", false)
+ verify(mockExecution).setVariable(Prefix + "networkInputs", expectedJSONNetworkInputs)
+ //verify(mockExecution).setVariable(Prefix + "requestId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ //verify(mockExecution).setVariable(Prefix + "messageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ verify(mockExecution).setVariable(Prefix + "source", "VID")
+ verify(mockExecution).setVariable("BasicAuthHeaderValuePO", "Basic cGFzc3dvcmQ=")
+ verify(mockExecution).setVariable("BasicAuthHeaderValueSDNC", "Basic cGFzc3dvcmQ=")
+ verify(mockExecution).setVariable(Prefix + "serviceInstanceId","f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ verify(mockExecution, atLeast(1)).setVariable("GENGS_type", "service-instance")
+ //verify(mockExecution, atLeast(1)).setVariable("msoRequestId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ //verify(mockExecution).setVariable("mso-service-instance-id","88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ verify(mockExecution).setVariable(Prefix + "networkId","")
+ verify(mockExecution).setVariable(Prefix + "networkOutputs", networkJSONOutputs)
+ verify(mockExecution).setVariable(Prefix + "networkName","")
+
+
+ }
+
+ @Test
+ //@Ignore
+ public void preProcessRequest_XML_NetworkRequest() {
+
+ println "************ preProcessRequest_Payload ************* "
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+
+ // Pre-defined value, testing Only
+ when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ // Inputs:
+ // when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("bpmnRequest")).thenReturn(xmlIncomingRequest) // XML format
+
+ when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
+ when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
+
+ when(mockExecution.getVariable("URN_mso_rollback")).thenReturn("true")
+ 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)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.preProcessRequest(mockExecution)
+
+ verify(mockExecution).getVariable("isDebugLogEnabled")
+ verify(mockExecution).setVariable("prefix", Prefix)
+
+ //verify variable initialization
+ initializeVariables(mockExecution)
+
+ verify(mockExecution).setVariable(Prefix + "networkRequest", expectedXMLNetworkRequest)
+ verify(mockExecution).setVariable("action", "CREATE")
+ verify(mockExecution).setVariable(Prefix + "rollbackEnabled", true)
+ verify(mockExecution).setVariable(Prefix + "networkInputs", expectedXMLNetworkInputs)
+ //verify(mockExecution).setVariable(Prefix + "requestId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ verify(mockExecution).setVariable(Prefix + "messageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ verify(mockExecution).setVariable(Prefix + "source", "PORTAL")
+ verify(mockExecution).setVariable("BasicAuthHeaderValuePO", "Basic cGFzc3dvcmQ=")
+ verify(mockExecution).setVariable("BasicAuthHeaderValueSDNC", "Basic cGFzc3dvcmQ=")
+ verify(mockExecution).setVariable(Prefix + "serviceInstanceId","MNS-25180-L-01-dmz_direct_net_1")
+ verify(mockExecution, atLeast(1)).setVariable("GENGS_type", "service-instance")
+ //verify(mockExecution).setVariable("mso-service-instance-id","88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ verify(mockExecution, atLeast(1)).setVariable(Prefix + "networkId","")
+ verify(mockExecution).setVariable(Prefix + "networkOutputs", networkXMLOutputs)
+ verify(mockExecution).setVariable(Prefix + "networkName","")
+
+ }
+
+
+
+ @Test
+ //@Ignore
+ public void prepareCreateNetworkRequest() {
+
+ println "************ prepareNetworkRequest ************* "
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedvIPRNetworkRequest)
+ when(mockExecution.getVariable(Prefix + "queryIdAAIResponse")).thenReturn(queryIdAIIResponse)
+ when(mockExecution.getVariable(Prefix + "cloudRegionPo")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("messageId_generated")
+ when(mockExecution.getVariable(Prefix + "source")).thenReturn("VID")
+ //when(mockExecution.getVariable(Prefix + "queryVpnBindingAAIResponse")).thenReturn(queryVpnBindingAAIResponse)
+ when(mockExecution.getVariable(Prefix + "routeCollection")).thenReturn("<routeTargets>13979:105757</routeTargets><routeTargets>13979:105757</routeTargets>")
+ when(mockExecution.getVariable(Prefix + "networkCollection")).thenReturn("<policyFqdns>GN_EVPN_Test</policyFqdns>")
+ when(mockExecution.getVariable(Prefix + "tableRefCollection")).thenReturn("<routeTableFqdns>refFQDN1</routeTableFqdns><routeTableFqdns>refFQDN2</routeTableFqdns>")
+ when(mockExecution.getVariable(Prefix + "requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ //when(mockExecution.getVariable("URN_?????")).thenReturn("") // notificationUrl, //TODO - is this coming from URN? What variable/value to use?
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+
+ // preProcessRequest(Execution execution)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.prepareCreateNetworkRequest(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(mockExecution)
+
+ // verify set prefix = Prefix + ""
+ verify(mockExecution).setVariable("prefix", Prefix)
+
+ verify(mockExecution).setVariable(Prefix + "createNetworkRequest", createNetworkRequest)
+
+ }
+
+
+ @Test
+ //@Ignore
+ public void prepareCreateNetworkRequest_Ipv4() {
+
+ println "************ prepareNetworkRequest ************* "
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedvIPRNetworkRequest)
+ when(mockExecution.getVariable(Prefix + "queryIdAAIResponse")).thenReturn(queryIdAIIResponse_Ipv4)
+ when(mockExecution.getVariable(Prefix + "cloudRegionPo")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("messageId_generated")
+ when(mockExecution.getVariable(Prefix + "source")).thenReturn("VID")
+ //when(mockExecution.getVariable(Prefix + "queryVpnBindingAAIResponse")).thenReturn(queryVpnBindingAAIResponse)
+ when(mockExecution.getVariable(Prefix + "routeCollection")).thenReturn("<routeTargets>13979:105757</routeTargets><routeTargets>13979:105757</routeTargets>")
+ when(mockExecution.getVariable(Prefix + "networkCollection")).thenReturn("<policyFqdns>GN_EVPN_Test</policyFqdns>")
+ when(mockExecution.getVariable(Prefix + "tableRefCollection")).thenReturn("<routeTableFqdns>refFQDN1</routeTableFqdns><routeTableFqdns>refFQDN2</routeTableFqdns>")
+ when(mockExecution.getVariable(Prefix + "requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ //when(mockExecution.getVariable("URN_?????")).thenReturn("") // notificationUrl, //TODO - is this coming from URN? What variable/value to use?
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+
+ // preProcessRequest(Execution execution)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.prepareCreateNetworkRequest(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(mockExecution)
+
+ // verify set prefix = Prefix + ""
+ verify(mockExecution).setVariable("prefix", Prefix)
+
+ verify(mockExecution).setVariable(Prefix + "createNetworkRequest", createNetworkRequest)
+
+ }
+
+ @Test
+ //@Ignore
+ public void prepareCreateNetworkRequest_AlaCarte() {
+
+ println "************ prepareNetworkRequest ************* "
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedJSONNetworkRequest)
+ when(mockExecution.getVariable(Prefix + "queryIdAAIResponse")).thenReturn(queryIdAIIResponse)
+ when(mockExecution.getVariable(Prefix + "cloudRegionPo")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("messageId_generated")
+ when(mockExecution.getVariable(Prefix + "source")).thenReturn("VID")
+ //when(mockExecution.getVariable(Prefix + "queryVpnBindingAAIResponse")).thenReturn(queryVpnBindingAAIResponse)
+ when(mockExecution.getVariable(Prefix + "routeCollection")).thenReturn("<routeTargets>13979:105757</routeTargets><routeTargets>13979:105757</routeTargets>")
+ when(mockExecution.getVariable(Prefix + "networkCollection")).thenReturn("<policyFqdns>GN_EVPN_Test</policyFqdns>")
+ when(mockExecution.getVariable(Prefix + "tableRefCollection")).thenReturn("<routeTableFqdns>refFQDN1</routeTableFqdns><routeTableFqdns>refFQDN2</routeTableFqdns>")
+ when(mockExecution.getVariable(Prefix + "requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ //when(mockExecution.getVariable("URN_?????")).thenReturn("") // notificationUrl, //TODO - is this coming from URN? What variable/value to use?
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+
+ // preProcessRequest(Execution execution)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.prepareCreateNetworkRequest(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(mockExecution)
+
+ // verify set prefix = Prefix + ""
+ verify(mockExecution).setVariable("prefix", Prefix)
+
+ verify(mockExecution).setVariable(Prefix + "createNetworkRequest", createNetworkRequestAlaCarte)
+
+ }
+
+ @Test
+ //@Ignore
+ public void prepareCreateNetworkRequest_SRIOV() {
+
+ println "************ prepareNetworkRequest ************* "
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedvIPRNetworkRequest)
+ when(mockExecution.getVariable(Prefix + "queryIdAAIResponse")).thenReturn(queryIdAIIResponse_SRIOV)
+ when(mockExecution.getVariable(Prefix + "cloudRegionPo")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("messageId_generated")
+ when(mockExecution.getVariable(Prefix + "source")).thenReturn("VID")
+ //when(mockExecution.getVariable(Prefix + "queryVpnBindingAAIResponse")).thenReturn(queryVpnBindingAAIResponse)
+ when(mockExecution.getVariable(Prefix + "routeCollection")).thenReturn("<routeTargets>13979:105757</routeTargets><routeTargets>13979:105757</routeTargets>")
+ when(mockExecution.getVariable(Prefix + "networkCollection")).thenReturn("<policyFqdns>GN_EVPN_Test</policyFqdns>")
+ when(mockExecution.getVariable(Prefix + "tableRefCollection")).thenReturn("<routeTableFqdns>refFQDN1</routeTableFqdns><routeTableFqdns>refFQDN2</routeTableFqdns>")
+ when(mockExecution.getVariable(Prefix + "requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ //when(mockExecution.getVariable("URN_?????")).thenReturn("") // notificationUrl, //TODO - is this coming from URN? What variable/value to use?
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+
+ // preProcessRequest(Execution execution)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.prepareCreateNetworkRequest(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(mockExecution)
+
+ // verify set prefix = Prefix + ""
+ verify(mockExecution).setVariable("prefix", Prefix)
+
+ verify(mockExecution).setVariable(Prefix + "createNetworkRequest", createNetworkRequest_SRIOV)
+
+ }
+
+
+ @Test
+ //@Ignore
+ public void prepareSDNCRequest() {
+
+ println "************ prepareSDNCRequest ************* "
+
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedvIPRNetworkRequest)
+ when(mockExecution.getVariable(Prefix + "cloudRegionSdnc")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(Prefix + "serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable(Prefix + "networkId")).thenReturn("networkId")
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback")
+ 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)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.prepareSDNCRequest(mockExecution)
+
+ // verify set prefix = Prefix + ""
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "assignSDNCRequest", assignSDNCRequest)
+
+ }
+
+ @Test
+ //@Ignore
+ public void prepareSDNCRequest_decodeUrlLink() {
+
+ println "************ prepareSDNCRequest ************* "
+
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedvIPRNetworkRequest)
+ when(mockExecution.getVariable(Prefix + "cloudRegionSdnc")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(Prefix + "serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable(Prefix + "networkId")).thenReturn("networkId")
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback")
+ 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/VIRTUAL%20USP/service-instances/service-instance/6d4eb22a-82f1-4257-9f80-4176262cfe69/")
+
+
+ // preProcessRequest(Execution execution)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.prepareSDNCRequest(mockExecution)
+
+ // verify set prefix = Prefix + ""
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "assignSDNCRequest", assignSDNCRequest_decodeUrlLink)
+
+ }
+
+ @Test
+ //@Ignore
+ public void prepareRpcSDNCRequest() {
+
+ println "************ prepareRpcSDNCRequest ************* "
+
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedvIPRNetworkRequest)
+ when(mockExecution.getVariable(Prefix + "cloudRegionSdnc")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(Prefix + "serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56") // test ONLY
+ when(mockExecution.getVariable(Prefix + "networkId")).thenReturn("networkId")
+ when(mockExecution.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback")
+ 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)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.prepareRpcSDNCRequest(mockExecution)
+
+ // verify set prefix = Prefix + ""
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "assignSDNCRequest", assignRpcSDNCRequest)
+
+ }
+
+ @Test
+ //@Ignore
+ public void prepareSDNCRollbackRequest() {
+
+ println "************ prepareSDNCRollbackRequest ************* "
+
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedvIPRNetworkRequest)
+ when(mockExecution.getVariable(Prefix + "cloudRegionSdnc")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(Prefix + "serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable(Prefix + "assignSDNCResponse")).thenReturn(assignResponse)
+ when(mockExecution.getVariable(Prefix + "networkId")).thenReturn("8abc633a-810b-4ca5-8b3a-09511d13a2ce")
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback")
+ 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)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.prepareSDNCRollbackRequest(mockExecution)
+
+ // verify set prefix = Prefix + ""
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "rollbackSDNCRequest", sdncRollbackRequest)
+
+ }
+
+ @Test
+ //@Ignore
+ public void prepareRpcSDNCActivateRequest() {
+
+ println "************ prepareRpcSDNCActivateRequest ************* "
+
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedvIPRNetworkRequest)
+ when(mockExecution.getVariable(Prefix + "cloudRegionSdnc")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(Prefix + "serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable(Prefix + "networkId")).thenReturn("networkId")
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56") // test ONLY
+ when(mockExecution.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback")
+ 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)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.prepareRpcSDNCActivateRequest(mockExecution)
+
+ // verify set prefix = Prefix + ""
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "activateSDNCRequest", activateSDNCRequest)
+
+ }
+
+
+ @Test
+ //@Ignore
+ public void prepareRpcSDNCRollbackRequest() {
+
+ println "************ prepareRpcSDNCRollbackRequest ************* "
+
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedvIPRNetworkRequest)
+ when(mockExecution.getVariable(Prefix + "cloudRegionSdnc")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(Prefix + "serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable(Prefix + "assignSDNCResponse")).thenReturn(assignResponse)
+ when(mockExecution.getVariable(Prefix + "networkId")).thenReturn("8abc633a-810b-4ca5-8b3a-09511d13a2ce")
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56") // test ONLY
+ when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback")
+ 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)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.prepareRpcSDNCRollbackRequest(mockExecution)
+
+ // verify set prefix = Prefix + ""
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "rollbackSDNCRequest", sdncRpcRollbackRequest)
+
+ }
+
+ @Test
+ //@Ignore
+ public void prepareRpcSDNCActivateRollback() {
+
+ println "************ prepareRpcSDNCActivateRollback ************* "
+
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedvIPRNetworkRequest)
+ when(mockExecution.getVariable(Prefix + "cloudRegionSdnc")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(Prefix + "serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable(Prefix + "activateSDNCResponse")).thenReturn(assignResponse)
+ when(mockExecution.getVariable(Prefix + "networkId")).thenReturn("8abc633a-810b-4ca5-8b3a-09511d13a2ce")
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56") // test ONLY
+ when(mockExecution.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback")
+ 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)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.prepareRpcSDNCActivateRollback(mockExecution)
+
+ // verify set prefix = Prefix + ""
+ verify(mockExecution).setVariable("prefix", Prefix)
+ //verify(mockExecution).setVariable("mso-request-id", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ //verify(mockExecution).setVariable(Prefix + "requestId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ //verify(mockExecution).setVariable("mso-service-instance-id", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ verify(mockExecution).setVariable(Prefix + "rollbackActivateSDNCRequest", sdncActivateRollbackRequest)
+
+ }
+
+ @Test
+ //@Ignore
+ public void callRESTQueryAAINetworkName_200() {
+
+ println "************ callRESTQueryAAINetworkName ************* "
+
+ WireMock.reset();
+ MockGetNetworkByName("MNS-25180-L-01-dmz_direct_net_1", "CreateNetworkV2/createNetwork_queryName_AAIResponse_Success.xml");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(networkInputs)
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
+ when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
+ // old: when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_network_l3_network_uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
+ when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_l3_network_uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
+ 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(Execution execution)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.callRESTQueryAAINetworkName(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "queryNameAAIRequest", "http://localhost:8090/aai/v8/network/l3-networks/l3-network?network-name=MNS-25180-L-01-dmz_direct_net_1")
+
+ verify(mockExecution).setVariable(Prefix + "aaiNameReturnCode", "200")
+ verify(mockExecution).setVariable(Prefix + "orchestrationStatus", "PENDING-CREATE")
+
+ }
+
+ @Test
+ //@Ignore
+ public void callRESTQueryAAINetworkName_404() {
+
+ println "************ callRESTQueryAAINetworkName ************* "
+
+ WireMock.reset();
+ MockGetNetworkByName_404("CreateNetworkV2/createNetwork_queryName_AAIResponse_Success.xml", "myOwn_Network");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(networkInputs_404)
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
+ when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
+ // old: when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_network_l3_network_uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
+ when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_l3_network_uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
+ 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(Execution execution)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.callRESTQueryAAINetworkName(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(mockExecution)
+
+ verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "queryNameAAIRequest", "http://localhost:8090/aai/v8/network/l3-networks/l3-network?network-name=myOwn_Network")
+ verify(mockExecution).setVariable(Prefix + "aaiNameReturnCode", "404")
+
+ }
+
+ @Test
+ //@Ignore
+ public void callRESTQueryAAINetworkId_200() {
+
+ println "************ callRESTQueryAAINetworkId ************* "
+
+ WireMock.reset();
+ MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml", "1");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "assignSDNCResponse")).thenReturn(sdncAdapterWorkflowAssignResponse)
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
+ when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
+ // old: when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_network_l3_network_uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
+ when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_l3_network_uri")).thenReturn("/aai/v9/network/l3-networks/l3-network")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("sdncVersion")).thenReturn("1702")
+ 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(Execution execution)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.callRESTQueryAAINetworkId(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //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 + "aaiIdReturnCode", "200")
+
+ }
+
+ @Test
+ //@Ignore
+ public void callRESTQueryAAICloudRegion30_200() {
+
+ println "************ callRESTQueryAAICloudRegion30_200 ************* "
+
+ WireMock.reset();
+ MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix)
+ when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedvIPRNetworkRequest)
+ when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
+ // old: when(mockExecution.getVariable("URN_mso_workflow_default_aai_cloud_infrastructure_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
+ when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8")
+ when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
+ //
+ when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
+ when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
+
+ // preProcessRequest(Execution execution)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(mockExecution)
+
+ verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "queryCloudRegionRequest", "http://localhost:8090/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/RDM2WAGPLCP")
+ verify(mockExecution, atLeast(2)).setVariable(Prefix + "queryCloudRegionReturnCode", "200")
+ verify(mockExecution).setVariable(Prefix + "isCloudRegionGood", true)
+
+ }
+
+ @Test
+ //@Ignore
+ public void callRESTQueryAAICloudRegion25_200() {
+
+ println "************ callRESTQueryAAICloudRegion25_200 ************* "
+
+ WireMock.reset();
+ MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix)
+ when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedvIPRNetworkRequest)
+ when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
+ // old: when(mockExecution.getVariable("URN_mso_workflow_default_aai_cloud_infrastructure_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
+ when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8")
+ when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
+ //
+ when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
+ when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
+
+ // preProcessRequest(Execution execution)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(mockExecution)
+
+ verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "queryCloudRegionRequest", "http://localhost:8090/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/RDM2WAGPLCP")
+ verify(mockExecution, atLeast(2)).setVariable(Prefix + "queryCloudRegionReturnCode", "200")
+ verify(mockExecution).setVariable(Prefix + "isCloudRegionGood", true)
+
+ }
+
+ @Test
+ //@Ignore
+ public void callRESTQueryAAICloudRegion_NotFound() {
+
+ println "************ callRESTQueryAAICloudRegionFake ************* "
+
+ WireMock.reset();
+ MockGetNetworkCloudRegion_404("MDTWNJ21")
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix)
+ when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(vnfRequestFakeRegion)
+ when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
+ //old: when(mockExecution.getVariable("URN_mso_workflow_default_aai_cloud_infrastructure_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
+ when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8")
+ when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
+ //
+ 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(Execution execution)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(mockExecution)
+
+ verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "queryCloudRegionRequest", "http://localhost:8090/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/MDTWNJ21")
+ verify(mockExecution, atLeast(1)).setVariable(Prefix + "queryCloudRegionReturnCode", "404")
+ verify(mockExecution).setVariable(Prefix + "cloudRegionPo", "MDTWNJ21")
+ verify(mockExecution).setVariable(Prefix + "cloudRegionSdnc", "AAIAIC25")
+ verify(mockExecution).setVariable(Prefix + "isCloudRegionGood", true)
+
+ }
+
+ @Test
+ //@Ignore
+ public void callRESTQueryAAINetworkVpnBinding_200() {
+
+ println "************ callRESTQueryAAINetworkVpnBinding_200 ************* "
+
+ WireMock.reset();
+ MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
+ MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_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")
+ // old: when(mockExecution.getVariable("URN_mso_workflow_default_aai_network_vpn-binding_uri")).thenReturn("")
+ // old: when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_network_vpn-binding_uri")).thenReturn("")
+ 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(Execution execution)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(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() {
+
+ println "************ callRESTQueryAAINetworkVpnBinding_200 ************* "
+
+ WireMock.reset();
+ MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "queryIdAAIResponse")).thenReturn(queryIdAIIResponseTestScenario01)
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
+ when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
+ // old: when(mockExecution.getVariable("URN_mso_workflow_default_aai_network_vpn-binding_uri")).thenReturn("")
+ // old: when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_network_vpn-binding_uri")).thenReturn("")
+ 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(Execution execution)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "vpnCount", 1)
+ verify(mockExecution).setVariable(Prefix + "vpnBindings", ['/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/'])
+ // 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).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200")
+
+ }
+
+ @Test
+ //@Ignore
+ public void callRESTQueryAAINetworkVpnBinding_200_URN_Uri() {
+
+ println "************ callRESTQueryAAINetworkVpnBinding_200 ************* "
+
+ WireMock.reset();
+ MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
+ MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "queryIdAAIResponse")).thenReturn(queryIdAIIResponse)
+ 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_network_vpn_binding_uri")).thenReturn("/aai/v8/network/vpn-bindings/vpn-binding")
+ //when(mockExecution.getVariable("URN_mso_workflow_default_aai_network_vpn_binding_uri")).thenReturn("/aai/v8/network/vpn-bindings/vpn-binding")
+ 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(Execution execution)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(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_NotPresent() {
+
+ println "************ callRESTQueryAAINetworkVpnBinding_NotPresent ************* "
+
+ WireMock.reset();
+ MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
+
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+
+ when(mockExecution.getVariable(Prefix + "queryIdAAIResponse")).thenReturn(queryIdAIIResponseVpnNotPresent)
+ 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_default_aai_network_l3_network_uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
+ when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8")
+ when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_l3_network_uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
+ 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(Execution execution)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200")
+ verify(mockExecution).setVariable(Prefix + "vpnCount", 0)
+ verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIResponse", aaiVpnResponseStub)
+
+ }
+
+ @Test
+ //@Ignore
+ public void callRESTQueryAAINetworkPolicy_200() {
+
+ println "************ callRESTQueryAAINetworkPolicy_200 ************* "
+
+ WireMock.reset();
+ MockGetNetworkPolicy("CreateNetworkV2/createNetwork_queryNetworkPolicy_AAIResponse_Success.xml", "cee6d136-e378-4678-a024-2cd15f0ee0cg");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "queryIdAAIResponse")).thenReturn(queryIdAIIResponse)
+ 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_network_policy_uri")).thenReturn("")
+ // old: when(mockExecution.getVariable("URN_mso_workflow_default_aai_network_policy_uri")).thenReturn("/aai/v8/network/network-policies/network-policy")
+ when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8")
+ when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_network_policy_uri")).thenReturn("/aai/v8/network/network-policies/network-policy")
+ 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(Execution execution)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.callRESTQueryAAINetworkPolicy(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "networkPolicyCount", 1)
+ verify(mockExecution).setVariable(Prefix + "networkPolicyUriList", ['/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg'])
+ // the last vpnBinding value is saved.
+ verify(mockExecution).setVariable(Prefix + "queryNetworkPolicyAAIRequest", "http://localhost:8090/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg?depth=all")
+ verify(mockExecution).setVariable(Prefix + "aaiQqueryNetworkPolicyReturnCode", "200")
+
+ }
+
+ @Test
+ //@Ignore
+ public void callRESTQueryAAINetworkTableRef_200() {
+
+ println "************ callRESTQueryAAINetworkTableRef_200 ************* "
+
+ WireMock.reset();
+ MockGetNetworkTableReference("CreateNetworkV2/createNetwork_queryNetworkTableRef1_AAIResponse_Success.xml", "refFQDN1");
+ MockGetNetworkTableReference("CreateNetworkV2/createNetwork_queryNetworkTableRef2_AAIResponse_Success.xml", "refFQDN2");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "queryIdAAIResponse")).thenReturn(queryIdAIIResponse)
+ 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_default_aai_network_table_reference_uri")).thenReturn("")
+ // old: when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_network_table_reference_uri")).thenReturn("")
+ when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_route_table_reference_uri")).thenReturn("/aai/v8/network/route-table-references/route-table-reference")
+ 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(Execution execution)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.callRESTQueryAAINetworkTableRef(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "networkTableRefCount", 2)
+ verify(mockExecution).setVariable(Prefix + "networkTableRefUriList", ['/aai/v8/network/route-table-references/route-table-reference/refFQDN1','/aai/v8/network/route-table-references/route-table-reference/refFQDN2'])
+ // the last vpnBinding value is saved.
+ verify(mockExecution).setVariable(Prefix + "queryNetworkTableRefAAIRequest", "http://localhost:8090/aai/v8/network/route-table-references/route-table-reference/refFQDN1?depth=all")
+ verify(mockExecution, atLeast(2)).setVariable(Prefix + "aaiQqueryNetworkTableRefReturnCode", "200")
+
+ }
+
+ @Test
+ //@Ignore
+ public void callRESTReQueryAAINetworkId_200() {
+
+ println "************ callRESTReQueryAAINetworkId ************* "
+
+ WireMock.reset();
+ MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml", "1");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "networkId")).thenReturn("49c86598-f766-46f8-84f8-8d1c1b10f9b4")
+ 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_default_aai_l3_network_version")).thenReturn("8")
+ when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_l3_network_uri")).thenReturn("/aai/v9/network/l3-networks/l3-network")
+ //old: when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_network_l3_network_uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("sdncVersion")).thenReturn("1702")
+ 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(Execution execution)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.callRESTReQueryAAINetworkId(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //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 + "aaiRequeryIdReturnCode", "200")
+
+ }
+
+ @Test
+ //@Ignore
+ public void callRESTUpdateContrailAAINetworkREST_200() {
+
+ println "************ callRESTUpdateContrailAAINetwork ************* "
+
+ WireMock.reset();
+ MockPutNetworkIdWithDepth("CreateNetworkV2/createNetwork_updateContrail_AAIResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "1");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "networkId")).thenReturn("49c86598-f766-46f8-84f8-8d1c1b10f9b4")
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse)
+ when(mockExecution.getVariable(Prefix + "createNetworkResponse")).thenReturn(createNetworkResponseREST)
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
+ when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
+ // old: when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_network_l3_network_uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
+ when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_l3_network_uri")).thenReturn("/aai/v9/network/l3-networks/l3-network")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("false")
+ 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(Execution execution)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.callRESTUpdateContrailAAINetwork(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //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 + "updateContrailAAIPayloadRequest", updateContrailAAIPayloadRequest)
+ verify(mockExecution).setVariable(Prefix + "aaiUpdateContrailReturnCode", "200")
+ //verify(mockExecution).setVariable(Prefix + "updateContrailAAIResponse", updateContrailAAIResponse)
+ verify(mockExecution).setVariable(Prefix + "isPONR", true)
+
+ }
+
+ @Test
+ //@Ignore
+ public void callRESTUpdateContrailAAINetworkREST_200_segmentation() {
+
+ println "************ callRESTUpdateContrailAAINetwork ************* "
+
+ WireMock.reset();
+ MockPutNetworkIdWithDepth("CreateNetworkV2/createNetwork_updateContrail_AAIResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "1");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "networkId")).thenReturn("49c86598-f766-46f8-84f8-8d1c1b10f9b4")
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse_segmentation)
+ when(mockExecution.getVariable(Prefix + "createNetworkResponse")).thenReturn(createNetworkResponseREST)
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
+ when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
+ // old: when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_network_l3_network_uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
+ when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_l3_network_uri")).thenReturn("/aai/v9/network/l3-networks/l3-network")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("false")
+ 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(Execution execution)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.callRESTUpdateContrailAAINetwork(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //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 + "updateContrailAAIPayloadRequest", updateContrailAAIPayloadRequest_segmentation)
+ verify(mockExecution).setVariable(Prefix + "aaiUpdateContrailReturnCode", "200")
+ //verify(mockExecution).setVariable(Prefix + "updateContrailAAIResponse", updateContrailAAIResponse)
+ verify(mockExecution).setVariable(Prefix + "isPONR", true)
+
+ }
+
+
+
+ @Test
+ //@Ignore
+ public void validateCreateNetworkResponseREST() {
+
+ println "************ validateNetworkResponse ************* "
+
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "createNetworkResponse")).thenReturn(createNetworkResponseREST)
+ when(mockExecution.getVariable(Prefix + "networkReturnCode")).thenReturn('200')
+
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.validateCreateNetworkResponse(mockExecution)
+
+ //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
+ //debugger.printInvocations(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "createNetworkResponse", createNetworkResponseREST)
+ verify(mockExecution).setVariable(Prefix + "isNetworkRollbackNeeded", true)
+ verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", createRollbackNetworkRequest)
+
+ }
+
+ @Test
+ //@Ignore
+ public void validateCreateNetworkResponseREST_Error() {
+
+ println "************ validateNetworkResponse ************* "
+
+ WorkflowException workflowException = new WorkflowException("DoCreateNetworkInstance", 2500, "Received error from Network Adapter: JBWEB000065: HTTP Status 500.")
+
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "createNetworkResponse")).thenReturn(networkException500)
+ when(mockExecution.getVariable(Prefix + "networkReturnCode")).thenReturn('500')
+
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ try {
+ DoCreateNetworkInstance.validateCreateNetworkResponse(mockExecution)
+ } catch (Exception ex) {
+ println " Test End - Handle catch-throw BpmnError()! "
+ }
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution, atLeast(1)).setVariable("WorkflowException", refEq(workflowException, any(WorkflowException.class)))
+
+ }
+
+ @Test
+ //@Ignore
+ public void validateSDNCResponse() {
+
+ println "************ validateSDNCResponse ************* "
+
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "assignSDNCResponse")).thenReturn(sdncAdapterWorkflowResponse)
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
+ when(mockExecution.getVariable("SDNCA_SuccessIndicator")).thenReturn(true)
+ when(mockExecution.getVariable(Prefix + "sdncReturnCode")).thenReturn("200")
+ when(mockExecution.getVariable(Prefix + "isResponseGood")).thenReturn(true)
+
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ try {
+ DoCreateNetworkInstance.validateSDNCResponse(mockExecution)
+ verify(mockExecution).setVariable(Prefix + "isSdncRollbackNeeded", true)
+
+ } catch (Exception ex) {
+ println " Graceful Exit - " + ex.getMessage()
+ }
+ //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
+ //debugger.printInvocations(mockExecution)
+
+ //verify(mockExecution).setVariable(Prefix + "isSdncRollbackNeeded", true)
+
+ }
+
+ @Test
+ //@Ignore
+ public void validateSDNCResponse_Error() {
+
+ println "************ validateSDNCResponse ************* "
+
+ WorkflowException workflowException = new WorkflowException("DoCreateNetworkInstance", 2500, "Received error from SNDC Adapter: HTTP Status 500.")
+
+ //ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "assignSDNCResponse")).thenReturn(sdncAdapterWorkflowResponse_Error)
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
+ when(mockExecution.getVariable("SDNCA_SuccessIndicator")).thenReturn(false)
+ when(mockExecution.getVariable(Prefix + "sdncReturnCode")).thenReturn("200")
+ when(mockExecution.getVariable("WorkflowException")).thenReturn(workflowException)
+
+
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ try {
+ DoCreateNetworkInstance.validateSDNCResponse(mockExecution)
+ } catch (Exception ex) {
+ println " Graceful Exit! - " + ex.getMessage()
+ }
+ //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
+ //debugger.printInvocations(mockExecution)
+
+ // verify set prefix = Prefix + ""
+ //verify(mockExecution).setVariable(Prefix + "sdncResponseSuccess", false)
+
+ }
+
+ @Test
+ //@Ignore
+ public void validateRpcSDNCActivateResponse() {
+
+ println "************ validateRpcSDNCActivateResponse ************* "
+
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "activateSDNCResponse")).thenReturn(sdncAdapterWorkflowResponse)
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
+ when(mockExecution.getVariable("SDNCA_SuccessIndicator")).thenReturn(true)
+ when(mockExecution.getVariable(Prefix + "sdncActivateReturnCode")).thenReturn("200")
+
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ try {
+ DoCreateNetworkInstance.validateRpcSDNCActivateResponse(mockExecution)
+ verify(mockExecution).setVariable(Prefix + "isSdncActivateRollbackNeeded", true)
+
+ } catch (Exception ex) {
+ println " Graceful Exit - " + ex.getMessage()
+ }
+ //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
+ //debugger.printInvocations(mockExecution)
+
+ //verify(mockExecution).setVariable(Prefix + "isSdncRollbackNeeded", true)
+
+ }
+
+ @Test
+ //@Ignore
+ public void prepareRollbackData() {
+
+ println "************ prepareRollbackData() ************* "
+
+
+
+ WorkflowException workflowException = new WorkflowException("DoCreateNetworkInstance", 2500, "Received error from Network Adapter: JBWEB000065: HTTP Status 500.")
+
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn(rollbackSDNCRequest)
+ when(mockExecution.getVariable(Prefix + "rollbackActivateSDNCRequest")).thenReturn(rollbackActivateSDNCRequest)
+ when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn(rollbackNetworkRequest)
+ when(mockExecution.getVariable("WorkflowException")).thenReturn(workflowException)
+
+ // preProcessRequest(Execution execution)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.prepareRollbackData(mockExecution)
+
+ verify(mockExecution).getVariable("isDebugLogEnabled")
+ verify(mockExecution).setVariable("prefix", Prefix)
+
+ }
+
+ @Test
+ @Ignore
+ public void postProcessResponse() {
+
+ println "************ postProcessResponse() ************* "
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "isException")).thenReturn(false)
+ when(mockExecution.getVariable("sdncVersion")).thenReturn("1702")
+ when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn(sdncRpcRollbackRequest)
+ when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn(rollbackSDNCRequest)
+ when(mockExecution.getVariable(Prefix + "rollbackActivateSDNCRequest")).thenReturn(sdncActivateRollbackRequest)
+
+
+ // preProcessRequest(Execution execution)
+ DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
+ DoCreateNetworkInstance.postProcessResponse(mockExecution)
+
+ verify(mockExecution).getVariable("isDebugLogEnabled")
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "Success", true)
+
+ }
+
+ private ExecutionEntity setupMock() {
+
+ ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class)
+ when(mockProcessDefinition.getKey()).thenReturn("DoCreateNetworkInstance")
+ RepositoryService mockRepositoryService = mock(RepositoryService.class)
+ when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition)
+ when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("DoCreateNetworkInstance")
+ 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("DoCreateNetworkInstance")
+ when(mockExecution.getProcessInstanceId()).thenReturn("DoCreateNetworkInstance")
+ 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/DoCreateVfModuleVolumeV1Test.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeV1Test.groovy
deleted file mode 100644
index e9c27b040a..0000000000
--- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeV1Test.groovy
+++ /dev/null
@@ -1,218 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * OPENECOMP - MSO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.bpmn.infrastructure.scripts;
-
-import static org.junit.Assert.*
-import static org.mockito.Mockito.*
-
-import org.apache.commons.lang3.*
-import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
-import org.junit.Assert
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.mockito.ArgumentCaptor
-import org.mockito.MockitoAnnotations
-import org.mockito.runners.MockitoJUnitRunner
-import org.openecomp.mso.bpmn.common.scripts.MsoGroovyTest
-
-
-@RunWith(MockitoJUnitRunner.class)
-class DoCreateVfModuleVolumeV1Test extends MsoGroovyTest {
-
- def volumeRequest =
-"""<volume-request xmlns="http://org.openecomp/mso/infra/vnf-request/v1" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <request-info>
- <test-data-only>123abc</test-data-only> <!-- don't remove this tag. Its used for junit test -->
- <request-id>d8d4fcfa-fd7e-4413-b19d-c95aa67291b8</request-id>
- <action>CREATE_VF_MODULE_VOL</action>
- <source>SoapUI-bns-create-base-vol-1001-1</source>
- </request-info>
- <volume-inputs>
- <vnf-type>Test/vSAMP12</vnf-type>
- <vf-module-model-name>vSAMP12::base::module-0</vf-module-model-name>
- <backout-on-failure>true</backout-on-failure>
- <asdc-service-model-version>2.0</asdc-service-model-version>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <aic-cloud-region>MDTWNJ21</aic-cloud-region>
- <tenant-id>897deadc2b954a6bac6d3c197fb3525e</tenant-id>
- <volume-group-name>MSOTESTVOL101a-vSAMP12_base_vol_module-0</volume-group-name>
- <volume-group-id/>
- </volume-inputs>
- <volume-params>
- <param name="param1">value1</param>"
- <param name="param2">value2</param>"
- <param name="param3">value3</param>"
- </volume-params>
-</volume-request>"""
-
- def genericVnfResponseXml = """
-<generic-vnf xmlns="http://org.openecomp.aai.inventory/v8">
- <vnf-id>TEST-VNF-ID-0123</vnf-id>
- <vnf-name>STMTN5MMSC20</vnf-name>
- <vnf-type>pcrf-capacity</vnf-type>
- <service-id>SDN-MOBILITY</service-id>
- <equipment-role>vPCRF</equipment-role>
- <orchestration-status>pending-create</orchestration-status>
- <in-maint>false</in-maint>
- <is-closed-loop-disabled>false</is-closed-loop-disabled>
- <persona-model-id>introvert</persona-model-id>
- <persona-model-version>2.0</persona-model-version>
- <resource-version>0000020</resource-version>
- <vf-modules>
- <vf-module>
- <vf-module-id>lukewarm</vf-module-id>
- <vf-module-name>PCRF::module-0-0</vf-module-name>
- <persona-model-id>introvert</persona-model-id>
- <persona-model-version>2.0</persona-model-version>
- <is-base-vf-module>true</is-base-vf-module>
- <heat-stack-id>fastburn</heat-stack-id>
- <orchestration-status>pending-create</orchestration-status>
- <resource-version>0000074</resource-version>
- </vf-module>
- <vf-module>
- <vf-module-id>supercool</vf-module-id>
- <vf-module-name>PCRF::module-1-0</vf-module-name>
- <persona-model-id>extrovert</persona-model-id>
- <persona-model-version>2.0</persona-model-version>
- <is-base-vf-module>false</is-base-vf-module>
- <heat-stack-id>slowburn</heat-stack-id>
- <orchestration-status>pending-create</orchestration-status>
- <resource-version>0000075</resource-version>
- </vf-module>
- </vf-modules>
- <relationship-list/>
- <l-interfaces/>
- <lag-interfaces/>
-</generic-vnf>
-"""
- def String expectedCreateVnfRequestXml = """<createVolumeGroupRequest>
- <cloudSiteId>MDTWNJ21</cloudSiteId>
- <tenantId>897deadc2b954a6bac6d3c197fb3525e</tenantId>
- <vnfId>TEST-VNF-ID-0123</vnfId>
- <vnfName>STMTN5MMSC20</vnfName>
- <volumeGroupId>test-vol-group-id-123</volumeGroupId>
- <volumeGroupName>MSOTESTVOL101a-vSAMP12_base_vol_module-0</volumeGroupName>
- <vnfType>Test/vSAMP12</vnfType>
- <vnfVersion>2.0</vnfVersion>
- <vfModuleType>vSAMP12::base::module-0</vfModuleType>
- <modelCustomizationUuid/>
- <volumeGroupParams>
- <entry>
- <key>vnf_id</key>
- <value>TEST-VNF-ID-0123</value>
- </entry>
- <entry>
- <key>vnf_name</key>
- <value>STMTN5MMSC20</value>
- </entry>
- <entry>
- <key>vf_module_id</key>
- <value>test-vol-group-id-123</value>
- </entry>
- <entry>
- <key>vf_module_name</key>
- <value>MSOTESTVOL101a-vSAMP12_base_vol_module-0</value>
- </entry>
- <entry>
- <key>param1</key>
- <value>value1</value>
- </entry>
- <entry>
- <key>param2</key>
- <value>value2</value>
- </entry>
- <entry>
- <key>param3</key>
- <value>value3</value>
- </entry>
- </volumeGroupParams>
- <skipAAI>true</skipAAI>
- <backout>true</backout>
- <failIfExists>true</failIfExists>
- <msoRequest>
- <requestId>d8d4fcfa-fd7e-4413-b19d-c95aa67291b8</requestId>
- <serviceInstanceId>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</serviceInstanceId>
- </msoRequest>
- <messageId>111</messageId>
- <notificationUrl>http://localhost:28080/mso/WorkflowMessage/12345678</notificationUrl>
-</createVolumeGroupRequest>
-"""
-
- @Before
- public void init()
- {
- MockitoAnnotations.initMocks(this)
-
- }
-
- @Test
- public void TestPreProcessRequest() {
-
- ExecutionEntity mockExecution = setupMock('DoCreateVfModuleVolumeV1')
-
- when(mockExecution.getVariable("DoCreateVfModuleVolumeV1Request")).thenReturn(volumeRequest)
- when(mockExecution.getVariable("vnf-id")).thenReturn('test-vnf-id-123')
- when(mockExecution.getVariable("volume-group-id")).thenReturn('test-volume-group-id-123')
- when(mockExecution.getVariable("mso-request-id")).thenReturn('test-request-id-123')
-
- DoCreateVfModuleVolumeV1 myprocess = new DoCreateVfModuleVolumeV1()
- myprocess.preProcessRequest(mockExecution, 'true')
-
- verify(mockExecution).setVariable('DCVFMODVOLV1_serviceId', 'a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb')
- verify(mockExecution).setVariable('DCVFMODVOLV1_source', 'SoapUI-bns-create-base-vol-1001-1')
- verify(mockExecution, times(7)).setVariable(anyString(), anyString())
- }
-
- @Test
- public void TestPrepareVnfAdapterCreateRequest() {
-
- ExecutionEntity mockExecution = setupMock('DoCreateVfModuleVolumeV1')
-
- when(mockExecution.getVariable("DCVFMODVOLV1_Request")).thenReturn(volumeRequest)
- when(mockExecution.getVariable("DCVFMODVOLV1_requestId")).thenReturn('d8d4fcfa-fd7e-4413-b19d-c95aa67291b8')
- when(mockExecution.getVariable("DCVFMODVOLV1_serviceId")).thenReturn('a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb')
- when(mockExecution.getVariable("DCVFMODVOLV1_AAIQueryGenericVfnResponse")).thenReturn(genericVnfResponseXml)
- when(mockExecution.getVariable("DCVFMODVOLV1_rollbackEnabled")).thenReturn(true)
- when(mockExecution.getVariable("volume-group-id")).thenReturn('test-vol-group-id-123')
- when(mockExecution.getVariable("URN_mso_workflow_message_endpoint")).thenReturn('http://localhost:28080/mso/WorkflowMessage')
- when(mockExecution.getVariable("URN_mso_use_qualified_host")).thenReturn(true)
-
- DoCreateVfModuleVolumeV1 myprocess = new DoCreateVfModuleVolumeV1()
- myprocess.prepareVnfAdapterCreateRequest(mockExecution, 'true')
-
- // Capture the arguments to setVariable
- ArgumentCaptor<String> captor1 = ArgumentCaptor.forClass(String.class);
- ArgumentCaptor<String> captor2 = ArgumentCaptor.forClass(String.class);
-
- verify(mockExecution, times(2)).setVariable(captor1.capture(), captor2.capture())
-
- List<String> arg2List = captor2.getAllValues()
- String createVnfRequestXml = arg2List.get(0)
-
- //replace messageID value because it is random generated
- createVnfRequestXml = createVnfRequestXml.replaceAll("<messageId>(.+?)</messageId>", "<messageId>111</messageId>")
- .replaceAll("<notificationUrl>(.+?)</notificationUrl>", "<notificationUrl>http://localhost:28080/mso/WorkflowMessage/12345678</notificationUrl>")
-
- Assert.assertEquals(expectedCreateVnfRequestXml.trim(), createVnfRequestXml.trim())
- }
-
-}
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
new file mode 100644
index 0000000000..96a84deb26
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollbackTest.groovy
@@ -0,0 +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 =
+ """<NetworkAdapter:rollbackNetwork xmlns:NetworkAdapter="http://org.openecomp.mso/network">
+ <rollback>
+ <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
+ <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
+ <networkStackId/>
+ <networkType>CONTRAIL_EXTERNAL</networkType>
+ <networkCreated>true</networkCreated>
+ <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
+ <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
+ <msoRequest>
+ <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId>
+ <serviceInstanceId/>
+ </msoRequest>
+ </rollback>
+</NetworkAdapter:rollbackNetwork>"""
+
+ String rollbackDeActivateSDNCRequest =
+ """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:ns5="http://org.openecomp/mso/request/types/v1"
+ xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>activate</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
+ <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
+ </sdncadapter:RequestHeader>
+ <aetgt:SDNCRequestData>
+ <request-information>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <request-action>CreateNetworkInstance</request-action>
+ <source>VID</source>
+ <notification-url/>
+ <order-number/>
+ <order-version/>
+ </request-information>
+ <service-information>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <service-type>MSO-dev-service-type</service-type>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ <subscriber-name>MSO_1610_dev</subscriber-name>
+ </service-information>
+ <network-information>
+ <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <ecomp-model-information>
+ <model-invariant-uuid>invariant-uuid</model-invariant-uuid>
+ <model-customization-uuid>customization-uuid</model-customization-uuid>
+ <model-uuid>uuid</model-uuid>
+ <model-version>version</model-version>
+ <model-name>CONTRAIL_EXTERNAL</model-name>
+ </ecomp-model-information>
+ </network-information>
+ <network-request-information>
+ <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <tenant>7dd5365547234ee8937416c65507d266</tenant>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ </network-request-information>
+ </aetgt:SDNCRequestData>
+</aetgt:SDNCAdapterWorkflowRequest>"""
+
+ String rollbackSDNCRequest =
+ """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:ns5="http://org.openecomp/mso/request/types/v1"
+ xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>rollback</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
+ </sdncadapter:RequestHeader>
+ <aetgt:SDNCRequestData>
+ <request-information>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <request-action>CreateNetworkInstance</request-action>
+ <source>VID</source>
+ <notification-url/>
+ <order-number/>
+ <order-version/>
+ </request-information>
+ <service-information>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <service-type>MSO-dev-service-type</service-type>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ <subscriber-name>MSO_1610_dev</subscriber-name>
+ </service-information>
+ <network-information>
+ <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <ecomp-model-information>
+ <model-invariant-uuid>invariant-uuid</model-invariant-uuid>
+ <model-customization-uuid>customization-uuid</model-customization-uuid>
+ <model-uuid>uuid</model-uuid>
+ <model-version>version</model-version>
+ <model-name>CONTRAIL_EXTERNAL</model-name>
+ </ecomp-model-information>
+ </network-information>
+ <network-request-information>
+ <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <tenant>7dd5365547234ee8937416c65507d266</tenant>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ </network-request-information>
+ </aetgt:SDNCRequestData>
+</aetgt:SDNCAdapterWorkflowRequest>"""
+
+// - - - - - - - -
+
+
+ @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<String, String> rollbackData = new HashMap<String, String>();
+ 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<String, String> rollbackData = new HashMap<String, String>();
+ 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
new file mode 100644
index 0000000000..0f87b6400e
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceTest.groovy
@@ -0,0 +1,1929 @@
+package org.openecomp.mso.bpmn.infrastructure.scripts
+
+import static org.mockito.Mockito.*
+
+import static org.openecomp.mso.bpmn.mock.StubResponseNetworkAdapter.MockNetworkAdapter;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkByIdWithDepth;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkCloudRegion;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkCloudRegion_404;
+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.Ignore
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.MockitoAnnotations
+import org.mockito.runners.MockitoJUnitRunner
+import org.openecomp.mso.bpmn.common.scripts.MsoUtils
+import org.openecomp.mso.bpmn.core.WorkflowException
+
+import com.github.tomakehurst.wiremock.client.WireMock
+import com.github.tomakehurst.wiremock.junit.WireMockRule
+import org.apache.commons.lang3.*
+
+
+@RunWith(MockitoJUnitRunner.class)
+class DoDeleteNetworkInstanceTest {
+
+ @Rule
+ public WireMockRule wireMockRule = new WireMockRule(8090);
+
+ def utils = new MsoUtils()
+ String Prefix="DELNWKI_"
+
+ String incomingJsonRequest =
+ """{ "requestDetails": {
+ "modelInfo": {
+ "modelType": "network",
+ "modelCustomizationId": "f21df226-8093-48c3-be7e-0408fcda0422",
+ "modelName": "CONTRAIL_EXTERNAL",
+ "modelVersion": "1.0"
+ },
+ "cloudConfiguration": {
+ "lcpCloudRegionId": "RDM2WAGPLCP",
+ "tenantId": "7dd5365547234ee8937416c65507d266"
+ },
+ "requestInfo": {
+ "instanceName": "HSL_direct_net_2",
+ "source": "VID",
+ "callbackUrl": "",
+ "suppressRollback": true,
+ "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"
+ },
+ "relatedInstanceList": [
+ {
+ "relatedInstance": {
+ "instanceId": "f70e927b-6087-4974-9ef8-c5e4d5847ca4",
+ "modelInfo": {
+ "modelType": "serviceT",
+ "modelId": "modelI",
+ "modelNameVersionId": "modelNameVersionI",
+ "modelName": "modleNam",
+ "modelVersion": "1"
+ }
+ }
+ }
+ ],
+ "requestParameters": {
+ "userParams": []
+ }
+ }"""
+
+ String expectedDoDeleteNetworkInstanceRequest =
+ """{ "requestDetails": {
+ "modelInfo": {
+ "modelType": "networkTyp",
+ "modelId": "modelId",
+ "modelNameVersionId": "modelNameVersionId",
+ "modelName": "CONTRAIL_EXTERNAL",
+ "modelVersion": "1"
+ },
+ "cloudConfiguration": {
+ "lcpCloudRegionId": "RDM2WAGPLCP",
+ "tenantId": "7dd5365547234ee8937416c65507d266"
+ },
+ "requestInfo": {
+ "instanceName": "HSL_direct_net_2",
+ "source": "VID",
+ "callbackUrl": "",
+ "suppressRollback": true,
+ "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"
+ },
+ "relatedInstanceList": [
+ {
+ "relatedInstance": {
+ "instanceId": "f70e927b-6087-4974-9ef8-c5e4d5847ca4",
+ "modelInfo": {
+ "modelType": "serviceT",
+ "modelId": "modelI",
+ "modelNameVersionId": "modelNameVersionI",
+ "modelName": "modleNam",
+ "modelVersion": "1"
+ }
+ }
+ }
+ ],
+ "requestParameters": {
+ "userParams": []
+ }
+ }"""
+
+ // expectedVnfRequest
+ String expectedNetworkRequest =
+"""<network-request xmlns="http://www.w3.org/2001/XMLSchema">
+ <request-info>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <action>DELETE</action>
+ <source>VID</source>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ </request-info>
+ <network-inputs>
+ <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
+ <network-name>HSL_direct_net_2</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <modelCustomizationId>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationId>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <backout-on-failure>false</backout-on-failure>
+ <sdncVersion>1610</sdncVersion>
+ </network-inputs>
+ <network-params/>
+</network-request>"""
+
+ String expectedVperNetworkRequest =
+"""<network-request xmlns="http://www.w3.org/2001/XMLSchema">
+ <request-info>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <action>DELETE</action>
+ <source>VID</source>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ </request-info>
+ <network-inputs>
+ <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <subscription-service-type>MSO-dev-service-type</subscription-service-type>
+ <global-customer-id>globalId_45678905678</global-customer-id>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <backout-on-failure>false</backout-on-failure>
+ <failIfExist>false</failIfExist>
+ <networkModelInfo>
+ <modelName>CONTRAIL_EXTERNAL</modelName>
+ <modelUuid>sn5256d1-5a33-55df-13ab-12abad84e111</modelUuid>
+ <modelInvariantUuid>sn5256d1-5a33-55df-13ab-12abad84e764</modelInvariantUuid>
+ <modelVersion>1</modelVersion>
+ <modelCustomizationUuid>sn5256d1-5a33-55df-13ab-12abad84e222</modelCustomizationUuid>
+ </networkModelInfo>
+ <serviceModelInfo>
+ <modelName/>
+ <modelUuid/>
+ <modelInvariantUuid/>
+ <modelVersion/>
+ <modelCustomizationUuid/>
+ </serviceModelInfo>
+ <sdncVersion>1702</sdncVersion>
+ </network-inputs>
+ <network-params/>
+</network-request>"""
+
+ String expected_networkInput =
+ """<network-inputs xmlns="http://www.w3.org/2001/XMLSchema">
+ <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
+ <network-name>HSL_direct_net_2</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <modelCustomizationId>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationId>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <backout-on-failure>false</backout-on-failure>
+ <sdncVersion>1610</sdncVersion>
+</network-inputs>"""
+
+ String expectedVper_networkInput =
+"""<network-inputs xmlns="http://www.w3.org/2001/XMLSchema">
+ <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <subscription-service-type>MSO-dev-service-type</subscription-service-type>
+ <global-customer-id>globalId_45678905678</global-customer-id>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <backout-on-failure>false</backout-on-failure>
+ <failIfExist>false</failIfExist>
+ <networkModelInfo>
+ <modelName>CONTRAIL_EXTERNAL</modelName>
+ <modelUuid>sn5256d1-5a33-55df-13ab-12abad84e111</modelUuid>
+ <modelInvariantUuid>sn5256d1-5a33-55df-13ab-12abad84e764</modelInvariantUuid>
+ <modelVersion>1</modelVersion>
+ <modelCustomizationUuid>sn5256d1-5a33-55df-13ab-12abad84e222</modelCustomizationUuid>
+ </networkModelInfo>
+ <serviceModelInfo>
+ <modelName/>
+ <modelUuid/>
+ <modelInvariantUuid/>
+ <modelVersion/>
+ <modelCustomizationUuid/>
+ </serviceModelInfo>
+ <sdncVersion>1702</sdncVersion>
+</network-inputs>"""
+
+// emptyRegionVnfRequest
+String emptyRegionVnfRequest =
+"""<network-request xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
+ <request-info>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <action>DELETE</action>
+ <source>PORTAL</source>
+ </request-info>
+ <network-inputs>
+ <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
+ <network-name>HSL_direct_net_2</network-name>
+ <network-type>CONTRAIL_BASIC</network-type>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <aic-cloud-region/>
+ <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
+ </network-inputs>
+ <network-params>
+ <param name="shared">0</param>
+ </network-params>
+</network-request>"""
+
+String vnfRequestCloudRegionNotFound =
+"""<network-request xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
+ <request-info>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <action>DELETE</action>
+ <source>PORTAL</source>
+ </request-info>
+ <network-inputs>
+ <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
+ <network-name>HSL_direct_net_2</network-name>
+ <network-type>CONTRAIL_BASIC</network-type>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <aic-cloud-region>MDTWNJ21</aic-cloud-region>
+ <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
+ </network-inputs>
+ <network-params>
+ <param name="shared">0</param>
+ </network-params>
+</network-request>"""
+
+ String vnfPayload =
+ """<rest:payload xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ contentType="text/xml">
+ <network-request xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
+ <request-info>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <action>DELETE</action>
+ <source>PORTAL</source>
+ </request-info>
+ <network-inputs>
+ <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
+ <network-name>HSL_direct_net_2</network-name>
+ <network-type>CONTRAIL_BASIC</network-type>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
+ </network-inputs>
+ <network-params>
+ <param name="shared">0</param>
+ </network-params>
+ </network-request>
+</rest:payload>"""
+
+ String vnfPayload_MissingId =
+"""<rest:payload xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ contentType="text/xml">
+ <network-request xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
+ <request-info>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <action>DELETE</action>
+ <source>PORTAL</source>
+ </request-info>
+ <network-inputs>
+ <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
+ <network-name/>
+ <network-type>CONTRAIL_BASIC</network-type>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
+ </network-inputs>
+ <network-params>
+ <param name="shared">0</param>
+ </network-params>
+ </network-request>
+</rest:payload>"""
+
+ String vnfRequestRESTPayload =
+"""<network-request xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
+ <request-info>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <action>DELETE</action>
+ <source>PORTAL</source>
+ </request-info>
+ <network-inputs>
+ <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
+ <network-name>HSL_direct_net_2</network-name>
+ <network-type>CONTRAIL_BASIC</network-type>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
+ </network-inputs>
+ <network-outputs>
+ <network-id>id</network-id>
+ <network-name>name</network-name>
+ </network-outputs>
+ <network-params>
+ <param name="shared">0</param>
+ </network-params>
+ </network-request>"""
+
+
+String incomingRequestMissingCloudRegion =
+"""{ "requestDetails": {
+ "modelInfo": {
+ "modelType": "network",
+ "modelCustomizationId": "f21df226-8093-48c3-be7e-0408fcda0422",
+ "modelName": "CONTRAIL_EXTERNAL",
+ "modelVersion": "1.0"
+ },
+ "cloudConfiguration": {
+ "tenantId": "7dd5365547234ee8937416c65507d266"
+ },
+ "requestInfo": {
+ "instanceName": "HSL_direct_net_2",
+ "source": "VID",
+ "callbackUrl": "",
+ "suppressRollback": true,
+ "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"
+ },
+ "relatedInstanceList": [
+ {
+ "relatedInstance": {
+ "instanceId": "f70e927b-6087-4974-9ef8-c5e4d5847ca4",
+ "modelInfo": {
+ "modelType": "serviceT",
+ "modelId": "modelI",
+ "modelNameVersionId": "modelNameVersionI",
+ "modelName": "modleNam",
+ "modelVersion": "1"
+ }
+ }
+ }
+ ],
+ "requestParameters": {
+ "userParams": []
+ }
+ }"""
+
+ String expectedNetworkRequestMissingId =
+ """<network-request xmlns="http://www.w3.org/2001/XMLSchema">
+ <request-info>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <action>DELETE</action>
+ <source>VID</source>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ </request-info>
+ <network-inputs>
+ <network-id/>
+ <network-name>HSL_direct_net_2</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <modelCustomizationId>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationId>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <backout-on-failure>false</backout-on-failure>
+ <sdncVersion>1610</sdncVersion>
+ </network-inputs>
+ <network-params/>
+</network-request>"""
+
+String expectedNetworkRequestMissingCloudRegion =
+"""<network-request xmlns="http://www.w3.org/2001/XMLSchema">
+ <request-info>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <action>DELETE</action>
+ <source>VID</source>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ </request-info>
+ <network-inputs>
+ <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
+ <network-name>HSL_direct_net_2</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <modelCustomizationId>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationId>
+ <aic-cloud-region>null</aic-cloud-region>
+ <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <backout-on-failure>false</backout-on-failure>
+ <sdncVersion>1610</sdncVersion>
+ </network-inputs>
+ <network-params/>
+</network-request>"""
+
+ // vnfRESTRequest
+ String vnfRESTRequest =
+"""<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ statusCode="200">
+ <rest:payload contentType="text/xml">
+ <network-request>
+ <request-info>
+ <action>DELETE</action>
+ <source>VID</source>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ </request-info>
+ <network-inputs>
+ <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
+ <network-name>HSL_direct_net_2</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <backout-on-failure>true</backout-on-failure>
+ </network-inputs>
+ <network-params>
+ <userParams/>
+ </network-params>
+ </network-request>
+ </rest:payload>
+</rest:RESTResponse>"""
+
+ String networkInputs =
+ """<network-inputs xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
+ <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
+ <network-name>HSL_direct_net_2</network-name>
+ <network-type>CONTRAIL_BASIC</network-type>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
+</network-inputs>"""
+
+String networkInputsNoType =
+"""<network-inputs xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
+ <network-id></network-id>
+ <network-name></network-name>
+ <network-type></network-type>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
+</network-inputs>"""
+
+ String networkInputsMissingId =
+ """<network-inputs xmlns="http://www.w3.org/2001/XMLSchema">
+ <network-id/>
+ <network-name>HSL_direct_net_2</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <modelCustomizationId>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationId>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <backout-on-failure>false</backout-on-failure>
+ <sdncVersion>1610</sdncVersion>
+</network-inputs>"""
+
+String networkInputsMissingCloudRegion =
+"""<network-inputs xmlns="http://www.w3.org/2001/XMLSchema">
+ <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
+ <network-name>HSL_direct_net_2</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <modelCustomizationId>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationId>
+ <aic-cloud-region>null</aic-cloud-region>
+ <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <backout-on-failure>false</backout-on-failure>
+ <sdncVersion>1610</sdncVersion>
+</network-inputs>"""
+
+ String MissingIdFault = "Invalid value or missing network-id element"
+ String MissingRegionFault = "Invalid value or missing 'aic-cloud-region' element"
+
+ String invalidWorkflowException = """<aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">
+ <aetgt:ErrorMessage>Invalid value of network-id element</aetgt:ErrorMessage>
+ <aetgt:ErrorCode>2500</aetgt:ErrorCode>
+ </aetgt:WorkflowException>"""
+
+
+ String queryAAIResponse =
+ """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ statusCode="200">
+ <rest:headers>
+ <rest:header name="Transfer-Encoding" value="chunked"/>
+ <rest:header name="Date" value="Sat,30 Jan 2016 20:09:24 GMT"/>
+ <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
+ <rest:header name="X-AAI-TXID"
+ value="mtcnjv9aaas01.mtcnj.aic.cip.com-20160130-20:09:24:814-165843"/>
+ <rest:header name="Content-Type" value="application/xml"/>
+ <rest:header name="Server" value="Apache-Coyote/1.1"/>
+ <rest:header name="Cache-Control" value="private"/>
+ </rest:headers>
+ <rest:payload contentType="text/xml">
+ <l3-network xmlns="http://org.openecomp.aai.inventory/v3">
+ <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
+ <network-name>HSL_direct_net_2</network-name>
+ <network-type>CONTRAIL_BASIC</network-type>
+ <network-role>HSL_direct</network-role>
+ <network-technology>contrail</network-technology>
+ <neutron-network-id>8bbd3edf-b835-4610-96a2-a5cafa029042</neutron-network-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <orchestration-status>active</orchestration-status>
+ <heat-stack-id>HSL_direct_net_2/57594a56-1c92-4a38-9caa-641c1fa3d4b6</heat-stack-id>
+ <subnets>
+ <subnet>
+ <subnet-id>ea5f2a2c-604f-47ff-a9c5-253ee4f0ef0a</subnet-id>
+ <neutron-subnet-id>5a77fdc2-7789-4649-a1b9-6eaf1db1813a</neutron-subnet-id>
+ <gateway-address>172.16.34.1</gateway-address>
+ <network-start-address>172.16.34.0</network-start-address>
+ <cidr-mask>28</cidr-mask>
+ <ip-version>4</ip-version>
+ <orchestration-status>active</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <relationship-list/>
+ </subnet>
+ </subnets>
+ <relationship-list>
+ <relationship>
+ <related-to>tenant</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v3/cloud-infrastructure/tenants/tenant/e81d842d3e8b45c5a59f57cd76af3aaf/</related-link>
+ <relationship-data>
+ <relationship-key>tenant.tenant-id</relationship-key>
+ <relationship-value>e81d842d3e8b45c5a59f57cd76af3aaf</relationship-value>
+ </relationship-data>
+ </relationship>
+ </relationship-list>
+ </l3-network>
+ </rest:payload>
+</rest:RESTResponse>"""
+
+ String deleteNetworkRequest =
+ """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <NetworkAdapter:deleteNetwork xmlns:NetworkAdapter="http://org.openecomp.mso/network">
+ <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
+ <tenantId>e81d842d3e8b45c5a59f57cd76af3aaf</tenantId>
+ <networkType>CONTRAIL_BASIC</networkType>
+ <networkId>HSL_direct_net_2/57594a56-1c92-4a38-9caa-641c1fa3d4b6</networkId>
+ <request>
+ <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
+ <serviceInstanceId>0</serviceInstanceId>
+ </request>
+ </NetworkAdapter:deleteNetwork>
+ </soapenv:Body>
+</soapenv:Envelope>"""
+
+String deleteNetworkRESTRequest =
+"""<deleteNetworkRequest>
+ <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
+ <tenantId>e81d842d3e8b45c5a59f57cd76af3aaf</tenantId>
+ <networkId>bdc5efe8-404a-409b-85f6-0dcc9eebae30</networkId>
+ <networkStackId>HSL_direct_net_2/57594a56-1c92-4a38-9caa-641c1fa3d4b6</networkStackId>
+ <networkType>CONTRAIL_BASIC</networkType>
+ <modelCustomizationUuid>sn5256d1-5a33-55df-13ab-12abad84e222</modelCustomizationUuid>
+ <skipAAI>true</skipAAI>
+ <msoRequest>
+ <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
+ <serviceInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</serviceInstanceId>
+ </msoRequest>
+ <messageId>messageId_value</messageId>
+ <notificationUrl/>
+</deleteNetworkRequest>"""
+
+String deleteNetworkRESTRequestAlaCarte =
+"""<deleteNetworkRequest>
+ <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
+ <tenantId>e81d842d3e8b45c5a59f57cd76af3aaf</tenantId>
+ <networkId>bdc5efe8-404a-409b-85f6-0dcc9eebae30</networkId>
+ <networkStackId>HSL_direct_net_2/57594a56-1c92-4a38-9caa-641c1fa3d4b6</networkStackId>
+ <networkType>CONTRAIL_BASIC</networkType>
+ <modelCustomizationUuid>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationUuid>
+ <skipAAI>true</skipAAI>
+ <msoRequest>
+ <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
+ <serviceInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</serviceInstanceId>
+ </msoRequest>
+ <messageId>messageId_value</messageId>
+ <notificationUrl/>
+</deleteNetworkRequest>"""
+
+ String deleteNetworkResponse_noRollback =
+"""<ns2:deleteNetworkResponse xmlns:ns2="http://org.openecomp.mso/network">
+ <networkDeleted>true</networkDeleted>
+</ns2:deleteNetworkResponse>
+"""
+
+ String deleteNetworkResponse =
+ """<ns2:deleteNetworkResponse xmlns:ns2="http://org.openecomp.mso/network">
+ <networkDeleted>true</networkDeleted>
+ <rollback>
+ <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
+ <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
+ <networkStackId></networkStackId>
+ <networkType>CONTRAIL_EXTERNAL</networkType>
+ <networkCreated>true</networkCreated>
+ <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
+ <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
+ <msoRequest>
+ <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId>
+ <serviceInstanceId></serviceInstanceId>
+ </msoRequest>
+ </rollback>
+ </ns2:deleteNetworkResponse>"""
+
+ String deleteRollbackNetworkRequest =
+ """<NetworkAdapter:rollbackNetwork xmlns:NetworkAdapter="http://org.openecomp.mso/network">
+ <rollback>
+ <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
+ <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
+ <networkStackId/>
+ <networkType>CONTRAIL_EXTERNAL</networkType>
+ <networkCreated>true</networkCreated>
+ <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
+ <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
+ <msoRequest>
+ <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId>
+ <serviceInstanceId/>
+ </msoRequest>
+ </rollback>
+</NetworkAdapter:rollbackNetwork>"""
+
+ String deleteNetworkResponseFalseCompletion =
+ """<ns2:deleteNetworkResponse xmlns:ns2="http://org.openecomp.mso/network"
+ xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
+ <networkDeleted>false</networkDeleted>
+ </ns2:deleteNetworkResponse>"""
+
+ String deleteNetworkErrorResponse =
+ """<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<deleteNetworkError>
+<messageId>680bd458-5ec1-4a16-b77c-509022e53450</messageId><category>INTERNAL</category>
+<message>400 Bad Request: The server could not comply with the request since it is either malformed or otherwise incorrect., error.type=StackValidationFailed, error.message=Property error: : resources.network.properties: : Unknown Property network_ipam_refs_data</message>
+<rolledBack>true</rolledBack>
+</deleteNetworkError>
+"""
+
+ String deleteNetworkWorkflowException =
+ """<aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">
+ <aetgt:ErrorMessage>Received error from Network Adapter: 400 Bad Request: The server could not comply with the request since it is either malformed or otherwise incorrect., error.type=StackValidationFailed, error.message=Property error: : resources.network.properties: : Unknown Property network_ipam_refs_data</aetgt:ErrorMessage>
+ <aetgt:ErrorCode>7020</aetgt:ErrorCode>
+ </aetgt:WorkflowException>"""
+
+String aaiWorkflowException =
+"""<aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">
+ <aetgt:ErrorMessage>Bpmn error encountered in DoDeleteNetworkInstance flow. Unexpected Response from AAI Adapter - org.apache.http.conn.HttpHostConnectException: Connect to localhost:8090 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect</aetgt:ErrorMessage>
+ <aetgt:ErrorCode>2500</aetgt:ErrorCode>
+ </aetgt:WorkflowException>"""
+
+ String aaiResponse =
+ """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ statusCode="200">
+ <rest:headers>
+ <rest:header name="Transfer-Encoding" value="chunked"/>
+ <rest:header name="Date" value="Sat,30 Jan 2016 20:09:24 GMT"/>
+ <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
+ <rest:header name="X-AAI-TXID"
+ value="mtcnjv9aaas01.mtcnj.aic.cip.com-20160130-20:09:24:814-165843"/>
+ <rest:header name="Content-Type" value="application/xml"/>
+ <rest:header name="Server" value="Apache-Coyote/1.1"/>
+ <rest:header name="Cache-Control" value="private"/>
+ </rest:headers>
+ <rest:payload contentType="text/xml">
+ <l3-network xmlns="http://org.openecomp.aai.inventory/v8">
+ <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
+ <network-name>HSL_direct_net_2</network-name>
+ <network-type>CONTRAIL_BASIC</network-type>
+ <network-role>HSL_direct</network-role>
+ <network-technology>contrail</network-technology>
+ <neutron-network-id>8bbd3edf-b835-4610-96a2-a5cafa029042</neutron-network-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <orchestration-status>active</orchestration-status>
+ <heat-stack-id>HSL_direct_net_2/57594a56-1c92-4a38-9caa-641c1fa3d4b6</heat-stack-id>
+ <subnets>
+ <subnet>
+ <subnet-id>ea5f2a2c-604f-47ff-a9c5-253ee4f0ef0a</subnet-id>
+ <neutron-subnet-id>5a77fdc2-7789-4649-a1b9-6eaf1db1813a</neutron-subnet-id>
+ <gateway-address>172.16.34.1</gateway-address>
+ <network-start-address>172.16.34.0</network-start-address>
+ <cidr-mask>28</cidr-mask>
+ <ip-version>4</ip-version>
+ <orchestration-status>active</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <relationship-list/>
+ </subnet>
+ </subnets>
+ <relationship-list>
+ <relationship>
+ <related-to>tenant</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/e81d842d3e8b45c5a59f57cd76af3aaf/</related-link>
+ <relationship-data>
+ <relationship-key>tenant.tenant-id</relationship-key>
+ <relationship-value>e81d842d3e8b45c5a59f57cd76af3aaf</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>cloud-region</related-to>
+ <related-link>cloud-infrastructure/cloud-regions/cloud-region/att-aic/RDM2WAGPLCP/</related-link>
+ <relationship-data>
+ <relationship-key>cloud-region.cloud-owner</relationship-key>
+ <relationship-value>att-aic</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>cloud-region.cloud-region-id</relationship-key>
+ <relationship-value>RDM2WAGPLCP</relationship-value>
+ </relationship-data>
+ </relationship>
+ </relationship-list>
+ </l3-network>
+ </rest:payload>
+</rest:RESTResponse>"""
+
+String aaiResponseWithRelationship =
+"""<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ statusCode="200">
+ <rest:headers>
+ <rest:header name="Transfer-Encoding" value="chunked"/>
+ <rest:header name="Date" value="Sat,30 Jan 2016 20:09:24 GMT"/>
+ <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
+ <rest:header name="X-AAI-TXID"
+ value="mtcnjv9aaas01.mtcnj.aic.cip.com-20160130-20:09:24:814-165843"/>
+ <rest:header name="Content-Type" value="application/xml"/>
+ <rest:header name="Server" value="Apache-Coyote/1.1"/>
+ <rest:header name="Cache-Control" value="private"/>
+ </rest:headers>
+ <rest:payload contentType="text/xml">
+ <l3-network xmlns="http://org.openecomp.aai.inventory/v8">
+ <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
+ <network-name>HSL_direct_net_2</network-name>
+ <network-type>CONTRAIL_BASIC</network-type>
+ <network-role>HSL_direct</network-role>
+ <network-technology>contrail</network-technology>
+ <neutron-network-id>8bbd3edf-b835-4610-96a2-a5cafa029042</neutron-network-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <orchestration-status>active</orchestration-status>
+ <heat-stack-id>HSL_direct_net_2/57594a56-1c92-4a38-9caa-641c1fa3d4b6</heat-stack-id>
+ <subnets>
+ <subnet>
+ <subnet-id>ea5f2a2c-604f-47ff-a9c5-253ee4f0ef0a</subnet-id>
+ <neutron-subnet-id>5a77fdc2-7789-4649-a1b9-6eaf1db1813a</neutron-subnet-id>
+ <gateway-address>172.16.34.1</gateway-address>
+ <network-start-address>172.16.34.0</network-start-address>
+ <cidr-mask>28</cidr-mask>
+ <ip-version>4</ip-version>
+ <orchestration-status>active</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <relationship-list/>
+ </subnet>
+ </subnets>
+ <relationship-list>
+ <relationship>
+ <related-to>tenant</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/e81d842d3e8b45c5a59f57cd76af3aaf/</related-link>
+ <relationship-data>
+ <relationship-key>tenant.tenant-id</relationship-key>
+ <relationship-value>e81d842d3e8b45c5a59f57cd76af3aaf</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>vf-module</related-to>
+ <related-link>https://aai-app-e2e.ecomp.cci.com:8443/aai/v8/network/generic-vnfs/generic-vnf/105df7e5-0b3b-49f7-a837-4864b62827c4/vf-modules/vf-module/d9217058-95a0-49ee-b9a9-949259e89349/</related-link>
+ <relationship-data>
+ <relationship-key>generic-vnf.vnf-id</relationship-key>
+ <relationship-value>105df7e5-0b3b-49f7-a837-4864b62827c4</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>vf-module.vf-module-id</relationship-key>
+ <relationship-value>d9217058-95a0-49ee-b9a9-949259e89349</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>generic-vnf</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/generic-vnfs/generic-vnf/45f822d9-73ca-4255-9844-7cef401bbf47/</related-link>
+ <relationship-data>
+ <relationship-key>generic-vnf.vnf-id</relationship-key>
+ <relationship-value>45f822d9-73ca-4255-9844-7cef401bbf47</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>generic-vnf.vnf-name</property-key>
+ <property-value>zrdm1scpx05</property-value>
+ </related-to-property>
+ </relationship>
+ </relationship-list>
+ </l3-network>
+ </rest:payload>
+</rest:RESTResponse>"""
+
+ String deleteSDNCRequest =
+ """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:ns5="http://org.openecomp/mso/request/types/v1"
+ xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>delete</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
+ </sdncadapter:RequestHeader>
+ <aetgt:SDNCRequestData>
+ <request-information>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <request-action>DisconnectNetworkRequest</request-action>
+ <source>VID</source>
+ <notification-url/>
+ <order-number/>
+ <order-version/>
+ </request-information>
+ <service-information>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <service-type/>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ <subscriber-name/>
+ </service-information>
+ <network-request-information>
+ <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
+ <network-type>CONTRAIL_BASIC</network-type>
+ <network-name>HSL_direct_net_2</network-name>
+ <tenant>7dd5365547234ee8937416c65507d266</tenant>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ </network-request-information>
+ </aetgt:SDNCRequestData>
+</aetgt:SDNCAdapterWorkflowRequest>"""
+
+ String deleteRpcSDNCRequest =
+ """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>unassign</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
+ <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
+ </sdncadapter:RequestHeader>
+ <aetgt:SDNCRequestData>
+ <request-information>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <request-action>DeleteNetworkInstance</request-action>
+ <source>VID</source>
+ <notification-url/>
+ <order-number/>
+ <order-version/>
+ </request-information>
+ <service-information>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <subscription-service-type>MSO-dev-service-type</subscription-service-type>
+ <ecomp-model-information>
+ <model-invariant-uuid>fcc85cb0-ad74-45d7-a5a1-17c8744fdb71</model-invariant-uuid>
+ <model-uuid>36a3a8ea-49a6-4ac8-b06c-89a54544b9b6</model-uuid>
+ <model-version>1.0</model-version>
+ <model-name>HNGW Protected OAM</model-name>
+ </ecomp-model-information>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ <global-customer-id>globalId_45678905678</global-customer-id>
+ <subscriber-name/>
+ </service-information>
+ <network-information>
+ <network-id>networkId</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <ecomp-model-information>
+ <model-invariant-uuid>sn5256d1-5a33-55df-13ab-12abad84e764</model-invariant-uuid>
+ <model-customization-uuid>sn5256d1-5a33-55df-13ab-12abad84e222</model-customization-uuid>
+ <model-uuid>sn5256d1-5a33-55df-13ab-12abad84e111</model-uuid>
+ <model-version>1</model-version>
+ <model-name>CONTRAIL_EXTERNAL</model-name>
+ </ecomp-model-information>
+ </network-information>
+ <network-request-input>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <tenant>7dd5365547234ee8937416c65507d266</tenant>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <aic-clli/>
+ <network-input-parameters/>
+ </network-request-input>
+ </aetgt:SDNCRequestData>
+</aetgt:SDNCAdapterWorkflowRequest>"""
+
+ String sdncAdapaterDeactivateRollback =
+"""<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>activate</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
+ <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
+ </sdncadapter:RequestHeader>
+ <aetgt:SDNCRequestData>
+ <request-information>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <request-action>CreateNetworkInstance</request-action>
+ <source>VID</source>
+ <notification-url/>
+ <order-number/>
+ <order-version/>
+ </request-information>
+ <service-information>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <subscription-service-type>MSO-dev-service-type</subscription-service-type>
+ <ecomp-model-information>
+ <model-invariant-uuid>fcc85cb0-ad74-45d7-a5a1-17c8744fdb71</model-invariant-uuid>
+ <model-uuid>36a3a8ea-49a6-4ac8-b06c-89a54544b9b6</model-uuid>
+ <model-version>1.0</model-version>
+ <model-name>HNGW Protected OAM</model-name>
+ </ecomp-model-information>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ <global-customer-id>globalId_45678905678</global-customer-id>
+ <subscriber-name/>
+ </service-information>
+ <network-information>
+ <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <ecomp-model-information>
+ <model-invariant-uuid>sn5256d1-5a33-55df-13ab-12abad84e764</model-invariant-uuid>
+ <model-customization-uuid>sn5256d1-5a33-55df-13ab-12abad84e222</model-customization-uuid>
+ <model-uuid>sn5256d1-5a33-55df-13ab-12abad84e111</model-uuid>
+ <model-version>1</model-version>
+ <model-name>CONTRAIL_EXTERNAL</model-name>
+ </ecomp-model-information>
+ </network-information>
+ <network-request-input>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <tenant>7dd5365547234ee8937416c65507d266</tenant>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <aic-clli/>
+ <network-input-parameters/>
+ </network-request-input>
+ </aetgt:SDNCRequestData>
+</aetgt:SDNCAdapterWorkflowRequest>"""
+ String sdncAdapterWorkflowResponse =
+ """<aetgt:SDNCAdapterWorkflowResponse xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1">
+ <sdncadapterworkflow:response-data>
+<tag0:CallbackHeader xmlns:tag0="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
+ <tag0:RequestId>745b1b50-e39e-4685-9cc8-c71f0bde8bf0</tag0:RequestId>
+ <tag0:ResponseCode>200</tag0:ResponseCode>
+ <tag0:ResponseMessage>OK</tag0:ResponseMessage>
+</tag0:CallbackHeader>
+ <tag0:RequestData xmlns:tag0="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;output xmlns="com:att:sdnctl:vnf"&gt;&lt;svc-request-id&gt;19174929-3809-49ca-89eb-17f84a035389&lt;/svc-request-id&gt;&lt;response-code&gt;200&lt;/response-code&gt;&lt;ack-final-indicator&gt;Y&lt;/ack-final-indicator&gt;&lt;network-information&gt;&lt;network-id&gt;bdc5efe8-404a-409b-85f6-0dcc9eebae30&lt;/network-id&gt;&lt;/network-information&gt;&lt;service-information&gt;&lt;service-type&gt;a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb&lt;/service-type&gt;&lt;service-instance-id&gt;HSL_direct_net_2&lt;/service-instance-id&gt;&lt;subscriber-name&gt;notsurewecare&lt;/subscriber-name&gt;&lt;/service-information&gt;&lt;/output&gt;</tag0:RequestData>
+ </sdncadapterworkflow:response-data>
+ </aetgt:SDNCAdapterWorkflowResponse>"""
+
+ String sdncAdapterWorkflowResponse_404 =
+ """<aetgt:SDNCAdapterWorkflowResponse xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1">
+ <sdncadapterworkflow:response-data>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;output xmlns="com:att:sdnctl:vnf"&gt;&lt;svc-request-id&gt;00703dc8-71ff-442d-a4a8-3adc5beef6a9&lt;/svc-request-id&gt;&lt;response-code&gt;404&lt;/response-code&gt;&lt;response-message&gt;Service instance not found in config tree&lt;/response-message&gt;&lt;ack-final-indicator&gt;Y&lt;/ack-final-indicator&gt;&lt;network-information&gt;&lt;network-id&gt;49c86598-f766-46f8-84f8-8d1c1b10f9b4&lt;/network-id&gt;&lt;/network-information&gt;&lt;service-information&gt;&lt;service-type&gt;a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb&lt;/service-type&gt;&lt;service-instance-id&gt;MNS-25180-L-01-dmz_direct_net_1&lt;/service-instance-id&gt;&lt;subscriber-name&gt;notsurewecare&lt;/subscriber-name&gt;&lt;/service-information&gt;&lt;/output&gt;</sdncadapterworkflow:response-data>
+</aetgt:SDNCAdapterWorkflowResponse>"""
+
+ String expected_sdncAdapterWorkflowFormattedResponse_404 =
+"""<aetgt:SDNCAdapterWorkflowResponse xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns="com:att:sdnctl:vnf">
+ <aetgt:response-data>
+ <output>
+ <svc-request-id>00703dc8-71ff-442d-a4a8-3adc5beef6a9</svc-request-id>
+ <response-code>404</response-code>
+ <response-message>Service instance not found in config tree</response-message>
+ <ack-final-indicator>Y</ack-final-indicator>
+ <network-information>
+ <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
+ </network-information>
+ <service-information>
+ <service-type>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-type>
+ <service-instance-id>MNS-25180-L-01-dmz_direct_net_1</service-instance-id>
+ <subscriber-name>notsurewecare</subscriber-name>
+ </service-information>
+ </output>
+ </aetgt:response-data>
+</aetgt:SDNCAdapterWorkflowResponse>"""
+
+ String sdncAdapterWorkflowFormattedResponse =
+ """<aetgt:SDNCAdapterWorkflowResponse xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns="com:att:sdnctl:vnf">
+ <aetgt:response-data>
+ <output>
+ <svc-request-id>19174929-3809-49ca-89eb-17f84a035389</svc-request-id>
+ <response-code>200</response-code>
+ <ack-final-indicator>Y</ack-final-indicator>
+ <network-information>
+ <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
+ </network-information>
+ <service-information>
+ <service-type>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-type>
+ <service-instance-id>HSL_direct_net_2</service-instance-id>
+ <subscriber-name>notsurewecare</subscriber-name>
+ </service-information>
+ </output>
+ </aetgt:response-data>
+</aetgt:SDNCAdapterWorkflowResponse>"""
+
+String sdncAdapterWorkflowFormattedResponse_404 =
+"""<aetgt:SDNCAdapterWorkflowResponse xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns="com:att:sdnctl:vnf">
+ <aetgt:response-data>
+ <output>
+ <svc-request-id>00703dc8-71ff-442d-a4a8-3adc5beef6a9</svc-request-id>
+ <response-code>404</response-code>
+ <response-message>Service instance not found in config tree</response-message>
+ <ack-final-indicator>Y</ack-final-indicator>
+ <network-information>
+ <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
+ </network-information>
+ <service-information>
+ <service-type>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-type>
+ <service-instance-id>MNS-25180-L-01-dmz_direct_net_1</service-instance-id>
+ <subscriber-name>notsurewecare</subscriber-name>
+ </service-information>
+ </output>
+ </aetgt:response-data>
+</aetgt:SDNCAdapterWorkflowResponse>"""
+
+ String invalidRequest = "Invalid value of network-id element"
+
+
+
+ String sndcWorkflowException =
+ """<aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">
+ <aetgt:ErrorMessage>Received error from SDN-C: No availability zone available</aetgt:ErrorMessage>
+ <aetgt:ErrorCode>5300</aetgt:ErrorCode>
+ <aetgt:SourceSystemErrorCode>200</aetgt:SourceSystemErrorCode>
+</aetgt:WorkflowException>"""
+
+ String sndcWorkflowErrorResponse =
+ """<aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">
+ <aetgt:ErrorMessage>Received error from SDN-C: <aetgt:SDNCAdapterWorkflowResponse xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1">
+ <sdncadapterworkflow:response-data>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;output xmlns="com:att:sdnctl:vnf"&gt;&lt;svc-request-id&gt;00703dc8-71ff-442d-a4a8-3adc5beef6a9&lt;/svc-request-id&gt;&lt;response-code&gt;404&lt;/response-code&gt;&lt;response-message&gt;Service instance not found in config tree&lt;/response-message&gt;&lt;ack-final-indicator&gt;Y&lt;/ack-final-indicator&gt;&lt;network-information&gt;&lt;network-id&gt;49c86598-f766-46f8-84f8-8d1c1b10f9b4&lt;/network-id&gt;&lt;/network-information&gt;&lt;service-information&gt;&lt;service-type&gt;a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb&lt;/service-type&gt;&lt;service-instance-id&gt;MNS-25180-L-01-dmz_direct_net_1&lt;/service-instance-id&gt;&lt;subscriber-name&gt;notsurewecare&lt;/subscriber-name&gt;&lt;/service-information&gt;&lt;/output&gt;</sdncadapterworkflow:response-data>
+</aetgt:SDNCAdapterWorkflowResponse></aetgt:ErrorMessage>
+ <aetgt:ErrorCode>5300</aetgt:ErrorCode>
+ </aetgt:WorkflowException>"""
+
+ String unexpectedErrorEncountered =
+ """<aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">
+ <aetgt:ErrorMessage>bpel error deleting network</aetgt:ErrorMessage>
+ <aetgt:ErrorCode>5300</aetgt:ErrorCode>
+ </aetgt:WorkflowException>"""
+
+
+ // expectedVnfRequest
+ String inputViprSDC_NetworkRequest =
+ """<network-request xmlns="http://www.w3.org/2001/XMLSchema">
+ <request-info>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <action>DELETE</action>
+ <source>VID</source>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ </request-info>
+ <network-inputs>
+ <network-id>networkId</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <subscription-service-type>MSO-dev-service-type</subscription-service-type>
+ <global-customer-id>globalId_45678905678</global-customer-id>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <backout-on-failure>false</backout-on-failure>
+ <failIfExist>false</failIfExist>
+ <networkModelInfo>
+ <modelName>CONTRAIL_EXTERNAL</modelName>
+ <modelUuid>sn5256d1-5a33-55df-13ab-12abad84e111</modelUuid>
+ <modelInvariantUuid>sn5256d1-5a33-55df-13ab-12abad84e764</modelInvariantUuid>
+ <modelVersion>1</modelVersion>
+ <modelCustomizationUuid>sn5256d1-5a33-55df-13ab-12abad84e222</modelCustomizationUuid>
+ <modelType>CONTRAIL_EXTERNAL</modelType>
+ </networkModelInfo>
+ <serviceModelInfo>
+ <modelName>HNGW Protected OAM</modelName>
+ <modelUuid>36a3a8ea-49a6-4ac8-b06c-89a54544b9b6</modelUuid>
+ <modelInvariantUuid>fcc85cb0-ad74-45d7-a5a1-17c8744fdb71</modelInvariantUuid>
+ <modelVersion>1.0</modelVersion>
+ <modelCustomizationUuid/>
+ <modelType>service</modelType>
+ </serviceModelInfo>
+ <sdncVersion>1702</sdncVersion>
+ </network-inputs>
+ <network-params/>
+</network-request>"""
+// - - - - - - - -
+
+
+ @Before
+ public void init()
+ {
+ MockitoAnnotations.initMocks(this)
+ }
+
+ @Test
+ //@Ignore
+ public void preProcessRequest_Json() {
+
+ println "************ preProcessRequest_Payload ************* "
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("isBaseVfModule")).thenReturn(true)
+ when(mockExecution.getVariable("recipeTimeout")).thenReturn(0)
+ when(mockExecution.getVariable("requestAction")).thenReturn("DELETE")
+ when(mockExecution.getVariable("networkId")).thenReturn("bdc5efe8-404a-409b-85f6-0dcc9eebae30")
+ when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable("vnfId")).thenReturn("")
+ when(mockExecution.getVariable("volumeGroupId")).thenReturn("")
+ //when(mockExecution.getVariable("networkId")).thenReturn("")
+ when(mockExecution.getVariable("serviceType")).thenReturn("MOG")
+ when(mockExecution.getVariable("networkType")).thenReturn("modelName")
+ when(mockExecution.getVariable("bpmnRequest")).thenReturn(incomingJsonRequest)
+ when(mockExecution.getVariable("disableRollback")).thenReturn(true)
+ when(mockExecution.getVariable("testMessageId")).thenReturn("7df689f9-7b93-430b-9b9e-28140d70cc7ad")
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("mso-service-instance-id")).thenReturn("FH/VLXM/003717//SW_INTERNET")
+ when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
+ when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("URN_mso_rollback")).thenReturn("true")
+ when(mockExecution.getVariable("sdncVersion")).thenReturn("1610")
+
+ DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
+ DoDeleteNetworkInstance.preProcessRequest(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(mockExecution)
+
+ verify(mockExecution).getVariable("isDebugLogEnabled")
+ verify(mockExecution).setVariable("prefix", Prefix)
+
+ //verify variable initialization
+ initializeVariables(mockExecution)
+
+ verify(mockExecution).setVariable("action", "DELETE")
+ verify(mockExecution).setVariable(Prefix + "networkRequest", expectedNetworkRequest)
+
+ verify(mockExecution).setVariable(Prefix + "rollbackEnabled", false)
+
+ verify(mockExecution).setVariable(Prefix + "networkInputs", expected_networkInput)
+ verify(mockExecution).setVariable(Prefix + "messageId", "7df689f9-7b93-430b-9b9e-28140d70cc7ad")
+ verify(mockExecution).setVariable(Prefix + "source", "VID")
+
+ // Authentications
+ verify(mockExecution).setVariable("BasicAuthHeaderValuePO", "Basic cGFzc3dvcmQ=")
+ verify(mockExecution).setVariable("BasicAuthHeaderValueSDNC", "Basic cGFzc3dvcmQ=")
+
+
+ }
+
+ @Test
+ //@Ignore
+ public void preProcessRequest_vPER() {
+
+ def networkModelInfo = """{"modelUuid": "sn5256d1-5a33-55df-13ab-12abad84e111",
+ "modelName": "CONTRAIL_EXTERNAL",
+ "modelType": "CONTRAIL_EXTERNAL",
+ "modelVersion": "1",
+ "modelCustomizationUuid": "sn5256d1-5a33-55df-13ab-12abad84e222",
+ "modelInvariantUuid": "sn5256d1-5a33-55df-13ab-12abad84e764"
+ }""".trim()
+
+ println "************ preProcessRequest_Payload ************* "
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ // Inputs:
+ when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("disableRollback")).thenReturn("true")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable("networkId")).thenReturn("bdc5efe8-404a-409b-85f6-0dcc9eebae30") // optional
+ when(mockExecution.getVariable("networkName")).thenReturn("MNS-25180-L-01-dmz_direct_net_1") // optional
+ when(mockExecution.getVariable("productFamilyId")).thenReturn("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb")
+ when(mockExecution.getVariable("networkModelInfo")).thenReturn("CONTRAIL_EXTERNAL")
+ when(mockExecution.getVariable("lcpCloudRegionId")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable("tenantId")).thenReturn("7dd5365547234ee8937416c65507d266")
+ when(mockExecution.getVariable("failIfExists")).thenReturn("false")
+ when(mockExecution.getVariable("networkModelInfo")).thenReturn(networkModelInfo)
+ when(mockExecution.getVariable("sdncVersion")).thenReturn("1702")
+ when(mockExecution.getVariable("action")).thenReturn("DELETE")
+ when(mockExecution.getVariable("subscriptionServiceType")).thenReturn("MSO-dev-service-type")
+ when(mockExecution.getVariable("globalSubscriberId")).thenReturn("globalId_45678905678")
+ when(mockExecution.getVariable("testMessageId")).thenReturn("7df689f9-7b93-430b-9b9e-28140d70cc7ad")
+
+ when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
+ when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
+
+ DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
+ DoDeleteNetworkInstance.preProcessRequest(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(mockExecution)
+
+ verify(mockExecution).getVariable("isDebugLogEnabled")
+ verify(mockExecution).setVariable("prefix", Prefix)
+
+ //verify variable initialization
+ initializeVariables(mockExecution)
+
+ verify(mockExecution).setVariable("action", "DELETE")
+ verify(mockExecution).setVariable(Prefix + "networkRequest", expectedVperNetworkRequest)
+
+ verify(mockExecution).setVariable(Prefix + "rollbackEnabled", false)
+
+ verify(mockExecution).setVariable(Prefix + "networkInputs", expectedVper_networkInput)
+ verify(mockExecution).setVariable(Prefix + "messageId", "7df689f9-7b93-430b-9b9e-28140d70cc7ad")
+ verify(mockExecution).setVariable(Prefix + "source", "VID")
+
+ // Authentications
+ verify(mockExecution).setVariable("BasicAuthHeaderValuePO", "Basic cGFzc3dvcmQ=")
+ verify(mockExecution).setVariable("BasicAuthHeaderValueSDNC", "Basic cGFzc3dvcmQ=")
+
+
+ }
+
+ public void initializeVariables (Execution mockExecution) {
+
+ verify(mockExecution).setVariable(Prefix + "networkRequest", "")
+ verify(mockExecution).setVariable(Prefix + "isSilentSuccess", false)
+ verify(mockExecution).setVariable(Prefix + "Success", false)
+
+ verify(mockExecution).setVariable(Prefix + "requestId", "")
+ verify(mockExecution).setVariable(Prefix + "source", "")
+ verify(mockExecution).setVariable(Prefix + "lcpCloudRegion", "")
+ verify(mockExecution).setVariable(Prefix + "networkInputs", "")
+ verify(mockExecution).setVariable(Prefix + "tenantId", "")
+
+ verify(mockExecution).setVariable(Prefix + "queryAAIRequest","")
+ verify(mockExecution).setVariable(Prefix + "queryAAIResponse", "")
+ verify(mockExecution).setVariable(Prefix + "aaiReturnCode", "")
+ verify(mockExecution).setVariable(Prefix + "isAAIGood", false)
+ verify(mockExecution).setVariable(Prefix + "isVfRelationshipExist", false)
+
+ // AAI query Cloud Region
+ verify(mockExecution).setVariable(Prefix + "queryCloudRegionRequest","")
+ verify(mockExecution).setVariable(Prefix + "queryCloudRegionReturnCode","")
+ verify(mockExecution).setVariable(Prefix + "queryCloudRegionResponse","")
+ verify(mockExecution).setVariable(Prefix + "cloudRegionPo","")
+ verify(mockExecution).setVariable(Prefix + "cloudRegionSdnc","")
+
+ verify(mockExecution).setVariable(Prefix + "deleteNetworkRequest", "")
+ verify(mockExecution).setVariable(Prefix + "deleteNetworkResponse", "")
+ verify(mockExecution).setVariable(Prefix + "networkReturnCode", "")
+ verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", "")
+
+ verify(mockExecution).setVariable(Prefix + "deleteSDNCRequest", "")
+ verify(mockExecution).setVariable(Prefix + "deleteSDNCResponse", "")
+ verify(mockExecution).setVariable(Prefix + "sdncReturnCode", "")
+ verify(mockExecution).setVariable(Prefix + "sdncResponseSuccess", false)
+
+ verify(mockExecution).setVariable(Prefix + "deactivateSDNCRequest", "")
+ verify(mockExecution).setVariable(Prefix + "deactivateSDNCResponse", "")
+ verify(mockExecution).setVariable(Prefix + "deactivateSdncReturnCode", "")
+ verify(mockExecution).setVariable(Prefix + "isSdncDeactivateRollbackNeeded", "")
+
+ verify(mockExecution).setVariable(Prefix + "rollbackDeactivateSDNCRequest", "")
+ verify(mockExecution).setVariable(Prefix + "isException", false)
+
+ }
+
+ @Test
+ //@Ignore
+ public void preProcessRequest_Json_MissingId() {
+
+ println "************ preProcessRequest_MissingId() ************* "
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("isBaseVfModule")).thenReturn(true)
+ when(mockExecution.getVariable("recipeTimeout")).thenReturn(0)
+ when(mockExecution.getVariable("requestAction")).thenReturn("DELETE")
+ //when(mockExecution.getVariable("networkId")).thenReturn("") // missing Id
+ when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable("vnfId")).thenReturn("")
+ when(mockExecution.getVariable("volumeGroupId")).thenReturn("")
+ //when(mockExecution.getVariable("networkId")).thenReturn("")
+ when(mockExecution.getVariable("serviceType")).thenReturn("MOG")
+ when(mockExecution.getVariable("networkType")).thenReturn("modelName")
+ when(mockExecution.getVariable("bpmnRequest")).thenReturn(incomingJsonRequest)
+ when(mockExecution.getVariable("disableRollback")).thenReturn(true)
+
+ when(mockExecution.getVariable("testMessageId")).thenReturn("7df689f9-7b93-430b-9b9e-28140d70cc7ad")
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("mso-service-instance-id")).thenReturn("FH/VLXM/003717//SW_INTERNET")
+ when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
+ when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("URN_mso_rollback")).thenReturn("true")
+ when(mockExecution.getVariable("sdncVersion")).thenReturn("1610")
+
+ // preProcessRequest(Execution execution)
+ DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
+ try {
+ DoDeleteNetworkInstance.preProcessRequest(mockExecution)
+ } catch (Exception ex) {
+ println " Test End - Handle catch-throw BpmnError()! "
+ }
+
+ //verify(mockExecution).getVariable("isDebugLogEnabled")
+ verify(mockExecution).setVariable("prefix", Prefix)
+
+ //verify variable initialization
+ initializeVariables(mockExecution)
+
+ verify(mockExecution).setVariable("action", "DELETE")
+ verify(mockExecution).setVariable(Prefix + "networkRequest", expectedNetworkRequestMissingId)
+ verify(mockExecution).setVariable(Prefix + "rollbackEnabled", false)
+
+ verify(mockExecution).setVariable(Prefix + "networkInputs", networkInputsMissingId)
+ verify(mockExecution).setVariable(Prefix + "messageId", "7df689f9-7b93-430b-9b9e-28140d70cc7ad")
+ verify(mockExecution).setVariable(Prefix + "source", "VID")
+
+ }
+
+ @Test
+ //@Ignore
+ public void preProcessRequest_Json_MissingCloudRegion() {
+
+ def networkModelInfo = """{"modelVersionId": "sn5256d1-5a33-55df-13ab-12abad84e111",
+ "modelName": "CONTRAIL_EXTERNAL",
+ "modelType": "CONTRAIL_EXTERNAL",
+ "modelVersion": "1",
+ "modelCustomizationId": "sn5256d1-5a33-55df-13ab-12abad84e222",
+ "modelInvariantId": "sn5256d1-5a33-55df-13ab-12abad84e764"
+ }""".trim()
+
+ println "************ preProcessRequest_MissingCloudRegion() ************* "
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("networkModelInfo")).thenReturn(networkModelInfo)
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("isBaseVfModule")).thenReturn(true)
+ when(mockExecution.getVariable("recipeTimeout")).thenReturn(0)
+ when(mockExecution.getVariable("requestAction")).thenReturn("DELETE")
+ when(mockExecution.getVariable("networkId")).thenReturn("bdc5efe8-404a-409b-85f6-0dcc9eebae30")
+ when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable("vnfId")).thenReturn("")
+ when(mockExecution.getVariable("volumeGroupId")).thenReturn("")
+ //when(mockExecution.getVariable("networkId")).thenReturn("")
+ when(mockExecution.getVariable("serviceType")).thenReturn("MOG")
+ when(mockExecution.getVariable("networkType")).thenReturn("modelName")
+ when(mockExecution.getVariable("bpmnRequest")).thenReturn(incomingRequestMissingCloudRegion)
+ when(mockExecution.getVariable("disableRollback")).thenReturn(true)
+
+ when(mockExecution.getVariable("testMessageId")).thenReturn("7df689f9-7b93-430b-9b9e-28140d70cc7ad")
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("mso-service-instance-id")).thenReturn("FH/VLXM/003717//SW_INTERNET")
+ when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
+ when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("URN_mso_rollback")).thenReturn("true")
+ when(mockExecution.getVariable("sdncVersion")).thenReturn("1610")
+
+ // preProcessRequest(Execution execution)
+ DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
+ DoDeleteNetworkInstance.preProcessRequest(mockExecution)
+
+ //verify(mockExecution).getVariable("isDebugLogEnabled")
+ verify(mockExecution).setVariable("prefix", Prefix)
+
+ //verify variable initialization
+ initializeVariables(mockExecution)
+
+ verify(mockExecution).setVariable("action", "DELETE")
+ verify(mockExecution).setVariable(Prefix + "networkRequest", expectedNetworkRequestMissingCloudRegion)
+ verify(mockExecution).setVariable(Prefix + "rollbackEnabled", false)
+
+ verify(mockExecution).setVariable(Prefix + "networkInputs", networkInputsMissingCloudRegion)
+ verify(mockExecution).setVariable(Prefix + "messageId", "7df689f9-7b93-430b-9b9e-28140d70cc7ad")
+ verify(mockExecution).setVariable(Prefix + "lcpCloudRegion", null)
+
+ verify(mockExecution).setVariable("BasicAuthHeaderValuePO","Basic cGFzc3dvcmQ=")
+ verify(mockExecution).setVariable("BasicAuthHeaderValueSDNC", "Basic cGFzc3dvcmQ=")
+
+ }
+
+
+
+ @Test
+ //@Ignore
+ public void prepareNetworkRequest() {
+
+ println "************ prepareNetworkRequest ************* "
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedVperNetworkRequest)
+ when(mockExecution.getVariable(Prefix + "queryAAIResponse")).thenReturn(queryAAIResponse)
+ when(mockExecution.getVariable(Prefix + "cloudRegionPo")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(Prefix + "tenantId")).thenReturn("e81d842d3e8b45c5a59f57cd76af3aaf")
+
+ when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable("URN_mso_adapters_network_rest_endpoint")).thenReturn("http://localhost:8090/networks/NetworkAdapter")
+ when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("messageId_value")
+ //when(mockExecution.getVariable("URN_?????")).thenReturn("") // notificationUrl, //TODO - is this coming from URN? What variable/value to use?
+ when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+
+ DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
+ DoDeleteNetworkInstance.prepareNetworkRequest(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable("URN_mso_adapters_network_rest_endpoint", "http://localhost:8090/networks/NetworkAdapter/bdc5efe8-404a-409b-85f6-0dcc9eebae30")
+ //verify(mockExecution).setVariable(Prefix + "deleteNetworkRequest", deleteNetworkRequest)
+ verify(mockExecution).setVariable(Prefix + "deleteNetworkRequest", deleteNetworkRESTRequest)
+
+ }
+
+ @Test
+ //@Ignore
+ public void prepareNetworkRequest_AlaCarte() {
+
+ println "************ prepareNetworkRequest ************* "
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
+ when(mockExecution.getVariable(Prefix + "queryAAIResponse")).thenReturn(queryAAIResponse)
+ when(mockExecution.getVariable(Prefix + "cloudRegionPo")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(Prefix + "tenantId")).thenReturn("e81d842d3e8b45c5a59f57cd76af3aaf")
+
+ when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable("URN_mso_adapters_network_rest_endpoint")).thenReturn("http://localhost:8090/networks/NetworkAdapter")
+ when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("messageId_value")
+ //when(mockExecution.getVariable("URN_?????")).thenReturn("") // notificationUrl, //TODO - is this coming from URN? What variable/value to use?
+ when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+
+ DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
+ DoDeleteNetworkInstance.prepareNetworkRequest(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable("URN_mso_adapters_network_rest_endpoint", "http://localhost:8090/networks/NetworkAdapter/bdc5efe8-404a-409b-85f6-0dcc9eebae30")
+ //verify(mockExecution).setVariable(Prefix + "deleteNetworkRequest", deleteNetworkRequest)
+ verify(mockExecution).setVariable("mso-request-id", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ verify(mockExecution).setVariable(Prefix + "deleteNetworkRequest", deleteNetworkRESTRequestAlaCarte)
+
+ }
+
+ @Test
+ //@Ignore
+ public void sendRequestToVnfAdapter() {
+
+ println "************ sendRequestToVnfAdapter ************* "
+
+ WireMock.reset();
+ MockNetworkAdapter("bdc5efe8-404a-409b-85f6-0dcc9eebae30", 200, "deleteNetworkResponse_Success.xml");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "deleteNetworkRequest")).thenReturn(deleteNetworkRESTRequest)
+ when(mockExecution.getVariable("URN_mso_adapters_network_rest_endpoint")).thenReturn("http://localhost:8090/networks/NetworkAdapter/bdc5efe8-404a-409b-85f6-0dcc9eebae30")
+ when(mockExecution.getVariable("BasicAuthHeaderValuePO")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+
+ DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
+ DoDeleteNetworkInstance.sendRequestToVnfAdapter(mockExecution)
+
+ verify(mockExecution).setVariable(Prefix + "networkReturnCode", 200)
+ //verify(mockExecution).setVariable(Prefix + "deleteNetworkResponse", deleteNetworkResponse_noRollback)
+
+ }
+
+
+ @Test
+ //@Ignore
+ public void prepareSDNCRequest() {
+
+ println "************ prepareSDNCRequest ************* "
+
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
+ when(mockExecution.getVariable(Prefix + "cloudRegionSdnc")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(Prefix + "queryAAIResponse")).thenReturn(aaiResponse)
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+
+ DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
+ DoDeleteNetworkInstance.prepareSDNCRequest(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "deleteSDNCRequest", deleteSDNCRequest)
+
+ }
+
+ @Test
+ //@Ignore
+ public void prepareRpcSDNCRequest() {
+
+ println "************ prepareRpcSDNCRequest ************* "
+
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(inputViprSDC_NetworkRequest)
+ when(mockExecution.getVariable(Prefix + "cloudRegionSdnc")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56") // test ONLY
+ when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+
+ DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
+ DoDeleteNetworkInstance.prepareRpcSDNCRequest(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "deleteSDNCRequest", deleteRpcSDNCRequest)
+
+ }
+
+ @Test
+ //@Ignore
+ public void prepareRpcSDNCActivateRollback() {
+
+ println "************ prepareRpcSDNCActivateRollback ************* "
+
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(inputViprSDC_NetworkRequest)
+ when(mockExecution.getVariable(Prefix + "cloudRegionSdnc")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(Prefix + "serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable(Prefix + "networkId")).thenReturn("8abc633a-810b-4ca5-8b3a-09511d13a2ce")
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56") // test ONLY
+ when(mockExecution.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("GENGSI_siResourceLink")).thenReturn(null)
+ when(mockExecution.getVariable(Prefix + "deactivateSDNCResponse")).thenReturn(sdncAdapterWorkflowFormattedResponse)
+
+ // preProcessRequest(Execution execution)
+ DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
+ DoDeleteNetworkInstance.prepareRpcSDNCDeactivateRollback(mockExecution)
+
+ // verify set prefix = Prefix + ""
+ verify(mockExecution).setVariable("prefix", Prefix)
+ //verify(mockExecution).setVariable("mso-request-id", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ //verify(mockExecution).setVariable(Prefix + "requestId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ //verify(mockExecution).setVariable("mso-service-instance-id", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ verify(mockExecution).setVariable(Prefix + "rollbackDeactivateSDNCRequest", sdncAdapaterDeactivateRollback)
+
+ }
+
+
+ @Test
+ //@Ignore
+ public void callRESTQueryAAI_200() {
+
+ println "************ callRESTQueryAAI ************* "
+
+ WireMock.reset();
+ MockGetNetworkByIdWithDepth("bdc5efe8-404a-409b-85f6-0dcc9eebae30", "DeleteNetworkV2/deleteNetworkAAIResponse_Success.xml", "1");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedNetworkRequest)
+ 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_default_aai_network_l3_network_uri")).thenReturn("")
+ // old: when(mockExecution.getVariable("URN_mso_workflow_DoDeleteNetworkInstance_aai_network_l3_network_uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
+ when(mockExecution.getVariable("URN_mso_workflow_DoDeleteNetworkInstance_aai_l3_network_uri")).thenReturn("/aai/v9/network/l3-networks/l3-network")
+ 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")
+
+ DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
+ 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 + "aaiReturnCode", "200")
+ //verify(mockExecution).setVariable(Prefix + "queryAAIResponse", aaiResponse)
+ verify(mockExecution).setVariable(Prefix + "isAAIGood", true)
+ verify(mockExecution).setVariable(Prefix + "isVfRelationshipExist", false)
+
+ }
+
+ @Test
+ //@Ignore
+ public void callRESTQueryAAI_withRelationship_200() {
+
+ println "************ callRESTQueryAAI ************* "
+
+ WireMock.reset();
+ MockGetNetworkByIdWithDepth("bdc5efe8-404a-409b-85f6-0dcc9eebae30", "DeleteNetworkV2/deleteNetworkAAIResponse_withRelationship_Success.xml", "1");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedNetworkRequest)
+ 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_default_aai_network_l3_network_uri")).thenReturn("")
+ // old: when(mockExecution.getVariable("URN_mso_workflow_DoDeleteNetworkInstance_aai_network_l3_network_uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
+ when(mockExecution.getVariable("URN_mso_workflow_DoDeleteNetworkInstance_aai_l3_network_uri")).thenReturn("/aai/v9/network/l3-networks/l3-network")
+ 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")
+
+ DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
+ 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 + "aaiReturnCode", "200")
+ //verify(mockExecution).setVariable(Prefix + "queryAAIResponse", aaiResponseWithRelationship)
+ verify(mockExecution).setVariable(Prefix + "isAAIGood", true)
+ verify(mockExecution).setVariable(Prefix + "isVfRelationshipExist", true)
+
+ }
+
+ @Test
+ //@Ignore
+ public void callRESTQueryAAI_200_DefaultUri() {
+
+ println "************ callRESTQueryAAI ************* "
+
+ WireMock.reset();
+ MockGetNetworkByIdWithDepth("bdc5efe8-404a-409b-85f6-0dcc9eebae30", "DeleteNetworkV2/deleteNetworkAAIResponse_Success.xml", "1");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedNetworkRequest)
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
+ when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
+ // old: when(mockExecution.getVariable("URN_mso_workflow_default_aai_network_l3_network_uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
+ when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8")
+ when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_l3_network_uri")).thenReturn("/aai/v9/network/l3-networks/l3-network")
+ 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")
+
+ DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
+ 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 + "aaiReturnCode", "200")
+ //verify(mockExecution).setVariable(Prefix + "queryAAIResponse", aaiResponse)
+ verify(mockExecution).setVariable(Prefix + "isAAIGood", true)
+
+ }
+
+ @Test
+ //@Ignore
+ public void callRESTQueryAAICloudRegion30_200() {
+
+ println "************ callRESTQueryAAICloudRegion30_200 ************* "
+
+ WireMock.reset();
+ MockGetNetworkCloudRegion("DeleteNetworkV2/cloudRegion30_AAIResponse_Success.xml", "RDM2WAGPLCP");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix)
+ when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedNetworkRequest)
+ when(mockExecution.getVariable(Prefix + "lcpCloudRegion")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
+ // old: when(mockExecution.getVariable("URN_mso_workflow_default_aai_cloud_infrastructure_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
+ when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8")
+ when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
+ 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")
+
+ DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
+ DoDeleteNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
+
+ verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "queryCloudRegionRequest", "http://localhost:8090/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/RDM2WAGPLCP")
+ verify(mockExecution, atLeast(2)).setVariable(Prefix + "queryCloudRegionReturnCode", "200")
+
+ }
+
+ @Test
+ //@Ignore
+ public void callRESTQueryAAICloudRegion_NotFound() {
+
+ println "************ callRESTQueryAAICloudRegion_NotFound ************* "
+
+ WireMock.reset();
+ MockGetNetworkCloudRegion_404("MDTWNJ21");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix)
+ when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(vnfRequestCloudRegionNotFound)
+ when(mockExecution.getVariable(Prefix + "lcpCloudRegion")).thenReturn("MDTWNJ21")
+ when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
+ // old: when(mockExecution.getVariable("URN_mso_workflow_default_aai_cloud_infrastructure_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
+ when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8")
+ when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
+ 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(Execution execution)
+ DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
+ DoDeleteNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
+
+ verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "cloudRegionPo", "MDTWNJ21")
+ verify(mockExecution).setVariable(Prefix + "cloudRegionSdnc", "AAIAIC25")
+
+ }
+
+ @Test
+ //@Ignore
+ public void callRESTQueryAAICloudRegion25_200() {
+
+ println "************ callRESTQueryAAICloudRegion25_200 ************* "
+
+ WireMock.reset();
+ MockGetNetworkCloudRegion("DeleteNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix)
+ when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedNetworkRequest)
+ when(mockExecution.getVariable(Prefix + "lcpCloudRegion")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
+ // old: when(mockExecution.getVariable("URN_mso_workflow_default_aai_cloud_infrastructure_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
+ when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8")
+ when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
+ //
+ 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(Execution execution)
+ DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
+ DoDeleteNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
+
+ verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "queryCloudRegionRequest", "http://localhost:8090/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/RDM2WAGPLCP")
+ verify(mockExecution, atLeast(2)).setVariable(Prefix + "queryCloudRegionReturnCode", "200")
+
+ }
+
+
+ @Test
+ //@Ignore
+ public void validateNetworkResponse() {
+
+ println "************ validateNetworkResponse ************* "
+
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "deleteNetworkResponse")).thenReturn(deleteNetworkResponse)
+ when(mockExecution.getVariable(Prefix + "networkReturnCode")).thenReturn('200')
+
+ DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
+ DoDeleteNetworkInstance.validateNetworkResponse(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ //verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", null)
+
+ }
+
+
+ @Test
+ //@Ignore
+ public void validateSDNCResponse_200() {
+
+ println "************ validateSDNCResponse ************* "
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "sdncReturnCode")).thenReturn("200")
+ when(mockExecution.getVariable("SDNCA_SuccessIndicator")).thenReturn(true)
+
+ DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
+ try {
+ DoDeleteNetworkInstance.validateSDNCResponse(mockExecution, sdncAdapterWorkflowResponse)
+ } catch (Exception ex) {
+ println " Graceful Exit - " + ex.getMessage()
+ }
+
+ }
+
+ @Test
+ //@Ignore
+ public void validateSDNCResponse_404() {
+
+ println "************ validateSDNCResponse ************* "
+
+ WorkflowException workflowException = new WorkflowException("DoCreateNetworkInstance", 2500, "Received error from SNDC Adapter: HTTP Status 404.")
+
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "sdncReturnCode")).thenReturn("404")
+ when(mockExecution.getVariable("SDNCA_SuccessIndicator")).thenReturn(false)
+ when(mockExecution.getVariable("WorkflowException")).thenReturn(workflowException)
+
+ DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
+ try {
+ DoDeleteNetworkInstance.validateSDNCResponse(mockExecution)
+ } catch (Exception ex) {
+ println " Graceful Exit - " + ex.getMessage()
+ }
+
+ }
+
+ @Test
+ //@Ignore
+ public void validateRpcSDNCDeactivateResponse() {
+
+ println "************ validateRpcSDNCDeactivateResponse ************* "
+
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "deactivateSDNCResponse")).thenReturn(sdncAdapterWorkflowResponse)
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
+ when(mockExecution.getVariable("SDNCA_SuccessIndicator")).thenReturn(true)
+ when(mockExecution.getVariable(Prefix + "deactivateSDNCReturnCode")).thenReturn("200")
+
+ DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
+ try {
+ DoDeleteNetworkInstance.validateRpcSDNCDeactivateResponse(mockExecution)
+ verify(mockExecution).setVariable(Prefix + "isSdncDeactivateRollbackNeeded", true)
+
+ } catch (Exception ex) {
+ println " Graceful Exit - " + ex.getMessage()
+ }
+ //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
+ //debugger.printInvocations(mockExecution)
+
+ //verify(mockExecution).setVariable(Prefix + "isSdncRollbackNeeded", true)
+
+ }
+
+ @Test
+ @Ignore
+ public void postProcessResponse() {
+
+ println "************ postProcessResponse ************* "
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "source")).thenReturn("PORTAL")
+ when(mockExecution.getVariable(Prefix + "isException")).thenReturn(false)
+
+ // postProcessResponse(Execution execution)
+ DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
+ DoDeleteNetworkInstance.postProcessResponse(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "Success", true)
+
+ }
+
+ @Test
+ //@Ignore
+ public void prepareRollbackData() {
+
+ println "************ prepareRollbackData() ************* "
+
+
+
+ WorkflowException workflowException = new WorkflowException("DoCreateNetworkInstance", 2500, "Received error from Network Adapter: JBWEB000065: HTTP Status 500.")
+
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn(deleteRollbackNetworkRequest)
+ //when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn(null)
+ //when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn("")
+ when(mockExecution.getVariable(Prefix + "rollbackDeactivateSDNCRequest")).thenReturn(sdncAdapaterDeactivateRollback)
+ when(mockExecution.getVariable("WorkflowException")).thenReturn(workflowException)
+
+ // preProcessRequest(Execution execution)
+ DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
+ DoDeleteNetworkInstance.prepareRollbackData(mockExecution)
+
+ verify(mockExecution).getVariable("isDebugLogEnabled")
+ verify(mockExecution).setVariable("prefix", Prefix)
+
+ }
+
+
+ private ExecutionEntity setupMock() {
+
+ ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class)
+ when(mockProcessDefinition.getKey()).thenReturn("DoDeleteNetworkInstance")
+ RepositoryService mockRepositoryService = mock(RepositoryService.class)
+ when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition)
+ when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("DoDeleteNetworkInstance")
+ 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("DoDeleteNetworkInstance")
+ when(mockExecution.getProcessInstanceId()).thenReturn("DoDeleteNetworkInstance")
+ 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/DoUpdateNetworkInstanceRollbackTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollbackTest.groovy
new file mode 100644
index 0000000000..c97bedbac1
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollbackTest.groovy
@@ -0,0 +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 =
+ """<NetworkAdapter:rollbackNetwork xmlns:NetworkAdapter="http://org.openecomp.mso/network">
+ <rollback>
+ <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
+ <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
+ <networkStackId/>
+ <networkType>CONTRAIL_EXTERNAL</networkType>
+ <networkCreated>true</networkCreated>
+ <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
+ <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
+ <msoRequest>
+ <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId>
+ <serviceInstanceId/>
+ </msoRequest>
+ </rollback>
+</NetworkAdapter:rollbackNetwork>"""
+
+ String rollbackActivateSDNCRequest =
+ """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:ns5="http://org.openecomp/mso/request/types/v1"
+ xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>rollback</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
+ <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
+ </sdncadapter:RequestHeader>
+ <aetgt:SDNCRequestData>
+ <request-information>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <request-action>CreateNetworkInstance</request-action>
+ <source>VID</source>
+ <notification-url/>
+ <order-number/>
+ <order-version/>
+ </request-information>
+ <service-information>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <service-type>MSO-dev-service-type</service-type>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ <subscriber-name>MSO_1610_dev</subscriber-name>
+ </service-information>
+ <network-information>
+ <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <ecomp-model-information>
+ <model-invariant-uuid>invariant-uuid</model-invariant-uuid>
+ <model-customization-uuid>customization-uuid</model-customization-uuid>
+ <model-uuid>uuid</model-uuid>
+ <model-version>version</model-version>
+ <model-name>CONTRAIL_EXTERNAL</model-name>
+ </ecomp-model-information>
+ </network-information>
+ <network-request-information>
+ <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <tenant>7dd5365547234ee8937416c65507d266</tenant>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ </network-request-information>
+ </aetgt:SDNCRequestData>
+</aetgt:SDNCAdapterWorkflowRequest>"""
+
+ String rollbackSDNCRequest =
+ """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:ns5="http://org.openecomp/mso/request/types/v1"
+ xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>rollback</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
+ <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
+ </sdncadapter:RequestHeader>
+ <aetgt:SDNCRequestData>
+ <request-information>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <request-action>CreateNetworkInstance</request-action>
+ <source>VID</source>
+ <notification-url/>
+ <order-number/>
+ <order-version/>
+ </request-information>
+ <service-information>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <service-type>MSO-dev-service-type</service-type>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ <subscriber-name>MSO_1610_dev</subscriber-name>
+ </service-information>
+ <network-information>
+ <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <ecomp-model-information>
+ <model-invariant-uuid>invariant-uuid</model-invariant-uuid>
+ <model-customization-uuid>customization-uuid</model-customization-uuid>
+ <model-uuid>uuid</model-uuid>
+ <model-version>version</model-version>
+ <model-name>CONTRAIL_EXTERNAL</model-name>
+ </ecomp-model-information>
+ </network-information>
+ <network-request-information>
+ <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <tenant>7dd5365547234ee8937416c65507d266</tenant>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ </network-request-information>
+ </aetgt:SDNCRequestData>
+</aetgt:SDNCAdapterWorkflowRequest>"""
+
+// - - - - - - - -
+
+
+ @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<String, String> rollbackData = new HashMap<String, String>();
+ 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<String, String> rollbackData = new HashMap<String, String>();
+ 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
new file mode 100644
index 0000000000..fb44067b68
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceTest.groovy
@@ -0,0 +1,2625 @@
+package org.openecomp.mso.bpmn.infrastructure.scripts
+
+import static org.mockito.Mockito.*
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkByIdWithDepth;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkCloudRegion;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkCloudRegion_404;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkVpnBinding;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkTableReference;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkPolicy;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutNetworkIdWithDepth;
+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.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.MockitoAnnotations
+import org.mockito.runners.MockitoJUnitRunner
+import org.openecomp.mso.bpmn.common.scripts.MsoUtils
+import org.openecomp.mso.bpmn.core.WorkflowException
+
+import com.github.tomakehurst.wiremock.client.WireMock
+import com.github.tomakehurst.wiremock.junit.WireMockRule
+import org.apache.commons.lang3.*
+
+
+@RunWith(MockitoJUnitRunner.class)
+class DoUpdateNetworkInstanceTest {
+
+ @Rule
+ public WireMockRule wireMockRule = new WireMockRule(8090);
+
+ def utils = new MsoUtils()
+ String Prefix="UPDNETI_"
+
+ String jsonIncomingRequest =
+ """{ "requestDetails": {
+ "modelInfo": {
+ "modelType": "network",
+ "modelCustomizationId": "f21df226-8093-48c3-be7e-0408fcda0422",
+ "modelName": "CONTRAIL_EXTERNAL",
+ "modelVersion": "1.0"
+ },
+ "cloudConfiguration": {
+ "lcpCloudRegionId": "RDM2WAGPLCP",
+ "tenantId": "7dd5365547234ee8937416c65507d266"
+ },
+ "requestInfo": {
+ "instanceName": "MNS-25180-L-01-dmz_direct_net_1",
+ "source": "VID",
+ "callbackUrl": "",
+ "suppressRollback": true,
+ "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"
+ },
+ "relatedInstanceList": [
+ {
+ "relatedInstance": {
+ "instanceId": "f70e927b-6087-4974-9ef8-c5e4d5847ca4",
+ "modelInfo": {
+ "modelType": "serviceT",
+ "modelId": "modelI",
+ "modelNameVersionId": "modelNameVersionI",
+ "modelName": "modleNam",
+ "modelVersion": "1"
+ }
+ }
+ }
+ ],
+ "requestParameters": {
+ "userParams": [
+ {
+ "name": "someUserParam1",
+ "value": "someValue1"
+ }
+ ]
+ }
+ }}"""
+
+
+ String jsonIncomingRequest_MissingCloudRegion =
+ """{ "requestDetails": {
+ "modelInfo": {
+ "modelType": "network",
+ "modelCustomizationId": "f21df226-8093-48c3-be7e-0408fcda0422",
+ "modelName": "CONTRAIL_EXTERNAL",
+ "modelVersion": "1.0"
+ },
+ "cloudConfiguration": {
+ "tenantId": "7dd5365547234ee8937416c65507d266"
+ },
+ "requestInfo": {
+ "instanceName": "MNS-25180-L-01-dmz_direct_net_1",
+ "source": "VID",
+ "callbackUrl": "",
+ "suppressRollback": true,
+ "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"
+ },
+ "relatedInstanceList": [
+ {
+ "relatedInstance": {
+ "instanceId": "f70e927b-6087-4974-9ef8-c5e4d5847ca4",
+ "modelInfo": {
+ "modelType": "serviceT",
+ "modelId": "modelI",
+ "modelNameVersionId": "modelNameVersionI",
+ "modelName": "modleNam",
+ "modelVersion": "1"
+ }
+ }
+ }
+ ],
+ "requestParameters": {
+ "userParams": []
+ }
+ }}"""
+
+
+
+ String expectedNetworkRequestMissingNetworkId =
+ """<network-request xmlns="http://www.w3.org/2001/XMLSchema">
+ <request-info>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <action>UPDATE</action>
+ <source>VID</source>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ </request-info>
+ <network-inputs>
+ <network-id/>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <modelCustomizationId>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationId>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <backout-on-failure>false</backout-on-failure>
+ <sdncVersion>1610</sdncVersion>
+ </network-inputs>
+ <network-params>
+ <param name="some_user_param1">someValue1</param>
+ </network-params>
+</network-request>"""
+
+
+String expectedNetworkRequestMissingCloudRegion =
+"""<network-request xmlns="http://www.w3.org/2001/XMLSchema">
+ <request-info>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <action>UPDATE</action>
+ <source>VID</source>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ </request-info>
+ <network-inputs>
+ <network-id>networkId</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <modelCustomizationId>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationId>
+ <aic-cloud-region>null</aic-cloud-region>
+ <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <backout-on-failure>false</backout-on-failure>
+ <sdncVersion>null</sdncVersion>
+ </network-inputs>
+ <network-params/>
+</network-request>"""
+
+String expectedNetworkInputMissingCloudRegion =
+"""<network-inputs xmlns="http://www.w3.org/2001/XMLSchema">
+ <network-id>networkId</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <modelCustomizationId>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationId>
+ <aic-cloud-region>null</aic-cloud-region>
+ <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <backout-on-failure>false</backout-on-failure>
+ <sdncVersion>null</sdncVersion>
+</network-inputs>"""
+
+ String networkInputsMissingName =
+ """<network-inputs xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
+ <network-name/>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
+ </network-inputs>"""
+
+String networkInputsMissingCloudRegion =
+"""<network-inputs xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
+ <network-name>HSL_direct_net_2</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <aic-cloud-region/>
+ <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
+</network-inputs>"""
+
+ // expectedNetworkRequest
+ String expectedNetworkRequest =
+ """<network-request xmlns="http://www.w3.org/2001/XMLSchema">
+ <request-info>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <action>UPDATE</action>
+ <source>VID</source>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ </request-info>
+ <network-inputs>
+ <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <modelCustomizationId>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationId>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <backout-on-failure>false</backout-on-failure>
+ <sdncVersion>1610</sdncVersion>
+ </network-inputs>
+ <network-params>
+ <param name="some_user_param1">someValue1</param>
+ </network-params>
+</network-request>"""
+
+String expectedNetworkInputs =
+"""<network-inputs xmlns="http://www.w3.org/2001/XMLSchema">
+ <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <modelCustomizationId>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationId>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <backout-on-failure>false</backout-on-failure>
+ <sdncVersion>1610</sdncVersion>
+</network-inputs>"""
+
+String expectedVperNetworkRequest =
+"""<network-request xmlns="http://www.w3.org/2001/XMLSchema">
+ <request-info>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <action>UPDATE</action>
+ <source>VID</source>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ </request-info>
+ <network-inputs>
+ <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <subscription-service-type>MSO-dev-service-type</subscription-service-type>
+ <global-customer-id>globalId_45678905678</global-customer-id>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <backout-on-failure>false</backout-on-failure>
+ <failIfExist>false</failIfExist>
+ <networkModelInfo>
+ <modelName>CONTRAIL_EXTERNAL</modelName>
+ <modelUuid>sn5256d1-5a33-55df-13ab-12abad84e111</modelUuid>
+ <modelInvariantUuid>sn5256d1-5a33-55df-13ab-12abad84e764</modelInvariantUuid>
+ <modelVersion>1</modelVersion>
+ <modelCustomizationUuid>sn5256d1-5a33-55df-13ab-12abad84e222</modelCustomizationUuid>
+ </networkModelInfo>
+ <serviceModelInfo>
+ <modelName/>
+ <modelUuid/>
+ <modelInvariantUuid/>
+ <modelVersion/>
+ <modelCustomizationUuid/>
+ </serviceModelInfo>
+ <sdncVersion>1702</sdncVersion>
+ </network-inputs>
+ <network-params/>
+</network-request>"""
+
+String expectedVperNetworkInputs =
+"""<network-inputs xmlns="http://www.w3.org/2001/XMLSchema">
+ <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <subscription-service-type>MSO-dev-service-type</subscription-service-type>
+ <global-customer-id>globalId_45678905678</global-customer-id>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <backout-on-failure>false</backout-on-failure>
+ <failIfExist>false</failIfExist>
+ <networkModelInfo>
+ <modelName>CONTRAIL_EXTERNAL</modelName>
+ <modelUuid>sn5256d1-5a33-55df-13ab-12abad84e111</modelUuid>
+ <modelInvariantUuid>sn5256d1-5a33-55df-13ab-12abad84e764</modelInvariantUuid>
+ <modelVersion>1</modelVersion>
+ <modelCustomizationUuid>sn5256d1-5a33-55df-13ab-12abad84e222</modelCustomizationUuid>
+ </networkModelInfo>
+ <serviceModelInfo>
+ <modelName/>
+ <modelUuid/>
+ <modelInvariantUuid/>
+ <modelVersion/>
+ <modelCustomizationUuid/>
+ </serviceModelInfo>
+ <sdncVersion>1702</sdncVersion>
+</network-inputs>"""
+
+String expectedNetworkInputsMissingNetworkId =
+"""<network-inputs xmlns="http://www.w3.org/2001/XMLSchema">
+ <network-id/>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <modelCustomizationId>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationId>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <backout-on-failure>false</backout-on-failure>
+ <sdncVersion>1610</sdncVersion>
+</network-inputs>"""
+
+
+ String NetworkRequest_noPhysicalName =
+ """<vnfreq:network-request xmlns:vnfreq="http://org.openecomp/mso/infra/vnf-request/v1">
+ <vnfreq:request-info>
+ <vnfreq:request-id>1ef47428-cade-45bd-a103-0751e8b2deb0</vnfreq:request-id>
+ <vnfreq:action>UPDATE</vnfreq:action>
+ <vnfreq:source>PORTAL</vnfreq:source>
+ </vnfreq:request-info>
+ <vnfreq:network-inputs>
+ <vnfreq:network-name>MNS-25180-L-01-dmz_direct_net_1</vnfreq:network-name>
+ <vnfreq:network-type>CONTRAIL_EXTERNAL</vnfreq:network-type>
+ <vnfreq:modelCustomizationId></vnfreq:modelCustomizationId>
+ <vnfreq:service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</vnfreq:service-id>
+ <vnfreq:aic-cloud-region>RDM2WAGPLCP</vnfreq:aic-cloud-region>
+ <vnfreq:tenant-id>7dd5365547234ee8937416c65507d266</vnfreq:tenant-id>
+ <vnfreq:vlans>3008</vnfreq:vlans>
+ </vnfreq:network-inputs>
+ <vnfreq:network-params>
+ <network-params>
+ <param name="dhcp-enabled">true</param>
+ <param name="serviceId">a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</param>
+ <param name="cidr-mask">true</param>
+ <param name="backoutOnFailure">true</param>
+ <param name="gateway-address">10.10.125.1</param>
+ </network-params>
+ </vnfreq:network-params>
+</vnfreq:network-request>"""
+
+ String vnfRequestFakeRegion =
+ """<vnfreq:network-request xmlns:vnfreq="http://org.openecomp/mso/infra/vnf-request/v1">
+ <vnfreq:request-info>
+ <vnfreq:request-id>1ef47428-cade-45bd-a103-0751e8b2deb0</vnfreq:request-id>
+ <vnfreq:action>UPDATE</vnfreq:action>
+ <vnfreq:source>PORTAL</vnfreq:source>
+ </vnfreq:request-info>
+ <vnfreq:network-inputs>
+ <vnfreq:network-name>MNS-25180-L-01-dmz_direct_net_1</vnfreq:network-name>
+ <vnfreq:network-type>CONTRAIL_EXTERNAL</vnfreq:network-type>
+ <vnfreq:service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</vnfreq:service-id>
+ <vnfreq:aic-cloud-region>MDTWNJ21</vnfreq:aic-cloud-region>
+ <vnfreq:tenant-id>7dd5365547234ee8937416c65507d266</vnfreq:tenant-id>
+ </vnfreq:network-inputs>
+ <vnfreq:network-params>
+ <param name="shared">1</param>
+ <param name="external">0</param>
+ </vnfreq:network-params>
+</vnfreq:network-request>"""
+
+ // expectedNetworkRequest
+ String expectedNetworkRequest_Outputs =
+ """<vnfreq:network-request xmlns:vnfreq="http://org.openecomp/mso/infra/vnf-request/v1">
+ <vnfreq:request-info>
+ <vnfreq:request-id>1ef47428-cade-45bd-a103-0751e8b2deb0</vnfreq:request-id>
+ <vnfreq:action>UPDATE</vnfreq:action>
+ <vnfreq:source>PORTAL</vnfreq:source>
+ </vnfreq:request-info>
+ <vnfreq:network-inputs>
+ <vnfreq:network-name>MNS-25180-L-01-dmz_direct_net_1</vnfreq:network-name>
+ <vnfreq:network-type>CONTRAIL_EXTERNAL</vnfreq:network-type>
+ <vnfreq:service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</vnfreq:service-id>
+ <vnfreq:aic-cloud-region>RDM2WAGPLCP</vnfreq:aic-cloud-region>
+ <vnfreq:tenant-id>7dd5365547234ee8937416c65507d266</vnfreq:tenant-id>
+ </vnfreq:network-inputs>
+ <vnfreq:network-outputs>
+ <vnfreq:network-name>MNS-25180-L-01-dmz_direct_net_1</vnfreq:network-name>
+ <vnfreq:network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</vnfreq:network-id>
+ </vnfreq:network-outputs>
+ <vnfreq:network-params>
+ <param name="shared">1</param>
+ <param name="external">0</param>
+ </vnfreq:network-params>
+</vnfreq:network-request>"""
+
+
+ String networkInputs =
+ """<network-inputs xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
+ <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
+</network-inputs>"""
+
+ String networkOutputs =
+ """<network-outputs>
+ <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ </network-outputs>"""
+
+ String queryAAIResponse =
+ """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ statusCode="200">
+ <rest:headers>
+ <rest:header name="Transfer-Encoding" value="chunked"/>
+ <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
+ <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
+ <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
+ <rest:header name="Content-Type" value="application/xml"/>
+ <rest:header name="Server" value="Apache-Coyote/1.1"/>
+ <rest:header name="Cache-Control" value="private"/>
+ </rest:headers>
+ <rest:payload contentType="text/xml">
+ <l3-network xmlns="http://org.openecomp.aai.inventory/v3">
+ <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
+ <network-name>HSL_direct_net_2</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-role>dmz_direct</network-role>
+ <network-technology>contrail</network-technology>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <network-role-instance>0</network-role-instance>
+ <orchestration-status>pending-delete</orchestration-status>
+ <subnets>
+ <subnet>
+ <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
+ <gateway-address>107.239.52.1</gateway-address>
+ <network-start-address>107.239.52.0</network-start-address>
+ <cidr-mask>24</cidr-mask>
+ <ip-version>4</ip-version>
+ <orchestration-status>pending-delete</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <relationship-list/>
+ </subnet>
+ </subnets>
+ <relationship-list>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>tenant</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
+ <relationship-data>
+ <relationship-key>tenant.tenant-id</relationship-key>
+ <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
+ </relationship-data>
+ </relationship>
+ </relationship-list>
+ </l3-network>
+ </rest:payload>
+</rest:RESTResponse>"""
+
+ String queryIdAIIResponse =
+ """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ statusCode="200">
+ <rest:headers>
+ <rest:header name="Transfer-Encoding" value="chunked"/>
+ <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
+ <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
+ <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
+ <rest:header name="Content-Type" value="application/xml"/>
+ <rest:header name="Server" value="Apache-Coyote/1.1"/>
+ <rest:header name="Cache-Control" value="private"/>
+ </rest:headers>
+ <rest:payload contentType="text/xml">
+ <l3-network xmlns="http://org.openecomp.aai.inventory/v6">
+ <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-role>dmz_direct</network-role>
+ <network-technology>contrail</network-technology>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <network-role-instance>0</network-role-instance>
+ <resource-version>l3-version</resource-version>
+ <orchestration-status>pending-delete</orchestration-status>
+ <heat-stack-id>ST_2Bindings_6006/55288ef0-595c-47d3-819e-cf93aaac6326</heat-stack-id>
+ <physical-network-name>networkName</physical-network-name>
+ <is-provider-network>false</is-provider-network>
+ <is-shared-network>true</is-shared-network>
+ <is-external-network>false</is-external-network>
+ <subnets>
+ <subnet>
+ <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
+ <gateway-address>107.239.52.1</gateway-address>
+ <network-start-address>107.239.52.0</network-start-address>
+ <cidr-mask>24</cidr-mask>
+ <ip-version>4</ip-version>
+ <orchestration-status>pending-update</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <subnet-name>subnetName</subnet-name>
+ <relationship-list/>
+ </subnet>
+ <subnet>
+ <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
+ <gateway-address>107.239.52.1</gateway-address>
+ <network-start-address>107.239.52.0</network-start-address>
+ <cidr-mask>24</cidr-mask>
+ <ip-version>4</ip-version>
+ <orchestration-status>pending-delete</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <subnet-name>subnetName</subnet-name>
+ <relationship-list/>
+ </subnet>
+ </subnets>
+ <segmentation-assignments>
+ <segmentation-id>414</segmentation-id>
+ <resource-version>4132176</resource-version>
+ </segmentation-assignments>
+ <segmentation-assignments>
+ <segmentation-id>415</segmentation-id>
+ <resource-version>4132176</resource-version>
+ </segmentation-assignments>
+ <ctag-assignments>
+ <ctag-assignment>
+ <vlan-id-inner>inner</vlan-id-inner>
+ <resource-version>ctag-version</resource-version>
+ <relationship-list>
+ <relationship>
+ <related-to>tenant</related-to>
+ <related-link>https://aai-ext1.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/897deadc2b954a6bac6d3c197fb3525e/</related-link>
+ <relationship-data>
+ <relationship-key>tenant.tenant-id</relationship-key>
+ <relationship-value>897deadc2b954a6bac6d3c197fb3525e</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>tenant.tenant-name</property-key>
+ <property-value>MSOTest1</property-value>
+ </related-to-property>
+ </relationship>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/a290b841-f672-44dd-b9cd-6f8c20d7d8c8/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>a290b841-f672-44dd-b9cd-6f8c20d7d8c8</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>vpn-binding.vpn-name</property-key>
+ <property-value>oam_protected_net_6_MTN5_msotest2</property-value>
+ </related-to-property>
+ </relationship>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/24a4b507-853a-4a38-99aa-05fcc54be24d/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>24a4b507-853a-4a38-99aa-05fcc54be24d</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>vpn-binding.vpn-name</property-key>
+ <property-value>oam_protected_net_6_MTN5_msotest1</property-value>
+ </related-to-property>
+ </relationship>
+ </relationship-list>
+ </ctag-assignment>
+ </ctag-assignments>
+ <relationship-list>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>tenant</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
+ <relationship-data>
+ <relationship-key>tenant.tenant-id</relationship-key>
+ <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>network-policy</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg</related-link>
+ <relationship-data>
+ <relationship-key>network-policy.network-policy-id</relationship-key>
+ <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0cg</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>route-table-reference</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN1</related-link>
+ <relationship-data>
+ <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
+ <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>route-table-reference</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN2</related-link>
+ <relationship-data>
+ <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
+ <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
+ </relationship-data>
+ </relationship>
+ </relationship-list>
+ </l3-network>
+ </rest:payload>
+</rest:RESTResponse>"""
+
+ String queryIdAIIResponseTestScenario01 =
+ """<?xml version="1.0" encoding="UTF-8"?>
+<l3-network xmlns="http://org.openecomp.aai.inventory/v7">
+ <network-id>4da55fe4-7a9e-478c-a434-8a98d62265ab</network-id>
+ <network-name>GN_EVPN_direct_net_0_ST1</network-name>
+ <network-type>CONTRAIL30_BASIC</network-type>
+ <network-role>GN_EVPN_direct</network-role>
+ <network-technology>contrail</network-technology>
+ <is-bound-to-vpn>false</is-bound-to-vpn>
+ <service-id>9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <network-role-instance>0</network-role-instance>
+ <resource-version>1465398611</resource-version>
+ <orchestration-status>pending-delete</orchestration-status>
+ <physical-network-name>networkName</physical-network-name>
+ <is-provider-network>false</is-provider-network>
+ <is-shared-network>true</is-shared-network>
+ <is-external-network>false</is-external-network>
+ <subnets>
+ <subnet>
+ <subnet-id>cb1a7b47-5428-44c9-89c2-8b17541c3228</subnet-id>
+ <gateway-address>108.239.40.1</gateway-address>
+ <network-start-address>108.239.40.0</network-start-address>
+ <cidr-mask>28</cidr-mask>
+ <ip-version>4</ip-version>
+ <orchestration-status>pending-delete</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <dhcp-start>108.239.40.0</dhcp-start>
+ <dhcp-end>108.239.40.0</dhcp-end>
+ <resource-version>1465398611</resource-version>
+ <subnet-name>subnetName</subnet-name>
+ <relationship-list />
+ </subnet>
+ <subnet>
+ <subnet-id>e2cc7c14-90f0-4205-840d-b4e07f04e621</subnet-id>
+ <gateway-address>2606:ae00:2e01:604::1</gateway-address>
+ <network-start-address>2606:ae00:2e01:604::</network-start-address>
+ <cidr-mask>64</cidr-mask>
+ <ip-version>6</ip-version>
+ <orchestration-status>pending-delete</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <dhcp-start>2606:ae00:2e01:604::</dhcp-start>
+ <dhcp-end>2606:ae00:2e01:604::</dhcp-end>
+ <resource-version>1465398611</resource-version>
+ <subnet-name>subnetName</subnet-name>
+ <relationship-list />
+ </subnet>
+ </subnets>
+ <ctag-assignments />
+ <segmentation-assignments>
+ <segmentation-id>416</segmentation-id>
+ <resource-version>4132176</resource-version>
+ </segmentation-assignments>
+ <relationship-list>
+ <relationship>
+ <related-to>cloud-region</related-to>
+ <related-link>https://mtanjv9aaas03.aic.cip.com:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/
+ </related-link>
+ <relationship-data>
+ <relationship-key>cloud-region.cloud-region-id</relationship-key>
+ <relationship-value>AAIAIC25</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>cloud-region.cloud-owner</relationship-key>
+ <relationship-value>att-aic</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>cloud-region.owner-defined-type</property-key>
+ <property-value></property-value>
+ </related-to-property>
+ </relationship>
+ <relationship>
+ <related-to>tenant</related-to>
+ <related-link>https://mtanjv9aaas03.aic.cip.com:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/tenants/tenant/4ae1d3446a4c48b2bec44b6cfba06d68/</related-link>
+ <relationship-data>
+ <relationship-key>tenant.tenant-id</relationship-key>
+ <relationship-value>4ae1d3446a4c48b2bec44b6cfba06d68
+ </relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>cloud-region.cloud-owner</relationship-key>
+ <relationship-value>att-aic</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>cloud-region.cloud-region-id</relationship-key>
+ <relationship-value>AAIAIC25</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>tenant.tenant-name</property-key>
+ <property-value>Ruchira Contrail 3.0 test</property-value>
+ </related-to-property>
+ </relationship>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://mtanjv9aaas03.aic.cip.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>9a7b327d9-287aa00-82c4b0-100001</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>vpn-binding.vpn-name</property-key>
+ <property-value>GN_EVPN_direct_net_0_ST1</property-value>
+ </related-to-property>
+ </relationship>
+ <relationship>
+ <related-to>route-table-reference</related-to>
+ <relationship-data>
+ <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
+ <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
+ </relationship-data>
+ </relationship>
+ </relationship-list>
+</l3-network>"""
+
+ String queryIdAIIResponseVpnNotPresent =
+ """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ statusCode="200">
+ <rest:headers>
+ <rest:header name="Transfer-Encoding" value="chunked"/>
+ <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
+ <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
+ <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
+ <rest:header name="Content-Type" value="application/xml"/>
+ <rest:header name="Server" value="Apache-Coyote/1.1"/>
+ <rest:header name="Cache-Control" value="private"/>
+ </rest:headers>
+ <rest:payload contentType="text/xml">
+ <l3-network xmlns="http://org.openecomp.aai.inventory/v6">
+ <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-role>dmz_direct</network-role>
+ <network-technology>contrail</network-technology>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <network-role-instance>0</network-role-instance>
+ <orchestration-status>pending-delete</orchestration-status>
+ <physical-network-name>networkName</physical-network-name>
+ <is-provider-network>false</is-provider-network>
+ <is-shared-network>true</is-shared-network>
+ <is-external-network>false</is-external-network>
+ <subnets>
+ <subnet>
+ <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
+ <gateway-address>107.239.52.1</gateway-address>
+ <network-start-address>107.239.52.0</network-start-address>
+ <cidr-mask>24</cidr-mask>
+ <ip-version>4</ip-version>
+ <orchestration-status>pending-delete</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <subnet-name>subnetName</subnet-name>
+ <relationship-list/>
+ </subnet>
+ </subnets>
+ <relationship-list/>
+ </l3-network>
+ </rest:payload>
+</rest:RESTResponse>"""
+
+ String queryNameAIIResponse =
+ """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ statusCode="200">
+ <rest:headers>
+ <rest:header name="Transfer-Encoding" value="chunked"/>
+ <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
+ <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
+ <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
+ <rest:header name="Content-Type" value="application/xml"/>
+ <rest:header name="Server" value="Apache-Coyote/1.1"/>
+ <rest:header name="Cache-Control" value="private"/>
+ </rest:headers>
+ <rest:payload contentType="text/xml">
+ <l3-network xmlns="http://org.openecomp.aai.inventory/v6">
+ <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-role>dmz_direct</network-role>
+ <network-technology>contrail</network-technology>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <network-role-instance>0</network-role-instance>
+ <orchestration-status>pending-delete</orchestration-status>
+ <subnets>
+ <subnet>
+ <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
+ <gateway-address>107.239.52.1</gateway-address>
+ <network-start-address>107.239.52.0</network-start-address>
+ <cidr-mask>24</cidr-mask>
+ <ip-version>4</ip-version>
+ <orchestration-status>pending-delete</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <relationship-list/>
+ </subnet>
+ </subnets>
+ <relationship-list>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>tenant</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
+ <relationship-data>
+ <relationship-key>tenant.tenant-id</relationship-key>
+ <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
+ </relationship-data>
+ </relationship>
+ </relationship-list>
+ </l3-network>
+ </rest:payload>
+ </rest:RESTResponse>"""
+
+ String queryNameAIIResponseVpnNotPresent =
+ """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ statusCode="200">
+ <rest:headers>
+ <rest:header name="Transfer-Encoding" value="chunked"/>
+ <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
+ <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
+ <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
+ <rest:header name="Content-Type" value="application/xml"/>
+ <rest:header name="Server" value="Apache-Coyote/1.1"/>
+ <rest:header name="Cache-Control" value="private"/>
+ </rest:headers>
+ <rest:payload contentType="text/xml">
+ <l3-network xmlns="http://org.openecomp.aai.inventory/v6>
+ <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-role>dmz_direct</network-role>
+ <network-technology>contrail</network-technology>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <network-role-instance>0</network-role-instance>
+ <orchestration-status>pending-delete</orchestration-status>
+ <subnets>
+ <subnet>
+ <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
+ <gateway-address>107.239.52.1</gateway-address>
+ <network-start-address>107.239.52.0</network-start-address>
+ <cidr-mask>24</cidr-mask>
+ <ip-version>4</ip-version>
+ <orchestration-status>pending-delete</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <relationship-list/>
+ </subnet>
+ </subnets>
+ </l3-network>
+ </rest:payload>
+ </rest:RESTResponse>"""
+
+ String aaiVpnResponseStub =
+ """<rest:payload xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ xmlns="http://org.openecomp.aai.inventory/v8"
+ contentType="text/xml">
+ <vpn-binding>
+ <global-route-target/>
+ </vpn-binding>
+</rest:payload>"""
+
+ String queryVpnBindingAAIResponse =
+ """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ statusCode="200">
+ <rest:headers>
+ <rest:header name="Transfer-Encoding" value="chunked"/>
+ <rest:header name="Date" value="Mon,14 Mar 2016 20:53:33 GMT"/>
+ <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
+ <rest:header name="X-AAI-TXID"
+ value="mtcnjv9aaas01.mtcnj.aic.cip.com-20160314-20:53:33:487-134392"/>
+ <rest:header name="Content-Type" value="application/xml"/>
+ <rest:header name="Server" value="Apache-Coyote/1.1"/>
+ <rest:header name="Cache-Control" value="private"/>
+ </rest:headers>
+ <rest:payload contentType="text/xml">
+ <vpn-binding xmlns="http://org.openecomp.aai.inventory/v6">
+ <vpn-id>9a7b327d9-287aa00-82c4b0-105757</vpn-id>
+ <vpn-name>GN_EVPN_Test</vpn-name>
+ <global-route-target>13979:105757</global-route-target>
+ <relationship-list>
+ <relationship>
+ <related-to>l3-network</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/689ec39e-c5fc-4462-8db2-4f760763ad28/</related-link>
+ <relationship-data>
+ <relationship-key>l3-network.network-id</relationship-key>
+ <relationship-value>689ec39e-c5fc-4462-8db2-4f760763ad28</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>l3-network</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/1a49396b-19b3-40a4-8792-aa2fbd0f0704/</related-link>
+ <relationship-data>
+ <relationship-key>l3-network.network-id</relationship-key>
+ <relationship-value>1a49396b-19b3-40a4-8792-aa2fbd0f0704</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>l3-network</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/774f3329-3c83-4771-86c7-9e6207cd50fd/</related-link>
+ <relationship-data>
+ <relationship-key>l3-network.network-id</relationship-key>
+ <relationship-value>774f3329-3c83-4771-86c7-9e6207cd50fd</relationship-value>
+ </relationship-data>
+ </relationship>
+ </relationship-list>
+ </vpn-binding>
+ </rest:payload>
+</rest:RESTResponse>"""
+
+
+ String updateNetworkRequest =
+ """<updateNetworkRequest>
+ <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
+ <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
+ <networkId>49c86598-f766-46f8-84f8-8d1c1b10f9b4</networkId>
+ <networkStackId>ST_2Bindings_6006/55288ef0-595c-47d3-819e-cf93aaac6326</networkStackId>
+ <networkName>MNS-25180-L-01-dmz_direct_net_1</networkName>
+ <networkType>CONTRAIL_EXTERNAL</networkType>
+ <modelCustomizationUuid>sn5256d1-5a33-55df-13ab-12abad84e222</modelCustomizationUuid>
+ <networkTypeVersion/>
+ <networkTechnology>CONTRAIL</networkTechnology>
+ <providerVlanNetwork>
+ <physicalNetworkName>networkName</physicalNetworkName>
+ <vlans>414,415</vlans>
+ </providerVlanNetwork>
+ <contrailNetwork>
+ <shared>true</shared>
+ <external>false</external>
+ <routeTargets>13979:105757</routeTargets>
+ <routeTargets>13979:105757</routeTargets>
+ <policyFqdns>GN_EVPN_Test</policyFqdns>
+ <routeTableFqdns>refFQDN1</routeTableFqdns>
+ <routeTableFqdns>refFQDN2</routeTableFqdns>
+ </contrailNetwork>
+ <subnets>
+ <allocationPools>
+ <start/>
+ <end/>
+ </allocationPools>
+ <cidr>107.239.52.0/24</cidr>
+ <enableDHCP>true</enableDHCP>
+ <gatewayIp>107.239.52.1</gatewayIp>
+ <ipVersion>4</ipVersion>
+ <subnetId>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnetId>
+ <subnetName>subnetName</subnetName>
+ </subnets>
+ <skipAAI>true</skipAAI>
+ <backout>true</backout>
+ <failIfExists>false</failIfExists>
+ <msoRequest>
+ <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
+ <serviceInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</serviceInstanceId>
+ </msoRequest>
+ <messageId>messageId_generated</messageId>
+ <notificationUrl/>
+</updateNetworkRequest>"""
+
+String updateNetworkRequest_noPhysicalName =
+"""<updateNetworkRequest>
+ <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
+ <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
+ <networkId>49c86598-f766-46f8-84f8-8d1c1b10f9b4</networkId>
+ <networkStackId>ST_2Bindings_6006/55288ef0-595c-47d3-819e-cf93aaac6326</networkStackId>
+ <networkName>MNS-25180-L-01-dmz_direct_net_1</networkName>
+ <networkType>CONTRAIL_EXTERNAL</networkType>
+ <modelCustomizationUuid/>
+ <networkTypeVersion/>
+ <networkTechnology>CONTRAIL</networkTechnology>
+ <providerVlanNetwork>
+ <physicalNetworkName>networkName</physicalNetworkName>
+ <vlans>414,415</vlans>
+ </providerVlanNetwork>
+ <contrailNetwork>
+ <shared>true</shared>
+ <external>false</external>
+ <routeTargets>13979:105757</routeTargets>
+ <routeTargets>13979:105757</routeTargets>
+ <policyFqdns>GN_EVPN_Test</policyFqdns>
+ </contrailNetwork>
+ <subnets>
+ <allocationPools>
+ <start/>
+ <end/>
+ </allocationPools>
+ <cidr>107.239.52.0/24</cidr>
+ <enableDHCP>true</enableDHCP>
+ <gatewayIp>107.239.52.1</gatewayIp>
+ <ipVersion>4</ipVersion>
+ <subnetId>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnetId>
+ <subnetName>subnetName</subnetName>
+ </subnets>
+ <skipAAI>true</skipAAI>
+ <backout>true</backout>
+ <failIfExists>false</failIfExists>
+ <networkParams>
+ <dhcp-enabled>true</dhcp-enabled>
+ <serviceId>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</serviceId>
+ <cidr-mask>true</cidr-mask>
+ <backoutOnFailure>true</backoutOnFailure>
+ <gateway-address>10.10.125.1</gateway-address>
+ </networkParams>
+ <msoRequest>
+ <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
+ <serviceInstanceId>null</serviceInstanceId>
+ </msoRequest>
+ <messageId>messageId_generated</messageId>
+ <notificationUrl/>
+</updateNetworkRequest>"""
+
+ String updateNetworkResponseREST =
+ """<ns2:updateNetworkContrailResponse xmlns:ns2="http://org.openecomp.mso/network">
+ <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
+ <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
+ <networkFqdn>default-domain:MSOTest:GN_EVPN_direct_net_0_ST1</networkFqdn>
+ <networkStackId></networkStackId>
+ <subnetMap>
+ <entry>
+ <key>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</key>
+ <value>bd8e87c6-f4e2-41b8-b0bc-9596aa00cd73</value>
+ </entry>
+ <entry>
+ <key>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</key>
+ <value>bd8e87c6-f4e2-41b8-b0bc-9596aa00cd73</value>
+ </entry>
+ </subnetMap>
+ <rollback>
+ <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
+ <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
+ <networkStackId></networkStackId>
+ <networkType>CONTRAIL_EXTERNAL</networkType>
+ <networkUpdated>true</networkUpdated>
+ <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
+ <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
+ <msoRequest>
+ <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId>
+ <serviceInstanceId></serviceInstanceId>
+ </msoRequest>
+ </rollback>
+ <messageId>messageId_generated</messageId>
+</ns2:updateNetworkContrailResponse>"""
+
+ String updateRollbackNetworkRequest =
+ """<rollbackNetworkRequest>
+ <networkRollback>
+ <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
+ <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
+ <networkStackId/>
+ <networkType>CONTRAIL_EXTERNAL</networkType>
+ <networkUpdated>true</networkUpdated>
+ <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
+ <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
+ <msoRequest>
+ <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId>
+ <serviceInstanceId/>
+ </msoRequest>
+ </networkRollback>
+</rollbackNetworkRequest>"""
+
+ String updateNetworkResponse =
+ """<ns2:updateNetworkContrailResponse xmlns:ns2="http://org.openecomp.mso/network"
+ xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
+ <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
+ <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
+ <networkStackId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkStackId>
+ <networkFqdn>default-domain:MSOTest:GN_EVPN_direct_net_0_ST1</networkFqdn>
+ <subnetIdMap>
+ <entry>
+ <key>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</key>
+ <value>bd8e87c6-f4e2-41b8-b0bc-9596aa00cd73</value>
+ </entry>
+ </subnetIdMap>
+ <rollback>
+ <cloudId>RDM2WAGPLCP</cloudId>
+ <msoRequest>
+ <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId>
+ <serviceInstanceId/>
+ </msoRequest>
+ <networkUpdated>true</networkUpdated>
+ <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
+ <networkType>CONTRAIL_EXTERNAL</networkType>
+ <networkUpdated>false</networkUpdated>
+ <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
+ <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
+ </rollback>
+</ns2:updateNetworkContrailResponse>"""
+
+ String updateContrailAAIPayloadRequest =
+ """<l3-network xmlns="http://org.openecomp.aai.inventory/v9">
+ <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-role>dmz_direct</network-role>
+ <network-technology>contrail</network-technology>
+ <neutron-network-id>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutron-network-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <network-role-instance>0</network-role-instance>
+ <resource-version>l3-version</resource-version>
+ <orchestration-status>Active</orchestration-status>
+ <heat-stack-id>ST_2Bindings_6006/55288ef0-595c-47d3-819e-cf93aaac6326</heat-stack-id>
+ <contrail-network-fqdn>default-domain:MSOTest:GN_EVPN_direct_net_0_ST1</contrail-network-fqdn>
+ <physical-network-name>networkName</physical-network-name>
+ <is-provider-network>false</is-provider-network>
+ <is-shared-network>true</is-shared-network>
+ <is-external-network>false</is-external-network>
+ <subnets>
+ <subnet>
+ <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
+ <neutron-subnet-id>bd8e87c6-f4e2-41b8-b0bc-9596aa00cd73</neutron-subnet-id>
+ <gateway-address>107.239.52.1</gateway-address>
+ <network-start-address>107.239.52.0</network-start-address>
+ <cidr-mask>24</cidr-mask>
+ <ip-version>4</ip-version>
+ <orchestration-status>Active</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <subnet-name>subnetName</subnet-name>
+ </subnet>
+ </subnets>
+ <segmentation-assignments>
+ <segmentation-id>414</segmentation-id>
+ <resource-version>4132176</resource-version>
+ </segmentation-assignments>
+ <segmentation-assignments>
+ <segmentation-id>415</segmentation-id>
+ <resource-version>4132176</resource-version>
+ </segmentation-assignments>
+ <ctag-assignments>
+ <ctag-assignment>
+ <vlan-id-inner>inner</vlan-id-inner>
+ <resource-version>ctag-version</resource-version>
+ <relationship-list>
+ <relationship>
+ <related-to>tenant</related-to>
+ <related-link>https://aai-ext1.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/897deadc2b954a6bac6d3c197fb3525e/</related-link>
+ <relationship-data>
+ <relationship-key>tenant.tenant-id</relationship-key>
+ <relationship-value>897deadc2b954a6bac6d3c197fb3525e</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>tenant.tenant-name</property-key>
+ <property-value>MSOTest1</property-value>
+ </related-to-property>
+ </relationship>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/a290b841-f672-44dd-b9cd-6f8c20d7d8c8/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>a290b841-f672-44dd-b9cd-6f8c20d7d8c8</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>vpn-binding.vpn-name</property-key>
+ <property-value>oam_protected_net_6_MTN5_msotest2</property-value>
+ </related-to-property>
+ </relationship>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/24a4b507-853a-4a38-99aa-05fcc54be24d/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>24a4b507-853a-4a38-99aa-05fcc54be24d</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>vpn-binding.vpn-name</property-key>
+ <property-value>oam_protected_net_6_MTN5_msotest1</property-value>
+ </related-to-property>
+ </relationship>
+ </relationship-list>
+ </ctag-assignment>
+ </ctag-assignments>
+ <relationship-list>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>vpn-binding</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
+ <relationship-data>
+ <relationship-key>vpn-binding.vpn-id</relationship-key>
+ <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>tenant</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
+ <relationship-data>
+ <relationship-key>tenant.tenant-id</relationship-key>
+ <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>network-policy</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg</related-link>
+ <relationship-data>
+ <relationship-key>network-policy.network-policy-id</relationship-key>
+ <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0cg</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>route-table-reference</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN1</related-link>
+ <relationship-data>
+ <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
+ <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>route-table-reference</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN2</related-link>
+ <relationship-data>
+ <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
+ <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
+ </relationship-data>
+ </relationship>
+ </relationship-list>
+</l3-network>"""
+
+
+ String updateContrailAAIResponse =
+ """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ statusCode="200">
+ <rest:headers>
+ <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
+ <rest:header name="Content-Length" value="0"/>
+ <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
+ <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:551-132672"/>
+ <rest:header name="Server" value="Apache-Coyote/1.1"/>
+ <rest:header name="Cache-Control" value="private"/>
+ </rest:headers>
+</rest:RESTResponse>"""
+
+ String updateNetworkErrorResponse =
+ """<updateNetworkError>
+ <messageId>680bd458-5ec1-4a16-b77c-509022e53450</messageId><category>INTERNAL</category>
+ <message>400 Bad Request: The server could not comply with the request since it is either malformed or otherwise incorrect., error.type=StackValidationFailed, error.message=Property error: : resources.network.properties: : Unknown Property network_ipam_refs_data</message>
+ <rolledBack>true</rolledBack>
+ </updateNetworkError>"""
+
+
+ String networkException500 =
+ """<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:VersionMismatch</faultcode><faultstring>"http://org.openecomp.mso/network", the namespace on the "updateNetworkContrail" element, is not a valid SOAP version.</faultstring></soap:Fault></soap:Body></soap:Envelope>"""
+
+ String aaiResponse =
+ """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ statusCode="200">
+ <rest:headers>
+ <rest:header name="Transfer-Encoding" value="chunked"/>
+ <rest:header name="Date" value="Sat,30 Jan 2016 20:09:24 GMT"/>
+ <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
+ <rest:header name="X-AAI-TXID"
+ value="mtcnjv9aaas01.mtcnj.aic.cip.com-20160130-20:09:24:814-165843"/>
+ <rest:header name="Content-Type" value="application/xml"/>
+ <rest:header name="Server" value="Apache-Coyote/1.1"/>
+ <rest:header name="Cache-Control" value="private"/>
+ </rest:headers>
+ <rest:payload contentType="text/xml">
+ <l3-network xmlns="http://org.openecomp.aai.inventory/v3">
+ <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
+ <network-name>HSL_direct_net_2</network-name>
+ <network-type>CONTRAIL_BASIC</network-type>
+ <network-role>HSL_direct</network-role>
+ <network-technology>contrail</network-technology>
+ <neutron-network-id>8bbd3edf-b835-4610-96a2-a5cafa029042</neutron-network-id>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <orchestration-status>active</orchestration-status>
+ <heat-stack-id>HSL_direct_net_2/57594a56-1c92-4a38-9caa-641c1fa3d4b6</heat-stack-id>
+ <subnets>
+ <subnet>
+ <subnet-id>ea5f2a2c-604f-47ff-a9c5-253ee4f0ef0a</subnet-id>
+ <neutron-subnet-id>5a77fdc2-7789-4649-a1b9-6eaf1db1813a</neutron-subnet-id>
+ <gateway-address>172.16.34.1</gateway-address>
+ <network-start-address>172.16.34.0</network-start-address>
+ <cidr-mask>28</cidr-mask>
+ <ip-version>4</ip-version>
+ <orchestration-status>active</orchestration-status>
+ <dhcp-enabled>true</dhcp-enabled>
+ <relationship-list/>
+ </subnet>
+ </subnets>
+ <relationship-list>
+ <relationship>
+ <related-to>tenant</related-to>
+ <related-link>https://aai-app-e2e.test.com:8443/aai/v3/cloud-infrastructure/tenants/tenant/e81d842d3e8b45c5a59f57cd76af3aaf/</related-link>
+ <relationship-data>
+ <relationship-key>tenant.tenant-id</relationship-key>
+ <relationship-value>e81d842d3e8b45c5a59f57cd76af3aaf</relationship-value>
+ </relationship-data>
+ </relationship>
+ </relationship-list>
+ </l3-network>
+ </rest:payload>
+ </rest:RESTResponse>"""
+
+ String changeAssignSDNCRequest =
+ """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:ns5="http://org.openecomp/mso/request/types/v1"
+ xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>changeassign</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
+ </sdncadapter:RequestHeader>
+ <aetgt:SDNCRequestData>
+ <request-information>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <request-action>NetworkActivateRequest</request-action>
+ <source>VID</source>
+ <notification-url/>
+ <order-number/>
+ <order-version/>
+ </request-information>
+ <service-information>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <service-type>MSO-dev-service-type</service-type>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ <subscriber-name>MSO_1610_dev</subscriber-name>
+ </service-information>
+ <network-request-information>
+ <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <tenant>7dd5365547234ee8937416c65507d266</tenant>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ </network-request-information>
+ </aetgt:SDNCRequestData>
+</aetgt:SDNCAdapterWorkflowRequest>"""
+
+String assignResponse =
+"""<sdncadapterworkflow:SDNCAdapterWorkflowResponse xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1" xmlns:tag0="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <sdncadapterworkflow:response-data> <tag0:CallbackHeader> <tag0:RequestId>006927ca-f5a3-47fd-880c-dfcbcd81a093</tag0:RequestId> <tag0:ResponseCode>200</tag0:ResponseCode> <tag0:ResponseMessage>OK</tag0:ResponseMessage> </tag0:CallbackHeader> <tag0:RequestData xsi:type="xs:string"><output xmlns="com:att:sdnctl:vnf"><response-code>200</response-code><svc-request-id>006927ca-f5a3-47fd-880c-dfcbcd81a093</svc-request-id><ack-final-indicator>Y</ack-final-indicator><service-information><subscriber-name>notsurewecare</subscriber-name><service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id><service-instance-id>GN_EVPN_direct_net_0_ST_noGW</service-instance-id></service-information><network-information><network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id></network-information></output></tag0:RequestData> </sdncadapterworkflow:response-data> </sdncadapterworkflow:SDNCAdapterWorkflowResponse>"""
+
+ String sdncRollbackRequest =
+ """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:ns5="http://org.openecomp/mso/request/types/v1"
+ xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>rollback</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
+ </sdncadapter:RequestHeader>
+ <aetgt:SDNCRequestData>
+ <request-information>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <request-action>NetworkActivateRequest</request-action>
+ <source>VID</source>
+ <notification-url/>
+ <order-number/>
+ <order-version/>
+ </request-information>
+ <service-information>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <service-type>MSO-dev-service-type</service-type>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ <subscriber-name>MSO_1610_dev</subscriber-name>
+ </service-information>
+ <network-request-information>
+ <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <tenant>7dd5365547234ee8937416c65507d266</tenant>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ </network-request-information>
+ </aetgt:SDNCRequestData>
+</aetgt:SDNCAdapterWorkflowRequest>"""
+
+ String sdncAdapterWorkflowResponse =
+ """<aetgt:SDNCAdapterWorkflowResponse xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1">
+ <sdncadapterworkflow:response-data>
+<tag0:CallbackHeader xmlns:tag0="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
+ <tag0:RequestId>745b1b50-e39e-4685-9cc8-c71f0bde8bf0</tag0:RequestId>
+ <tag0:ResponseCode>200</tag0:ResponseCode>
+ <tag0:ResponseMessage>OK</tag0:ResponseMessage>
+</tag0:CallbackHeader>
+ <tag0:RequestData xmlns:tag0="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:type="xs:string">&lt;output xmlns="com:att:sdnctl:vnf"&gt;&lt;svc-request-id&gt;00703dc8-71ff-442d-a4a8-3adc5beef6a9&lt;/svc-request-id&gt;&lt;response-code&gt;200&lt;/response-code&gt;&lt;ack-final-indicator&gt;Y&lt;/ack-final-indicator&gt;&lt;network-information&gt;&lt;network-id&gt;49c86598-f766-46f8-84f8-8d1c1b10f9b4&lt;/network-id&gt;&lt;/network-information&gt;&lt;service-information&gt;&lt;service-type&gt;a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb&lt;/service-type&gt;&lt;service-instance-id&gt;MNS-25180-L-01-dmz_direct_net_1&lt;/service-instance-id&gt;&lt;subscriber-name&gt;notsurewecare&lt;/subscriber-name&gt;&lt;/service-information&gt;&lt;/output&gt;</tag0:RequestData>
+ </sdncadapterworkflow:response-data>
+</aetgt:SDNCAdapterWorkflowResponse>"""
+
+
+ String sdncAdapterWorkflowResponse_Error =
+ """<sdncadapterworkflow:SDNCAdapterWorkflowResponse xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:tag0="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="com:att:sdnctl:vnf">
+ <sdncadapterworkflow:response-data>
+ <tag0:RequestData xsi:type="xs:string">
+ <output>
+ <response-code>400</response-code>
+ <response-message>Error writing to l3-netework</response-message>
+ <ack-final-indicator>Y</ack-final-indicator>
+ <svc-request-id>c79240d8-34b5-4853-af69-2021928dba00</svc-request-id>
+ </output>
+ </tag0:RequestData>
+ </sdncadapterworkflow:response-data>
+</sdncadapterworkflow:SDNCAdapterWorkflowResponse>"""
+
+ String expected_sdncAdapterWorkflowResponse_Error =
+ """<sdncadapterworkflow:SDNCAdapterWorkflowResponse xmlns="com:att:sdnctl:vnf"
+ xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:tag0="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <sdncadapterworkflow:response-data>
+ <tag0:RequestData xsi:type="xs:string">
+ <output>
+ <response-code>400</response-code>
+ <response-message>Error writing to l3-netework</response-message>
+ <ack-final-indicator>Y</ack-final-indicator>
+ <svc-request-id>c79240d8-34b5-4853-af69-2021928dba00</svc-request-id>
+ </output>
+ </tag0:RequestData>
+ </sdncadapterworkflow:response-data>
+</sdncadapterworkflow:SDNCAdapterWorkflowResponse>"""
+
+ String sdncAdapterWorkflowFormattedResponse =
+ """<aetgt:SDNCAdapterWorkflowResponse xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns="com:att:sdnctl:vnf">
+ <aetgt:response-data>
+ <output>
+ <svc-request-id>00703dc8-71ff-442d-a4a8-3adc5beef6a9</svc-request-id>
+ <response-code>200</response-code>
+ <ack-final-indicator>Y</ack-final-indicator>
+ <network-information>
+ <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
+ </network-information>
+ <service-information>
+ <service-type>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-type>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ <subscriber-name>notsurewecare</subscriber-name>
+ </service-information>
+ </output>
+ </aetgt:response-data>
+</aetgt:SDNCAdapterWorkflowResponse>"""
+
+String rollbackSDNCRequest =
+"""<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:ns5="http://org.openecomp/mso/request/types/v1"
+ xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>rollback</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
+ </sdncadapter:RequestHeader>
+ <aetgt:SDNCRequestData>
+ <request-information>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <request-action>CreateNetworkInstance</request-action>
+ <source>VID</source>
+ <notification-url/>
+ <order-number/>
+ <order-version/>
+ </request-information>
+ <service-information>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <service-type>MSO-dev-service-type</service-type>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ <subscriber-name>MSO_1610_dev</subscriber-name>
+ </service-information>
+ <network-information>
+ <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <ecomp-model-information>
+ <model-invariant-uuid>invariant-uuid</model-invariant-uuid>
+ <model-customization-uuid>customization-uuid</model-customization-uuid>
+ <model-uuid>uuid</model-uuid>
+ <model-version>version</model-version>
+ <model-name>CONTRAIL_EXTERNAL</model-name>
+ </ecomp-model-information>
+ </network-information>
+ <network-request-information>
+ <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
+ <network-type>CONTRAIL_EXTERNAL</network-type>
+ <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <tenant>7dd5365547234ee8937416c65507d266</tenant>
+ <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
+ </network-request-information>
+ </aetgt:SDNCRequestData>
+</aetgt:SDNCAdapterWorkflowRequest>"""
+
+String rollbackNetworkRequest =
+"""<NetworkAdapter:rollbackNetwork xmlns:NetworkAdapter="http://org.openecomp.mso/network">
+ <rollback>
+ <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
+ <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
+ <networkStackId/>
+ <networkType>CONTRAIL_EXTERNAL</networkType>
+ <networkCreated>true</networkCreated>
+ <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
+ <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
+ <msoRequest>
+ <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId>
+ <serviceInstanceId/>
+ </msoRequest>
+ </rollback>
+</NetworkAdapter:rollbackNetwork>"""
+
+// - - - - - - - -
+
+
+ @Before
+ public void init()
+ {
+ MockitoAnnotations.initMocks(this)
+
+ }
+
+ public void initializeVariables (Execution mockExecution) {
+
+ verify(mockExecution).setVariable(Prefix + "messageId", "")
+ verify(mockExecution).setVariable("BasicAuthHeaderValuePO", "")
+ verify(mockExecution).setVariable("BasicAuthHeaderValueSDNC", "")
+ verify(mockExecution).setVariable(Prefix + "networkRequest", "")
+ verify(mockExecution).setVariable(Prefix + "networkInputs", "")
+ verify(mockExecution).setVariable(Prefix + "networkOutputs", "")
+ verify(mockExecution).setVariable(Prefix + "requestId", "")
+ verify(mockExecution).setVariable(Prefix + "source", "")
+ verify(mockExecution).setVariable(Prefix + "networkId", "")
+
+ verify(mockExecution).setVariable(Prefix + "isPONR", false)
+
+ // AAI query Cloud Region
+ verify(mockExecution).setVariable(Prefix + "queryCloudRegionRequest","")
+ verify(mockExecution).setVariable(Prefix + "queryCloudRegionReturnCode","")
+ verify(mockExecution).setVariable(Prefix + "queryCloudRegionResponse","")
+ verify(mockExecution).setVariable(Prefix + "cloudRegionPo","")
+ verify(mockExecution).setVariable(Prefix + "cloudRegionSdnc","")
+ verify(mockExecution).setVariable(Prefix + "isCloudRegionGood", false)
+
+ // AAI query Id
+ verify(mockExecution).setVariable(Prefix + "queryIdAAIRequest","")
+ verify(mockExecution).setVariable(Prefix + "queryIdAAIResponse", "")
+ verify(mockExecution).setVariable(Prefix + "aaiIdReturnCode", "")
+
+ // AAI query vpn binding
+ verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIRequest","")
+ verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIResponse", "")
+ verify(mockExecution).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "")
+ verify(mockExecution).setVariable(Prefix + "vpnBindings", null)
+ verify(mockExecution).setVariable(Prefix + "vpnCount", 0)
+ verify(mockExecution).setVariable(Prefix + "routeCollection", "")
+
+ // AAI query network policy
+ verify(mockExecution).setVariable(Prefix + "queryNetworkPolicyAAIRequest","")
+ verify(mockExecution).setVariable(Prefix + "queryNetworkPolicyAAIResponse", "")
+ verify(mockExecution).setVariable(Prefix + "aaiQqueryNetworkPolicyReturnCode", "")
+ verify(mockExecution).setVariable(Prefix + "networkPolicyUriList", null)
+ verify(mockExecution).setVariable(Prefix + "networkPolicyCount", 0)
+ verify(mockExecution).setVariable(Prefix + "networkCollection", "")
+
+ // AAI query route table reference
+ verify(mockExecution).setVariable(Prefix + "queryNetworkTableRefAAIRequest","")
+ verify(mockExecution).setVariable(Prefix + "queryNetworkTableRefAAIResponse", "")
+ verify(mockExecution).setVariable(Prefix + "aaiQqueryNetworkTableRefReturnCode", "")
+ verify(mockExecution).setVariable(Prefix + "networkTableRefUriList", null)
+ verify(mockExecution).setVariable(Prefix + "networkTableRefCount", 0)
+ verify(mockExecution).setVariable(Prefix + "tableRefCollection", "")
+
+
+ // AAI requery Id
+ verify(mockExecution).setVariable(Prefix + "requeryIdAAIRequest","")
+ verify(mockExecution).setVariable(Prefix + "requeryIdAAIResponse", "")
+ verify(mockExecution).setVariable(Prefix + "aaiRequeryIdReturnCode", "")
+
+ // AAI update contrail
+ verify(mockExecution).setVariable(Prefix + "updateContrailAAIUrlRequest","")
+ verify(mockExecution).setVariable(Prefix + "updateContrailAAIPayloadRequest","")
+ verify(mockExecution).setVariable(Prefix + "updateContrailAAIResponse", "")
+ verify(mockExecution).setVariable(Prefix + "aaiUpdateContrailReturnCode", "")
+
+ verify(mockExecution).setVariable(Prefix + "updateNetworkRequest", "")
+ verify(mockExecution).setVariable(Prefix + "updateNetworkResponse", "")
+ verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", "")
+ //verify(mockExecution).setVariable(Prefix + "rollbackNetworkResponse", "")
+ verify(mockExecution).setVariable(Prefix + "networkReturnCode", "")
+ //verify(mockExecution).setVariable(Prefix + "rollbackNetworkReturnCode", "")
+ verify(mockExecution).setVariable(Prefix + "isNetworkRollbackNeeded", false)
+
+ verify(mockExecution).setVariable(Prefix + "changeAssignSDNCRequest", "")
+ verify(mockExecution).setVariable(Prefix + "changeAssignSDNCResponse", "")
+ verify(mockExecution).setVariable(Prefix + "rollbackSDNCRequest", "")
+ //verify(mockExecution).setVariable(Prefix + "rollbackSDNCResponse", "")
+ verify(mockExecution).setVariable(Prefix + "sdncReturnCode", "")
+ //verify(mockExecution).setVariable(Prefix + "rollbackSDNCReturnCode", "")
+ verify(mockExecution).setVariable(Prefix + "isSdncRollbackNeeded", false)
+ verify(mockExecution).setVariable(Prefix + "sdncResponseSuccess", false)
+
+ verify(mockExecution).setVariable(Prefix + "isVnfBindingPresent", false)
+ verify(mockExecution).setVariable(Prefix + "Success", false)
+ verify(mockExecution).setVariable(Prefix + "serviceInstanceId", "")
+
+ verify(mockExecution).setVariable(Prefix + "isException", false)
+
+ }
+
+ @Test
+ //@Ignore
+ public void preProcessRequest_NetworkRequest() {
+
+ println "************ preProcessRequest_Payload ************* "
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("isBaseVfModule")).thenReturn(true)
+ when(mockExecution.getVariable("recipeTimeout")).thenReturn(0)
+ when(mockExecution.getVariable("requestAction")).thenReturn("UPDATE")
+ when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable("vnfId")).thenReturn("")
+ when(mockExecution.getVariable("volumeGroupId")).thenReturn("")
+ when(mockExecution.getVariable("networkId")).thenReturn("49c86598-f766-46f8-84f8-8d1c1b10f9b4")
+ when(mockExecution.getVariable("serviceType")).thenReturn("MOG")
+ when(mockExecution.getVariable("networkType")).thenReturn("modelName")
+ when(mockExecution.getVariable("bpmnRequest")).thenReturn(jsonIncomingRequest)
+ when(mockExecution.getVariable("sdncVersion")).thenReturn("1610")
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
+ when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("URN_mso_rollback")).thenReturn("true")
+ when(mockExecution.getVariable("disableRollback")).thenReturn("true")
+
+ // preProcessRequest(Execution execution)
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.preProcessRequest(mockExecution)
+
+ verify(mockExecution).getVariable("isDebugLogEnabled")
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+
+ //verify variable initialization
+ initializeVariables(mockExecution)
+
+ // Authentications
+ verify(mockExecution).setVariable("action", "UPDATE")
+ verify(mockExecution).setVariable(Prefix + "networkRequest", expectedNetworkRequest)
+ verify(mockExecution).setVariable(Prefix + "rollbackEnabled", false)
+ verify(mockExecution).setVariable(Prefix + "networkInputs", expectedNetworkInputs)
+ verify(mockExecution).setVariable("BasicAuthHeaderValuePO", "Basic cGFzc3dvcmQ=")
+ verify(mockExecution).setVariable("BasicAuthHeaderValueSDNC", "Basic cGFzc3dvcmQ=")
+ verify(mockExecution).setVariable(Prefix + "networkOutputs", "")
+
+ }
+
+ @Test
+ //@Ignore
+ public void preProcessRequest_vPERNetworkRequest() {
+
+ def networkModelInfo = """{"modelUuid": "sn5256d1-5a33-55df-13ab-12abad84e111",
+ "modelName": "CONTRAIL_EXTERNAL",
+ "modelType": "CONTRAIL_EXTERNAL",
+ "modelVersion": "1",
+ "modelCustomizationUuid": "sn5256d1-5a33-55df-13ab-12abad84e222",
+ "modelInvariantUuid": "sn5256d1-5a33-55df-13ab-12abad84e764"
+ }""".trim()
+
+ println "************ preProcessRequest_Payload ************* "
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("disableRollback")).thenReturn("true")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable("networkId")).thenReturn("49c86598-f766-46f8-84f8-8d1c1b10f9b4") // optional
+ when(mockExecution.getVariable("networkName")).thenReturn("MNS-25180-L-01-dmz_direct_net_1") // optional
+ when(mockExecution.getVariable("productFamilyId")).thenReturn("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb")
+ when(mockExecution.getVariable("networkModelInfo")).thenReturn("CONTRAIL_EXTERNAL")
+ when(mockExecution.getVariable("lcpCloudRegionId")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable("tenantId")).thenReturn("7dd5365547234ee8937416c65507d266")
+ when(mockExecution.getVariable("failIfExists")).thenReturn("false")
+ when(mockExecution.getVariable("networkModelInfo")).thenReturn(networkModelInfo)
+ when(mockExecution.getVariable("sdncVersion")).thenReturn("1702")
+ when(mockExecution.getVariable("action")).thenReturn("UPDATE")
+ when(mockExecution.getVariable("subscriptionServiceType")).thenReturn("MSO-dev-service-type")
+ when(mockExecution.getVariable("globalSubscriberId")).thenReturn("globalId_45678905678")
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+
+ when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
+ when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
+
+ when(mockExecution.getVariable("URN_mso_rollback")).thenReturn("true")
+ 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)
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.preProcessRequest(mockExecution)
+
+ verify(mockExecution).getVariable("isDebugLogEnabled")
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+
+ //verify variable initialization
+ initializeVariables(mockExecution)
+
+ // Authentications
+ verify(mockExecution).setVariable("action", "UPDATE")
+ verify(mockExecution).setVariable(Prefix + "networkRequest", expectedVperNetworkRequest)
+ verify(mockExecution).setVariable(Prefix + "rollbackEnabled", false)
+ verify(mockExecution).setVariable(Prefix + "networkInputs", expectedVperNetworkInputs)
+ verify(mockExecution).setVariable("BasicAuthHeaderValuePO", "Basic cGFzc3dvcmQ=")
+ verify(mockExecution).setVariable("BasicAuthHeaderValueSDNC", "Basic cGFzc3dvcmQ=")
+ verify(mockExecution).setVariable(Prefix + "networkOutputs", "")
+
+ }
+
+ @Test
+ //@Ignore
+ public void preProcessRequest_MissingNetworkId() {
+
+ println "************ preProcessRequest_MissingName() ************* "
+
+ WorkflowException missingNameWorkflowException = new WorkflowException("DoUpdateNetworkInstance", 2500, "Variable 'network-id' value/element is missing.")
+
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("isBaseVfModule")).thenReturn(true)
+ when(mockExecution.getVariable("recipeTimeout")).thenReturn(0)
+ when(mockExecution.getVariable("requestAction")).thenReturn("UPDATE")
+ when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable("vnfId")).thenReturn("")
+ when(mockExecution.getVariable("volumeGroupId")).thenReturn("")
+ //when(mockExecution.getVariable("networkId")).thenReturn("49c86598-f766-46f8-84f8-8d1c1b10f9b4")
+ when(mockExecution.getVariable("serviceType")).thenReturn("MOG")
+ when(mockExecution.getVariable("networkType")).thenReturn("modelName")
+ when(mockExecution.getVariable("bpmnRequest")).thenReturn(jsonIncomingRequest)
+ when(mockExecution.getVariable("sdncVersion")).thenReturn("1610")
+
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
+ when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("URN_mso_rollback")).thenReturn("true")
+ when(mockExecution.getVariable("disableRollback")).thenReturn("true")
+
+ // preProcessRequest(Execution execution)
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ try {
+ DoUpdateNetworkInstance.preProcessRequest(mockExecution)
+ } catch (Exception ex) {
+ println " Test End - Handle catch-throw BpmnError()! "
+ }
+
+ verify(mockExecution, atLeast(1)).getVariable("isDebugLogEnabled")
+ verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix + "")
+
+ //verify variable initialization
+ initializeVariables(mockExecution)
+
+ verify(mockExecution).setVariable("action", "UPDATE")
+ verify(mockExecution).setVariable(Prefix + "networkRequest", expectedNetworkRequestMissingNetworkId)
+ verify(mockExecution).setVariable(Prefix + "rollbackEnabled", false)
+ verify(mockExecution).setVariable(Prefix + "networkInputs", expectedNetworkInputsMissingNetworkId)
+ verify(mockExecution).setVariable(Prefix + "messageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ verify(mockExecution).setVariable(Prefix + "source", "VID")
+ verify(mockExecution).setVariable(Prefix + "networkOutputs", "")
+
+ verify(mockExecution).setVariable(eq("WorkflowException"), refEq(missingNameWorkflowException))
+
+ }
+
+ @Test
+ //@Ignore
+ public void preProcessRequest_MissingCloudRegion() {
+
+ println "************ preProcessRequest_MissingCloudRegion() ************* "
+
+ WorkflowException missingCloudRegionWorkflowException = new WorkflowException("DoUpdateNetworkInstance", 2500, "requestDetails has missing 'aic-cloud-region' value/element.")
+
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("isBaseVfModule")).thenReturn(true)
+ when(mockExecution.getVariable("recipeTimeout")).thenReturn(0)
+ when(mockExecution.getVariable("requestAction")).thenReturn("UPDATE")
+ when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable("vnfId")).thenReturn("")
+ when(mockExecution.getVariable("volumeGroupId")).thenReturn("")
+ when(mockExecution.getVariable("networkId")).thenReturn("networkId")
+ when(mockExecution.getVariable("serviceType")).thenReturn("MOG")
+ when(mockExecution.getVariable("networkType")).thenReturn("modelName")
+
+ when(mockExecution.getVariable("bpmnRequest")).thenReturn(jsonIncomingRequest_MissingCloudRegion)
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
+ when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("URN_mso_rollback")).thenReturn("true")
+ when(mockExecution.getVariable("disableRollback")).thenReturn("true")
+
+ // preProcessRequest(Execution execution)
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ try {
+ DoUpdateNetworkInstance.preProcessRequest(mockExecution)
+ } catch (Exception ex) {
+ println " Test End - Handle catch-throw BpmnError()! "
+ }
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(mockExecution)
+
+ verify(mockExecution, atLeast(1)).getVariable("isDebugLogEnabled")
+ verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix + "")
+
+ //verify variable initialization
+ initializeVariables(mockExecution)
+
+ verify(mockExecution).setVariable("action", "UPDATE")
+ verify(mockExecution).setVariable(Prefix + "networkRequest", expectedNetworkRequestMissingCloudRegion)
+ verify(mockExecution).setVariable(Prefix + "rollbackEnabled", false)
+ verify(mockExecution).setVariable(Prefix + "networkInputs", expectedNetworkInputMissingCloudRegion)
+ verify(mockExecution).setVariable(Prefix + "messageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ verify(mockExecution).setVariable(Prefix + "source", "VID")
+
+ verify(mockExecution).setVariable(eq("WorkflowException"), refEq(missingCloudRegionWorkflowException))
+
+ }
+
+ @Test
+ //@Ignore
+ public void prepareUpdateNetworkRequest() {
+
+ println "************ prepareNetworkRequest ************* "
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedVperNetworkRequest)
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse)
+ when(mockExecution.getVariable(Prefix + "cloudRegionPo")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("messageId_generated")
+ when(mockExecution.getVariable(Prefix + "source")).thenReturn("VID")
+ //when(mockExecution.getVariable(Prefix + "queryVpnBindingAAIResponse")).thenReturn(queryVpnBindingAAIResponse)
+ when(mockExecution.getVariable(Prefix + "routeCollection")).thenReturn("<routeTargets>13979:105757</routeTargets><routeTargets>13979:105757</routeTargets>")
+ when(mockExecution.getVariable(Prefix + "networkCollection")).thenReturn("<policyFqdns>GN_EVPN_Test</policyFqdns>")
+ when(mockExecution.getVariable(Prefix + "tableRefCollection")).thenReturn("<routeTableFqdns>refFQDN1</routeTableFqdns><routeTableFqdns>refFQDN2</routeTableFqdns>")
+ when(mockExecution.getVariable(Prefix + "requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ //when(mockExecution.getVariable("URN_?????")).thenReturn("") // notificationUrl, //TODO - is this coming from URN? What variable/value to use?
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true")
+
+ // preProcessRequest(Execution execution)
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.prepareUpdateNetworkRequest(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(mockExecution)
+
+ // verify set prefix = Prefix + ""
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+
+ verify(mockExecution).setVariable(Prefix + "updateNetworkRequest", updateNetworkRequest)
+
+ }
+
+
+ @Test
+ //@Ignore
+ public void prepareUpdateNetworkRequest_NoPhysicalname() {
+
+ println "************ prepareNetworkRequest ************* "
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(NetworkRequest_noPhysicalName)
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse)
+ when(mockExecution.getVariable(Prefix + "cloudRegionPo")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("messageId_generated")
+ when(mockExecution.getVariable(Prefix + "source")).thenReturn("VID")
+ //when(mockExecution.getVariable(Prefix + "queryVpnBindingAAIResponse")).thenReturn(queryVpnBindingAAIResponse)
+ when(mockExecution.getVariable(Prefix + "routeCollection")).thenReturn("<routeTargets>13979:105757</routeTargets><routeTargets>13979:105757</routeTargets>")
+ when(mockExecution.getVariable(Prefix + "networkCollection")).thenReturn("<policyFqdns>GN_EVPN_Test</policyFqdns>")
+ when(mockExecution.getVariable(Prefix + "tableRefCollection")).thenReturn("")
+ when(mockExecution.getVariable(Prefix + "requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ //when(mockExecution.getVariable("URN_?????")).thenReturn("") // notificationUrl, //TODO - is this coming from URN? What variable/value to use?
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true")
+
+ // preProcessRequest(Execution execution)
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.prepareUpdateNetworkRequest(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(mockExecution)
+
+ // verify set prefix = Prefix + ""
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+
+ verify(mockExecution).setVariable(Prefix + "updateNetworkRequest", updateNetworkRequest_noPhysicalName)
+
+ }
+
+ @Test
+ //@Ignore
+ public void prepareSDNCRequest() {
+
+ println "************ prepareSDNCRequest ************* "
+
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
+ when(mockExecution.getVariable(Prefix + "cloudRegionSdnc")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(Prefix + "serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback")
+ 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)
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.prepareSDNCRequest(mockExecution)
+
+ // verify set prefix = Prefix + ""
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "changeAssignSDNCRequest", changeAssignSDNCRequest)
+
+ }
+
+ @Test
+ //@Ignore
+ public void prepareSDNCRollbackRequest() {
+
+ println "************ prepareSDNCRollbackRequest ************* "
+
+
+
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
+ when(mockExecution.getVariable(Prefix + "cloudRegionSdnc")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(Prefix + "serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable(Prefix + "changeAssignSDNCResponse")).thenReturn(assignResponse)
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback")
+ 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)
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.prepareSDNCRollbackRequest(mockExecution)
+
+ // verify set prefix = Prefix + ""
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "rollbackSDNCRequest", sdncRollbackRequest)
+
+ }
+
+ @Test
+ //@Ignore
+ public void callRESTQueryAAINetworkId_200() {
+
+ println "************ callRESTQueryAAINetworkId ************* "
+
+ WireMock.reset();
+ MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "UpdateNetworkV2/updateNetwork_queryNetworkId_AAIResponse_Success.xml", "1");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
+ 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_DoUpdateNetworkInstance_aai_l3_network_uri")).thenReturn("/aai/v9/network/l3-networks/l3-network")
+ 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(Execution execution)
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAINetworkId(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //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 + "aaiIdReturnCode", "200")
+
+ }
+
+ @Test
+ //@Ignore
+ public void callRESTQueryAAICloudRegion30_200() {
+
+ println "************ callRESTQueryAAICloudRegion30_200 ************* "
+
+ WireMock.reset();
+ MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion30_AAIResponse_Success.xml", "RDM2WAGPLCP");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
+ when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedNetworkRequest)
+ 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_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
+ 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(Execution execution)
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(mockExecution)
+
+ verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "queryCloudRegionRequest", "http://localhost:8090/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/RDM2WAGPLCP")
+ verify(mockExecution, atLeast(2)).setVariable(Prefix + "queryCloudRegionReturnCode", "200")
+ verify(mockExecution).setVariable(Prefix + "isCloudRegionGood", true)
+
+ }
+
+ @Test
+ //@Ignore
+ public void callRESTQueryAAICloudRegion25_200() {
+
+ println "************ callRESTQueryAAICloudRegion25_200 ************* "
+
+ WireMock.reset();
+ MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
+ when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedNetworkRequest)
+ 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_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
+ 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(Execution execution)
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(mockExecution)
+
+ verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "queryCloudRegionRequest", "http://localhost:8090/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/RDM2WAGPLCP")
+ verify(mockExecution, atLeast(2)).setVariable(Prefix + "queryCloudRegionReturnCode", "200")
+ verify(mockExecution).setVariable(Prefix + "isCloudRegionGood", true)
+
+ }
+
+ @Test
+ //@Ignore
+ public void callRESTQueryAAICloudRegion_NotFound() {
+
+ println "************ callRESTQueryAAICloudRegionFake ************* "
+
+ WireMock.reset();
+ MockGetNetworkCloudRegion_404("MDTWNJ21");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
+ when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(vnfRequestFakeRegion)
+ 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_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
+ 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(Execution execution)
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(mockExecution)
+
+ verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "queryCloudRegionRequest", "http://localhost:8090/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/MDTWNJ21")
+ verify(mockExecution, atLeast(1)).setVariable(Prefix + "queryCloudRegionReturnCode", "404")
+ verify(mockExecution).setVariable(Prefix + "cloudRegionPo", "MDTWNJ21")
+ verify(mockExecution).setVariable(Prefix + "cloudRegionSdnc", "AAIAIC25")
+ verify(mockExecution).setVariable(Prefix + "isCloudRegionGood", true)
+
+ }
+
+ @Test
+ //@Ignore
+ public void callRESTQueryAAINetworkVpnBinding_200() {
+
+ println "************ callRESTQueryAAINetworkVpnBinding_200 ************* "
+
+ WireMock.reset();
+ MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
+ MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_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(Execution execution)
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(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() {
+
+ println "************ callRESTQueryAAINetworkVpnBinding_200 ************* "
+
+ WireMock.reset();
+ MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponseTestScenario01)
+ 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(Execution execution)
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "vpnCount", 1)
+ verify(mockExecution).setVariable(Prefix + "vpnBindings", ['/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/'])
+ // 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).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200")
+
+ }
+
+ @Test
+ //@Ignore
+ public void callRESTQueryAAINetworkVpnBinding_200_URN_Uri() {
+
+ println "************ callRESTQueryAAINetworkVpnBinding_200 ************* "
+
+ WireMock.reset();
+ MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
+ MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse)
+ 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(Execution execution)
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(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_NotPresent() {
+
+ println "************ callRESTQueryAAINetworkVpnBinding_NotPresent ************* "
+
+ WireMock.reset();
+ MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
+
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponseVpnNotPresent)
+ 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_l3_network_uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
+ 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(Execution execution)
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200")
+ verify(mockExecution).setVariable(Prefix + "vpnCount", 0)
+ verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIResponse", aaiVpnResponseStub)
+
+ }
+
+ @Test
+ //@Ignore
+ public void callRESTQueryAAINetworkTableRef_200() {
+
+ println "************ callRESTQueryAAINetworkTableRef_200 ************* "
+
+ WireMock.reset();
+ MockGetNetworkTableReference("UpdateNetworkV2/updateNetwork_queryNetworkTableRef1_AAIResponse_Success.xml", "refFQDN1");
+ MockGetNetworkTableReference("UpdateNetworkV2/updateNetwork_queryNetworkTableRef2_AAIResponse_Success.xml", "refFQDN2");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse)
+ 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_default_aai_network_table_reference_uri")).thenReturn("")
+ when(mockExecution.getVariable("URN_mso_workflow_DoUpdateNetworkInstance_aai_route_table_reference_uri")).thenReturn("/aai/v8/network/route-table-references/route-table-reference")
+ 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(Execution execution)
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAINetworkTableRef(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "networkTableRefCount", 2)
+ verify(mockExecution).setVariable(Prefix + "networkTableRefUriList", ['/aai/v8/network/route-table-references/route-table-reference/refFQDN1','/aai/v8/network/route-table-references/route-table-reference/refFQDN2'])
+ // the last vpnBinding value is saved.
+ verify(mockExecution).setVariable(Prefix + "queryNetworkTableRefAAIRequest", "http://localhost:8090/aai/v8/network/route-table-references/route-table-reference/refFQDN1?depth=all")
+ verify(mockExecution, atLeast(2)).setVariable(Prefix + "aaiQqueryNetworkTableRefReturnCode", "200")
+
+ }
+
+ @Test
+ //@Ignore
+ public void callRESTQueryAAINetworkPolicy_200() {
+
+ println "************ callRESTQueryAAINetworkPolicy_200 ************* "
+
+ WireMock.reset();
+ MockGetNetworkPolicy("UpdateNetworkV2/updateNetwork_queryNetworkPolicy_AAIResponse_Success.xml", "cee6d136-e378-4678-a024-2cd15f0ee0cg");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse)
+ 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_network_policy_uri")).thenReturn("/aai/v8/network/network-policies/network-policy")
+ 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(Execution execution)
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAINetworkPolicy(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "networkPolicyCount", 1)
+ verify(mockExecution).setVariable(Prefix + "networkPolicyUriList", ['/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg'])
+ // the last vpnBinding value is saved.
+ verify(mockExecution).setVariable(Prefix + "queryNetworkPolicyAAIRequest", "http://localhost:8090/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg?depth=all")
+ verify(mockExecution).setVariable(Prefix + "aaiQqueryNetworkPolicyReturnCode", "200")
+
+ }
+
+
+ @Test
+ //@Ignore
+ public void callRESTReQueryAAINetworkId_200() {
+
+ println "************ callRESTReQueryAAINetworkId ************* "
+
+ WireMock.reset();
+ MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "UpdateNetworkV2/updateNetwork_queryNetworkId_AAIResponse_Success.xml", "1");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
+ when(mockExecution.getVariable(Prefix + "changeAssignSDNCResponse")).thenReturn(sdncAdapterWorkflowFormattedResponse)
+ 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_DoUpdateNetworkInstance_aai_l3_network_uri")).thenReturn("/aai/v9/network/l3-networks/l3-network")
+ 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(Execution execution)
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTReQueryAAINetworkId(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //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 + "aaiRequeryIdReturnCode", "200")
+
+ }
+
+
+ @Test
+ //@Ignore
+ public void callRESTUpdateContrailAAINetworkREST_200() {
+
+ println "************ callRESTUpdateContrailAAINetwork ************* "
+
+ WireMock.reset();
+ MockPutNetworkIdWithDepth("UpdateNetworkV2/updateNetwork_updateContrail_AAIResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "1");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
+ when(mockExecution.getVariable(Prefix + "changeAssignSDNCResponse")).thenReturn(sdncAdapterWorkflowFormattedResponse)
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse)
+ when(mockExecution.getVariable(Prefix + "updateNetworkResponse")).thenReturn(updateNetworkResponseREST)
+ 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_DoUpdateNetworkInstance_aai_l3_network_uri")).thenReturn("/aai/v9/network/l3-networks/l3-network")
+ 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(Execution execution)
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTUpdateContrailAAINetwork(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //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 + "updateContrailAAIPayloadRequest", updateContrailAAIPayloadRequest)
+ verify(mockExecution).setVariable(Prefix + "aaiUpdateContrailReturnCode", "200")
+ //verify(mockExecution).setVariable(Prefix + "updateContrailAAIResponse", updateContrailAAIResponse)
+ verify(mockExecution).setVariable(Prefix + "isPONR", true)
+
+ }
+
+
+
+ @Test
+ //@Ignore
+ public void validateUpdateNetworkResponseREST() {
+
+ println "************ validateNetworkResponse ************* "
+
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "updateNetworkResponse")).thenReturn(updateNetworkResponseREST)
+ when(mockExecution.getVariable(Prefix + "networkReturnCode")).thenReturn('200')
+
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.validateUpdateNetworkResponse(mockExecution)
+
+ //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
+ //debugger.printInvocations(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "updateNetworkResponse", updateNetworkResponseREST)
+ verify(mockExecution).setVariable(Prefix + "isNetworkRollbackNeeded", true)
+ verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", updateRollbackNetworkRequest)
+
+ }
+
+ @Test
+ //@Ignore
+ public void validateUpdateNetworkResponseREST_Error() {
+
+ println "************ validateNetworkResponse ************* "
+
+ WorkflowException workflowException = new WorkflowException("DoUpdateNetworkInstance", 2500, "Received error from Network Adapter: JBWEB000065: HTTP Status 500.")
+
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "updateNetworkResponse")).thenReturn(networkException500)
+ when(mockExecution.getVariable(Prefix + "networkReturnCode")).thenReturn('500')
+
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ try {
+ DoUpdateNetworkInstance.validateUpdateNetworkResponse(mockExecution)
+ } catch (Exception ex) {
+ println " Test End - Handle catch-throw BpmnError()! "
+ }
+
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution, atLeast(1)).setVariable("WorkflowException", refEq(workflowException, any(WorkflowException.class)))
+
+ }
+
+ @Test
+ //@Ignore
+ public void validateSDNCResponse() {
+
+ println "************ validateSDNCResponse ************* "
+
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "changeAssignSDNCResponse")).thenReturn(sdncAdapterWorkflowResponse)
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
+ when(mockExecution.getVariable("SDNCA_SuccessIndicator")).thenReturn(true)
+ when(mockExecution.getVariable(Prefix + "sdncReturnCode")).thenReturn("200")
+ when(mockExecution.getVariable(Prefix + "isResponseGood")).thenReturn(true)
+
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ try {
+ DoUpdateNetworkInstance.validateSDNCResponse(mockExecution)
+ verify(mockExecution).setVariable(Prefix + "isSdncRollbackNeeded", true)
+ verify(mockExecution).setVariable(Prefix + "rollbackSDNCRequest", "")
+
+ } catch (Exception ex) {
+ println " Graceful Exit - " + ex.getMessage()
+ }
+ //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
+ //debugger.printInvocations(mockExecution)
+
+ //verify(mockExecution).setVariable(Prefix + "isSdncRollbackNeeded", true)
+
+ }
+
+ @Test
+ //@Ignore
+ public void validateSDNCResponse_Error() {
+
+ println "************ validateSDNCResponse ************* "
+ //ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "changeAssignSDNCResponse")).thenReturn(sdncAdapterWorkflowResponse_Error)
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
+ when(mockExecution.getVariable("SDNCA_SuccessIndicator")).thenReturn(false)
+ when(mockExecution.getVariable(Prefix + "sdncReturnCode")).thenReturn("200")
+ when(mockExecution.getVariable(Prefix + "isResponseGood")).thenReturn(true)
+
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ try {
+ DoUpdateNetworkInstance.validateSDNCResponse(mockExecution)
+ } catch (Exception ex) {
+ println " Graceful Exit! - " + ex.getMessage()
+ }
+ //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
+ //debugger.printInvocations(mockExecution)
+
+ // verify set prefix = Prefix + ""
+ //verify(mockExecution).setVariable(Prefix + "sdncResponseSuccess", false)
+
+ }
+
+ @Test
+ //@Ignore
+ public void prepareRollbackData() {
+
+ println "************ prepareRollbackData() ************* "
+
+
+
+ WorkflowException workflowException = new WorkflowException("DoUpdateNetworkInstance", 2500, "Received error from Network Adapter: JBWEB000065: HTTP Status 500.")
+
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn(rollbackSDNCRequest)
+ when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn(rollbackNetworkRequest)
+ when(mockExecution.getVariable("WorkflowException")).thenReturn(workflowException)
+
+ // preProcessRequest(Execution execution)
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.prepareRollbackData(mockExecution)
+
+ verify(mockExecution).getVariable("isDebugLogEnabled")
+ verify(mockExecution).setVariable("prefix", Prefix)
+
+ }
+
+ @Test
+ //@Ignore
+ public void postProcessResponse() {
+
+ println "************ postProcessResponse() ************* "
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "isException")).thenReturn(false)
+ when(mockExecution.getVariable("sdncVersion")).thenReturn("1610")
+ when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn(rollbackSDNCRequest)
+ when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn(rollbackSDNCRequest)
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("requestId")
+
+ // preProcessRequest(Execution execution)
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.postProcessResponse(mockExecution)
+
+ verify(mockExecution, atLeast(3)).getVariable("isDebugLogEnabled")
+ verify(mockExecution, atLeast(3)).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "Success", true)
+
+ }
+
+ private ExecutionEntity setupMock() {
+
+ ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class)
+ when(mockProcessDefinition.getKey()).thenReturn("DoUpdateNetworkInstance")
+ RepositoryService mockRepositoryService = mock(RepositoryService.class)
+ when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition)
+ when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("DoUpdateNetworkInstance")
+ 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("DoUpdateNetworkInstance")
+ when(mockExecution.getProcessInstanceId()).thenReturn("DoUpdateNetworkInstance")
+ 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/UpdateNetworkInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/UpdateNetworkInstanceTest.groovy
new file mode 100644
index 0000000000..e987d59805
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/UpdateNetworkInstanceTest.groovy
@@ -0,0 +1,368 @@
+package org.openecomp.mso.bpmn.infrastructure.scripts
+
+import static org.mockito.Mockito.*
+
+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.Ignore
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.MockitoAnnotations
+import org.mockito.runners.MockitoJUnitRunner
+import org.openecomp.mso.bpmn.common.scripts.MsoUtils
+import org.openecomp.mso.bpmn.core.WorkflowException
+
+import com.github.tomakehurst.wiremock.junit.WireMockRule
+import org.apache.commons.lang3.*
+
+
+@RunWith(MockitoJUnitRunner.class)
+class UpdateNetworkInstanceTest {
+
+ @Rule
+ public WireMockRule wireMockRule = new WireMockRule(8090);
+
+ String Prefix="UPDNI_"
+ def utils = new MsoUtils()
+
+ String createDBRequestError =
+"""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <ns:updateInfraRequest xmlns:ns="http://org.openecomp.mso/requestsdb">
+ <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
+ <lastModifiedBy>BPMN</lastModifiedBy>
+ <statusMessage>Received error from SDN-C: No availability zone available</statusMessage>
+ <responseBody></responseBody>
+ <requestStatus>FAILED</requestStatus>
+ <vnfOutputs>&lt;network-id&gt;&lt;/network-id&gt;&lt;network-name&gt;&lt;/network-names&gt;</vnfOutputs>
+ </ns:updateInfraRequest>
+ </soapenv:Body>
+ </soapenv:Envelope>"""
+
+ String falloutHandlerRequest =
+ """<aetgt:FalloutHandlerRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:ns="http://org.openecomp/mso/request/types/v1"
+ xmlns:wfsch="http://org.openecomp/mso/workflow/schema/v1">
+ <request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
+ <request-id>b69c9054-da09-4a2c-adf5-51042b62bfac</request-id>
+ <action>UPDATE</action>
+ <source>VID</source>
+ </request-info>
+ <aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">
+ <aetgt:ErrorMessage>Received error from SDN-C: No availability zone available.</aetgt:ErrorMessage>
+ <aetgt:ErrorCode>5300</aetgt:ErrorCode>
+ </aetgt:WorkflowException>
+ </aetgt:FalloutHandlerRequest>"""
+
+ String completeMsoProcessRequest =
+ """<aetgt:MsoCompletionRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:ns="http://org.openecomp/mso/request/types/v1"
+ xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
+ <request-info>
+ <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
+ <action>UPDATE</action>
+ <source>VID</source>
+ </request-info>
+ <aetgt:status-message>Network has been updated successfully.</aetgt:status-message>
+ <aetgt:mso-bpel-name>BPMN Network action: UPDATE</aetgt:mso-bpel-name>
+</aetgt:MsoCompletionRequest>"""
+
+
+String jsonIncomingRequest =
+"""{ "requestDetails": {
+ "modelInfo": {
+ "modelType": "networkTyp",
+ "modelId": "modelId",
+ "modelNameVersionId": "modelNameVersionId",
+ "modelName": "CONTRAIL_EXTERNAL",
+ "modelVersion": "1"
+ },
+ "cloudConfiguration": {
+ "lcpCloudRegionId": "RDM2WAGPLCP",
+ "tenantId": "7dd5365547234ee8937416c65507d266"
+ },
+ "requestInfo": {
+ "instanceName": "MNS-25180-L-01-dmz_direct_net_1",
+ "source": "VID",
+ "callbackUrl": "",
+ "suppressRollback": true,
+ "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"
+ },
+ "relatedInstanceList": [
+ {
+ "relatedInstance": {
+ "instanceId": "f70e927b-6087-4974-9ef8-c5e4d5847ca4",
+ "modelInfo": {
+ "modelType": "serviceT",
+ "modelId": "modelI",
+ "modelNameVersionId": "modelNameVersionI",
+ "modelName": "modleNam",
+ "modelVersion": "1"
+ }
+ }
+ }
+ ],
+ "requestParameters": {
+ "userParams": [
+ {
+ "name": "someUserParam1",
+ "value": "someValue1"
+ }
+ ]
+ }
+ }}"""
+
+ @Before
+ public void init()
+ {
+ MockitoAnnotations.initMocks(this)
+
+ }
+
+ public void initializeVariables(Execution mockExecution) {
+
+ verify(mockExecution).setVariable(Prefix + "source", "")
+ verify(mockExecution).setVariable(Prefix + "Success", false)
+
+ verify(mockExecution).setVariable(Prefix + "CompleteMsoProcessRequest", "")
+ verify(mockExecution).setVariable(Prefix + "FalloutHandlerRequest", "")
+
+ }
+
+ @Test
+ //@Ignore
+ public void preProcessRequest() {
+
+ println "************ preProcessRequest() ************* "
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("bpmnRequest")).thenReturn(jsonIncomingRequest)
+
+ when(mockExecution.getVariable("URN_mso_adapters_db_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
+ when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
+
+ // preProcessRequest(Execution execution)
+ UpdateNetworkInstance UpdateNetworkInstance = new UpdateNetworkInstance()
+ UpdateNetworkInstance.preProcessRequest(mockExecution)
+
+ verify(mockExecution).getVariable("isDebugLogEnabled")
+ verify(mockExecution).setVariable("prefix", Prefix)
+
+ initializeVariables(mockExecution)
+ //verify(mockExecution).setVariable(Prefix + "Success", false)
+
+ }
+
+
+ @Test
+ //@Ignore
+ public void getNetworkModelInfo() {
+
+ println "************ getNetworkModelInfo() ************* "
+
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+
+ // preProcessRequest(Execution execution)
+ UpdateNetworkInstance UpdateNetworkInstance = new UpdateNetworkInstance()
+ UpdateNetworkInstance.getNetworkModelInfo(mockExecution)
+
+ verify(mockExecution).getVariable("isDebugLogEnabled")
+ verify(mockExecution).setVariable("prefix", Prefix)
+
+ }
+
+ @Test
+ //@Ignore
+ public void sendSyncResponse() {
+
+ println "************ sendSyncResponse ************* "
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("isAsyncProcess")).thenReturn(true)
+ 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)
+ UpdateNetworkInstance UpdateNetworkInstance = new UpdateNetworkInstance()
+ UpdateNetworkInstance.sendSyncResponse(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable("UpdateNetworkInstanceResponseCode", "202")
+
+ }
+
+ @Test
+ //@Ignore
+ public void sendSyncError() {
+
+ println "************ sendSyncError ************* "
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("isAsyncProcess")).thenReturn(true)
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
+ when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+
+ UpdateNetworkInstance UpdateNetworkInstance = new UpdateNetworkInstance()
+ UpdateNetworkInstance.sendSyncError(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable("UpdateNetworkInstanceResponseCode", "500")
+
+ }
+
+ @Test
+ //@Ignore
+ public void prepareDBRequestError() {
+
+ println "************ prepareDBRequestError ************* "
+
+ WorkflowException sndcWorkflowException = new WorkflowException("UpdateNetworkInstance", 500, "Received error from SDN-C: No availability zone available")
+
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("WorkflowException")).thenReturn(sndcWorkflowException)
+ //when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable(Prefix + "requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("networkId")).thenReturn("")
+ when(mockExecution.getVariable("networkName")).thenReturn("")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+
+ when(mockExecution.getVariable("URN_mso_adapters_db_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
+ when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
+
+ // preProcessRequest(Execution execution)
+ UpdateNetworkInstance UpdateNetworkInstance = new UpdateNetworkInstance()
+ UpdateNetworkInstance.prepareDBRequestError(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "createDBRequest", createDBRequestError)
+
+ }
+
+
+ @Test
+ //@Ignore
+ public void prepareCompletion() {
+
+ println "************ postProcessResponse ************* "
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable(Prefix + "dbReturnCode")).thenReturn("200")
+
+ // postProcessResponse(Execution execution)
+ UpdateNetworkInstance UpdateNetworkInstance = new UpdateNetworkInstance()
+ UpdateNetworkInstance.prepareCompletion(mockExecution)
+
+ // check the sequence of variable invocation
+ //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
+ //preDebugger.printInvocations(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "Success", true)
+ verify(mockExecution).setVariable(Prefix + "CompleteMsoProcessRequest", completeMsoProcessRequest)
+
+ }
+
+ @Test
+ //@Ignore
+ public void buildErrorResponse() {
+
+ println "************ buildErrorResponse ************* "
+
+
+ WorkflowException sndcWorkflowException = new WorkflowException("UpdateNetworkInstance", 5300, "Received error from SDN-C: No availability zone available.")
+
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("b69c9054-da09-4a2c-adf5-51042b62bfac")
+ //when(mockExecution.getVariable("WorkflowException")).thenReturn(sndcWorkflowException)
+ when(mockExecution.getVariable("WorkflowException")).thenReturn(sndcWorkflowException)
+
+ // buildErrorResponse(Execution execution)
+ UpdateNetworkInstance UpdateNetworkInstance = new UpdateNetworkInstance()
+ UpdateNetworkInstance.buildErrorResponse(mockExecution)
+
+ verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "FalloutHandlerRequest", falloutHandlerRequest)
+
+ //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
+ //debugger.printInvocations(mockExecution)
+
+ }
+
+ @Test
+ //@Ignore
+ public void postProcessResponse() {
+
+ println "************ postProcessResponse() ************* "
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("CMSO_ResponseCode")).thenReturn("200")
+
+ // postProcessResponse(Execution execution)
+ UpdateNetworkInstance UpdateNetworkInstance = new UpdateNetworkInstance()
+ UpdateNetworkInstance.postProcessResponse(mockExecution)
+
+ //verify(mockExecution).getVariable("isDebugLogEnabled")
+ //verify(mockExecution).setVariable("prefix", Prefix)
+
+ verify(mockExecution).setVariable(Prefix + "Success", true)
+
+ }
+
+ @Test
+ //@Ignore
+ public void processRollbackData() {
+
+ println "************ callDBCatalog() ************* "
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+
+ // preProcessRequest(Execution execution)
+ UpdateNetworkInstance UpdateNetworkInstance = new UpdateNetworkInstance()
+ UpdateNetworkInstance.processRollbackData(mockExecution)
+
+ verify(mockExecution).getVariable("isDebugLogEnabled")
+ verify(mockExecution).setVariable("prefix", Prefix)
+
+ }
+
+ private ExecutionEntity setupMock() {
+
+ ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class)
+ when(mockProcessDefinition.getKey()).thenReturn("UpdateNetworkInstance")
+ RepositoryService mockRepositoryService = mock(RepositoryService.class)
+ when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition)
+ when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("UpdateNetworkInstance")
+ 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("UpdateNetworkInstance")
+ when(mockExecution.getProcessInstanceId()).thenReturn("UpdateNetworkInstance")
+ 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/java/org/openecomp/mso/bpmn/infrastructure/CreateGenericALaCarteServiceInstanceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateGenericALaCarteServiceInstanceTest.java
new file mode 100644
index 0000000000..8419e19206
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateGenericALaCarteServiceInstanceTest.java
@@ -0,0 +1,109 @@
+package org.openecomp.mso.bpmn.infrastructure;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.openecomp.mso.bpmn.common.BPMNUtil.executeWorkFlow;
+import static org.openecomp.mso.bpmn.common.BPMNUtil.waitForWorkflowToFinish;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetCustomer;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceByName;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutServiceInstance;
+import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
+import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import org.camunda.bpm.engine.test.Deployment;
+import org.junit.Test;
+import org.openecomp.mso.bpmn.common.BPMNUtil;
+import org.openecomp.mso.bpmn.common.WorkflowTest;
+import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse;
+import org.openecomp.mso.bpmn.mock.FileUtil;
+
+/**
+ * Unit test cases for CreateGenericALaCarteServiceInstance.bpmn
+ */
+public class CreateGenericALaCarteServiceInstanceTest extends WorkflowTest {
+
+ private final CallbackSet callbacks = new CallbackSet();
+
+ public CreateGenericALaCarteServiceInstanceTest() throws IOException {
+ callbacks.put("assign", FileUtil.readResourceFile("__files/VfModularity/SDNCSITopologyAssignCallback.xml"));
+ }
+
+ /**
+ * Sunny day VID scenario.
+ *
+ * @throws Exception
+ */
+ //@Ignore // File not found - unable to run the test. Also, Stubs need updating..
+ @Test
+ @Deployment(resources = {
+ "process/CreateGenericALaCarteServiceInstance.bpmn",
+ "subprocess/DoCreateServiceInstance.bpmn",
+ "subprocess/DoCreateServiceInstanceRollback.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/GenericPutService.bpmn",
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+ "subprocess/FalloutHandler.bpmn" })
+ public void sunnyDayAlaCarte() throws Exception {
+
+ logStart();
+
+ //AAI
+ MockGetCustomer("MCBH-1610", "CreateServiceInstance/createServiceInstance_queryGlobalCustomerId_AAIResponse_Success.xml");
+ MockPutServiceInstance("MCBH-1610", "viprsvc", "RaaTest-1-id", "");
+ MockGetServiceInstance("MCBH-1610", "viprsvc", "RaaTest-1-id", "GenericFlows/getServiceInstance.xml");
+ MockNodeQueryServiceInstanceByName("RAATest-1", "");
+ MockNodeQueryServiceInstanceById("RaaTest-1-id", "");
+ //SDNC
+ mockSDNCAdapter(200);
+ //DB
+ mockUpdateRequestDB(200, "DBUpdateResponse.xml");
+
+
+ String businessKey = UUID.randomUUID().toString();
+
+ //String createVfModuleRequest = FileUtil.readResourceFile("__files/SIRequest.json");
+
+ Map<String, String> variables = setupVariables();
+ WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CreateGenericALaCarteServiceInstance", variables);
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+
+ String workflowResp = BPMNUtil.getVariable(processEngineRule, "CreateGenericALaCarteServiceInstance", "WorkflowResponse");
+ //assertNotNull(workflowResp);
+ System.out.println("Workflow (Synch) Response:\n" + workflowResp);
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "CreateGenericALaCarteServiceInstance", "WorkflowException");
+ String completionReq = BPMNUtil.getVariable(processEngineRule, "CreateGenericALaCarteServiceInstance", "completionRequest");
+ System.out.println("completionReq:\n" + completionReq);
+ System.out.println("workflowException:\n" + workflowException);
+ assertNotNull(completionReq);
+ assertEquals(null, workflowException);
+
+
+ //injectSDNCCallbacks(callbacks, "assign");
+
+ logEnd();
+ }
+
+ // Success Scenario
+ private Map<String, String> setupVariables() {
+ Map<String, String> variables = new HashMap<String, String>();
+ variables.put("isDebugLogEnabled", "true");
+ variables.put("bpmnRequest", getRequest());
+ variables.put("mso-request-id", "RaaCSIRequestId-1");
+ variables.put("serviceInstanceId","RaaTest-1-id");
+ return variables;
+ }
+
+ public String getRequest() {
+ String request = "{\"requestDetails\":{\"modelInfo\":{\"modelType\":\"service\",\"modelInvariantUuid\":\"uuid-miu-svc-011-abcdef\",\"modelVersionUuid\":\"ASDC_TOSCA_UUID\",\"modelName\":\"SIModelName1\",\"modelVersion\":\"2\"},\"subscriberInfo\":{\"globalSubscriberId\":\"MCBH-1610\",\"subscriberName\":\"Kaneohe\"},\"requestInfo\":{\"instanceName\":\"RAATest-1\",\"source\":\"VID\",\"suppressRollback\":\"true\",\"productFamilyId\":\"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\"},\"cloudConfiguration\":{\"lcpCloudRegionId\":\"mdt1\",\"tenantId\":\"8b1df54faa3b49078e3416e21370a3ba\"},\"requestParameters\":{\"subscriptionServiceType\":\"viprsvc\",\"aLaCarte\":\"false\",\"userParams\":[]}}}";
+ return request;
+ }
+
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateNetworkInstanceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateNetworkInstanceTest.java
new file mode 100644
index 0000000000..30cd4a5631
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateNetworkInstanceTest.java
@@ -0,0 +1,645 @@
+package org.openecomp.mso.bpmn.infrastructure;
+
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.*;
+import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.MockUpdateRequestDB;
+import static org.openecomp.mso.bpmn.mock.StubResponseNetworkAdapter.MockNetworkAdapterPost;
+import static org.openecomp.mso.bpmn.mock.StubResponseNetworkAdapter.MockNetworkAdapterRestRollbackDelete;
+// new mock methods
+import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapterTopology;
+import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter_500;
+import org.openecomp.mso.bpmn.mock.SDNCAdapterNetworkTopologyMockTransformer;
+
+import static org.openecomp.mso.bpmn.common.BPMNUtil.executeAsyncWorkflow;
+import static org.openecomp.mso.bpmn.common.BPMNUtil.getVariable;
+import static org.junit.Assert.assertEquals;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.camunda.bpm.engine.test.Deployment;
+import org.junit.Assert;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.openecomp.mso.bpmn.common.BPMNUtil;
+import org.openecomp.mso.bpmn.common.WorkflowTest;
+import org.openecomp.mso.bpmn.common.WorkflowTestTransformer;
+import org.openecomp.mso.bpmn.common.SDNCAdapterCallbackRule;
+import com.github.tomakehurst.wiremock.extension.ResponseTransformer;
+
+/**
+ * Unit test cases for CreateNetworkInstance.bpmn
+ *
+ */
+public class CreateNetworkInstanceTest extends WorkflowTest {
+ @WorkflowTestTransformer
+ public static final ResponseTransformer sdncAdapterMockTransformer =
+ new SDNCAdapterNetworkTopologyMockTransformer();
+
+ @Rule
+ public final SDNCAdapterCallbackRule sdncAdapterCallbackRule =
+ new SDNCAdapterCallbackRule(processEngineRule);
+
+ /**
+ * End-to-End flow - Unit test for CreateNetworkInstance.bpmn
+ * - String input & String response
+ */
+
+
+ @Test
+ //@Ignore
+ @Deployment(resources = {"process/CreateNetworkInstance.bpmn",
+ "subprocess/DoCreateNetworkInstance.bpmn",
+ "subprocess/DoCreateNetworkInstanceRollback.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn"})
+
+ public void shouldInvokeServiceCreateNetworkInstance_vIPER_Success1() throws Exception {
+
+ System.out.println("-----------------------------------------------------------------");
+ System.out.println(" Success vIPER 1 - CreateNetworkInstance flow Started! ");
+ System.out.println("-----------------------------------------------------------------");
+
+ // setup simulators
+ mockSDNCAdapterTopology("CreateNetworkV2mock/sdncCreateNetworkTopologyRsrcAssignResponse.xml", "SvcAction>assign");
+ mockSDNCAdapterTopology("CreateNetworkV2mock/sdncCreateNetworkTopologySimResponse.xml", "SvcAction>activate");
+ MockNetworkAdapterPost("CreateNetworkV2/createNetworkResponse_Success.xml", "createNetworkRequest");
+ MockGetNetworkByName("MNS-25180-L-01-dmz_direct_net_1", "CreateNetworkV2/createNetwork_queryName_AAIResponse_Success.xml");
+ MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP");
+ MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml", "1");
+ MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
+ MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6");
+ MockGetNetworkPolicy("CreateNetworkV2/createNetwork_queryNetworkPolicy_AAIResponse_Success.xml", "cee6d136-e378-4678-a024-2cd15f0ee0cg");
+ MockGetNetworkTableReference("CreateNetworkV2/createNetwork_queryNetworkTableRef1_AAIResponse_Success.xml", "refFQDN1");
+ MockGetNetworkTableReference("CreateNetworkV2/createNetwork_queryNetworkTableRef2_AAIResponse_Success.xml", "refFQDN2");
+ MockPutNetworkIdWithDepth("CreateNetworkV2/createNetwork_updateContrail_AAIResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "1");
+ MockUpdateRequestDB("DBUpdateResponse.xml");
+ //MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "CreateNetworkV2/createNetwork_queryInstance_Success.xml", "v8");
+ MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "CreateNetworkV2/createNetwork_queryInstance_Success.xml");
+
+ Map<String, String> variables = setupVariables1();
+ //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables);
+ executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables);
+ System.out.println("----------------------------------------------------------");
+ System.out.println("- got workflow response -");
+ System.out.println("----------------------------------------------------------");
+ //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+
+ assertEquals("true", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_Success"));
+ assertEquals("true", getVariable(processEngineRule, "DoCreateNetworkInstance", "CRENWKI_Success"));
+ Assert.assertNotNull("CRENI_CompleteMsoProcessRequest - ", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_CompleteMsoProcessRequest"));
+
+ String workflowResp = BPMNUtil.getVariable(processEngineRule, "CreateNetworkInstance", "WorkflowResponse");
+ Assert.assertNotNull(workflowResp);
+
+ System.out.println("----------------------------------------------------------");
+ System.out.println(" Success vIPER 1 - CreateNetworkInstance flow Completed ");
+ System.out.println("----------------------------------------------------------");
+
+ }
+
+ @Test
+ //@Ignore
+ @Deployment(resources = {"process/CreateNetworkInstance.bpmn",
+ "subprocess/DoCreateNetworkInstance.bpmn",
+ "subprocess/DoCreateNetworkInstanceRollback.bpmn",
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn"})
+
+ public void shouldInvokeServiceCreateNetworkInstance_vIPER_Success2() throws Exception {
+
+ System.out.println("----------------------------------------------------------------");
+ System.out.println(" Success viPER 2 - CreateNetworkInstance flow Started! ");
+ System.out.println("----------------------------------------------------------------");
+
+ // setup simulators
+ mockSDNCAdapterTopology("CreateNetworkV2mock/sdncCreateNetworkTopologyRsrcAssignResponse.xml", "SvcAction>assign");
+ mockSDNCAdapterTopology("CreateNetworkV2mock/sdncCreateNetworkTopologySimResponse.xml", "SvcAction>activate");
+ MockNetworkAdapterPost("CreateNetworkV2/createNetworkResponse_Success.xml", "createNetworkRequest");
+ MockGetNetworkByName_404("CreateNetworkV2/createNetwork_queryName_AAIResponse_Success.xml", "myOwn_Network");
+ MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP");
+ MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml", "1");
+ MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
+ MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6");
+ MockGetNetworkPolicy("CreateNetworkV2/createNetwork_queryNetworkPolicy_AAIResponse_Success.xml", "cee6d136-e378-4678-a024-2cd15f0ee0cg");
+ MockGetNetworkTableReference("CreateNetworkV2/createNetwork_queryNetworkTableRef1_AAIResponse_Success.xml", "refFQDN1");
+ MockGetNetworkTableReference("CreateNetworkV2/createNetwork_queryNetworkTableRef2_AAIResponse_Success.xml", "refFQDN2");
+ MockPutNetworkIdWithDepth("CreateNetworkV2/createNetwork_updateContrail_AAIResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "1");
+ MockUpdateRequestDB("DBUpdateResponse.xml");
+ //MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "CreateNetworkV2/createNetwork_queryInstance_Success.xml", "v8");
+ MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "CreateNetworkV2/createNetwork_queryInstance_Success.xml");
+
+ Map<String, String> variables = setupVariables2();
+ //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables);
+ executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables);
+ //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+
+ assertEquals("true", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_Success"));
+ assertEquals("true", getVariable(processEngineRule, "DoCreateNetworkInstance", "CRENWKI_Success"));
+ Assert.assertNotNull("CRENI_CompleteMsoProcessRequest - ", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_CompleteMsoProcessRequest"));
+
+ String completeMsoProcessRequest =
+ "<aetgt:MsoCompletionRequest xmlns:aetgt=\"http://org.openecomp/mso/workflow/schema/v1\"" + '\n'
+ + " xmlns:ns=\"http://org.openecomp/mso/request/types/v1\"" + '\n'
+ + " xmlns=\"http://org.openecomp/mso/infra/vnf-request/v1\">" + '\n'
+ + " <request-info>" + '\n'
+ + " <request-id>testRequestId</request-id>" + '\n'
+ + " <action>CREATE</action>" + '\n'
+ + " <source>VID</source>" + '\n'
+ + " </request-info>" + '\n'
+ + " <aetgt:status-message>Network has been created successfully.</aetgt:status-message>" + '\n'
+ + " <aetgt:mso-bpel-name>BPMN Network action: CREATE</aetgt:mso-bpel-name>" + '\n'
+ + "</aetgt:MsoCompletionRequest>";
+
+ Assert.assertEquals(completeMsoProcessRequest, getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_CompleteMsoProcessRequest"));
+
+ System.out.println("---------------------------------------------------------");
+ System.out.println(" Success viPER 2 - CreateNetworkInstance flow Completed ");
+ System.out.println("---------------------------------------------------------");
+
+ }
+
+ @Test
+ //@Ignore
+ @Deployment(resources = {"process/CreateNetworkInstance.bpmn",
+ "subprocess/DoCreateNetworkInstance.bpmn",
+ "subprocess/DoCreateNetworkInstanceRollback.bpmn",
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn"})
+
+ public void shouldInvokeServiceCreateNetworkInstance_VID_1610_Network_SDNC_Rollback() throws Exception {
+
+ System.out.println("--------------------------------------------------------------------------");
+ System.out.println(" Network and SDNC Rollback - CreateNetworkInstance flow Started! ");
+ System.out.println("--------------------------------------------------------------------------");
+
+ // setup simulators
+ mockSDNCAdapterTopology("CreateNetworkV2mock/sdncCreateNetworkTopologySimResponse.xml", "SvcAction>assign");
+ mockSDNCAdapterTopology("CreateNetworkV2mock/sdncCreateNetworkTopologySimResponse.xml", "SvcAction>rollback");
+ MockNetworkAdapterPost("CreateNetworkV2/createNetworkResponse_Success.xml", "createNetworkRequest");
+ MockGetNetworkByName("MNS-25180-L-01-dmz_direct_net_1", "CreateNetworkV2/createNetwork_queryName_AAIResponse_Success.xml");
+ MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP");
+ MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml", "1");
+ MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
+ MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6");
+ MockGetNetworkPolicy("CreateNetworkV2/createNetwork_queryNetworkPolicy_AAIResponse_Success.xml", "cee6d136-e378-4678-a024-2cd15f0ee0cg");
+ MockGetNetworkTableReference("CreateNetworkV2/createNetwork_queryNetworkTableRef1_AAIResponse_Success.xml", "refFQDN1");
+ MockGetNetworkTableReference("CreateNetworkV2/createNetwork_queryNetworkTableRef2_AAIResponse_Success.xml", "refFQDN2");
+ MockUpdateRequestDB("DBUpdateResponse.xml");
+ //MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "CreateNetworkV2/createNetwork_queryInstance_Success.xml", "v8");
+ MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "CreateNetworkV2/createNetwork_queryInstance_Success.xml");
+ MockNetworkAdapterRestRollbackDelete("deleteNetworkResponse_Success.xml","49c86598-f766-46f8-84f8-8d1c1b10f9b4");
+
+ Map<String, String> variables = setupVariablesVID1();
+ executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables);
+ //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables);
+ //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+
+ assertEquals("false", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_Success"));
+ assertEquals("false", getVariable(processEngineRule, "DoCreateNetworkInstance", "CRENWKI_Success"));
+ Assert.assertNotNull("CRENI_FalloutHandlerRequest - ", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_FalloutHandlerRequest"));
+
+ System.out.println("--------------------------------------------------------------------");
+ System.out.println(" Network and SCNC Rollback - CreateNetworkInstance flow Completed ");
+ System.out.println("--------------------------------------------------------------------");
+
+ }
+
+ @Test
+ //@Ignore
+ @Deployment(resources = {"process/CreateNetworkInstance.bpmn",
+ "subprocess/DoCreateNetworkInstance.bpmn",
+ "subprocess/DoCreateNetworkInstanceRollback.bpmn",
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn"})
+
+ public void shouldInvokeServiceCreateNetworkInstance_vIPER_1702_Network_SDNC_Rollback() throws Exception {
+
+ System.out.println("--------------------------------------------------------------------------");
+ System.out.println(" Network and SDNC Rollback - CreateNetworkInstance flow Started! ");
+ System.out.println("--------------------------------------------------------------------------");
+
+ // setup simulators
+ mockSDNCAdapterTopology("CreateNetworkV2mock/sdncCreateNetworkTopologyRsrcAssignResponse.xml", "SvcAction>assign");
+ mockSDNCAdapterTopology("CreateNetworkV2mock/sdncCreateNetworkTopologySimResponse.xml", "SvcAction>unassign");
+ mockSDNCAdapterTopology("CreateNetworkV2mock/sdncCreateNetworkTopologySimResponse.xml", "SvcAction>activate");
+ mockSDNCAdapterTopology("CreateNetworkV2mock/sdncCreateNetworkTopologySimResponse.xml", "SvcAction>deactivate");
+ MockNetworkAdapterPost("CreateNetworkV2/createNetworkResponse_Success.xml", "createNetworkRequest");
+ MockGetNetworkByName("MNS-25180-L-01-dmz_direct_net_1", "CreateNetworkV2/createNetwork_queryName_AAIResponse_Success.xml");
+ MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP");
+ MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml", "1");
+ MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
+ MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6");
+ MockGetNetworkPolicy("CreateNetworkV2/createNetwork_queryNetworkPolicy_AAIResponse_Success.xml", "cee6d136-e378-4678-a024-2cd15f0ee0cg");
+ MockGetNetworkTableReference("CreateNetworkV2/createNetwork_queryNetworkTableRef1_AAIResponse_Success.xml", "refFQDN1");
+ MockGetNetworkTableReference("CreateNetworkV2/createNetwork_queryNetworkTableRef2_AAIResponse_Success.xml", "refFQDN2");
+ MockUpdateRequestDB("DBUpdateResponse.xml");
+ //MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "CreateNetworkV2/createNetwork_queryInstance_Success.xml", "v8");
+ MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "CreateNetworkV2/createNetwork_queryInstance_Success.xml");
+ MockNetworkAdapterRestRollbackDelete("deleteNetworkResponse_Success.xml","49c86598-f766-46f8-84f8-8d1c1b10f9b4");
+
+ Map<String, String> variables = setupVariables1();
+ executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables);
+ //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables);
+ //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+
+ assertEquals("false", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_Success"));
+ assertEquals("false", getVariable(processEngineRule, "DoCreateNetworkInstance", "CRENWKI_Success"));
+ Assert.assertNotNull("CRENI_FalloutHandlerRequest - ", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_FalloutHandlerRequest"));
+
+ System.out.println("--------------------------------------------------------------------");
+ System.out.println(" Network and SCNC Rollback - CreateNetworkInstance flow Completed ");
+ System.out.println("--------------------------------------------------------------------");
+
+ }
+
+ @Test
+ //@Ignore
+ @Deployment(resources = {"process/CreateNetworkInstance.bpmn",
+ "subprocess/DoCreateNetworkInstance.bpmn",
+ "subprocess/DoCreateNetworkInstanceRollback.bpmn",
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn"})
+
+ public void shouldInvokeServiceCreateNetworkInstance_sdncFailure() throws Exception {
+
+ System.out.println("----------------------------------------------------------------");
+ System.out.println(" SNDC Failure - CreateNetworkInstance flow Started! ");
+ System.out.println("----------------------------------------------------------------");
+
+ // setup simulators
+ mockSDNCAdapter_500("SvcAction>query");
+ MockGetNetworkByName_404("CreateNetworkV2/createNetwork_queryName_AAIResponse_Success.xml", "myOwn_Network");
+ MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP");
+ MockUpdateRequestDB("DBUpdateResponse.xml");
+ //MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "CreateNetworkV2/createNetwork_queryInstance_Success.xml", "v8");
+ MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "CreateNetworkV2/createNetwork_queryInstance_Success.xml");
+
+ Map<String, String> variables = setupVariables2();
+ //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables);
+ executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables);
+ //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+
+ assertEquals("false", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_Success"));
+ assertEquals("false", getVariable(processEngineRule, "DoCreateNetworkInstance", "CRENWKI_Success"));
+ Assert.assertNotNull("CRENI_FalloutHandlerRequest - ", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_FalloutHandlerRequest"));
+
+ System.out.println("---------------------------------------------------------");
+ System.out.println(" SNDC Failure - CreateNetworkInstance flow Completed ");
+ System.out.println("---------------------------------------------------------");
+
+ }
+
+ @Test
+ //@Ignore
+ @Deployment(resources = {"process/CreateNetworkInstance.bpmn",
+ "subprocess/DoCreateNetworkInstance.bpmn",
+ "subprocess/DoCreateNetworkInstanceRollback.bpmn",
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn"})
+
+ public void shouldInvokeServiceCreateNetworkInstance_queryServiceInstance404() throws Exception {
+
+ System.out.println("----------------------------------------------------------------------------------");
+ System.out.println(" Query ServiceIntance Not found - CreateNetworkInstance flow Started! ");
+ System.out.println("----------------------------------------------------------------------------------");
+
+ //setup simulators
+ mockSDNCAdapter_500("SvcAction>query");
+ MockGetNetworkByName_404("CreateNetworkV2/createNetwork_queryName_AAIResponse_Success.xml", "myOwn_Network");
+ MockUpdateRequestDB("DBUpdateResponse.xml");
+ MockNodeQueryServiceInstanceById_404("f70e927b-6087-4974-9ef8-c5e4d5847ca4");
+
+ Map<String, String> variables = setupVariables2();
+ //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables);
+ executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables);
+ //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+
+ assertEquals("false", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_Success"));
+ assertEquals("false", getVariable(processEngineRule, "DoCreateNetworkInstance", "CRENWKI_Success"));
+ Assert.assertNotNull("CRENI_FalloutHandlerRequest - ", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_FalloutHandlerRequest"));
+
+ System.out.println("---------------------------------------------------------------------------------");
+ System.out.println(" Query ServiceIntance Not found - CreateNetworkInstance flow Completed ");
+ System.out.println("---------------------------------------------------------------------------------");
+
+ }
+
+ @Test
+ //@Ignore
+ @Deployment(resources = {"process/CreateNetworkInstance.bpmn",
+ "subprocess/DoCreateNetworkInstance.bpmn",
+ "subprocess/DoCreateNetworkInstanceRollback.bpmn",
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn"})
+
+ public void shouldInvokeServiceCreateNetworkInstance_VID_Success1() throws Exception {
+
+ System.out.println("----------------------------------------------------------");
+ System.out.println(" Success VID1 - CreateNetworkInstance flow Started! ");
+ System.out.println("----------------------------------------------------------");
+
+ // setup simulators
+ mockSDNCAdapterTopology("CreateNetworkV2mock/sdncCreateNetworkTopologySimResponse.xml", "SvcAction>assign");
+ MockNetworkAdapterPost("CreateNetworkV2/createNetworkResponse_Success.xml", "createNetworkRequest");
+ MockGetNetworkByName("MNS-25180-L-01-dmz_direct_net_1", "CreateNetworkV2/createNetwork_queryName_AAIResponse_Success.xml");
+ MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP");
+ MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml", "1");
+ MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
+ MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6");
+ MockGetNetworkPolicy("CreateNetworkV2/createNetwork_queryNetworkPolicy_AAIResponse_Success.xml", "cee6d136-e378-4678-a024-2cd15f0ee0cg");
+ MockGetNetworkTableReference("CreateNetworkV2/createNetwork_queryNetworkTableRef1_AAIResponse_Success.xml", "refFQDN1");
+ MockGetNetworkTableReference("CreateNetworkV2/createNetwork_queryNetworkTableRef2_AAIResponse_Success.xml", "refFQDN2");
+ MockPutNetworkIdWithDepth("CreateNetworkV2/createNetwork_updateContrail_AAIResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "1");
+ MockUpdateRequestDB("DBUpdateResponse.xml");
+ //MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "CreateNetworkV2/createNetwork_queryInstance_Success.xml", "v8");
+ MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "CreateNetworkV2/createNetwork_queryInstance_Success.xml");
+
+ Map<String, String> variables = setupVariablesVID1();
+ //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables);
+ executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables);
+ System.out.println("----------------------------------------------------------");
+ System.out.println("- got workflow response -");
+ System.out.println("----------------------------------------------------------");
+ //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+
+ assertEquals("true", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_Success"));
+ Assert.assertNotNull("CRENI_CompleteMsoProcessRequest - ", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_CompleteMsoProcessRequest"));
+
+ String workflowResp = BPMNUtil.getVariable(processEngineRule, "CreateNetworkInstance", "WorkflowResponse");
+ Assert.assertNotNull(workflowResp);
+
+ System.out.println("-----------------------------------------------------------");
+ System.out.println(" Success VID1 - CreateNetworkInstanceInfra flow Completed ");
+ System.out.println("-----------------------------------------------------------");
+
+ }
+
+ // *****************
+ // Utility Section
+ // *****************
+
+ String networkModelInfo =
+ " {\"modelUuid\": \"mod-inst-uuid-123\", " + '\n' +
+ " \"modelName\": \"mod_inst_z_123\", " + '\n' +
+ " \"modelVersion\": \"mod-inst-uuid-123\", " + '\n' +
+ " \"modelCustomizationUuid\": \"z_network_123\", " + '\n' +
+ " \"modelInvariantUuid\": \"mod-invar-uuid-123\" " + '\n' +
+ " }";
+
+ String serviceModelInfo =
+ " {\"modelUuid\": \"36a3a8ea-49a6-4ac8-b06c-89a54544b9b6\", " + '\n' +
+ " \"modelName\": \"HNGW Protected OAM\", " + '\n' +
+ " \"modelVersion\": \"1.0\", " + '\n' +
+ " \"modelInvariantUuid\": \"fcc85cb0-ad74-45d7-a5a1-17c8744fdb71\" " + '\n' +
+ " }";
+
+ // Success Scenario
+ private Map<String, String> setupVariables1() {
+ Map<String, String> variables = new HashMap<String, String>();
+ variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");
+ variables.put("msoRequestId", "testRequestId");
+ variables.put("requestId", "testRequestId");
+ variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
+ variables.put("networkId", "networkId");
+ variables.put("networkName", "MNS-25180-L-01-dmz_direct_net_1");
+ variables.put("lcpCloudRegionId", "RDM2WAGPLCP");
+ variables.put("tenantId", "7dd5365547234ee8937416c65507d266");
+ variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
+ variables.put("disableRollback", "false"); // macro
+ variables.put("failIfExists", "false");
+ variables.put("sdncVersion", "1702");
+ variables.put("subscriptionServiceType", "MSO-dev-service-type");
+ variables.put("globalSubscriberId", "globalId_45678905678");
+ variables.put("networkModelInfo", networkModelInfo);
+ variables.put("serviceModelInfo", serviceModelInfo);
+
+
+ return variables;
+
+ }
+
+ // Success Scenario 2
+ private Map<String, String> setupVariables2() {
+ Map<String, String> variables = new HashMap<String, String>();
+ variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");
+ variables.put("msoRequestId", "testRequestId");
+ variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
+ variables.put("networkId", "networkId");
+ variables.put("networkName", "myOwn_Network"); // Name Not found in AA&I
+ variables.put("lcpCloudRegionId", "RDM2WAGPLCP");
+ variables.put("tenantId", "7dd5365547234ee8937416c65507d266");
+ variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
+ variables.put("disableRollback", "false"); // 1702
+ variables.put("failIfExists", "false");
+ //variables.put("sdncVersion", "1702");
+ variables.put("sdncVersion", "1707");
+ variables.put("subscriptionServiceType", "MSO-dev-service-type");
+ variables.put("globalSubscriberId", "globalId_45678905678");
+ variables.put("networkModelInfo", networkModelInfo);
+ variables.put("serviceModelInfo", serviceModelInfo);
+
+ return variables;
+
+ }
+
+ // Active Scenario
+ private Map<String, String> setupVariablesActive() {
+ Map<String, String> variables = new HashMap<String, String>();
+ variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");
+ variables.put("msoRequestId", "testRequestId");
+ variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
+ variables.put("networkId", "networkId");
+ variables.put("networkName", "MNS-25180-L-01-dmz_direct_net_2"); // Unique name for Active
+ variables.put("lcpCloudRegionId", "RDM2WAGPLCP");
+ variables.put("tenantId", "7dd5365547234ee8937416c65507d266");
+ variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
+ variables.put("suppressRollback", "false");
+ variables.put("disableRollback", "false");
+ variables.put("failIfExists", "false");
+ variables.put("sdncVersion", "1702");
+ variables.put("subscriptionServiceType", "MSO-dev-service-type");
+ variables.put("globalSubscriberId", "globalId_45678905678");
+ variables.put("networkModelInfo", networkModelInfo);
+ variables.put("serviceModelInfo", serviceModelInfo);
+
+ return variables;
+
+ }
+
+ // Missing Name Scenario
+ private Map<String, String> setupVariablesMissingName() {
+ Map<String, String> variables = new HashMap<String, String>();
+ //variables.put("bpmnRequest", getCreateNetworkRequestMissingName());
+ variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");
+ variables.put("msoRequestId", "testRequestId");
+ variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
+ variables.put("networkId", "networkId");
+ // variables.put("networkName", "MNS-25180-L-01-dmz_direct_net_2"); // Missing 'name' variable
+ // variables.put("networkName", ""); // Missing 'value' of name variable
+ variables.put("modelName", "CONTRAIL_EXTERNAL");
+ variables.put("cloudConfiguration", "RDM2WAGPLCP");
+ variables.put("tenantId", "7dd5365547234ee8937416c65507d266");
+ variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
+ variables.put("suppressRollback", "true");
+ variables.put("failIfExists", "false");
+
+ return variables;
+
+ }
+
+ // SDNC Rollback Scenario
+ private Map<String, String> setupVariablesSDNCRollback() {
+ Map<String, String> variables = new HashMap<String, String>();
+ variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");
+ variables.put("msoRequestId", "testRequestId");
+ variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
+ variables.put("networkId", "networkId");
+ variables.put("networkName", "MNS-25180-L-01-dmz_direct_net_3"); // Unique name for Rollback
+ variables.put("modelName", "CONTRAIL_EXTERNAL");
+ variables.put("cloudConfiguration", "RDM2WAGPLCP");
+ variables.put("tenantId", "7dd5365547234ee8937416c65507d266");
+ variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
+ variables.put("suppressRollback", "true");
+ variables.put("disableRollback", "false");
+
+ return variables;
+
+ }
+
+ // old
+ public String getCreateNetworkRequestActive() {
+
+ String request =
+ "{ \"requestDetails\": { " + '\n' +
+ " \"modelInfo\": { " + '\n' +
+ " \"modelType\": \"modelType\", " + '\n' +
+ " \"modelId\": \"modelId\", " + '\n' +
+ " \"modelCustomizationUuid\": \"modelCustUuid\", " + '\n' +
+ " \"modelName\": \"CONTRAIL_EXTERNAL\", " + '\n' +
+ " \"modelVersion\": \"1\" " + '\n' +
+ " }, " + '\n' +
+ " \"cloudConfiguration\": { " + '\n' +
+ " \"lcpCloudRegionId\": \"RDM2WAGPLCP\", " + '\n' +
+ " \"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\" " + '\n' +
+ " }, " + '\n' +
+ " \"requestInfo\": { " + '\n' +
+ " \"instanceName\": \"MNS-25180-L-01-dmz_direct_net_2\", " + '\n' +
+ " \"source\": \"VID\", " + '\n' +
+ " \"callbackUrl\": \"\", " + '\n' +
+ " \"suppressRollback\": \"false\" ," + '\n' +
+ " \"productFamilyId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\" " + '\n' +
+ " }, " + '\n' +
+ " \"requestParameters\": { " + '\n' +
+ " \"userParams\": [] " + '\n' +
+ " } " + '\n' +
+ " } " + '\n' +
+ "}";
+
+ return request;
+
+ }
+
+ public String getCreateNetworkRequestSDNCRollback() {
+
+ String request =
+ "{ \"requestDetails\": { " + '\n' +
+ " \"modelInfo\": { " + '\n' +
+ " \"modelType\": \"modelType\", " + '\n' +
+ " \"modelId\": \"modelId\", " + '\n' +
+ " \"modelNameVersionId\": \"modelNameVersionId\", " + '\n' +
+ " \"modelName\": \"CONTRAIL_EXTERNAL\", " + '\n' +
+ " \"modelVersion\": \"1\" " + '\n' +
+ " }, " + '\n' +
+ " \"cloudConfiguration\": { " + '\n' +
+ " \"lcpCloudRegionId\": \"RDM2WAGPLCP\", " + '\n' +
+ " \"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\" " + '\n' +
+ " }, " + '\n' +
+ " \"requestInfo\": { " + '\n' +
+ " \"instanceName\": \"MNS-25180-L-01-dmz_direct_net_3\", " + '\n' +
+ " \"source\": \"VID\", " + '\n' +
+ " \"callbackUrl\": \"\", " + '\n' +
+ " \"suppressRollback\": \"true\" ," + '\n' +
+ " \"productFamilyId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\" " + '\n' +
+ " }, " + '\n' +
+ " \"requestParameters\": { " + '\n' +
+ " \"userParams\": [] " + '\n' +
+ " } " + '\n' +
+ " } " + '\n' +
+ "}";
+
+
+ return request;
+ }
+
+
+ // VID json input
+ private Map<String, String> setupVariablesVID1() {
+ Map<String, String> variables = new HashMap<String, String>();
+ variables.put("bpmnRequest", getCreateNetworkRequestVID1());
+ variables.put("mso-request-id", "testRequestId");
+ //variables.put("msoRequestId", "testRequestId");
+ variables.put("requestId", "testRequestId");
+ variables.put("isBaseVfModule", "true");
+ variables.put("recipeTimeout", "0");
+ variables.put("requestAction", "CREATE");
+ variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
+ variables.put("vnfId", "");
+ variables.put("vfModuleId", "");
+ variables.put("volumeGroupId", "");
+ //variables.put("networkId", "networkId");
+ variables.put("serviceType", "vMOG");
+ variables.put("vfModuleType", "");
+ variables.put("networkType", "modelName");
+
+ return variables;
+
+ }
+
+ public String getCreateNetworkRequestVID1() {
+
+ String request =
+ "{ \"requestDetails\": { " + '\n' +
+ " \"modelInfo\": { " + '\n' +
+ " \"modelType\": \"modelType\", " + '\n' +
+ " \"modelCustomizationId\": \"f21df226-8093-48c3-be7e-0408fcda0422\", " + '\n' +
+ " \"modelName\": \"CONTRAIL_EXTERNAL\", " + '\n' +
+ " \"modelVersion\": \"1.0\" " + '\n' +
+ " }, " + '\n' +
+ " \"cloudConfiguration\": { " + '\n' +
+ " \"lcpCloudRegionId\": \"RDM2WAGPLCP\", " + '\n' +
+ " \"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\" " + '\n' +
+ " }, " + '\n' +
+ " \"requestInfo\": { " + '\n' +
+ " \"instanceName\": \"MNS-25180-L-01-dmz_direct_net_1\", " + '\n' +
+ " \"source\": \"VID\", " + '\n' +
+ " \"callbackUrl\": \"\", " + '\n' +
+ " \"suppressRollback\": \"false\" ," + '\n' +
+ " \"productFamilyId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\" " + '\n' +
+ " }, " + '\n' +
+ " \"requestParameters\": { " + '\n' +
+ " \"backoutOnFailure\": false, " + '\n' +
+ " \"serviceId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\", " + '\n' +
+ " \"userParams\": [] " + '\n' +
+ " } " + '\n' +
+ " } " + '\n' +
+ "}";
+
+ return request;
+ }
+
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleVolumeInfraV1Test.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleVolumeInfraV1Test.java
index e70f48d758..d361d1e511 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleVolumeInfraV1Test.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleVolumeInfraV1Test.java
@@ -20,6 +20,10 @@
package org.openecomp.mso.bpmn.infrastructure;
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteVolumeGroupById;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfById;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetVolumeGroupByName;
@@ -27,6 +31,7 @@ import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceIn
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutVolumeGroupById;
import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
import static org.openecomp.mso.bpmn.mock.StubResponseVNFAdapter.mockPostVNFVolumeGroup;
+import static org.openecomp.mso.bpmn.mock.StubResponseVNFAdapter.mockPutVNFVolumeGroupRollback;
import java.io.IOException;
import java.util.HashMap;
@@ -34,10 +39,12 @@ import java.util.Map;
import java.util.UUID;
import org.camunda.bpm.engine.test.Deployment;
+import org.junit.Ignore;
import org.junit.Test;
import org.openecomp.mso.bpmn.common.WorkflowTest;
import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse;
import org.openecomp.mso.bpmn.mock.FileUtil;
+import org.openecomp.mso.bpmn.mock.StubResponseAAI;
public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest {
@@ -48,6 +55,8 @@ public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest {
public CreateVfModuleVolumeInfraV1Test() throws IOException {
callbacks.put("volumeGroupCreate", FileUtil.readResourceFile(
"__files/CreateVfModuleVolumeInfraV1/CreateVfModuleVolumeCallbackResponse.xml"));
+ callbacks.put("volumeGroupDelete", FileUtil.readResourceFile(
+ "__files/DeleteVfModuleVolumeInfraV1/DeleteVfModuleVolumeCallbackResponse.xml"));
callbacks.put("volumeGroupException", FileUtil.readResourceFile(
"__files/CreateVfModuleVolumeInfraV1/CreateVfModuleCallbackException.xml"));
callbacks.put("volumeGroupRollback", FileUtil.readResourceFile(
@@ -58,9 +67,10 @@ public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest {
* Happy path scenario for VID
*****************************/
@Test
+ //@Ignore
@Deployment(resources = {"process/CreateVfModuleVolumeInfraV1.bpmn",
"subprocess/GenericGetService.bpmn",
- "subprocess/DoCreateVfModuleVolumeV1.bpmn",
+ "subprocess/DoCreateVfModuleVolumeV2.bpmn",
"subprocess/FalloutHandler.bpmn",
"subprocess/CompleteMsoProcess.bpmn",
"subprocess/VnfAdapterRestV1.bpmn"})
@@ -100,9 +110,61 @@ public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest {
}
/**
+ * Fail - trigger rollback
+ *****************************/
+ @Test
+ //@Ignore
+ @Deployment(resources = {"process/CreateVfModuleVolumeInfraV1.bpmn",
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/DoCreateVfModuleVolumeV2.bpmn",
+ "subprocess/DoCreateVfModuleVolumeRollback.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+ "subprocess/VnfAdapterRestV1.bpmn"})
+ public void TestRollback() throws Exception {
+
+ logStart();
+
+ MockNodeQueryServiceInstanceById("test-service-instance-id", "CreateVfModuleVolumeInfraV1/getSIUrlById.xml");
+ MockGetGenericVnfById("/TEST-VNF-ID-0123", "CreateVfModuleVolumeInfraV1/GenericVnf.xml", 200);
+ MockPutVolumeGroupById("AAIAIC25", "TEST-VOLUME-GROUP-ID-0123", "CreateVfModuleVolumeInfraV1/createVfModuleVolume_createVolumeName_AAIResponse_Success.xml", 201);
+ mockPostVNFVolumeGroup(202);
+ mockPutVNFVolumeGroupRollback("TEST-VOLUME-GROUP-ID-0123", 202);
+ MockDeleteVolumeGroupById("AAIAIC25", "8424bb3c-c3e7-4553-9662-469649ed9379", "1460134360", 202);
+ StubResponseAAI.MockGetVolumeGroupByName_404("AAIAIC25", "TEST-MSOTESTVOL101a-vSAMP12_base_vol_module-0");
+ StubResponseAAI.MockGetVolumeGroupByName("AAIAIC25", "MSOTESTVOL101a-vSAMP12_base_vol_module-0", "CreateVfModuleVolumeInfraV1/createVfModuleVolume_queryVolumeName_AAIResponse_Success.xml", 200);
+ StubResponseAAI.MockDeleteVolumeGroup("AAIAIC25", "8424bb3c-c3e7-4553-9662-469649ed9379", "1460134360");
+
+ String businessKey = UUID.randomUUID().toString();
+ String createVfModuleVolRequest = FileUtil.readResourceFile("__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request.json");
+
+ Map<String, Object> testVariables = new HashMap<String, Object>();
+ testVariables.put("requestId", "TEST-REQUEST-ID-0123");
+ testVariables.put("serviceInstanceId", "test-service-instance-id");
+ testVariables.put("vnfId", "TEST-VNF-ID-0123");
+ testVariables.put("test-volume-group-name", "TEST-MSOTESTVOL101a-vSAMP12_base_vol_module-0");
+ testVariables.put("test-volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
+
+ TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVfModuleVolumeInfraV1", "v1", businessKey, createVfModuleVolRequest, testVariables);
+ WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 1000000);
+
+ String responseBody = response.getResponse();
+ System.out.println("Workflow (Synch) Response:\n" + responseBody);
+
+ injectVNFRestCallbacks(callbacks, "volumeGroupCreate");
+ injectVNFRestCallbacks(callbacks, "volumeGroupDelete");
+
+ waitForProcessEnd(businessKey, 100000);
+ checkVariable(businessKey, "CVMVINFRAV1_SuccessIndicator", false);
+
+ logEnd();
+ }
+
+ /**
* Happy path scenario for VID
*****************************/
@Test
+ @Ignore
@Deployment(resources = {"process/CreateVfModuleVolumeInfraV1.bpmn",
"subprocess/GenericGetService.bpmn",
"subprocess/DoCreateVfModuleVolumeV1.bpmn",
@@ -145,7 +207,7 @@ public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest {
*Vnf Create fail
*****************************/
@Test
- //@Ignore
+ @Ignore
@Deployment(resources = {"process/CreateVfModuleVolumeInfraV1.bpmn",
"subprocess/GenericGetService.bpmn",
"subprocess/DoCreateVfModuleVolumeV1.bpmn",
@@ -193,7 +255,7 @@ public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest {
* Error scenario - vnf not found
********************************/
@Test
- //@Ignore
+ @Ignore
@Deployment(resources = {"process/CreateVfModuleVolumeInfraV1.bpmn",
"subprocess/GenericGetService.bpmn",
"subprocess/DoCreateVfModuleVolumeV1.bpmn",
@@ -233,7 +295,7 @@ public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest {
* Error scenario - error in validation
**************************************/
@Test
- //@Ignore
+ @Ignore
@Deployment(resources = {"process/CreateVfModuleVolumeInfraV1.bpmn",
"subprocess/GenericGetService.bpmn",
"subprocess/DoCreateVfModuleVolumeV1.bpmn",
@@ -270,7 +332,7 @@ public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest {
* Error scenario - service instance not found
*********************************************/
@Test
- //@Ignore
+ @Ignore
@Deployment(resources = {"process/CreateVfModuleVolumeInfraV1.bpmn",
"subprocess/GenericGetService.bpmn",
"subprocess/DoCreateVfModuleVolumeV1.bpmn",
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVnfInfraTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVnfInfraTest.java
index 80c1e8c215..48705220c4 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVnfInfraTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVnfInfraTest.java
@@ -44,6 +44,7 @@ import java.util.Map;
import java.util.UUID;
import org.camunda.bpm.engine.test.Deployment;
+import org.junit.Ignore;
import org.junit.Test;
import org.openecomp.mso.bpmn.common.BPMNUtil;
import org.openecomp.mso.bpmn.common.WorkflowTest;
@@ -134,6 +135,7 @@ public class CreateVnfInfraTest extends WorkflowTest {
}
@Test
+ @Ignore
@Deployment(resources = {"subprocess/DoCreateVnf.bpmn", "subprocess/GenericGetService.bpmn", "subprocess/GenericGetVnf.bpmn", "subprocess/GenericPutVnf.bpmn", "process/CreateVnfInfra.bpmn", "subprocess/FalloutHandler.bpmn", "subprocess/CompleteMsoProcess.bpmn"})
public void testCreateVnfInfra_error_siNotFound() throws Exception{
@@ -151,6 +153,7 @@ public class CreateVnfInfraTest extends WorkflowTest {
}
@Test
+ @Ignore
@Deployment(resources = {"subprocess/DoCreateVnf.bpmn",
"subprocess/GenericGetService.bpmn",
"subprocess/GenericGetVnf.bpmn",
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteGenericALaCarteServiceInstanceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteGenericALaCarteServiceInstanceTest.java
new file mode 100644
index 0000000000..d9e882b612
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteGenericALaCarteServiceInstanceTest.java
@@ -0,0 +1,91 @@
+package org.openecomp.mso.bpmn.infrastructure;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.openecomp.mso.bpmn.common.BPMNUtil.executeWorkFlow;
+import static org.openecomp.mso.bpmn.common.BPMNUtil.waitForWorkflowToFinish;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteServiceInstance;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById;
+import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import org.camunda.bpm.engine.test.Deployment;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.openecomp.mso.bpmn.common.BPMNUtil;
+import org.openecomp.mso.bpmn.common.WorkflowTest;
+import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse;
+
+/**
+ * Unit test cases for DelServiceInstance.bpmn
+ */
+public class DeleteGenericALaCarteServiceInstanceTest extends WorkflowTest {
+
+ public DeleteGenericALaCarteServiceInstanceTest() throws IOException {
+ }
+
+ /**
+ * Sunny day VID scenario.
+ *
+ * @throws Exception
+ */
+ @Ignore // IGNORED FOR 1710 MERGE TO ONAP
+ @Test
+ @Deployment(resources = {
+ "process/DeleteGenericALaCarteServiceInstance.bpmn",
+ "subprocess/DoDeleteServiceInstance.bpmn",
+ "subprocess/GenericDeleteService.bpmn",
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+ "subprocess/FalloutHandler.bpmn" })
+ public void sunnyDayAlaCarte() throws Exception {
+
+ logStart();
+
+ //AAI
+ MockDeleteServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "");
+ MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getSINoRelations.xml");
+ MockNodeQueryServiceInstanceById("MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getSIUrlById.xml");
+ //DB
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+
+ Map<String, String> variables = setupVariables();
+ WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "DeleteGenericALaCarteServiceInstance", variables);
+ waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+
+ String workflowResp = BPMNUtil.getVariable(processEngineRule, "DeleteGenericALaCarteServiceInstance", "WorkflowResponse");
+ //assertNotNull(workflowResp);
+ System.out.println("Workflow (Synch) Response:\n" + workflowResp);
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "DeleteGenericALaCarteServiceInstance", "WorkflowException");
+ String completionReq = BPMNUtil.getVariable(processEngineRule, "DeleteGenericALaCarteServiceInstance", "completionRequest");
+ System.out.println("completionReq:\n" + completionReq);
+ System.out.println("workflowException:\n" + workflowException);
+ assertNotNull(completionReq);
+ assertEquals(null, workflowException);
+
+ logEnd();
+ }
+
+ // Success Scenario
+ private Map<String, String> setupVariables() {
+ Map<String, String> variables = new HashMap<String, String>();
+ variables.put("isDebugLogEnabled", "true");
+ variables.put("bpmnRequest", getRequest());
+ variables.put("mso-request-id", "RaaTestRequestId-1");
+ variables.put("serviceInstanceId","MIS%252F1604%252F0026%252FSW_INTERNET");
+ return variables;
+ }
+
+ public String getRequest() {
+ String request = "{\"requestDetails\":{\"modelInfo\":{\"modelType\":\"service\",\"modelInvariantUuid\":\"uuid-miu-svc-011-abcdef\",\"modelUuid\":\"ASDC_TOSCA_UUID\",\"modelName\":\"SIModelName1\",\"modelVersion\":\"2\"},\"subscriberInfo\":{\"globalSubscriberId\":\"SDN-ETHERNET-INTERNET\",\"subscriberName\":\"\"},\"requestInfo\":{\"instanceName\":\"1604-MVM-26\",\"source\":\"VID\",\"suppressRollback\":\"true\",\"productFamilyId\":\"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\"},\"cloudConfiguration\":{\"lcpCloudRegionId\":\"mdt1\",\"tenantId\":\"8b1df54faa3b49078e3416e21370a3ba\"},\"requestParameters\":{\"subscriptionServiceType\":\"123456789\",\"aLaCarte\":\"false\",\"userParams\":\"somep\"}}}";
+ return request;
+ }
+
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteNetworkInstanceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteNetworkInstanceTest.java
new file mode 100644
index 0000000000..0da2526fc1
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteNetworkInstanceTest.java
@@ -0,0 +1,321 @@
+package org.openecomp.mso.bpmn.infrastructure;
+
+import static org.openecomp.mso.bpmn.common.BPMNUtil.executeAsyncWorkflow;
+import static org.openecomp.mso.bpmn.common.BPMNUtil.getVariable;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetCloudRegion;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkByIdWithDepth;
+import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
+import static org.openecomp.mso.bpmn.mock.StubResponseNetworkAdapter.MockNetworkAdapter;
+import static org.openecomp.mso.bpmn.mock.StubResponseNetworkAdapter.MockNetworkAdapterContainingRequest;
+import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
+import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapterTopology;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.camunda.bpm.engine.test.Deployment;
+import org.junit.Assert;
+import org.junit.Rule;
+import org.junit.Test;
+import org.openecomp.mso.bpmn.common.BPMNUtil;
+import org.openecomp.mso.bpmn.common.SDNCAdapterCallbackRule;
+import org.openecomp.mso.bpmn.common.WorkflowTest;
+import org.openecomp.mso.bpmn.common.WorkflowTestTransformer;
+import org.openecomp.mso.bpmn.mock.SDNCAdapterNetworkTopologyMockTransformer;
+
+import com.github.tomakehurst.wiremock.extension.ResponseTransformer;
+
+
+/**
+ * Unit test cases for DeleteNetworkInstance.bpmn
+ *
+ */
+//@Ignore
+public class DeleteNetworkInstanceTest extends WorkflowTest {
+ @WorkflowTestTransformer
+ public static final ResponseTransformer sdncAdapterMockTransformer =
+ new SDNCAdapterNetworkTopologyMockTransformer();
+
+ @Rule
+ public final SDNCAdapterCallbackRule sdncAdapterCallbackRule =
+ new SDNCAdapterCallbackRule(processEngineRule);
+
+ /**
+ * End-to-End flow - Unit test for DeleteNetworkInstance.bpmn
+ * - String input & String response
+ */
+
+ @Test
+ //@Ignore
+ @Deployment(resources = {"process/DeleteNetworkInstance.bpmn",
+ "subprocess/DoDeleteNetworkInstance.bpmn",
+ "subprocess/DoDeleteNetworkInstanceRollback.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn"})
+
+ public void shouldInvokeServiceDeleteNetworkInstance_VID_Success() throws Exception {
+
+ System.out.println("----------------------------------------------------------");
+ System.out.println(" Success VID - DeleteNetworkInstance flow Started! ");
+ System.out.println("----------------------------------------------------------");
+
+ // setup simulators
+ mockSDNCAdapterTopology("DeleteNetworkV2mock/sdncDeleteNetworkTopologySimResponse.xml", "SvcAction>delete");
+ MockNetworkAdapter("bdc5efe8-404a-409b-85f6-0dcc9eebae30", 200, "deleteNetworkResponse_Success.xml");
+ MockGetNetworkByIdWithDepth("bdc5efe8-404a-409b-85f6-0dcc9eebae30", "DeleteNetworkV2/deleteNetworkAAIResponse_Success.xml", "1");
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetCloudRegion("RDM2WAGPLCP", 200, "DeleteNetworkV2/cloudRegion30_AAIResponse_Success.xml");
+
+ Map<String, String> variables = new HashMap<String, String>();
+ variables.put("mso-request-id", "testRequestId");
+ variables.put("requestId", "testRequestId");
+ variables.put("isBaseVfModule", "true");
+ variables.put("recipeTimeout", "0");
+ variables.put("requestAction", "DELETE");
+ variables.put("serviceInstanceId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
+ variables.put("vnfId", "");
+ variables.put("vfModuleId", "");
+ variables.put("volumeGroupId", "");
+ variables.put("networkId", "bdc5efe8-404a-409b-85f6-0dcc9eebae30");
+ variables.put("serviceType", "MOG");
+ variables.put("vfModuleType", "");
+ variables.put("networkType", "modelName");
+ variables.put("bpmnRequest", getDeleteNetworkInstanceInfraRequest());
+
+ executeAsyncWorkflow(processEngineRule, "DeleteNetworkInstance", variables);
+
+ Assert.assertNotNull("DELNI_CompleteMsoProcessRequest - ", getVariable(processEngineRule, "DeleteNetworkInstance", "DELNI_CompleteMsoProcessRequest"));
+ Assert.assertEquals("true", getVariable(processEngineRule, "DeleteNetworkInstance", "DELNI_Success"));
+
+ String workflowResp = BPMNUtil.getVariable(processEngineRule, "DeleteNetworkInstance", "WorkflowResponse");
+ Assert.assertNotNull(workflowResp);
+ System.out.println("DeleteNetworkInstanceTest.shouldInvokeServiceDeleteNetworkInstance_Success() WorkflowResponse:\n" + workflowResp);
+
+ String completeMsoProcessRequest =
+ "<aetgt:MsoCompletionRequest xmlns:aetgt=\"http://org.openecomp/mso/workflow/schema/v1\"" + '\n'
+ + " xmlns:ns=\"http://org.openecomp/mso/request/types/v1\"" + '\n'
+ + " xmlns=\"http://org.openecomp/mso/infra/vnf-request/v1\">" + '\n'
+ + " <request-info>" + '\n'
+ + " <request-id>testRequestId</request-id>" + '\n'
+ + " <action>DELETE</action>" + '\n'
+ + " <source>VID</source>" + '\n'
+ + " </request-info>" + '\n'
+ + " <aetgt:status-message>Network has been deleted successfully.</aetgt:status-message>" + '\n'
+ + " <aetgt:mso-bpel-name>BPMN Network action: DELETE</aetgt:mso-bpel-name>" + '\n'
+ + "</aetgt:MsoCompletionRequest>";
+
+ Assert.assertEquals(completeMsoProcessRequest, getVariable(processEngineRule, "DeleteNetworkInstance", "DELNI_CompleteMsoProcessRequest"));
+
+ System.out.println("----------------------------------------------------------");
+ System.out.println(" Success VID - DeleteNetworkInstance flow Completed ");
+ System.out.println("----------------------------------------------------------");
+
+
+ }
+
+ @Test
+ //@Ignore
+ @Deployment(resources = {"process/DeleteNetworkInstance.bpmn",
+ "subprocess/DoDeleteNetworkInstance.bpmn",
+ //"subprocess/DoDeleteNetworkInstanceRollback.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn"})
+
+ public void shouldInvokeServiceDeleteNetworkInstance_vIPER_Success() throws Exception {
+
+ System.out.println("----------------------------------------------------------");
+ System.out.println(" Success vIPER - DeleteNetworkInstance flow Started! ");
+ System.out.println("----------------------------------------------------------");
+
+ // setup simulators
+ mockSDNCAdapterTopology("DeleteNetworkV2mock/sdncDeleteNetworkTopologySimResponse.xml", "SvcAction>unassign");
+ mockSDNCAdapterTopology("DeleteNetworkV2mock/sdncDeleteNetworkTopologySimResponse.xml", "SvcAction>deactivate");
+ MockNetworkAdapter("bdc5efe8-404a-409b-85f6-0dcc9eebae30", 200, "deleteNetworkResponse_Success.xml");
+ MockGetNetworkByIdWithDepth("bdc5efe8-404a-409b-85f6-0dcc9eebae30", "DeleteNetworkV2/deleteNetworkAAIResponse_Success.xml", "1");
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetCloudRegion("RDM2WAGPLCP", 200, "DeleteNetworkV2/cloudRegion30_AAIResponse_Success.xml");
+
+ String networkModelInfo = " {\"modelName\": \"modelName\", " + '\n' +
+ " \"networkType\": \"modelName\" }";
+
+ Map<String, String> variables = new HashMap<String, String>();
+ variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");
+ variables.put("msoRequestId", "testRequestId");
+ variables.put("requestId", "testRequestId");
+ variables.put("serviceInstanceId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
+ variables.put("networkId", "bdc5efe8-404a-409b-85f6-0dcc9eebae30");
+ variables.put("networkName", "HSL_direct_net_2");
+ variables.put("lcpCloudRegionId", "RDM2WAGPLCP");
+ variables.put("tenantId", "88a6ca3ee0394ade9403f075db23167e");
+ variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
+ variables.put("disableRollback", "false"); // 1702
+ variables.put("failIfExists", "false");
+ //variables.put("sdncVersion", "1702");
+ variables.put("sdncVersion", "1707");
+ variables.put("subscriptionServiceType", "MSO-dev-service-type");
+ variables.put("networkModelInfo", networkModelInfo);
+
+ executeAsyncWorkflow(processEngineRule, "DeleteNetworkInstance", variables);
+
+ Assert.assertNotNull("DELNI_CompleteMsoProcessRequest - ", getVariable(processEngineRule, "DeleteNetworkInstance", "DELNI_CompleteMsoProcessRequest"));
+ Assert.assertEquals("true", getVariable(processEngineRule, "DeleteNetworkInstance", "DELNI_Success"));
+
+ String workflowResp = BPMNUtil.getVariable(processEngineRule, "DeleteNetworkInstance", "WorkflowResponse");
+ Assert.assertNotNull(workflowResp);
+ System.out.println("DeleteNetworkInstanceTest.shouldInvokeServiceDeleteNetworkInstance_vIPER_Success() WorkflowResponse:\n" + workflowResp);
+
+ String completeMsoProcessRequest =
+ "<aetgt:MsoCompletionRequest xmlns:aetgt=\"http://org.openecomp/mso/workflow/schema/v1\"" + '\n'
+ + " xmlns:ns=\"http://org.openecomp/mso/request/types/v1\"" + '\n'
+ + " xmlns=\"http://org.openecomp/mso/infra/vnf-request/v1\">" + '\n'
+ + " <request-info>" + '\n'
+ + " <request-id>testRequestId</request-id>" + '\n'
+ + " <action>DELETE</action>" + '\n'
+ + " <source>VID</source>" + '\n'
+ + " </request-info>" + '\n'
+ + " <aetgt:status-message>Network has been deleted successfully.</aetgt:status-message>" + '\n'
+ + " <aetgt:mso-bpel-name>BPMN Network action: DELETE</aetgt:mso-bpel-name>" + '\n'
+ + "</aetgt:MsoCompletionRequest>";
+
+ Assert.assertEquals(completeMsoProcessRequest, getVariable(processEngineRule, "DeleteNetworkInstance", "DELNI_CompleteMsoProcessRequest"));
+
+ System.out.println("----------------------------------------------------------");
+ System.out.println(" Success VID - DeleteNetworkInstance flow Completed ");
+ System.out.println("----------------------------------------------------------");
+
+
+ }
+
+ @Test
+ //@Ignore
+ @Deployment(resources = {"process/DeleteNetworkInstance.bpmn",
+ "subprocess/DoDeleteNetworkInstance.bpmn",
+ "subprocess/DoDeleteNetworkInstanceRollback.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn"})
+
+ public void shouldInvokeServiceDeleteNetworkInstanceInfra_vIPER_Rollback() throws Exception {
+ // Rollback is not Applicable for DeleteNetwork (no requirements). Rollback should not be invoked.
+ System.out.println("----------------------------------------------------------");
+ System.out.println(" Rollback - DeleteNetworkInstance flow Started! ");
+ System.out.println("----------------------------------------------------------");
+
+ // setup simulatores
+ mockSDNCAdapter("/SDNCAdapter", "SvcAction>unassign", 500, "");
+ mockSDNCAdapterTopology("DeleteNetworkV2mock/sdncDeleteNetworkTopologySimResponse.xml", "SvcAction>deactivate");
+ mockSDNCAdapterTopology("CreateNetworkV2mock/sdncCreateNetworkTopologySimResponse.xml", "SvcAction>activate");
+ MockNetworkAdapter("bdc5efe8-404a-409b-85f6-0dcc9eebae30", 200, "deleteNetworkResponse_Success.xml");
+ MockNetworkAdapterContainingRequest("createNetworkRequest", 200, "CreateNetworkV2/createNetworkResponse_Success.xml");
+ MockGetNetworkByIdWithDepth ("bdc5efe8-404a-409b-85f6-0dcc9eebae30", "DeleteNetworkV2/deleteNetworkAAIResponse_Success.xml", "1");
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetCloudRegion("RDM2WAGPLCP", 200, "DeleteNetworkV2/cloudRegion30_AAIResponse_Success.xml");
+
+ String networkModelInfo = " {\"modelCustomizationId\": \"uuid-nrc-001-1234\", " + '\n' +
+ " \"modelInvariantId\": \"was-ist-das-001-1234\" }";
+
+ Map<String, String> variables = new HashMap<String, String>();
+ variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");
+ variables.put("msoRequestId", "testRequestId");
+ variables.put("requestId", "testRequestId");
+ variables.put("serviceInstanceId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
+ variables.put("networkId", "bdc5efe8-404a-409b-85f6-0dcc9eebae30");
+ variables.put("networkName", "HSL_direct_net_2");
+ variables.put("lcpCloudRegionId", "RDM2WAGPLCP");
+ variables.put("tenantId", "88a6ca3ee0394ade9403f075db23167e");
+ variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
+ variables.put("disableRollback", "false"); // 1702
+ variables.put("failIfExists", "false");
+ variables.put("sdncVersion", "1702");
+ variables.put("subscriptionServiceType", "MSO-dev-service-type");
+ variables.put("networkModelInfo", networkModelInfo);
+
+ executeAsyncWorkflow(processEngineRule, "DeleteNetworkInstance", variables);
+ //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "DeleteNetworkInstance", variables);
+ //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+
+ String workflowResp = BPMNUtil.getVariable(processEngineRule, "DeleteNetworkInstance", "WorkflowResponse");
+ Assert.assertNotNull(workflowResp);
+
+ Assert.assertNotNull("DELNI_FalloutHandlerRequest - ", getVariable(processEngineRule, "DeleteNetworkInstance", "DELNI_FalloutHandlerRequest"));
+ Assert.assertEquals("false", getVariable(processEngineRule, "DeleteNetworkInstance", "DELNI_Success"));
+ Assert.assertEquals("false", BPMNUtil.getVariable(processEngineRule, "DoDeleteNetworkInstance", "DELNWKI_Success"));
+
+ System.out.println("----------------------------------------------------------");
+ System.out.println(" Rollback - DeleteNetworkInstanceModular flow Completed ");
+ System.out.println("----------------------------------------------------------");
+
+
+ }
+
+
+ // *****************
+ // Utility Section
+ // *****************
+
+ public String getDeleteNetworkInstanceInfraRequest() {
+
+ String request =
+ "{ \"requestDetails\": { " + '\n' +
+ " \"modelInfo\": { " + '\n' +
+ " \"modelType\": \"modelType\", " + '\n' +
+ " \"modelCustomizationId\": \"f21df226-8093-48c3-be7e-0408fcda0422\", " + '\n' +
+ " \"modelName\": \"CONTRAIL_EXTERNAL\", " + '\n' +
+ " \"modelVersion\": \"1.0\" " + '\n' +
+ " }, " + '\n' +
+ " \"cloudConfiguration\": { " + '\n' +
+ " \"lcpCloudRegionId\": \"RDM2WAGPLCP\", " + '\n' +
+ " \"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\" " + '\n' +
+ " }, " + '\n' +
+ " \"requestInfo\": { " + '\n' +
+ " \"instanceName\": \"HSL_direct_net_2\", " + '\n' +
+ " \"source\": \"VID\", " + '\n' +
+ " \"suppressRollback\": \"false\", " + '\n' +
+ " \"callbackUrl\": \"\" " + '\n' +
+ " }, " + '\n' +
+ " \"requestParameters\": { " + '\n' +
+ " \"backoutOnFailure\": true, " + '\n' +
+ " \"serviceId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\", " + '\n' +
+ " \"userParams\": {} " + '\n' +
+ " } " + '\n' +
+ " } " + '\n' +
+ "}";
+ return request;
+
+ }
+
+
+ public String getDeleteNetworkInstanceInfraRequest_MissingId() {
+
+ String request =
+ "{ \"requestDetails\": { " + '\n' +
+ " \"modelInfo\": { " + '\n' +
+ " \"modelType\": \"modelType\", " + '\n' +
+ " \"modelId\": \"modelId\", " + '\n' +
+ " \"modelNameVersionId\": \"modelNameVersionId\", " + '\n' +
+ " \"modelName\": \"CONTRAIL_EXTERNAL\", " + '\n' +
+ " \"modelVersion\": \"1\" " + '\n' +
+ " }, " + '\n' +
+ " \"cloudConfiguration\": { " + '\n' +
+ " \"lcpCloudRegionId\": \"RDM2WAGPLCP\", " + '\n' +
+ " \"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\" " + '\n' +
+ " }, " + '\n' +
+ " \"requestInfo\": { " + '\n' +
+ " \"instanceName\": \"HSL_direct_net_2\", " + '\n' +
+ " \"source\": \"VID\", " + '\n' +
+ " \"callbackUrl\": \"\" " + '\n' +
+ " }, " + '\n' +
+ " \"requestParameters\": { " + '\n' +
+ " \"backoutOnFailure\": true, " + '\n' +
+ " \"serviceId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\", " + '\n' +
+ " \"userParams\": [] " + '\n' +
+ " } " + '\n' +
+ " } " + '\n' +
+ "}";
+ return request;
+
+ }
+
+} \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateSIRollbackTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateSIRollbackTest.java
new file mode 100644
index 0000000000..f2c9680075
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateSIRollbackTest.java
@@ -0,0 +1,179 @@
+package org.openecomp.mso.bpmn.infrastructure;
+
+import static org.junit.Assert.assertEquals;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteServiceInstance;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById;
+import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
+import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import org.camunda.bpm.engine.test.Deployment;
+import org.junit.Assert;
+import org.junit.Test;
+import org.openecomp.mso.bpmn.common.BPMNUtil;
+import org.openecomp.mso.bpmn.common.WorkflowTest;
+import org.openecomp.mso.bpmn.core.RollbackData;
+
+/**
+ * Unit test cases for DoCreateServiceInstanceRollback.bpmn
+ */
+public class DoCreateSIRollbackTest extends WorkflowTest {
+ private static final String EOL = "\n";
+ private final CallbackSet callbacks = new CallbackSet();
+ private final String sdncAdapterCallback =
+ "<output xmlns=\"com:att:sdnctl:l3api\">" + EOL +
+ " <svc-request-id>((REQUEST-ID))</svc-request-id>" + EOL +
+ " <ack-final-indicator>Y</ack-final-indicator>" + EOL +
+ "</output>" + EOL;
+
+ public DoCreateSIRollbackTest() throws IOException {
+ callbacks.put("deactivate", sdncAdapterCallback);
+ callbacks.put("delete", sdncAdapterCallback);
+ }
+
+ /**
+ * Sunny day VID scenario.
+ *
+ * @throws Exception
+ */
+ //@Ignore // File not found - unable to run the test. Also, Stubs need updating..
+ @Test
+ @Deployment(resources = {
+ "subprocess/DoCreateServiceInstanceRollback.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/GenericDeleteService.bpmn",
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+ "subprocess/FalloutHandler.bpmn" })
+ public void sunnyDay() throws Exception {
+
+ logStart();
+
+ //AAI
+ MockDeleteServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "");
+ MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getSINoRelations.xml");
+ MockNodeQueryServiceInstanceById("MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getSIUrlById.xml");
+ //SDNC
+ mockSDNCAdapter(200);
+ //DB
+ mockUpdateRequestDB(200, "DBUpdateResponse.xml");
+ String businessKey = UUID.randomUUID().toString();
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ setupVariables(variables);
+ invokeSubProcess("DoCreateServiceInstanceRollback", businessKey, variables);
+ injectSDNCCallbacks(callbacks, "deactivate");
+ injectSDNCCallbacks(callbacks, "delete");
+ waitForProcessEnd(businessKey, 10000);
+ Assert.assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "DoCreateServiceInstanceRollback", "WorkflowException");
+ System.out.println("workflowException:\n" + workflowException);
+ assertEquals(null, workflowException);
+
+ logEnd();
+ }
+
+ // Success Scenario
+ private void setupVariables(Map<String, Object> variables) {
+ variables.put("isDebugLogEnabled", "true");
+ variables.put("msoRequestId", "RaaTestRequestId-1");
+ variables.put("mso-request-id", "RaaTestRequestId-1");
+ variables.put("serviceInstanceId","MIS%252F1604%252F0026%252FSW_INTERNET");
+
+ RollbackData rollbackData = new RollbackData();
+
+ rollbackData.put("SERVICEINSTANCE", "serviceInstanceId", "MIS%252F1604%252F0026%252FSW_INTERNET");
+ rollbackData.put("SERVICEINSTANCE", "globalCustomerId", "SDN-ETHERNET-INTERNET");
+ rollbackData.put("SERVICEINSTANCE", "serviceSubscriptionType", "123456789");
+ rollbackData.put("SERVICEINSTANCE", "disablerollback", "false");
+ rollbackData.put("SERVICEINSTANCE", "rollbackAAI", "true");
+ rollbackData.put("SERVICEINSTANCE", "rollbackSDNC", "true");
+
+ String req = "<sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:ns5=\"http://org.openecomp/mso/request/types/v1\"" + EOL +
+ "xmlns:sdncadapter=\"http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1\" " + EOL +
+ "xmlns:sdncadapterworkflow=\"http://org.openecomp/mso/workflow/schema/v1\">" + EOL +
+ "<sdncadapter:RequestHeader>" + EOL +
+ "<sdncadapter:RequestId>b043d290-140d-4a38-a9b6-95d3b8bd27d4</sdncadapter:RequestId>" + EOL +
+ "<sdncadapter:SvcInstanceId>MIS%252F1604%252F0026%252FSW_INTERNET</sdncadapter:SvcInstanceId>" + EOL +
+ "<sdncadapter:SvcAction>deactivate</sdncadapter:SvcAction>" + EOL +
+ "<sdncadapter:SvcOperation>service-topology-operation</sdncadapter:SvcOperation>" + EOL +
+ "<sdncadapter:CallbackUrl>http://localhost:8080/mso/SDNCAdapterCallbackService</sdncadapter:CallbackUrl>" + EOL +
+ "</sdncadapter:RequestHeader>" + EOL +
+ "<sdncadapterworkflow:SDNCRequestData>" + EOL +
+ "<request-information>" + EOL +
+ "<request-id>RaaTestRequestId-1</request-id>" + EOL +
+ "<source>MSO</source>" + EOL +
+ "<notification-url/>" + EOL +
+ "<order-number/>" + EOL +
+ "<order-version/>" + EOL +
+ "<request-action>DeleteServiceInstance</request-action>" + EOL +
+ "</request-information>" + EOL +
+ "<service-information>" + EOL +
+ "<service-id/>" + EOL +
+ "<subscription-service-type>123456789</subscription-service-type>" + EOL +
+ "<ecomp-model-information>" + EOL +
+ "<model-invariant-uuid/>" + EOL +
+ "<model-uuid/>" + EOL +
+ "<model-version/>" + EOL +
+ "<model-name/>" + EOL +
+ "</ecomp-model-information>" + EOL +
+ "<service-instance-id>MIS%252F1604%252F0026%252FSW_INTERNET</service-instance-id>" + EOL +
+ "<subscriber-name/>" + EOL +
+ "<global-customer-id>SDN-ETHERNET-INTERNET</global-customer-id>" + EOL +
+ "</service-information>" + EOL +
+ "<service-request-input>" + EOL +
+ "<service-instance-name/>" + EOL +
+ "</service-request-input>" + EOL +
+ "</sdncadapterworkflow:SDNCRequestData>" + EOL +
+ "</sdncadapterworkflow:SDNCAdapterWorkflowRequest>";
+
+ String req1 = "<sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:ns5=\"http://org.openecomp/mso/request/types/v1\"" + EOL +
+ "xmlns:sdncadapter=\"http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1\" " + EOL +
+ "xmlns:sdncadapterworkflow=\"http://org.openecomp/mso/workflow/schema/v1\">" + EOL +
+ "<sdncadapter:RequestHeader>" + EOL +
+ "<sdncadapter:RequestId>bca4fede-0804-4c13-af69-9e80b378150f</sdncadapter:RequestId>" + EOL +
+ "<sdncadapter:SvcInstanceId>MIS%252F1604%252F0026%252FSW_INTERNET</sdncadapter:SvcInstanceId>" + EOL +
+ "<sdncadapter:SvcAction>delete</sdncadapter:SvcAction>" + EOL +
+ "<sdncadapter:SvcOperation>service-topology-operation</sdncadapter:SvcOperation>" + EOL +
+ "<sdncadapter:CallbackUrl>http://localhost:8080/mso/SDNCAdapterCallbackService</sdncadapter:CallbackUrl>" + EOL +
+ "</sdncadapter:RequestHeader>" + EOL +
+ "<sdncadapterworkflow:SDNCRequestData>" + EOL +
+ "<request-information>" + EOL +
+ "<request-id>RaaTestRequestId-1</request-id>" + EOL +
+ "<source>MSO</source>" + EOL +
+ "<notification-url/>" + EOL +
+ "<order-number/>" + EOL +
+ "<order-version/>" + EOL +
+ "<request-action>DeleteServiceInstance</request-action>" + EOL +
+ "</request-information>" + EOL +
+ "<service-information>" + EOL +
+ "<service-id/>" + EOL +
+ "<subscription-service-type>123456789</subscription-service-type>" + EOL +
+ "<ecomp-model-information>" + EOL +
+ "<model-invariant-uuid/>" + EOL +
+ "<model-uuid/>" + EOL +
+ "<model-version/>" + EOL +
+ "<model-name/>" + EOL +
+ "</ecomp-model-information>" + EOL +
+ "<service-instance-id>MIS%252F1604%252F0026%252FSW_INTERNET</service-instance-id>" + EOL +
+ "<subscriber-name/>" + EOL +
+ "<global-customer-id>SDN-ETHERNET-INTERNET</global-customer-id>" + EOL +
+ "</service-information>" + EOL +
+ "<service-request-input>" + EOL +
+ "<service-instance-name/>" + EOL +
+ "</service-request-input>" + EOL +
+ "</sdncadapterworkflow:SDNCRequestData>" + EOL +
+ "</sdncadapterworkflow:SDNCAdapterWorkflowRequest>";
+
+ rollbackData.put("SERVICEINSTANCE", "sdncDeactivate", req);
+
+ rollbackData.put("SERVICEINSTANCE", "sdncDelete",req1);
+ variables.put("rollbackData",rollbackData);
+
+ }
+} \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstanceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstanceTest.java
new file mode 100644
index 0000000000..359a372098
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstanceTest.java
@@ -0,0 +1,98 @@
+package org.openecomp.mso.bpmn.infrastructure;
+
+import static org.junit.Assert.assertEquals;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetCustomer;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceByName;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutServiceInstance;
+import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
+import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import org.camunda.bpm.engine.test.Deployment;
+import org.junit.Assert;
+import org.junit.Test;
+import org.openecomp.mso.bpmn.common.BPMNUtil;
+import org.openecomp.mso.bpmn.common.WorkflowTest;
+
+/**
+ * Unit test cases for DoCreateServiceInstance.bpmn
+ */
+public class DoCreateServiceInstanceTest extends WorkflowTest {
+ private static final String EOL = "\n";
+ private final CallbackSet callbacks = new CallbackSet();
+ private final String sdncAdapterCallback =
+ "<output xmlns=\"com:att:sdnctl:l3api\">" + EOL +
+ " <svc-request-id>((REQUEST-ID))</svc-request-id>" + EOL +
+ " <ack-final-indicator>Y</ack-final-indicator>" + EOL +
+ "</output>" + EOL;
+
+ public DoCreateServiceInstanceTest() throws IOException {
+ callbacks.put("assign", sdncAdapterCallback);
+ }
+
+ /**
+ * Sunny day VID scenario.
+ *
+ * @throws Exception
+ */
+ //@Ignore // File not found - unable to run the test. Also, Stubs need updating..
+ @Test
+ @Deployment(resources = {
+ "subprocess/DoCreateServiceInstance.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/GenericPutService.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+ "subprocess/DoCreateServiceInstanceRollback.bpmn",
+ "subprocess/FalloutHandler.bpmn" })
+ public void sunnyDay() throws Exception {
+
+ logStart();
+
+ //AAI
+ MockGetCustomer("MCBH-1610", "CreateServiceInstance/createServiceInstance_queryGlobalCustomerId_AAIResponse_Success.xml");
+ MockPutServiceInstance("MCBH-1610", "viprsvc", "RaaTest-si-id", "");
+ MockGetServiceInstance("MCBH-1610", "viprsvc", "RaaTest-si-id", "GenericFlows/getServiceInstance.xml");
+ MockNodeQueryServiceInstanceByName("RAATest-si", "");
+
+ MockNodeQueryServiceInstanceById("RaaTest-si-id", "");
+ MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getSINoRelations.xml");
+ MockNodeQueryServiceInstanceById("MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getSIUrlById.xml");
+ //SDNC
+ mockSDNCAdapter(200);
+ //DB
+ mockUpdateRequestDB(200, "DBUpdateResponse.xml");
+ String businessKey = UUID.randomUUID().toString();
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ setupVariables(variables);
+ invokeSubProcess("DoCreateServiceInstance", businessKey, variables);
+ injectSDNCCallbacks(callbacks, "assign");
+ waitForProcessEnd(businessKey, 10000);
+ Assert.assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "DoCreateServiceInstance", "WorkflowException");
+ System.out.println("workflowException:\n" + workflowException);
+ assertEquals(null, workflowException);
+
+ logEnd();
+ }
+
+ // Success Scenario
+ private void setupVariables(Map<String, Object> variables) {
+ variables.put("mso-request-id", "RaaDSITest1");
+ variables.put("isDebugLogEnabled", "true");
+ variables.put("msoRequestId", "RaaDSITestRequestId-1");
+ variables.put("serviceInstanceId","RaaTest-si-id");
+ variables.put("serviceModelInfo", "{\"modelType\":\"service\",\"modelInvariantUuid\":\"uuid-miu-svc-011-abcdef\",\"modelVersionUuid\":\"ASDC_TOSCA_UUID\",\"modelName\":\"SIModelName1\",\"modelVersion\":\"2\"}");
+ variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
+ variables.put("globalSubscriberId", "MCBH-1610");
+ variables.put("subscriptionServiceType", "viprsvc");
+ variables.put("instanceName", "RAATest-1");
+ }
+} \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleRollbackTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleRollbackTest.java
index 5b0d4c73bd..ea46bfe8a2 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleRollbackTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleRollbackTest.java
@@ -136,7 +136,8 @@ public class DoCreateVfModuleRollbackTest extends WorkflowTest {
variables.put("mso-service-instance-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
rollbackData.put("VFMODULE", "msorequestid", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
rollbackData.put("VFMODULE", "serviceinstanceid", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("RollbackData", rollbackData);
+ variables.put("rollbackData", rollbackData);
+ variables.put("sdncVersion", "1702");
invokeSubProcess("DoCreateVfModuleRollback", businessKey, variables);
// "changedelete" operation not required for deleting a Vf Module
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleTest.java
index fc4816cef3..565ef0285a 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleTest.java
@@ -22,8 +22,11 @@ package org.openecomp.mso.bpmn.infrastructure;
import static org.openecomp.mso.bpmn.common.BPMNUtil.getRawVariable;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockAAIVfModule;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithDepth;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithPriority;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchGenericVnf;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchVfModuleId;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutGenericVnf;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutNetwork;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutVfModuleIdNoResponse;
@@ -38,10 +41,8 @@ import java.util.UUID;
import org.camunda.bpm.engine.test.Deployment;
import org.junit.Assert;
-import org.junit.Ignore;
import org.junit.Test;
import org.openecomp.mso.bpmn.common.WorkflowTest;
-import org.openecomp.mso.bpmn.common.WorkflowTest.CallbackSet;
import org.openecomp.mso.bpmn.mock.FileUtil;
/**
@@ -56,6 +57,12 @@ public class DoCreateVfModuleTest extends WorkflowTest {
"__files/VfModularity/SDNCTopologyAssignCallback.xml"));
callbacks.put("query", FileUtil.readResourceFile(
"__files/VfModularity/SDNCTopologyQueryCallback.xml"));
+ callbacks.put("queryVnf", FileUtil.readResourceFile(
+ "__files/VfModularity/SDNCTopologyQueryCallbackVnf.xml"));
+ callbacks.put("queryModuleNoVnf", FileUtil.readResourceFile(
+ "__files/VfModularity/SDNCTopologyQueryCallbackVfModuleNoVnf.xml"));
+ callbacks.put("queryModule", FileUtil.readResourceFile(
+ "__files/VfModularity/SDNCTopologyQueryCallbackVfModule.xml"));
callbacks.put("activate", FileUtil.readResourceFile(
"__files/VfModularity/SDNCTopologyActivateCallback.xml"));
callbacks.put("vnfCreate", FileUtil.readResourceFile(
@@ -66,10 +73,11 @@ public class DoCreateVfModuleTest extends WorkflowTest {
* Test the sunny day scenario.
*/
@Test
- @Ignore
+
@Deployment(resources = {
"subprocess/DoCreateVfModule.bpmn",
"subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/GenericGetVnf.bpmn",
"subprocess/VnfAdapterRestV1.bpmn",
"subprocess/ConfirmVolumeGroupTenant.bpmn",
"subprocess/ConfirmVolumeGroupName.bpmn",
@@ -82,6 +90,54 @@ public class DoCreateVfModuleTest extends WorkflowTest {
logStart();
+ MockAAIVfModule();
+ MockPatchGenericVnf("skask");
+ MockPatchVfModuleId("skask", ".*");
+ mockSDNCAdapter("VfModularity/StandardSDNCSynchResponse.xml");
+ mockVNFPost("", 202, "skask");
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ //RuntimeService runtimeService = processEngineRule.getRuntimeService();
+
+ Map<String, Object> variables = setupVariablesSunnyDayBuildingBlocks();
+ //runtimeService.startProcessInstanceByKey("DoCreateVfModule", variables);
+ invokeSubProcess("DoCreateVfModule", businessKey, variables);
+
+ injectSDNCCallbacks(callbacks, "queryVnf");
+ injectSDNCCallbacks(callbacks, "assign, queryModuleNoVnf");
+ injectVNFRestCallbacks(callbacks, "vnfCreate");
+ injectSDNCCallbacks(callbacks, "activate");
+
+ waitForProcessEnd(businessKey, 10000);
+
+ Assert.assertTrue(isProcessEnded(businessKey));
+ Assert.assertTrue((boolean) getRawVariable(processEngineRule, "DoCreateVfModule", "DCVFM_SuccessIndicator"));
+
+ logEnd();
+ }
+
+ /**
+ * Test the sunny day scenario with 1702 SDNC interaction.
+ */
+ @Test
+
+ @Deployment(resources = {
+ "subprocess/DoCreateVfModule.bpmn",
+ "subprocess/GenericGetVnf.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/VnfAdapterRestV1.bpmn",
+ "subprocess/ConfirmVolumeGroupTenant.bpmn",
+ "subprocess/ConfirmVolumeGroupName.bpmn",
+ "subprocess/CreateAAIVfModule.bpmn",
+ "subprocess/UpdateAAIVfModule.bpmn",
+ "subprocess/CreateAAIVfModuleVolumeGroup.bpmn",
+ "subprocess/UpdateAAIGenericVnf.bpmn"
+ })
+ public void sunnyDay_1702() throws IOException {
+
+ logStart();
+
MockGetGenericVnfByIdWithPriority("skask", ".*", 200, "VfModularity/VfModule-new.xml", 5);
MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
MockPutVfModuleIdNoResponse("skask", "PCRF", ".*");
@@ -91,11 +147,72 @@ public class DoCreateVfModuleTest extends WorkflowTest {
mockSDNCAdapter("/SDNCAdapter", "SvcAction>query", 200, "VfModularity/StandardSDNCSynchResponse.xml");
mockVNFPost("", 202, "skask");
mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockPatchGenericVnf("skask");
+ MockPatchVfModuleId("skask", ".*");
String businessKey = UUID.randomUUID().toString();
//RuntimeService runtimeService = processEngineRule.getRuntimeService();
Map<String, Object> variables = setupVariablesSunnyDayBuildingBlocks();
+ variables.put("sdncVersion", "1702");
+ //runtimeService.startProcessInstanceByKey("DoCreateVfModule", variables);
+ invokeSubProcess("DoCreateVfModule", businessKey, variables);
+
+
+ injectSDNCCallbacks(callbacks, "assign, queryModule");
+ injectVNFRestCallbacks(callbacks, "vnfCreate");
+ injectSDNCCallbacks(callbacks, "activate");
+
+ waitForProcessEnd(businessKey, 10000);
+
+ Assert.assertTrue(isProcessEnded(businessKey));
+ Assert.assertTrue((boolean) getRawVariable(processEngineRule, "DoCreateVfModule", "DCVFM_SuccessIndicator"));
+
+ logEnd();
+ }
+
+ /**
+ * Test the sunny day scenario.
+ */
+ @Test
+
+ @Deployment(resources = {
+ "subprocess/DoCreateVfModule.bpmn",
+ "subprocess/GenerateVfModuleName.bpmn",
+ "subprocess/GenericGetVnf.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/VnfAdapterRestV1.bpmn",
+ "subprocess/ConfirmVolumeGroupTenant.bpmn",
+ "subprocess/ConfirmVolumeGroupName.bpmn",
+ "subprocess/CreateAAIVfModule.bpmn",
+ "subprocess/UpdateAAIVfModule.bpmn",
+ "subprocess/CreateAAIVfModuleVolumeGroup.bpmn",
+ "subprocess/UpdateAAIGenericVnf.bpmn"
+ })
+ public void sunnyDay_withVfModuleNameGeneration() throws IOException {
+
+ logStart();
+
+ MockGetGenericVnfByIdWithPriority("skask", ".*", 200, "VfModularity/VfModule-new.xml", 5);
+ MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
+ MockPutVfModuleIdNoResponse("skask", "PCRF", ".*");
+ MockPutNetwork(".*", "VfModularity/AddNetworkPolicy_AAIResponse_Success.xml", 200);
+ MockPutGenericVnf("skask");
+ MockAAIVfModule();
+ mockSDNCAdapter("/SDNCAdapter", "vnf-type>STMTN", 200, "VfModularity/StandardSDNCSynchResponse.xml");
+ mockSDNCAdapter("/SDNCAdapter", "SvcAction>query", 200, "VfModularity/StandardSDNCSynchResponse.xml");
+ mockVNFPost("", 202, "skask");
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockPatchGenericVnf("skask");
+ MockPatchVfModuleId("skask", ".*");
+
+ String businessKey = UUID.randomUUID().toString();
+ //RuntimeService runtimeService = processEngineRule.getRuntimeService();
+
+ Map<String, Object> variables = setupVariablesSunnyDayBuildingBlocks();
+ variables.put("vfModuleName", null);
+ variables.put("vfModuleLabel", "MODULELABEL");
+ variables.put("sdncVersion", "1702");
//runtimeService.startProcessInstanceByKey("DoCreateVfModule", variables);
invokeSubProcess("DoCreateVfModule", businessKey, variables);
@@ -111,11 +228,19 @@ public class DoCreateVfModuleTest extends WorkflowTest {
logEnd();
}
+
private Map<String, Object> setupVariablesSunnyDayBuildingBlocks() {
Map<String, Object> variables = new HashMap<String, Object>();
+ //try {
+ // variables.put("bpmnRequest", FileUtil.readResourceFile("__files/CreateVfModule_VID_request.json"));
+ //}
+ //catch (Exception e) {
+
+ //}
variables.put("mso-request-id", "testRequestId");
- variables.put("requestId", "testRequestId");
+
+ variables.put("msoRequestId", "testRequestId");
variables.put("isBaseVfModule", false);
variables.put("isDebugLogEnabled", "true");
variables.put("disableRollback", "true");
@@ -123,6 +248,7 @@ public class DoCreateVfModuleTest extends WorkflowTest {
//variables.put("requestAction", "CREATE_VF_MODULE");
variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
variables.put("vnfId", "skask");
+ variables.put("vnfName", "vnfname");
variables.put("vfModuleName", "PCRF::module-0-2");
variables.put("vnfType", "vSAMP12");
variables.put("vfModuleId", "");
@@ -131,20 +257,40 @@ public class DoCreateVfModuleTest extends WorkflowTest {
variables.put("vfModuleType", "");
variables.put("isVidRequest", "true");
variables.put("asdcServiceModelVersion", "1.0");
+ variables.put("usePreload", true);
- String vfModuleModelInfo = "{" + "\"modelInfo\": { "+ "\"modelType\": \"vfModule\"," +
- "\"modelInvariantId\": \"ff5256d2-5a33-55df-13ab-12abad84e7ff\"," +
- "\"modelNameVersionId\": \"fe6478e5-ea33-3346-ac12-ab121484a3fe\"," +
+ String vfModuleModelInfo = "{ "+ "\"modelType\": \"vfModule\"," +
+ "\"modelInvariantUuid\": \"ff5256d2-5a33-55df-13ab-12abad84e7ff\"," +
+ "\"modelUuid\": \"fe6478e5-ea33-3346-ac12-ab121484a3fe\"," +
"\"modelName\": \"STMTN5MMSC21-MMSC::model-1-0\"," +
"\"modelVersion\": \"1\"," +
- "\"modelCustomizationId\": \"MODEL-123\"" + "}}";
+ "\"modelCustomizationUuid\": \"MODEL-123\"" + "}";
variables.put("vfModuleModelInfo", vfModuleModelInfo);
- String cloudConfiguration = "{" + "\"cloudConfiguration\": { " +
- "\"lcpCloudRegionId\": \"MDTWNJ21\"," +
- "\"tenantId\": \"fba1bd1e195a404cacb9ce17a9b2b421\"" + "}}";
- variables.put("cloudConfiguration", cloudConfiguration);
+ variables.put("sdncVersion", "1707");
+
+ variables.put("lcpCloudRegionId", "MDTWNJ21");
+ variables.put("tenantId", "fba1bd1e195a404cacb9ce17a9b2b421");
+
+ String serviceModelInfo = "{ "+ "\"modelType\": \"service\"," +
+ "\"modelInvariantUuid\": \"aa5256d2-5a33-55df-13ab-12abad84e7ff\"," +
+ "\"modelUuid\": \"bb6478e5-ea33-3346-ac12-ab121484a3fe\"," +
+ "\"modelName\": \"SVC-STMTN5MMSC21-MMSC::model-1-0\"," +
+ "\"modelVersion\": \"1\"," +
+ "}";
+ variables.put("serviceModelInfo", serviceModelInfo);
+
+ String vnfModelInfo = "{ "+ "\"modelType\": \"vnf\"," +
+ "\"modelInvariantUuid\": \"445256d2-5a33-55df-13ab-12abad84e7ff\"," +
+ "\"modelUuid\": \"f26478e5-ea33-3346-ac12-ab121484a3fe\"," +
+ "\"modelName\": \"VNF-STMTN5MMSC21-MMSC::model-1-0\"," +
+ "\"modelVersion\": \"1\"," +
+ "\"modelCustomizationUuid\": \"VNF-MODEL-123\"" + "}";
+ variables.put("vnfModelInfo", vnfModelInfo);
+
+ variables.put("vnfQueryPath", "/restconf/vnfQueryPath");
+
return variables;
}
-}
+} \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleVolumeV1Test.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleVolumeV1Test.java
deleted file mode 100644
index c7a112d5aa..0000000000
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleVolumeV1Test.java
+++ /dev/null
@@ -1,351 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * OPENECOMP - MSO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.bpmn.infrastructure;
-
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
-import static com.github.tomakehurst.wiremock.client.WireMock.delete;
-import static com.github.tomakehurst.wiremock.client.WireMock.get;
-import static com.github.tomakehurst.wiremock.client.WireMock.post;
-import static com.github.tomakehurst.wiremock.client.WireMock.put;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.camunda.bpm.engine.test.Deployment;
-import org.junit.Test;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
-import org.openecomp.mso.bpmn.common.WorkflowTest.CallbackSet;
-import org.openecomp.mso.bpmn.mock.FileUtil;
-
-public class DoCreateVfModuleVolumeV1Test extends WorkflowTest {
-
- public static final String _prefix = "CVFMODVOL2_";
-
- private final CallbackSet callbacks = new CallbackSet();
-
- public DoCreateVfModuleVolumeV1Test() throws IOException {
- callbacks.put("volumeGroupCreate", FileUtil.readResourceFile(
- "__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeCallbackResponse.xml"));
- callbacks.put("volumeGroupRollback", FileUtil.readResourceFile(
- "__files/DoCreateVfModuleVolumeV1/RollbackVfModuleVolumeCallbackResponse.xml"));
- }
-
- /**
- * Happy Path
- * @throws Exception
- */
- @Test
- @Deployment(resources = {"subprocess/DoCreateVfModuleVolumeV1.bpmn",
- "subprocess/FalloutHandler.bpmn",
- "subprocess/CompleteMsoProcess.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn"})
- public void TestHappyPath() throws Exception {
-
- logStart();
-
- DoCreateVfModuleVolume_Success();
-
- String businessKey = UUID.randomUUID().toString();
- String createVfModuleVolRequest = FileUtil.readResourceFile("__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeRequest.xml");
-
- Map<String, Object> testVariables = new HashMap<String, Object>();
- testVariables.put("DCVFMODVOLV1_volumeGroupId", "TEST-VOLUME-VOLUME-GROUP-ID-0123");
- testVariables.put("vnf-id", "TEST-VNF-ID-0123");
- testVariables.put("volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
- testVariables.put("test-volume-group-name", "TEST-MSOTESTVOL101a-vSAMP12_base_vol_module-0");
- //testVariables.put("test-volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
- testVariables.put("DoCreateVfModuleVolumeV1Request", createVfModuleVolRequest);
- invokeAsyncProcess("DoCreateVfModuleVolumeV1", "v1", businessKey, createVfModuleVolRequest, testVariables);
-
- injectVNFRestCallbacks(callbacks, "volumeGroupCreate");
-
- waitForProcessEnd(businessKey, 100000);
- checkVariable(businessKey, "DCVFMODVOLV1_SuccessIndicator", true);
-
- logEnd();
- }
-
- @Test
- @Deployment(resources = {"subprocess/DoCreateVfModuleVolumeV1.bpmn",
- "subprocess/FalloutHandler.bpmn",
- "subprocess/CompleteMsoProcess.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn"})
- public void TestVolumeGroupExistError() throws Exception {
-
- logStart();
-
- DoCreateVfModuleVolume_VolumeGroupExistsFail();
-
- String businessKey = UUID.randomUUID().toString();
- String createVfModuleVolRequest = FileUtil.readResourceFile("__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeRequest.xml");
-
- Map<String, Object> testVariables = new HashMap<String, Object>();
- testVariables.put("DCVFMODVOLV1_volumeGroupId", "TEST-VOLUME-VOLUME-GROUP-ID-0123");
- testVariables.put("vnf-id", "TEST-VNF-ID-0123");
- testVariables.put("volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
- testVariables.put("test-volume-group-name", "TEST-MSOTESTVOL101a-vSAMP12_base_vol_module-0");
- testVariables.put("DoCreateVfModuleVolumeV1Request", createVfModuleVolRequest);
- invokeAsyncProcess("DoCreateVfModuleVolumeV1", "v1", businessKey, createVfModuleVolRequest, testVariables);
-
- //injectVNFRestCallbacks(callbacks, "volumeGroupCreate");
-
- waitForProcessEnd(businessKey, 100000);
- checkVariable(businessKey, "DCVFMODVOLV1_SuccessIndicator", false);
-
- logEnd();
- }
-
- /**
- * Will trigger AAI create rollback
- * @throws Exception
- */
- @Test
- @Deployment(resources = {"subprocess/DoCreateVfModuleVolumeV1.bpmn",
- "subprocess/FalloutHandler.bpmn",
- "subprocess/CompleteMsoProcess.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn"})
- public void TestVnfVolumeGroupCreateError() throws Exception {
-
- logStart();
-
- DoCreateVfModuleVolume_VnfCreateVolumeGroupFail();
-
- String businessKey = UUID.randomUUID().toString();
- String createVfModuleVolRequest = FileUtil.readResourceFile("__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeRequest.xml");
-
- Map<String, Object> testVariables = new HashMap<String, Object>();
- testVariables.put("DCVFMODVOLV1_volumeGroupId", "TEST-VOLUME-VOLUME-GROUP-ID-0123");
- testVariables.put("vnf-id", "TEST-VNF-ID-0123");
- testVariables.put("volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
- testVariables.put("test-volume-group-name", "TEST-MSOTESTVOL101a-vSAMP12_base_vol_module-0");
- testVariables.put("test-volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
- testVariables.put("DoCreateVfModuleVolumeV1Request", createVfModuleVolRequest);
- invokeAsyncProcess("DoCreateVfModuleVolumeV1", "v1", businessKey, createVfModuleVolRequest, testVariables);
-
- //injectVNFRestCallbacks(callbacks, "volumeGroupCreate");
-
- waitForProcessEnd(businessKey, 100000);
- checkVariable(businessKey, "DCVFMODVOLV1_SuccessIndicator", false);
-
- logEnd();
- }
-
- /**
- * Will trigger AAI create rollback
- * @throws Exception
- */
- @Test
- @Deployment(resources = {"subprocess/DoCreateVfModuleVolumeV1.bpmn",
- "subprocess/FalloutHandler.bpmn",
- "subprocess/CompleteMsoProcess.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn"})
- public void TestUpdateAaiVolumeGroupError() throws Exception {
-
- logStart();
-
- DoCreateVfModuleVolume_AaiVolumeGroupUpdateFail();
-
- String businessKey = UUID.randomUUID().toString();
- String createVfModuleVolRequest = FileUtil.readResourceFile("__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeRequest.xml");
-
- Map<String, Object> testVariables = new HashMap<String, Object>();
- testVariables.put("DCVFMODVOLV1_volumeGroupId", "TEST-VOLUME-VOLUME-GROUP-ID-0123");
- testVariables.put("vnf-id", "TEST-VNF-ID-0123");
- testVariables.put("volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
- testVariables.put("test-volume-group-name", "TEST-MSOTESTVOL101a-vSAMP12_base_vol_module-0");
- testVariables.put("test-volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
- testVariables.put("DoCreateVfModuleVolumeV1Request", createVfModuleVolRequest);
- invokeAsyncProcess("DoCreateVfModuleVolumeV1", "v1", businessKey, createVfModuleVolRequest, testVariables);
-
- injectVNFRestCallbacks(callbacks, "volumeGroupCreate,volumeGroupRollback");
-
- waitForProcessEnd(businessKey, 100000);
- checkVariable(businessKey, "DCVFMODVOLV1_SuccessIndicator", false);
-
- logEnd();
- }
-
- /**
- * Will trigger not trigger rollback
- * @throws Exception
- */
- @Test
- @Deployment(resources = {"subprocess/DoCreateVfModuleVolumeV1.bpmn",
- "subprocess/FalloutHandler.bpmn",
- "subprocess/CompleteMsoProcess.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn"})
- public void TestUpdateAaiVolumeGroupErrorNoRollback() throws Exception {
-
- logStart();
-
- DoCreateVfModuleVolume_AaiVolumeGroupUpdateFail();
-
- String businessKey = UUID.randomUUID().toString();
- String createVfModuleVolRequest = FileUtil.readResourceFile("__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeNoRollbackRequest.xml");
-
- Map<String, Object> testVariables = new HashMap<String, Object>();
- testVariables.put("DCVFMODVOLV1_volumeGroupId", "TEST-VOLUME-VOLUME-GROUP-ID-0123");
- testVariables.put("vnf-id", "TEST-VNF-ID-0123");
- testVariables.put("volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
- testVariables.put("test-volume-group-name", "TEST-MSOTESTVOL101a-vSAMP12_base_vol_module-0");
- testVariables.put("test-volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
- testVariables.put("DoCreateVfModuleVolumeV1Request", createVfModuleVolRequest);
- invokeAsyncProcess("DoCreateVfModuleVolumeV1", "v1", businessKey, createVfModuleVolRequest, testVariables);
-
- injectVNFRestCallbacks(callbacks, "volumeGroupCreate");
-
- waitForProcessEnd(businessKey, 100000);
- checkVariable(businessKey, "DCVFMODVOLV1_SuccessIndicator", false);
-
- logEnd();
- }
-
- public static void DoCreateVfModuleVolume_Success() {
- // Notes:
- // 1. initial aai volume group by name - /aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/volume-groups/volume-group?volume-group-name=TEST-MSOTESTVOL101a-vSAMP12_base_vol_module-0
- // 2. Create volume group - /aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/volume-groups/volume-group
- // 3. Requery Volume Group - /aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/volume-groups/volume-group?volume-group-name=MSOTESTVOL101a-vSAMP12_base_vol_module-0
- // 4. Update volume group (id from requery response - /aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/volume-groups/volume-group/8424bb3c-c3e7-4553-9662-469649ed9379
-
- //generic vnf
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/TEST-VNF-ID-0123"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("DoCreateVfModuleVolumeV1/GenericVnf.xml")));
- //create volume group
- stubFor(put(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/volume-groups/volume-group/TEST-VOLUME-GROUP-ID-0123"))
- .willReturn(aResponse()
- .withStatus(201)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("DoCreateVfModuleVolumeV1/createVfModuleVolume_createVolumeName_AAIResponse_Success.xml")));
- //requery volume group
- stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/volume-groups[?]volume-group-name=MSOTESTVOL101a-vSAMP12_base_vol_module-0"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("DoCreateVfModuleVolumeV1/createVfModuleVolume_queryVolumeName_AAIResponse_Success.xml")));
- //update volume group
- stubFor(put(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/volume-groups/volume-group/8424bb3c-c3e7-4553-9662-469649ed9379"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("DoCreateVfModuleVolumeV1/createVfModuleVolume_updateVolumeName_AAIResponse_Success.xml")));
- // VNF rest Adapter
- stubFor(post(urlEqualTo("/vnfs/v1/volume-groups"))
- .willReturn(aResponse()
- .withStatus(202)
- .withHeader("Content-Type", "application/xml")));
- }
-
- public static void DoCreateVfModuleVolume_VolumeGroupExistsFail() {
- //generic vnf
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/TEST-VNF-ID-0123"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("DoCreateVfModuleVolumeV1/GenericVnf.xml")));
- //initial volume group query
- stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/volume-groups/volume-group[?]volume-group-name=TEST-MSOTESTVOL101a-vSAMP12_base_vol_module-0"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("DoCreateVfModuleVolumeV1/createVfModuleVolume_queryVolumeName_AAIResponse_Success.xml")));
- }
-
- public static void DoCreateVfModuleVolume_VnfCreateVolumeGroupFail() {
- //generic vnf
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/TEST-VNF-ID-0123"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("DoCreateVfModuleVolumeV1/GenericVnf.xml")));
- //create volume group
- stubFor(put(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/volume-groups/volume-group/TEST-VOLUME-GROUP-ID-0123"))
- .willReturn(aResponse()
- .withStatus(201)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("DoCreateVfModuleVolumeV1/createVfModuleVolume_createVolumeName_AAIResponse_Success.xml")));
- //Query AAI volume group by name -- needed before delete
- stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/volume-groups[?]volume-group-name=MSOTESTVOL101a-vSAMP12_base_vol_module-0"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("DoCreateVfModuleVolumeV1/createVfModuleVolume_queryVolumeName_AAIResponse_Success.xml")));
- //delete volume group in aai
- stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/volume-groups/volume-group/8424bb3c-c3e7-4553-9662-469649ed9379[?]resource-version=1460134360"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("DoCreateVfModuleVolumeV1/createVfModuleVolume_deleteVolumeName_AAIResponse_Success.xml")));
- stubFor(post(urlEqualTo("/vnfs/v1/volume-groups"))
- .willReturn(aResponse()
- .withStatus(404)
- .withHeader("Content-Type", "application/xml")));
- }
-
- public static void DoCreateVfModuleVolume_AaiVolumeGroupUpdateFail() {
- //generic vnf
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/TEST-VNF-ID-0123"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("DoCreateVfModuleVolumeV1/GenericVnf.xml")));
- //create volume group
- stubFor(put(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/volume-groups/volume-group/TEST-VOLUME-GROUP-ID-0123"))
- .willReturn(aResponse()
- .withStatus(201)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("DoCreateVfModuleVolumeV1/createVfModuleVolume_createVolumeName_AAIResponse_Success.xml")));
- //requery volume group
- stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/volume-groups[?]volume-group-name=MSOTESTVOL101a-vSAMP12_base_vol_module-0"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("DoCreateVfModuleVolumeV1/createVfModuleVolume_queryVolumeName_AAIResponse_Success.xml")));
- //delete volume group in aai
- stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/volume-groups/volume-group/8424bb3c-c3e7-4553-9662-469649ed9379[?]resource-version=1460134360"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("DoCreateVfModuleVolumeV1/createVfModuleVolume_deleteVolumeName_AAIResponse_Success.xml")));
- // VNF rest Adapter
- stubFor(post(urlEqualTo("/vnfs/v1/volume-groups"))
- .willReturn(aResponse()
- .withStatus(202)
- .withHeader("Content-Type", "application/xml")));
- // VNF Rest Adapter rollback - vnfs/v1/volume-groups/STUB-TEST-8424bb3c-c3e7-4553-9662-469649ed9379/rollback
- stubFor(delete(urlEqualTo("/vnfs/v1/volume-groups/TEST-VOLUME-GROUP-ID-0123/rollback"))
- .willReturn(aResponse()
- .withStatus(202)
- .withHeader("Content-Type", "application/xml")));
- }
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleVolumeV2Test.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleVolumeV2Test.java
new file mode 100644
index 0000000000..3b1f4b8faf
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleVolumeV2Test.java
@@ -0,0 +1,220 @@
+package org.openecomp.mso.bpmn.infrastructure;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import org.camunda.bpm.engine.test.Deployment;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.openecomp.mso.bpmn.common.WorkflowTest;
+import org.openecomp.mso.bpmn.core.WorkflowException;
+import org.openecomp.mso.bpmn.mock.FileUtil;
+
+@Ignore
+public class DoCreateVfModuleVolumeV2Test extends WorkflowTest {
+
+ public static final String _prefix = "CVFMODVOL2_";
+
+ private final CallbackSet callbacks = new CallbackSet();
+
+ public DoCreateVfModuleVolumeV2Test() throws IOException {
+ callbacks.put("volumeGroupCreate", FileUtil.readResourceFile(
+ "__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeCallbackResponse.xml"));
+ callbacks.put("volumeGroupRollback", FileUtil.readResourceFile(
+ "__files/DoCreateVfModuleVolumeV1/RollbackVfModuleVolumeCallbackResponse.xml"));
+ }
+
+ /**
+ * Happy Path
+ * @throws Exception
+ */
+ @Test
+ //@Ignore
+ @Deployment(resources = {"subprocess/DoCreateVfModuleVolumeV2.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+ "subprocess/vnfAdapterRestV1.bpmn",
+ "subprocess/DoCreateVfModuleVolumeRollback.bpmn"})
+ public void TestHappyPath() throws Exception {
+
+ logStart();
+
+// DoCreateVfModuleVolume_Success();
+
+ String businessKey = UUID.randomUUID().toString();
+ String createVfModuleVolRequest = FileUtil.readResourceFile("__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeRequest.xml");
+
+ Map<String, Object> testVariables = new HashMap<String, Object>();
+ testVariables.put("volumeGroupId", "TEST-VOLUME-VOLUME-GROUP-ID-0123");
+ testVariables.put("vnfId", "TEST-VNF-ID-0123");
+ testVariables.put("lcpCloudRegionId", "AAIAIC25");
+ testVariables.put("test-volume-group-name", "MSOTESTVOL101a-vSAMP12_base_vol_module-01");
+ testVariables.put("test-volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
+ //testVariables.put("DoCreateVfModuleVolumeV1Request", createVfModuleVolRequest);
+ TestAsyncResponse asyncResponse = invokeAsyncProcess("DoCreateVfModuleVolumeV2", "v1", businessKey, createVfModuleVolRequest, testVariables);
+
+ injectVNFRestCallbacks(callbacks, "volumeGroupCreate");
+
+ waitForProcessEnd(businessKey, 100000);
+ checkVariable(businessKey, "DCVFMODVOLV2_SuccessIndicator", true);
+
+ logEnd();
+ }
+
+ @Test
+// @Ignore
+ @Deployment(resources = {"subprocess/DoCreateVfModuleVolumeV2.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+ "subprocess/vnfAdapterRestV1.bpmn",
+ "subprocess/DoCreateVfModuleVolumeRollback.bpmn"})
+ public void TestVolumeGroupExistError() throws Exception {
+
+ logStart();
+
+// DoCreateVfModuleVolume_VolumeGroupExistsFail();
+
+ String businessKey = UUID.randomUUID().toString();
+ String createVfModuleVolRequest = FileUtil.readResourceFile("__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeRequest.xml");
+
+ Map<String, Object> testVariables = new HashMap<String, Object>();
+ testVariables.put("DCVFMODVOLV2_volumeGroupId", "TEST-VOLUME-VOLUME-GROUP-ID-0123");
+ testVariables.put("vnf-id", "TEST-VNF-ID-0123");
+ testVariables.put("volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
+ testVariables.put("test-volume-group-name", "TEST-MSOTESTVOL101a-vSAMP12_base_vol_module-0");
+ testVariables.put("DoCreateVfModuleVolumeV1Request", createVfModuleVolRequest);
+ TestAsyncResponse asyncResponse = invokeAsyncProcess("DoCreateVfModuleVolumeV2", "v1", businessKey, createVfModuleVolRequest, testVariables);
+
+ //injectVNFRestCallbacks(callbacks, "volumeGroupCreate");
+
+ waitForProcessEnd(businessKey, 100000);
+ WorkflowException wfe = (WorkflowException) getVariableFromHistory(businessKey, "SavedWorkflowException1");
+ Assert.assertTrue(wfe.getErrorCode() == 2500);
+ Assert.assertTrue(wfe.getErrorMessage().startsWith("Generic vnf null was not found in AAI. Return code: 404."));
+ checkVariable(businessKey, "DCVFMODVOLV2_SuccessIndicator", false);
+
+ logEnd();
+ }
+
+ /**
+ * Will trigger AAI create rollback
+ * @throws Exception
+ */
+ @Test
+// @Ignore
+ @Deployment(resources = {"subprocess/DoCreateVfModuleVolumeV2.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+ "subprocess/vnfAdapterRestV1.bpmn",
+ "subprocess/DoCreateVfModuleVolumeRollback.bpmn"})
+ public void TestVnfVolumeGroupCreateError() throws Exception {
+
+ logStart();
+
+// DoCreateVfModuleVolume_VnfCreateVolumeGroupFail();
+
+ String businessKey = UUID.randomUUID().toString();
+ String createVfModuleVolRequest = FileUtil.readResourceFile("__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeRequest.xml");
+
+ Map<String, Object> testVariables = new HashMap<String, Object>();
+ testVariables.put("DCVFMODVOLV2_volumeGroupId", "TEST-VOLUME-VOLUME-GROUP-ID-0123");
+ testVariables.put("vnf-id", "TEST-VNF-ID-0123");
+ testVariables.put("volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
+ testVariables.put("test-volume-group-name", "TEST-MSOTESTVOL101a-vSAMP12_base_vol_module-0");
+ testVariables.put("test-volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
+ testVariables.put("DoCreateVfModuleVolumeV1Request", createVfModuleVolRequest);
+ TestAsyncResponse asyncResponse = invokeAsyncProcess("DoCreateVfModuleVolumeV2", "v1", businessKey, createVfModuleVolRequest, testVariables);
+
+ //injectVNFRestCallbacks(callbacks, "volumeGroupCreate");
+
+ waitForProcessEnd(businessKey, 100000);
+ checkVariable(businessKey, "DCVFMODVOLV2_SuccessIndicator", false);
+
+ logEnd();
+ }
+
+ /**
+ * Will trigger AAI create rollback
+ * @throws Exception
+ */
+ @Test
+// @Ignore
+ @Deployment(resources = {"subprocess/DoCreateVfModuleVolumeV2.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+ "subprocess/vnfAdapterRestV1.bpmn",
+ "subprocess/DoCreateVfModuleVolumeRollback.bpmn"})
+ public void TestUpdateAaiVolumeGroupError() throws Exception {
+
+ logStart();
+
+// DoCreateVfModuleVolume_AaiVolumeGroupUpdateFail();
+
+ String businessKey = UUID.randomUUID().toString();
+ String createVfModuleVolRequest = FileUtil.readResourceFile("__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeRequest.xml");
+
+ Map<String, Object> testVariables = new HashMap<String, Object>();
+ testVariables.put("DCVFMODVOLV2_volumeGroupId", "TEST-VOLUME-VOLUME-GROUP-ID-0123");
+ testVariables.put("vnf-id", "TEST-VNF-ID-0123");
+ testVariables.put("volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
+ testVariables.put("test-volume-group-name", "TEST-MSOTESTVOL101a-vSAMP12_base_vol_module-0");
+ testVariables.put("test-volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
+ testVariables.put("DoCreateVfModuleVolumeV1Request", createVfModuleVolRequest);
+ TestAsyncResponse asyncResponse = invokeAsyncProcess("DoCreateVfModuleVolumeV2", "v1", businessKey, createVfModuleVolRequest, testVariables);
+
+ // VNF callback not needed fort this failure scenario
+// injectVNFRestCallbacks(callbacks, "volumeGroupCreate,volumeGroupRollback");
+
+ waitForProcessEnd(businessKey, 100000);
+ WorkflowException wfe = (WorkflowException) getVariableFromHistory(businessKey, "SavedWorkflowException1");
+ Assert.assertTrue(wfe.getErrorCode() == 2500);
+ Assert.assertTrue(wfe.getErrorMessage().startsWith("Generic vnf null was not found in AAI. Return code: 404."));
+ checkVariable(businessKey, "DCVFMODVOLV2_SuccessIndicator", false);
+
+ logEnd();
+ }
+
+ /**
+ * Will trigger not trigger rollback
+ * @throws Exception
+ */
+ @Test
+// @Ignore
+ @Deployment(resources = {"subprocess/DoCreateVfModuleVolumeV2.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+ "subprocess/vnfAdapterRestV1.bpmn",
+ "subprocess/DoCreateVfModuleVolumeRollback.bpmn"})
+ public void TestUpdateAaiVolumeGroupErrorNoRollback() throws Exception {
+
+ logStart();
+
+// DoCreateVfModuleVolume_AaiVolumeGroupUpdateFail();
+
+ String businessKey = UUID.randomUUID().toString();
+ String createVfModuleVolRequest = FileUtil.readResourceFile("__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeNoRollbackRequest.xml");
+
+ Map<String, Object> testVariables = new HashMap<String, Object>();
+ testVariables.put("DCVFMODVOLV2_volumeGroupId", "TEST-VOLUME-VOLUME-GROUP-ID-0123");
+ testVariables.put("vnf-id", "TEST-VNF-ID-0123");
+ testVariables.put("volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
+ testVariables.put("test-volume-group-name", "TEST-MSOTESTVOL101a-vSAMP12_base_vol_module-0");
+ testVariables.put("test-volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
+ testVariables.put("DoCreateVfModuleVolumeV1Request", createVfModuleVolRequest);
+ TestAsyncResponse asyncResponse = invokeAsyncProcess("DoCreateVfModuleVolumeV2", "v1", businessKey, createVfModuleVolRequest, testVariables);
+
+ // VNF callback not needed fort this failure scenario
+// injectVNFRestCallbacks(callbacks, "volumeGroupCreate");
+
+ waitForProcessEnd(businessKey, 100000);
+ WorkflowException wfe = (WorkflowException) getVariableFromHistory(businessKey, "SavedWorkflowException1");
+ Assert.assertTrue(wfe.getErrorCode() == 2500);
+ Assert.assertTrue(wfe.getErrorMessage().startsWith("Generic vnf null was not found in AAI. Return code: 404."));
+ checkVariable(businessKey, "DCVFMODVOLV2_SuccessIndicator", false);
+
+ logEnd();
+ }
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfAndModulesRollbackTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfAndModulesRollbackTest.java
new file mode 100644
index 0000000000..fb065ab633
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfAndModulesRollbackTest.java
@@ -0,0 +1,405 @@
+package org.openecomp.mso.bpmn.infrastructure;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.containing;
+import static com.github.tomakehurst.wiremock.client.WireMock.post;
+import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteGenericVnf;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteVfModuleId;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfById;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithDepth;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByName;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchGenericVnf;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchVfModuleId;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutVfModuleId;
+import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
+import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
+import static org.openecomp.mso.bpmn.mock.StubResponseVNFAdapter.mockVNFDelete;
+import static org.openecomp.mso.bpmn.mock.StubResponseVNFAdapter.mockVfModuleDelete;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import org.camunda.bpm.engine.test.Deployment;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.openecomp.mso.bpmn.common.WorkflowTest;
+import org.openecomp.mso.bpmn.core.RollbackData;
+import org.openecomp.mso.bpmn.core.WorkflowException;
+import org.openecomp.mso.bpmn.mock.FileUtil;
+
+/**
+ * Unit test for DoCreateVnfAndModulesRollback.bpmn.
+ */
+public class DoCreateVnfAndModulesRollbackTest extends WorkflowTest {
+ private final CallbackSet callbacks = new CallbackSet();
+
+ private static final String EOL = "\n";
+
+
+
+ private final String vnfAdapterDeleteCallback =
+ "<deleteVfModuleResponse>" + EOL +
+ " <vnfId>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnfId>" + EOL +
+ " <vfModuleId>973ed047-d251-4fb9-bf1a-65b8949e0a73</vfModuleId>" + EOL +
+ " <vfModuleDeleted>true</vfModuleDeleted>" + EOL +
+ " <messageId>{{MESSAGE-ID}}</messageId>" + EOL +
+ "</deleteVfModuleResponse>" + EOL;
+
+ private final String vnfAdapterDeleteCallbackFail =
+ "<vfModuleException>" + EOL +
+ " <message>Error processing request to VNF-Async. Not Found.</message>" + EOL +
+ " <category>INTERNAL</category>" + EOL +
+ " <rolledBack>false</rolledBack>" + EOL +
+ " <messageId>{{MESSAGE-ID}}</messageId>" + EOL +
+ "</vfModuleException>" + EOL;
+
+ private final String sdncAdapterDeleteCallback =
+ "<output xmlns=\"com:att:sdnctl:l3api\">" + EOL +
+ " <svc-request-id>{{REQUEST-ID}}</svc-request-id>" + EOL +
+ " <ack-final-indicator>Y</ack-final-indicator>" + EOL +
+ "</output>" + EOL;
+
+ public DoCreateVnfAndModulesRollbackTest() throws IOException {
+ callbacks.put("sdncChangeDelete", sdncAdapterDeleteCallback);
+ callbacks.put("sdncDelete", sdncAdapterDeleteCallback);
+ callbacks.put("vnfDelete", vnfAdapterDeleteCallback);
+ callbacks.put("vnfDeleteFail", vnfAdapterDeleteCallbackFail);
+ callbacks.put("deactivate", FileUtil.readResourceFile(
+ "__files/VfModularity/SDNCTopologyActivateCallback.xml"));
+ callbacks.put("unassign", FileUtil.readResourceFile(
+ "__files/VfModularity/SDNCTopologyActivateCallback.xml"));
+ }
+
+ @Test
+ @Ignore
+ @Deployment(resources = {
+ "subprocess/DoCreateVnfAndModulesRollback.bpmn",
+ "subprocess/DoCreateVfModuleRollback.bpmn",
+ "subprocess/PrepareUpdateAAIVfModule.bpmn",
+ "subprocess/UpdateAAIVfModule.bpmn",
+ "subprocess/UpdateAAIGenericVnf.bpmn",
+ "subprocess/DeleteAAIVfModule.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/VnfAdapterRestV1.bpmn",
+ "subprocess/GenericGetVnf.bpmn",
+ "subprocess/GenericDeleteVnf.bpmn",
+ "subprocess/DoDeleteVnf.bpmn"
+ })
+ public void TestDoCreateVnfAndModulesRollbackSuccess_BaseOnly() {
+ // delete the Base Module and Generic Vnf
+ // vnf-id=a27ce5a9-29c4-4c22-a017-6615ac73c721, vf-module-id=973ed047-d251-4fb9-bf1a-65b8949e0a73
+ String request =
+ "<vnf-request xmlns=\"http://org.openecomp/mso/infra/vnf-request/v1\">" + EOL +
+ " <request-info>" + EOL +
+ " <action>DELETE_VF_MODULE</action>" + EOL +
+ " <source>PORTAL</source>" + EOL +
+ " </request-info>" + EOL +
+ " <vnf-inputs>" + EOL +
+ " <vnf-id>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnf-id>" + EOL +
+ " <vnf-name>STMTN5MMSC21</vnf-name>" + EOL +
+ " <vnf-type>asc_heat-int</vnf-type>" + EOL +
+ " <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</vf-module-id>" + EOL +
+ " <vf-module-name>STMTN5MMSC21-MMSC::module-0-0</vf-module-name>" + EOL +
+ " <service-id>00000000-0000-0000-0000-000000000000</service-id>" + EOL +
+ " <service-type>SDN-ETHERNET-INTERNET</service-type>" + EOL +
+ " <tenant-id>fba1bd1e195a404cacb9ce17a9b2b421</tenant-id>" + EOL +
+ " <orchestration-status>pending-delete</orchestration-status>" + EOL +
+ " <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>" + EOL +
+ " </vnf-inputs>" + EOL +
+ " <vnf-params xmlns:tns=\"http://org.openecomp/mso/infra/vnf-request/v1\"/>" + EOL +
+ "</vnf-request>" + EOL;
+ logStart();
+ mockSDNCAdapter("/SDNCAdapter", "SvcAction>changedelete", 200, "DeleteGenericVNFV1/sdncAdapterResponse.xml");
+ mockSDNCAdapter("/SDNCAdapter", "SvcAction>delete", 200, "DeleteGenericVNFV1/sdncAdapterResponse.xml");
+ mockVNFDelete(".*", "/.*", 202);
+ mockVfModuleDelete("78987");
+ MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
+ MockPatchGenericVnf("a27ce5a9-29c4-4c22-a017-6615ac73c721");
+ MockGetGenericVnfByName("STMTN5MMSC21", "DoCreateVfModule_getVnfResponse.xml");
+ MockGetGenericVnfById("/a27ce5a9-29c4-4c22-a017-6615ac73c721.*", "DoCreateVfModule_getVnfResponse.xml", 200);
+ MockPutVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
+ MockDeleteGenericVnf("a27ce5a9-29c4-4c22-a017-6615ac73c721", "0000021");
+ MockDeleteVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73", "0000073", 200);
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<String, Object>();
+ RollbackData rollbackData = new RollbackData();
+
+ rollbackData.put("VFMODULE_BASE", "source", "PORTAL");
+ rollbackData.put("VFMODULE_BASE", "vnfid", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
+ rollbackData.put("VFMODULE_BASE", "vnfname", "STMTN5MMSC21");
+ rollbackData.put("VFMODULE_BASE", "vnftype", "asc_heat-int");
+ rollbackData.put("VFMODULE_BASE", "vfmoduleid", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
+ rollbackData.put("VFMODULE_BASE", "vfmodulename", "STMTN5MMSC21-MMSC::module-0-0");
+ rollbackData.put("VFMODULE_BASE", "tenantid", "fba1bd1e195a404cacb9ce17a9b2b421");
+ rollbackData.put("VFMODULE_BASE", "aiccloudregion", "RDM2WAGPLCP");
+ rollbackData.put("VFMODULE_BASE", "heatstackid", "thisisaheatstack");
+ rollbackData.put("VFMODULE_BASE", "contrailNetworkPolicyFqdn0", "MSOTest:DefaultPolicyFQDN1");
+ rollbackData.put("VFMODULE_BASE", "contrailNetworkPolicyFqdn1", "MSOTest:DefaultPolicyFQDN2");
+ rollbackData.put("VFMODULE_BASE", "oamManagementV6Address", "2000:abc:bce:1111");
+ rollbackData.put("VFMODULE_BASE", "oamManagementV4Address", "127.0.0.1");
+
+ rollbackData.put("VFMODULE_BASE", "rollbackPrepareUpdateVfModule", "true");
+ rollbackData.put("VFMODULE_BASE", "rollbackVnfAdapterCreate", "true");
+ rollbackData.put("VFMODULE_BASE", "rollbackUpdateAAIVfModule", "true");
+ rollbackData.put("VFMODULE_BASE", "rollbackSDNCRequestActivate", "true");
+ rollbackData.put("VFMODULE_BASE", "rollbackCreateAAIVfModule", "true");
+ rollbackData.put("VFMODULE_BASE", "rollbackCreateNetworkPoliciesAAI", "true");
+ rollbackData.put("VFMODULE_BASE", "rollbackUpdateVnfAAI", "true");
+
+ rollbackData.put("VNF", "vnfId", "testVnfId123");
+
+ rollbackData.put("VNFANDMODULES", "numOfCreatedAddOnModules", "0");
+
+ variables.put("isDebugLogEnabled","true");
+ variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
+ variables.put("mso-service-instance-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
+ rollbackData.put("VFMODULE_BASE", "msorequestid", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
+ rollbackData.put("VFMODULE_BASE", "serviceinstanceid", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
+
+ variables.put("rollbackData", rollbackData);
+ invokeSubProcess("DoCreateVnfAndModulesRollback", businessKey, variables);
+
+ // "changedelete" operation not required for deleting a Vf Module
+// injectSDNCCallbacks(callbacks, "sdncChangeDelete");
+ injectVNFRestCallbacks(callbacks, "vnfDelete");
+ //waitForRunningProcessCount("DoCreateVnfAndModulesRollback", 0, 120000);
+ injectSDNCCallbacks(callbacks, "sdncDelete");
+
+ waitForProcessEnd(businessKey, 10000);
+ WorkflowException wfe = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException");
+ checkVariable(businessKey, "WorkflowException", null);
+ if (wfe != null) {
+ System.out.println("TestCreateVfModuleSuccess: ErrorCode=" + wfe.getErrorCode() +
+ ", ErrorMessage=" + wfe.getErrorMessage());
+ }
+ logEnd();
+ }
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/DoCreateVnfAndModulesRollback.bpmn",
+ "subprocess/PrepareUpdateAAIVfModule.bpmn",
+ "subprocess/UpdateAAIVfModule.bpmn",
+ "subprocess/UpdateAAIGenericVnf.bpmn",
+ "subprocess/DeleteAAIVfModule.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/GenericGetVnf.bpmn",
+ "subprocess/GenericDeleteVnf.bpmn",
+ "subprocess/DoDeleteVnf.bpmn"
+ })
+ public void TestDoCreateVnfAndModulesRollbackSuccess_vnfOnly() {
+ // delete the Base Module and Generic Vnf
+ // vnf-id=a27ce5a9-29c4-4c22-a017-6615ac73c721, vf-module-id=973ed047-d251-4fb9-bf1a-65b8949e0a73
+ String request =
+ "<vnf-request xmlns=\"http://org.openecomp/mso/infra/vnf-request/v1\">" + EOL +
+ " <request-info>" + EOL +
+ " <action>DELETE_VF_MODULE</action>" + EOL +
+ " <source>PORTAL</source>" + EOL +
+ " </request-info>" + EOL +
+ " <vnf-inputs>" + EOL +
+ " <vnf-id>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnf-id>" + EOL +
+ " <vnf-name>STMTN5MMSC21</vnf-name>" + EOL +
+ " <vnf-type>asc_heat-int</vnf-type>" + EOL +
+ " <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</vf-module-id>" + EOL +
+ " <vf-module-name>STMTN5MMSC21-MMSC::module-0-0</vf-module-name>" + EOL +
+ " <service-id>00000000-0000-0000-0000-000000000000</service-id>" + EOL +
+ " <service-type>SDN-ETHERNET-INTERNET</service-type>" + EOL +
+ " <tenant-id>fba1bd1e195a404cacb9ce17a9b2b421</tenant-id>" + EOL +
+ " <orchestration-status>pending-delete</orchestration-status>" + EOL +
+ " <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>" + EOL +
+ " </vnf-inputs>" + EOL +
+ " <vnf-params xmlns:tns=\"http://org.openecomp/mso/infra/vnf-request/v1\"/>" + EOL +
+ "</vnf-request>" + EOL;
+ logStart();
+ MockGetGenericVnfById("testVnfId123.*", "GenericFlows/getGenericVnfByNameResponse.xml");
+ MockDeleteGenericVnf("testVnfId123", "testReVer123");
+ MockDoDeleteVfModule_SDNCSuccess();
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<String, Object>();
+ RollbackData rollbackData = new RollbackData();
+
+ rollbackData.put("VNF", "vnfId", "testVnfId123");
+ rollbackData.put("VNF", "rollbackVnfCreate", "true");
+ rollbackData.put("VNF", "rollbackSDNCAssign", "true");
+ rollbackData.put("VNF", "rollbackSDNCActivate", "true");
+ rollbackData.put("VNFANDMODULES", "numOfCreatedAddOnModules", "0");
+
+
+ variables.put("isDebugLogEnabled","true");
+ variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
+ variables.put("mso-service-instance-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
+
+
+ variables.put("rollbackData", rollbackData);
+ variables.put("sdncVersion", "1707");
+ invokeSubProcess("DoCreateVnfAndModulesRollback", businessKey, variables);
+
+ // "changedelete" operation not required for deleting a Vf Module
+// injectSDNCCallbacks(callbacks, "sdncChangeDelete");
+
+ //waitForRunningProcessCount("DoCreateVnfAndModulesRollback", 0, 120000);
+ // injectSDNCCallbacks(callbacks, "sdncDelete");
+
+ waitForProcessEnd(businessKey, 10000);
+ WorkflowException wfe = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException");
+ checkVariable(businessKey, "WorkflowException", null);
+ if (wfe != null) {
+ System.out.println("TestCreateVfModuleSuccess: ErrorCode=" + wfe.getErrorCode() +
+ ", ErrorMessage=" + wfe.getErrorMessage());
+ }
+ logEnd();
+ }
+
+ @Test
+ @Ignore
+ @Deployment(resources = {
+ "subprocess/DoCreateVnfAndModulesRollback.bpmn",
+ "subprocess/DoCreateVfModuleRollback.bpmn",
+ "subprocess/PrepareUpdateAAIVfModule.bpmn",
+ "subprocess/UpdateAAIVfModule.bpmn",
+ "subprocess/UpdateAAIGenericVnf.bpmn",
+ "subprocess/DeleteAAIVfModule.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/VnfAdapterRestV1.bpmn",
+ "subprocess/GenericGetVnf.bpmn",
+ "subprocess/GenericDeleteVnf.bpmn",
+ "subprocess/DoDeleteVnf.bpmn"
+ })
+ public void TestDoCreateVnfAndModulesRollbackSuccess_AddOn() {
+ // delete the Base Module and Generic Vnf
+ // vnf-id=a27ce5a9-29c4-4c22-a017-6615ac73c721, vf-module-id=973ed047-d251-4fb9-bf1a-65b8949e0a73
+ String request =
+ "<vnf-request xmlns=\"http://org.openecomp/mso/infra/vnf-request/v1\">" + EOL +
+ " <request-info>" + EOL +
+ " <action>DELETE_VF_MODULE</action>" + EOL +
+ " <source>PORTAL</source>" + EOL +
+ " </request-info>" + EOL +
+ " <vnf-inputs>" + EOL +
+ " <vnf-id>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnf-id>" + EOL +
+ " <vnf-name>STMTN5MMSC21</vnf-name>" + EOL +
+ " <vnf-type>asc_heat-int</vnf-type>" + EOL +
+ " <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</vf-module-id>" + EOL +
+ " <vf-module-name>STMTN5MMSC21-MMSC::module-0-0</vf-module-name>" + EOL +
+ " <service-id>00000000-0000-0000-0000-000000000000</service-id>" + EOL +
+ " <service-type>SDN-ETHERNET-INTERNET</service-type>" + EOL +
+ " <tenant-id>fba1bd1e195a404cacb9ce17a9b2b421</tenant-id>" + EOL +
+ " <orchestration-status>pending-delete</orchestration-status>" + EOL +
+ " <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>" + EOL +
+ " </vnf-inputs>" + EOL +
+ " <vnf-params xmlns:tns=\"http://org.openecomp/mso/infra/vnf-request/v1\"/>" + EOL +
+ "</vnf-request>" + EOL;
+ logStart();
+ mockSDNCAdapter("/SDNCAdapter", "SvcAction>changedelete", 200, "DeleteGenericVNFV1/sdncAdapterResponse.xml");
+ mockSDNCAdapter("/SDNCAdapter", "SvcAction>delete", 200, "DeleteGenericVNFV1/sdncAdapterResponse.xml");
+ mockVNFDelete(".*", "/.*", 202);
+ mockVfModuleDelete("78987");
+ MockGetGenericVnfByName("STMTN5MMSC21", "DoCreateVfModule_getVnfResponse.xml");
+ MockGetGenericVnfById("/a27ce5a9-29c4-4c22-a017-6615ac73c721", "DoCreateVfModule_getVnfResponse.xml", 200);
+ MockGetGenericVnfByIdWithDepth("a27ce5a9-29c4-4c22-a017-6615ac73c721", 1, "DoCreateVfModuleRollback/GenericVnf.xml");
+ MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
+ MockPatchGenericVnf("a27ce5a9-29c4-4c22-a017-6615ac73c721");
+ MockPutVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
+ MockDeleteGenericVnf("a27ce5a9-29c4-4c22-a017-6615ac73c721", "0000021");
+ MockDeleteVfModuleId("", "", "", 200);
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<String, Object>();
+ RollbackData rollbackData = new RollbackData();
+
+ rollbackData.put("VFMODULE_BASE", "source", "PORTAL");
+ rollbackData.put("VFMODULE_BASE", "vnfid", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
+ rollbackData.put("VFMODULE_BASE", "vnfname", "STMTN5MMSC21");
+ rollbackData.put("VFMODULE_BASE", "vnftype", "asc_heat-int");
+ rollbackData.put("VFMODULE_BASE", "vfmoduleid", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
+ rollbackData.put("VFMODULE_BASE", "vfmodulename", "STMTN5MMSC21-MMSC::module-0-0");
+ rollbackData.put("VFMODULE_BASE", "tenantid", "fba1bd1e195a404cacb9ce17a9b2b421");
+ rollbackData.put("VFMODULE_BASE", "aiccloudregion", "RDM2WAGPLCP");
+ rollbackData.put("VFMODULE_BASE", "heatstackid", "thisisaheatstack");
+ rollbackData.put("VFMODULE_BASE", "contrailNetworkPolicyFqdn0", "MSOTest:DefaultPolicyFQDN1");
+ rollbackData.put("VFMODULE_BASE", "contrailNetworkPolicyFqdn1", "MSOTest:DefaultPolicyFQDN2");
+ rollbackData.put("VFMODULE_BASE", "oamManagementV6Address", "2000:abc:bce:1111");
+ rollbackData.put("VFMODULE_BASE", "oamManagementV4Address", "127.0.0.1");
+ rollbackData.put("VFMODULE_BASE", "rollbackPrepareUpdateVfModule", "true");
+ rollbackData.put("VFMODULE_BASE", "rollbackVnfAdapterCreate", "true");
+ rollbackData.put("VFMODULE_BASE", "rollbackUpdateAAIVfModule", "true");
+ rollbackData.put("VFMODULE_BASE", "rollbackSDNCRequestActivate", "true");
+ rollbackData.put("VFMODULE_BASE", "rollbackCreateAAIVfModule", "true");
+ rollbackData.put("VFMODULE_BASE", "rollbackCreateNetworkPoliciesAAI", "true");
+ rollbackData.put("VFMODULE_BASE", "rollbackUpdateVnfAAI", "true");
+ rollbackData.put("VFMODULE_BASE", "msorequestid", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
+ rollbackData.put("VFMODULE_BASE", "serviceinstanceid", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
+
+
+ rollbackData.put("VFMODULE_ADDON_1", "source", "PORTAL");
+ rollbackData.put("VFMODULE_ADDON_1", "vnfid", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
+ rollbackData.put("VFMODULE_ADDON_1", "vnfname", "STMTN5MMSC21");
+ rollbackData.put("VFMODULE_ADDON_1", "vnftype", "asc_heat-int");
+ rollbackData.put("VFMODULE_ADDON_1", "vfmoduleid", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
+ rollbackData.put("VFMODULE_ADDON_1", "vfmodulename", "STMTN5MMSC21-MMSC::module-0-0");
+ rollbackData.put("VFMODULE_ADDON_1", "tenantid", "fba1bd1e195a404cacb9ce17a9b2b421");
+ rollbackData.put("VFMODULE_ADDON_1", "aiccloudregion", "RDM2WAGPLCP");
+ rollbackData.put("VFMODULE_ADDON_1", "heatstackid", "thisisaheatstack");
+ rollbackData.put("VFMODULE_ADDON_1", "contrailNetworkPolicyFqdn0", "MSOTest:DefaultPolicyFQDN1");
+ rollbackData.put("VFMODULE_ADDON_1", "contrailNetworkPolicyFqdn1", "MSOTest:DefaultPolicyFQDN2");
+ rollbackData.put("VFMODULE_ADDON_1", "oamManagementV6Address", "2000:abc:bce:1111");
+ rollbackData.put("VFMODULE_ADDON_1", "oamManagementV4Address", "127.0.0.1");
+ rollbackData.put("VFMODULE_ADDON_1", "rollbackPrepareUpdateVfModule", "true");
+ rollbackData.put("VFMODULE_ADDON_1", "rollbackVnfAdapterCreate", "true");
+ rollbackData.put("VFMODULE_ADDON_1", "rollbackUpdateAAIVfModule", "true");
+ rollbackData.put("VFMODULE_ADDON_1", "rollbackSDNCRequestActivate", "true");
+ rollbackData.put("VFMODULE_ADDON_1", "rollbackCreateAAIVfModule", "true");
+ rollbackData.put("VFMODULE_ADDON_1", "rollbackCreateNetworkPoliciesAAI", "true");
+ rollbackData.put("VFMODULE_ADDON_1", "rollbackUpdateVnfAAI", "true");
+ rollbackData.put("VFMODULE_ADDON_1", "msorequestid", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
+ rollbackData.put("VFMODULE_ADDON_1", "serviceinstanceid", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
+
+ rollbackData.put("VNF", "vnfId", "testVnfId123");
+
+ rollbackData.put("VNFANDMODULES", "numOfCreatedAddOnModules", "1");
+
+ variables.put("isDebugLogEnabled","true");
+ variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
+ variables.put("mso-service-instance-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
+
+
+ variables.put("rollbackData", rollbackData);
+ invokeSubProcess("DoCreateVnfAndModulesRollback", businessKey, variables);
+
+ // "changedelete" operation not required for deleting a Vf Module
+ // injectSDNCCallbacks(callbacks, "sdncChangeDelete");
+ injectVNFRestCallbacks(callbacks, "vnfDelete");
+ injectVNFRestCallbacks(callbacks, "vnfDelete");
+ //waitForRunningProcessCount("DoCreateVnfAndModulesRollback", 0, 120000);
+ injectSDNCCallbacks(callbacks, "sdncDelete");
+
+ waitForProcessEnd(businessKey, 10000);
+ WorkflowException wfe = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException");
+ checkVariable(businessKey, "WorkflowException", null);
+ if (wfe != null) {
+ System.out.println("TestCreateVfModuleSuccess: ErrorCode=" + wfe.getErrorCode() +
+ ", ErrorMessage=" + wfe.getErrorMessage());
+ }
+ logEnd();
+ }
+
+ public static void MockDoDeleteVfModule_SDNCSuccess() {
+ stubFor(post(urlEqualTo("/SDNCAdapter"))
+ .withRequestBody(containing("SvcAction>deactivate"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("DeleteGenericVNFV1/sdncAdapterResponse.xml")));
+ stubFor(post(urlEqualTo("/SDNCAdapter"))
+ .withRequestBody(containing("SvcAction>unassign"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("DeleteGenericVNFV1/sdncAdapterResponse.xml")));
+ }
+
+
+} \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfAndModulesTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfAndModulesTest.java
new file mode 100644
index 0000000000..3c10872dc8
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfAndModulesTest.java
@@ -0,0 +1,354 @@
+package org.openecomp.mso.bpmn.infrastructure;
+
+import static org.junit.Assert.assertEquals;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockAAIVfModule;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDBUpdateVfModule;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfById_404;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchGenericVnf;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchVfModuleId;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutGenericVnf;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockSDNCAdapterVfModule;
+import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockVNFAdapterRestVfModule;
+import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import org.camunda.bpm.engine.test.Deployment;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.openecomp.mso.bpmn.common.BPMNUtil;
+import org.openecomp.mso.bpmn.common.WorkflowTest;
+import org.openecomp.mso.bpmn.core.domain.ModelInfo;
+import org.openecomp.mso.bpmn.core.domain.ModuleResource;
+import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition;
+import org.openecomp.mso.bpmn.core.domain.VnfResource;
+import org.openecomp.mso.bpmn.mock.FileUtil;
+
+/**
+ * Unit Test for the DoCreateVnfAndModules Flow
+ *
+ */
+public class DoCreateVnfAndModulesTest extends WorkflowTest {
+
+ private final CallbackSet callbacks = new CallbackSet();
+
+ public DoCreateVnfAndModulesTest() throws IOException {
+
+ callbacks.put("assign", FileUtil.readResourceFile(
+ "__files/VfModularity/SDNCTopologyAssignCallback.xml"));
+ callbacks.put("activate", FileUtil.readResourceFile(
+ "__files/VfModularity/SDNCTopologyActivateCallback.xml"));
+ callbacks.put("query", FileUtil.readResourceFile(
+ "__files/VfModularity/SDNCTopologyQueryCallback.xml"));
+ callbacks.put("queryVnf", FileUtil.readResourceFile(
+ "__files/VfModularity/SDNCTopologyQueryCallbackVnf.xml"));
+ callbacks.put("queryModuleNoVnf", FileUtil.readResourceFile(
+ "__files/VfModularity/SDNCTopologyQueryCallbackVfModuleNoVnf.xml"));
+ callbacks.put("queryModule", FileUtil.readResourceFile(
+ "__files/VfModularity/SDNCTopologyQueryCallbackVfModule.xml"));
+ callbacks.put("vnfCreate", FileUtil.readResourceFile(
+ "__files/VfModularity/VNFAdapterRestCreateCallback.xml"));
+ }
+
+ @Test
+ @Ignore // IGNORED FOR 1710 MERGE TO ONAP
+ @Deployment(resources = {"subprocess/GenericGetService.bpmn",
+ "subprocess/GenericGetVnf.bpmn",
+ "subprocess/GenericPutVnf.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/DoCreateVnf.bpmn",
+ "subprocess/GenerateVfModuleName.bpmn",
+ "subprocess/DoCreateVfModule.bpmn",
+ "subprocess/DoCreateVnfAndModules.bpmn",
+ "subprocess/GenericGetVnf.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/VnfAdapterRestV1.bpmn",
+ "subprocess/ConfirmVolumeGroupTenant.bpmn",
+ "subprocess/ConfirmVolumeGroupName.bpmn",
+ "subprocess/CreateAAIVfModule.bpmn",
+ "subprocess/UpdateAAIVfModule.bpmn",
+ "subprocess/CreateAAIVfModuleVolumeGroup.bpmn",
+ "subprocess/UpdateAAIGenericVnf.bpmn",
+ "subprocess/DoCreateVnfAndModulesRollback.bpmn"})
+ public void testDoCreateVnfAndModulesBaseOnly_success() throws Exception{
+
+ MockNodeQueryServiceInstanceById("MIS%2F1604%2F0026%2FSW_INTERNET", "GenericFlows/getSIUrlByIdVipr.xml");
+ MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
+ MockGetGenericVnfById_404("testVnfId");
+ MockPutGenericVnf(".*");
+ MockAAIVfModule();
+ MockPatchGenericVnf("skask");
+ MockPatchVfModuleId("skask", ".*");
+ mockSDNCAdapter("VfModularity/StandardSDNCSynchResponse.xml");
+ MockVNFAdapterRestVfModule();
+ MockDBUpdateVfModule();
+
+ mockSDNCAdapter("VfModularity/StandardSDNCSynchResponse.xml");
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<String, Object>();
+ setVariablesSuccess(variables, "", "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
+ invokeSubProcess("DoCreateVnfAndModules", businessKey, variables);
+
+ injectSDNCCallbacks(callbacks, "assign");
+ injectSDNCCallbacks(callbacks, "query");
+ injectSDNCCallbacks(callbacks, "activate");
+ injectSDNCCallbacks(callbacks, "queryVnf");
+ injectSDNCCallbacks(callbacks, "assign, queryModuleNoVnf");
+ injectVNFRestCallbacks(callbacks, "vnfCreate");
+ injectSDNCCallbacks(callbacks, "activate");
+ waitForProcessEnd(businessKey, 10000);
+
+ Assert.assertTrue(isProcessEnded(businessKey));
+ assertVariables("true", "true", "false", "true", "Success", null);
+
+ }
+
+ @Test
+ @Ignore // IGNORED FOR 1710 MERGE TO ONAP
+ @Deployment(resources = {"subprocess/GenericGetService.bpmn",
+ "subprocess/GenericGetVnf.bpmn",
+ "subprocess/GenericPutVnf.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/DoCreateVnf.bpmn",
+ "subprocess/GenerateVfModuleName.bpmn",
+ "subprocess/DoCreateVfModule.bpmn",
+ "subprocess/DoCreateVnfAndModules.bpmn",
+ "subprocess/GenericGetVnf.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/VnfAdapterRestV1.bpmn",
+ "subprocess/ConfirmVolumeGroupTenant.bpmn",
+ "subprocess/ConfirmVolumeGroupName.bpmn",
+ "subprocess/CreateAAIVfModule.bpmn",
+ "subprocess/UpdateAAIVfModule.bpmn",
+ "subprocess/CreateAAIVfModuleVolumeGroup.bpmn",
+ "subprocess/UpdateAAIGenericVnf.bpmn",
+ "subprocess/DoCreateVnfAndModulesRollback.bpmn"})
+ public void testDoCreateVnfAndModulesWithAddon_success() throws Exception{
+
+ MockNodeQueryServiceInstanceById("MIS%2F1604%2F0026%2FSW_INTERNET", "GenericFlows/getSIUrlByIdVipr.xml");
+ MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
+ MockGetGenericVnfById_404("testVnfId");
+ MockPutGenericVnf(".*");
+ MockAAIVfModule();
+ MockPatchGenericVnf("skask");
+ MockPatchVfModuleId("skask", ".*");
+ mockSDNCAdapter("VfModularity/StandardSDNCSynchResponse.xml");
+ MockVNFAdapterRestVfModule();
+ MockDBUpdateVfModule();
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ mockSDNCAdapter("VfModularity/StandardSDNCSynchResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<String, Object>();
+ setVariablesAddonSuccess(variables, "", "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
+ invokeSubProcess("DoCreateVnfAndModules", businessKey, variables);
+
+ injectSDNCCallbacks(callbacks, "assign");
+ injectSDNCCallbacks(callbacks, "query");
+ injectSDNCCallbacks(callbacks, "activate");
+ injectSDNCCallbacks(callbacks, "queryVnf");
+ injectSDNCCallbacks(callbacks, "assign, queryModuleNoVnf");
+ injectVNFRestCallbacks(callbacks, "vnfCreate");
+ injectSDNCCallbacks(callbacks, "activate");
+ injectSDNCCallbacks(callbacks, "queryVnf");
+ injectSDNCCallbacks(callbacks, "assign, queryModuleNoVnf");
+ injectVNFRestCallbacks(callbacks, "vnfCreate");
+ injectSDNCCallbacks(callbacks, "activate");
+ waitForProcessEnd(businessKey, 10000);
+
+ Assert.assertTrue(isProcessEnded(businessKey));
+ assertVariables("true", "true", "false", "true", "Success", null);
+
+ }
+
+ private void assertVariables(String exSIFound, String exSISucc, String exVnfFound, String exVnfSucc, String exResponse, String exWorkflowException) {
+
+ String siFound = BPMNUtil.getVariable(processEngineRule, "DoCreateVnf", "GENGS_FoundIndicator");
+ String siSucc = BPMNUtil.getVariable(processEngineRule, "DoCreateVnf", "GENGS_SuccessIndicator");
+ String vnfFound = BPMNUtil.getVariable(processEngineRule, "DoCreateVnf", "GENGV_FoundIndicator");
+ String vnfSucc = BPMNUtil.getVariable(processEngineRule, "DoCreateVnf", "GENGV_SuccessIndicator");
+ String response = BPMNUtil.getVariable(processEngineRule, "DoCreateVnf", "WorkflowResponse");
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "DoCreateVnf", "SavedWorkflowException1");
+
+ //assertEquals(exSIFound, siFound);
+ //assertEquals(exSISucc, siSucc);
+ //assertEquals(exVnfFound, vnfFound);
+ //assertEquals(exVnfSucc, vnfSucc);
+ //assertEquals(exResponse, response);
+ assertEquals(exWorkflowException, workflowException);
+ }
+
+ private void setVariables(Map<String, String> variables, String request, String requestId, String siId) {
+ variables.put("isDebugLogEnabled", "true");
+ variables.put("bpmnRequest", request);
+ variables.put("mso-request-id", requestId);
+ variables.put("serviceInstanceId",siId);
+ variables.put("testVnfId","testVnfId123");
+ variables.put("vnfType", "STMTN");
+ }
+
+ private void setVariablesSuccess(Map<String, Object> variables, String request, String requestId, String siId) {
+ variables.put("isDebugLogEnabled", "true");
+ variables.put("mso-request-id", requestId);
+ variables.put("requestId", requestId);
+ variables.put("msoRequestId", requestId);
+ variables.put("serviceInstanceId",siId);
+ variables.put("disableRollback", "true");
+ //variables.put("testVnfId","testVnfId123");
+ variables.put("vnfType", "STMTN");
+
+ String serviceModelInfo = "{ "+ "\"modelType\": \"service\"," +
+ "\"modelInvariantUuid\": \"995256d2-5a33-55df-13ab-12abad84e7ff\"," +
+ "\"modelUuid\": \"ab6478e5-ea33-3346-ac12-ab121484a3fe\"," +
+ "\"modelName\": \"ServicevSAMP12\"," +
+ "\"modelVersion\": \"1.0\"," +
+ "}";
+ variables.put("serviceModelInfo", serviceModelInfo);
+ variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
+ String vnfModelInfo = "{" + "\"modelType\": \"vnf\"," +
+ "\"modelInvariantUuid\": \"ff5256d2-5a33-55df-13ab-12abad84e7ff\"," +
+ "\"modelUuid\": \"fe6478e5-ea33-3346-ac12-ab121484a3fe\"," +
+ "\"modelName\": \"vSAMP12\"," +
+ "\"modelVersion\": \"1.0\"," +
+ "\"modelCustomizationUuid\": \"MODEL-ID-1234\"" + "}";
+ variables.put("vnfModelInfo", vnfModelInfo);
+
+ String cloudConfiguration = "{" + "\"cloudConfiguration\": { " +
+ "\"lcpCloudRegionId\": \"mdt1\"," +
+ "\"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\"" + "}}";
+ variables.put("cloudConfiguration", cloudConfiguration);
+ variables.put("sdncVersion", "1707");
+ variables.put("globalSubscriberId", "subscriber123");
+
+ try {
+ String serviceDecomposition = FileUtil.readResourceFile("__files/VIPR/serviceDecompositionATMFW.json");
+ ServiceDecomposition sd = new ServiceDecomposition();
+ ModelInfo serviceModel = new ModelInfo();
+ serviceModel.setModelName("servicewithVNFs");
+ sd.setModelInfo(serviceModel);
+ VnfResource vr = new VnfResource();
+ ModelInfo mvr = new ModelInfo();
+ mvr.setModelName("vSAMP12");
+ mvr.setModelInstanceName("v123");
+ mvr.setModelInvariantUuid("");
+ mvr.setModelVersion("1.0");
+ mvr.setModelCustomizationUuid("MODEL-ID-1234");
+ vr.setModelInfo(mvr);
+ vr.constructVnfType("vnf1");
+ vr.setNfType("somenftype");
+ vr.setNfRole("somenfrole");
+ vr.setNfFunction("somenffunction");
+ vr.setNfNamingCode("somenamingcode");
+ ModuleResource mr = new ModuleResource();
+ ModelInfo mvmr = new ModelInfo();
+ mvmr.setModelInvariantUuid("ff5256d2-5a33-55df-13ab-12abad84e7ff");
+ mvmr.setModelName("STMTN5MMSC21-MMSC::model-1-0");
+ mvmr.setModelVersion("1");
+ mvmr.setModelCustomizationUuid("MODEL-123");
+ mr.setModelInfo(mvmr);
+ mr.setIsBase(true);
+ mr.setVfModuleLabel("MODULELABEL");
+ vr.addVfModule(mr);
+ sd.addVnfResource(vr);
+
+ variables.put("serviceDecomposition", sd);
+ variables.put("isTest", true);
+ } catch(Exception e) {
+
+ }
+
+ }
+
+ private void setVariablesAddonSuccess(Map<String, Object> variables, String request, String requestId, String siId) {
+ variables.put("isDebugLogEnabled", "true");
+ variables.put("mso-request-id", requestId);
+ variables.put("requestId", requestId);
+ variables.put("msoRequestId", requestId);
+ variables.put("serviceInstanceId",siId);
+ variables.put("disableRollback", "true");
+ //variables.put("testVnfId","testVnfId123");
+ variables.put("vnfType", "STMTN");
+
+ String serviceModelInfo = "{ "+ "\"modelType\": \"service\"," +
+ "\"modelInvariantUuid\": \"995256d2-5a33-55df-13ab-12abad84e7ff\"," +
+ "\"modelUuid\": \"ab6478e5-ea33-3346-ac12-ab121484a3fe\"," +
+ "\"modelName\": \"ServicevSAMP12\"," +
+ "\"modelVersion\": \"1.0\"," +
+ "}";
+ variables.put("serviceModelInfo", serviceModelInfo);
+ variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
+ String vnfModelInfo = "{" + "\"modelType\": \"vnf\"," +
+ "\"modelInvariantUuid\": \"ff5256d2-5a33-55df-13ab-12abad84e7ff\"," +
+ "\"modelUuid\": \"fe6478e5-ea33-3346-ac12-ab121484a3fe\"," +
+ "\"modelName\": \"vSAMP12\"," +
+ "\"modelVersion\": \"1.0\"," +
+ "\"modelCustomizationUuid\": \"MODEL-ID-1234\"" + "}";
+ variables.put("vnfModelInfo", vnfModelInfo);
+
+ String cloudConfiguration = "{" + "\"cloudConfiguration\": { " +
+ "\"lcpCloudRegionId\": \"mdt1\"," +
+ "\"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\"" + "}}";
+ variables.put("cloudConfiguration", cloudConfiguration);
+ variables.put("sdncVersion", "1707");
+ variables.put("globalSubscriberId", "subscriber123");
+
+ try {
+ String serviceDecomposition = FileUtil.readResourceFile("__files/VIPR/serviceDecompositionATMFW.json");
+ ServiceDecomposition sd = new ServiceDecomposition();
+ ModelInfo serviceModel = new ModelInfo();
+ serviceModel.setModelName("servicewithVNFs");
+ sd.setModelInfo(serviceModel);
+ VnfResource vr = new VnfResource();
+ ModelInfo mvr = new ModelInfo();
+ mvr.setModelName("vSAMP12");
+ mvr.setModelInstanceName("v123");
+ mvr.setModelInvariantUuid("");
+ mvr.setModelVersion("1.0");
+ mvr.setModelCustomizationUuid("MODEL-ID-1234");
+ vr.setModelInfo(mvr);
+ vr.setNfType("somenftype");
+ vr.setNfRole("somenfrole");
+ vr.setNfFunction("somenffunction");
+ vr.setNfNamingCode("somenamingcode");
+ ModuleResource mr = new ModuleResource();
+ ModelInfo mvmr = new ModelInfo();
+ mvmr.setModelInvariantUuid("ff5256d2-5a33-55df-13ab-12abad84e7ff");
+ mvmr.setModelName("STMTN5MMSC21-MMSC::model-1-0");
+ mvmr.setModelVersion("1");
+ mvmr.setModelCustomizationUuid("MODEL-123");
+ mr.setModelInfo(mvmr);
+ mr.setIsBase(true);
+ mr.setVfModuleLabel("MODULELABEL");
+ vr.addVfModule(mr);
+ ModuleResource mr1 = new ModuleResource();
+ ModelInfo mvmr1 = new ModelInfo();
+ mvmr1.setModelInvariantUuid("ff5256d2-5a33-55df-13ab-12abad84e7ff");
+ mvmr1.setModelName("STMTN5MMSC21-MMSC::model-1-0");
+ mvmr1.setModelVersion("1");
+ mvmr1.setModelCustomizationUuid("MODEL-123");
+ mr1.setModelInfo(mvmr1);
+ mr1.setIsBase(false);
+ mr1.setVfModuleLabel("MODULELABEL");
+ mr1.setInitialCount(1);
+ vr.addVfModule(mr1);
+
+ sd.addVnfResource(vr);
+
+ variables.put("serviceDecomposition", sd);
+ variables.put("isTest", true);
+ } catch(Exception e) {
+
+
+
+ }
+ }
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfTest.java
index b161d05bfe..4d2b512a2f 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfTest.java
@@ -102,11 +102,11 @@ public class DoCreateVnfTest extends WorkflowTest {
variables.put("vnfType", "STMTN");
variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
String vnfModelInfo = "{ "+ "\"modelType\": \"vnf\"," +
- "\"modelInvariantId\": \"ff5256d2-5a33-55df-13ab-12abad84e7ff\"," +
- "\"modelNameVersionId\": \"fe6478e5-ea33-3346-ac12-ab121484a3fe\"," +
+ "\"modelInvariantUuid\": \"ff5256d2-5a33-55df-13ab-12abad84e7ff\"," +
+ "\"modelUuid\": \"fe6478e5-ea33-3346-ac12-ab121484a3fe\"," +
"\"modelName\": \"vSAMP12\"," +
"\"modelVersion\": \"1.0\"," +
- "\"modelCustomizationId\": \"MODEL-ID-1234\"," +
+ "\"modelCustomizationUuid\": \"MODEL-ID-1234\"," +
"}";
variables.put("vnfModelInfo", vnfModelInfo);
@@ -114,6 +114,15 @@ public class DoCreateVnfTest extends WorkflowTest {
"\"lcpCloudRegionId\": \"mdt1\"," +
"\"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\"" + "}";
variables.put("cloudConfiguration", cloudConfiguration);
+
+ String serviceModelInfo = "{ "+ "\"modelType\": \"service\"," +
+ "\"modelInvariantUuid\": \"995256d2-5a33-55df-13ab-12abad84e7ff\"," +
+ "\"modelUuid\": \"ab6478e5-ea33-3346-ac12-ab121484a3fe\"," +
+ "\"modelName\": \"ServicevSAMP12\"," +
+ "\"modelVersion\": \"1.0\"," +
+ "}";
+ variables.put("serviceModelInfo", serviceModelInfo);
+ variables.put("globalSubscriberId", "MSO-1610");
}
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteServiceInstanceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteServiceInstanceTest.java
new file mode 100644
index 0000000000..3aefb6afaa
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteServiceInstanceTest.java
@@ -0,0 +1,88 @@
+package org.openecomp.mso.bpmn.infrastructure;
+
+import static org.junit.Assert.assertEquals;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteServiceInstance;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById;
+import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
+import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import org.camunda.bpm.engine.test.Deployment;
+import org.junit.Assert;
+import org.junit.Test;
+import org.openecomp.mso.bpmn.common.BPMNUtil;
+import org.openecomp.mso.bpmn.common.WorkflowTest;
+
+/**
+ * Unit test cases for DoDeleteServiceInstance.bpmn
+ */
+public class DoDeleteServiceInstanceTest extends WorkflowTest {
+
+ private final CallbackSet callbacks = new CallbackSet();
+ private static final String EOL = "\n";
+ private final String sdncAdapterCallback =
+ "<output xmlns=\"com:att:sdnctl:l3api\">" + EOL +
+ " <svc-request-id>((REQUEST-ID))</svc-request-id>" + EOL +
+ " <ack-final-indicator>Y</ack-final-indicator>" + EOL +
+ "</output>" + EOL;
+
+ public DoDeleteServiceInstanceTest() throws IOException {
+ callbacks.put("deactivate", sdncAdapterCallback);
+ callbacks.put("delete", sdncAdapterCallback);
+ }
+
+ /**
+ * Sunny day VID scenario.
+ *
+ * @throws Exception
+ */
+ //@Ignore // File not found - unable to run the test. Also, Stubs need updating..
+ @Test
+ @Deployment(resources = {
+ "subprocess/DoDeleteServiceInstance.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/GenericDeleteService.bpmn",
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+ "subprocess/FalloutHandler.bpmn" })
+ public void sunnyDay() throws Exception {
+
+ logStart();
+
+ //AAI
+ MockDeleteServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "", 204);
+ MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getSINoRelations.xml");
+ MockNodeQueryServiceInstanceById("MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getSIUrlById.xml");
+ //SDNC
+ mockSDNCAdapter(200);
+ //DB
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ String businessKey = UUID.randomUUID().toString();
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ setupVariables(variables);
+ invokeSubProcess("DoDeleteServiceInstance", businessKey, variables);
+ injectSDNCCallbacks(callbacks, "deactivate");
+ injectSDNCCallbacks(callbacks, "delete");
+ waitForProcessEnd(businessKey, 10000);
+ Assert.assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "DoDeleteServiceInstance", "WorkflowException");
+ System.out.println("workflowException:\n" + workflowException);
+ assertEquals(null, workflowException);
+
+ logEnd();
+ }
+
+ // Success Scenario
+ private void setupVariables(Map<String, Object> variables) {
+ variables.put("isDebugLogEnabled", "true");
+ variables.put("msoRequestId", "RaaDDSIRequestId-1");
+ variables.put("mso-request-id", "RaaDDSIRequestId-1");
+ variables.put("serviceInstanceId","MIS%252F1604%252F0026%252FSW_INTERNET");
+ }
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleFromVnfTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleFromVnfTest.java
new file mode 100644
index 0000000000..a1f66553f4
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleFromVnfTest.java
@@ -0,0 +1,157 @@
+package org.openecomp.mso.bpmn.infrastructure;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.containing;
+import static com.github.tomakehurst.wiremock.client.WireMock.delete;
+import static com.github.tomakehurst.wiremock.client.WireMock.post;
+import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
+import static org.openecomp.mso.bpmn.common.DeleteAAIVfModuleTest.MockAAIDeleteVfModule;
+import static org.openecomp.mso.bpmn.common.DeleteAAIVfModuleTest.MockAAIGenericVnfSearch;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import org.camunda.bpm.engine.test.Deployment;
+import org.junit.Test;
+import org.openecomp.mso.bpmn.common.WorkflowTest;
+import org.openecomp.mso.bpmn.core.WorkflowException;
+
+public class DoDeleteVfModuleFromVnfTest extends WorkflowTest {
+ private final CallbackSet callbacks = new CallbackSet();
+
+ private static final String EOL = "\n";
+
+ private final String vnfAdapterDeleteCallback =
+ "<deleteVfModuleResponse>" + EOL +
+ " <vnfId>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnfId>" + EOL +
+ " <vfModuleId>973ed047-d251-4fb9-bf1a-65b8949e0a73</vfModuleId>" + EOL +
+ " <vfModuleDeleted>true</vfModuleDeleted>" + EOL +
+ " <messageId>{{MESSAGE-ID}}</messageId>" + EOL +
+ "</deleteVfModuleResponse>" + EOL;
+
+ private final String vnfAdapterDeleteCallbackFail =
+ "<vfModuleException>" + EOL +
+ " <message>Error processing request to VNF-Async. Not Found.</message>" + EOL +
+ " <category>INTERNAL</category>" + EOL +
+ " <rolledBack>false</rolledBack>" + EOL +
+ " <messageId>{{MESSAGE-ID}}</messageId>" + EOL +
+ "</vfModuleException>" + EOL;
+
+ private final String sdncAdapterDeleteCallback =
+ "<output xmlns=\"com:att:sdnctl:l3api\">" + EOL +
+ " <svc-request-id>{{REQUEST-ID}}</svc-request-id>" + EOL +
+ " <ack-final-indicator>Y</ack-final-indicator>" + EOL +
+ "</output>" + EOL;
+
+ public DoDeleteVfModuleFromVnfTest() throws IOException {
+ callbacks.put("deactivate", sdncAdapterDeleteCallback);
+ callbacks.put("unassign", sdncAdapterDeleteCallback);
+ callbacks.put("vnfDelete", vnfAdapterDeleteCallback);
+ callbacks.put("vnfDeleteFail", vnfAdapterDeleteCallbackFail);
+ }
+
+ private final String wfeString = "WorkflowException";
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/DoDeleteVfModuleFromVnf.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/VnfAdapterRestV1.bpmn",
+ "subprocess/DeleteAAIVfModule.bpmn"
+ })
+ public void TestDoDeleteVfModuleFromVnfSuccess() {
+ // delete the Base Module and Generic Vnf
+ // vnf-id=a27ce5a9-29c4-4c22-a017-6615ac73c721, vf-module-id=973ed047-d251-4fb9-bf1a-65b8949e0a73
+ String request =
+ "<vnf-request xmlns=\"http://org.openecomp/mso/infra/vnf-request/v1\">" + EOL +
+ " <request-info>" + EOL +
+ " <action>DELETE_VF_MODULE</action>" + EOL +
+ " <source>PORTAL</source>" + EOL +
+ " </request-info>" + EOL +
+ " <vnf-inputs>" + EOL +
+ " <vnf-id>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnf-id>" + EOL +
+ " <vnf-name>STMTN5MMSC21</vnf-name>" + EOL +
+ " <vnf-type>asc_heat-int</vnf-type>" + EOL +
+ " <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</vf-module-id>" + EOL +
+ " <vf-module-name>STMTN5MMSC21-MMSC::module-0-0</vf-module-name>" + EOL +
+ " <service-id>00000000-0000-0000-0000-000000000000</service-id>" + EOL +
+ " <service-type>SDN-ETHERNET-INTERNET</service-type>" + EOL +
+ " <tenant-id>fba1bd1e195a404cacb9ce17a9b2b421</tenant-id>" + EOL +
+ " <orchestration-status>pending-delete</orchestration-status>" + EOL +
+ " <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>" + EOL +
+ " </vnf-inputs>" + EOL +
+ " <vnf-params xmlns:tns=\"http://org.openecomp/mso/infra/vnf-request/v1\"/>" + EOL +
+ "</vnf-request>" + EOL;
+ logStart();
+ MockDoDeleteVfModule_SDNCSuccess();
+ MockDoDeleteVfModule_DeleteVNFSuccess();
+ MockAAIGenericVnfSearch();
+ MockAAIDeleteVfModule();
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("isDebugLogEnabled","true");
+ variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
+ variables.put("msoRequestId", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
+ variables.put("serviceInstanceId", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
+ variables.put("vnfId", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
+ variables.put("vfModuleId", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
+ variables.put("lcpCloudRegionId", "RDM2WAGPLCP");
+ variables.put("tenantId", "fba1bd1e195a404cacb9ce17a9b2b421");
+ variables.put("sdncVersion", "1707");
+
+ invokeSubProcess("DoDeleteVfModuleFromVnf", businessKey, variables);
+
+ injectSDNCCallbacks(callbacks, "deactivate");
+ injectVNFRestCallbacks(callbacks, "vnfDelete");
+ //waitForRunningProcessCount("vnfAdapterDeleteV1", 0, 120000);
+ injectSDNCCallbacks(callbacks, "unassign");
+
+ waitForProcessEnd(businessKey, 10000);
+ WorkflowException wfe = (WorkflowException) getVariableFromHistory(businessKey, wfeString);
+ checkVariable(businessKey, wfeString, null);
+ if (wfe != null) {
+ System.out.println("TestDoDeleteVfModuleSuccess: ErrorCode=" + wfe.getErrorCode() +
+ ", ErrorMessage=" + wfe.getErrorMessage());
+ }
+ logEnd();
+ }
+
+
+ // start of mocks used locally and by other VF Module unit tests
+
+
+
+ public static void MockDoDeleteVfModule_SDNCSuccess() {
+ stubFor(post(urlEqualTo("/SDNCAdapter"))
+ .withRequestBody(containing("SvcAction>deactivate"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("DeleteGenericVNFV1/sdncAdapterResponse.xml")));
+ stubFor(post(urlEqualTo("/SDNCAdapter"))
+ .withRequestBody(containing("SvcAction>unassign"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("DeleteGenericVNFV1/sdncAdapterResponse.xml")));
+ }
+
+
+ public static void MockDoDeleteVfModule_DeleteVNFSuccess() {
+ stubFor(delete(urlMatching("/vnfs/v1/vnfs/.*/vf-modules/.*"))
+ .willReturn(aResponse()
+ .withStatus(202)
+ .withHeader("Content-Type", "application/xml")));
+ stubFor(delete(urlMatching("/vnfs/v1/volume-groups/78987"))
+ .willReturn(aResponse()
+ .withStatus(202)
+ .withHeader("Content-Type", "application/xml")));
+ }
+
+
+} \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleTest.java
index a3165f7ff3..3e1c498c58 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleTest.java
@@ -43,6 +43,7 @@ import org.junit.Assert;
import org.junit.Test;
import org.openecomp.mso.bpmn.common.WorkflowTest;
import org.openecomp.mso.bpmn.core.WorkflowException;
+import org.openecomp.mso.bpmn.mock.FileUtil;
/**
* Unit test for DoDeleteVfModule.bpmn.
@@ -77,7 +78,8 @@ public class DoDeleteVfModuleTest extends WorkflowTest {
public DoDeleteVfModuleTest() throws IOException {
callbacks.put("sdncChangeDelete", sdncAdapterDeleteCallback);
callbacks.put("sdncDelete", sdncAdapterDeleteCallback);
- callbacks.put("vnfDelete", vnfAdapterDeleteCallback);
+ callbacks.put("vnfDelete", FileUtil.readResourceFile(
+ "__files/DeleteVfModuleCallbackResponse.xml"));
callbacks.put("vnfDeleteFail", vnfAdapterDeleteCallbackFail);
}
@@ -182,12 +184,13 @@ public class DoDeleteVfModuleTest extends WorkflowTest {
variables.put("vfModuleName", "STMTN5MMSC21-MMSC::module-0-0");
variables.put("sdncVersion", "1610");
variables.put("isVidRequest", "true");
+ variables.put("retainResources", false);
String vfModuleModelInfo = "{" + "\"modelType\": \"vnf\"," +
- "\"modelInvariantId\": \"ff5256d2-5a33-55df-13ab-12abad84e7ff\"," +
- "\"modelNameVersionId\": \"fe6478e5-ea33-3346-ac12-ab121484a3fe\"," +
+ "\"modelInvariantUuid\": \"ff5256d2-5a33-55df-13ab-12abad84e7ff\"," +
+ "\"modelUuid\": \"fe6478e5-ea33-3346-ac12-ab121484a3fe\"," +
"\"modelName\": \"vSAMP12\"," +
"\"modelVersion\": \"1.0\"," +
- "\"modelCustomizationId\": \"MODEL-ID-1234\"," +
+ "\"modelCustomizationUuid\": \"MODEL-ID-1234\"," +
"}";
variables.put("vfModuleModelInfo", vfModuleModelInfo);
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleVolumeV2Test.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleVolumeV2Test.java
new file mode 100644
index 0000000000..01043100c1
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleVolumeV2Test.java
@@ -0,0 +1,198 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.bpmn.infrastructure;
+
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteVolumeGroupById;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkCloudRegion;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetVolumeGroupById;
+import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
+import static org.openecomp.mso.bpmn.mock.StubResponseVNFAdapter.mockPutVNFVolumeGroup;
+import static org.openecomp.mso.bpmn.mock.StubResponseVNFAdapter.mockVfModuleDelete;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import org.camunda.bpm.engine.test.Deployment;
+import org.junit.Test;
+import org.openecomp.mso.bpmn.common.WorkflowTest;
+import org.openecomp.mso.bpmn.core.WorkflowException;
+import org.openecomp.mso.bpmn.mock.FileUtil;
+
+public class DoDeleteVfModuleVolumeV2Test extends WorkflowTest {
+
+ private final CallbackSet callbacks = new CallbackSet();
+
+ public DoDeleteVfModuleVolumeV2Test() throws IOException {
+ callbacks.put("volumeGroupDelete", FileUtil.readResourceFile(
+ "__files/DeleteVfModuleVolumeInfraV1/DeleteVfModuleVolumeCallbackResponse.xml"));
+ }
+
+ @Test
+ //@Ignore
+ @Deployment(resources = {"subprocess/DoDeleteVfModuleVolumeV2.bpmn", "subprocess/VnfAdapterRestV1.bpmn"})
+ public void happyPath() throws Exception {
+
+ logStart();
+
+ MockGetNetworkCloudRegion("MDTWNJ21", "CreateNetworkV2/cloudRegion30_AAIResponse_Success.xml");
+ MockGetVolumeGroupById("RDM2WAGPLCP", "78987", "DeleteVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_Success.xml");
+ MockDeleteVolumeGroupById("RDM2WAGPLCP", "78987", "0000020", 200);
+ mockPutVNFVolumeGroup("78987", 202);
+ mockVfModuleDelete("78987");
+ MockDeleteVolumeGroupById("AAIAIC25", "78987", "0000020", 200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetVolumeGroupById("AAIAIC25", "78987", "VfModularity/VolumeGroup.xml");
+ String businessKey = UUID.randomUUID().toString();
+
+ Map<String, Object> testVariables = new HashMap<String, Object>();
+ testVariables.put("mso-request-id", "TEST-REQUEST-ID-0123");
+ testVariables.put("msoRequestId", "TEST-REQUEST-ID-0123");
+ testVariables.put("isDebugLogEnabled", "true");
+ //testVariables.put("lcpCloudRegionId", "MDTWNJ21");
+ //testVariables.put("tenantId", "fba1bd1e195a404cacb9ce17a9b2b421");
+ testVariables.put("volumeGroupId", "78987");
+ testVariables.put("serviceInstanceId", "test-service-instance-id-0123");
+
+ String cloudConfiguration = "{" +
+ "\"lcpCloudRegionId\": \"MDTWNJ21\"," +
+ "\"tenantId\": \"fba1bd1e195a404cacb9ce17a9b2b421\"" + "}";
+ testVariables.put("cloudConfiguration", cloudConfiguration);
+
+ invokeSubProcess("DoDeleteVfModuleVolumeV2", businessKey, testVariables);
+
+ injectVNFRestCallbacks(callbacks, "volumeGroupDelete");
+
+ waitForProcessEnd(businessKey, 100000);
+ checkVariable(businessKey, "wasDeleted", "true");
+
+ logEnd();
+ }
+
+
+ @Test
+ //@Ignore
+ @Deployment(resources = {"subprocess/DoDeleteVfModuleVolumeV2.bpmn", "subprocess/VnfAdapterRestV1.bpmn"})
+ public void testVolumeGroupInUse() throws Exception {
+
+ logStart();
+ MockGetNetworkCloudRegion("MDTWNJ21", "CreateNetworkV2/cloudRegion30_AAIResponse_Success.xml");
+ MockGetVolumeGroupById("RDM2WAGPLCP", "78987", "DeleteVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_HasVfModRelationship.xml");
+ MockDeleteVolumeGroupById("RDM2WAGPLCP", "78987", "0000020", 200);
+ mockVfModuleDelete("78987");
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ String businessKey = UUID.randomUUID().toString();
+
+ Map<String, Object> testVariables = new HashMap<String, Object>();
+ testVariables.put("mso-request-id", "TEST-REQUEST-ID-0123");
+ testVariables.put("msoRequestId", "TEST-REQUEST-ID-0123");
+ testVariables.put("isDebugLogEnabled", "true");
+ testVariables.put("volumeGroupId", "78987");
+ testVariables.put("serviceInstanceId", "test-service-instance-id-0123");
+
+ String cloudConfiguration = "{" +
+ "\"lcpCloudRegionId\": \"MDTWNJ21\"," +
+ "\"tenantId\": \"fba1bd1e195a404cacb9ce17a9b2b421\"" + "}";
+ testVariables.put("cloudConfiguration", cloudConfiguration);
+
+ invokeSubProcess("DoDeleteVfModuleVolumeV2", businessKey, testVariables);
+
+ waitForProcessEnd(businessKey, 100000);
+ checkVariable(businessKey, "wasDeleted", "false");
+ WorkflowException msoException = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException");
+ System.out.println("WorkflowException - Code: " + msoException.getErrorCode() + " Message: " + msoException.getErrorMessage());
+
+
+ logEnd();
+ }
+
+ @Test
+ //@Ignore
+ @Deployment(resources = {"subprocess/DoDeleteVfModuleVolumeV2.bpmn", "subprocess/VnfAdapterRestV1.bpmn"})
+ public void testTenantIdMismatch() throws Exception {
+
+ logStart();
+ MockGetNetworkCloudRegion("MDTWNJ21", "CreateNetworkV2/cloudRegion30_AAIResponse_Success.xml");
+ MockGetVolumeGroupById("RDM2WAGPLCP", "78987", "DeleteVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_Success.xml");
+ MockDeleteVolumeGroupById("RDM2WAGPLCP", "78987", "0000020", 200);
+ mockVfModuleDelete("78987", 404);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ String businessKey = UUID.randomUUID().toString();
+
+ Map<String, Object> testVariables = new HashMap<String, Object>();
+ testVariables.put("mso-request-id", "TEST-REQUEST-ID-0123");
+ testVariables.put("msoRequestId", "TEST-REQUEST-ID-0123");
+ testVariables.put("isDebugLogEnabled", "true");
+ testVariables.put("volumeGroupId", "78987");
+ testVariables.put("serviceInstanceId", "test-service-instance-id-0123");
+
+ String cloudConfiguration = "{" +
+ "\"lcpCloudRegionId\": \"MDTWNJ21\"," +
+ "\"tenantId\": \"fba1bd1e195a404cacb9ce17a9b2b421xxx\"" + "}";
+ testVariables.put("cloudConfiguration", cloudConfiguration);
+
+ invokeSubProcess("DoDeleteVfModuleVolumeV2", businessKey, testVariables);
+
+ waitForProcessEnd(businessKey, 100000);
+ checkVariable(businessKey, "wasDeleted", "false");
+ WorkflowException msoException = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException");
+ System.out.println("WorkflowException - Code: " + msoException.getErrorCode() + " Message: " + msoException.getErrorMessage());
+
+
+ logEnd();
+ }
+
+ @Test
+ //@Ignore
+ @Deployment(resources = {"subprocess/DoDeleteVfModuleVolumeV2.bpmn", "subprocess/VnfAdapterRestV1.bpmn"})
+ public void testVnfAdapterCallfail() throws Exception {
+
+ logStart();
+ MockGetNetworkCloudRegion("MDTWNJ21", "CreateNetworkV2/cloudRegion30_AAIResponse_Success.xml");
+ MockGetVolumeGroupById("RDM2WAGPLCP", "78987", "DeleteVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_Success.xml");
+ MockDeleteVolumeGroupById("RDM2WAGPLCP", "78987", "0000020", 200);
+ mockVfModuleDelete("78987", 404);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ String businessKey = UUID.randomUUID().toString();
+
+ Map<String, Object> testVariables = new HashMap<String, Object>();
+ testVariables.put("mso-request-id", "TEST-REQUEST-ID-0123");
+ testVariables.put("msoRequestId", "TEST-REQUEST-ID-0123");
+ testVariables.put("isDebugLogEnabled", "true");
+ testVariables.put("volumeGroupId", "78987");
+ testVariables.put("serviceInstanceId", "test-service-instance-id-0123");
+
+ String cloudConfiguration = "{" +
+ "\"lcpCloudRegionId\": \"MDTWNJ21\"," +
+ "\"tenantId\": \"fba1bd1e195a404cacb9ce17a9b2b421\"" + "}";
+ testVariables.put("cloudConfiguration", cloudConfiguration);
+
+ invokeSubProcess("DoDeleteVfModuleVolumeV2", businessKey, testVariables);
+
+ waitForProcessEnd(businessKey, 100000);
+ checkVariable(businessKey, "wasDeleted", "false");
+ WorkflowException msoException = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException");
+ System.out.println("WorkflowException - Code: " + msoException.getErrorCode() + " Message: " + msoException.getErrorMessage());
+
+ logEnd();
+ }
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVnfAndModulesTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVnfAndModulesTest.java
new file mode 100644
index 0000000000..585c26d801
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVnfAndModulesTest.java
@@ -0,0 +1,190 @@
+package org.openecomp.mso.bpmn.infrastructure;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.containing;
+import static com.github.tomakehurst.wiremock.client.WireMock.delete;
+import static com.github.tomakehurst.wiremock.client.WireMock.post;
+import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
+import static org.junit.Assert.assertEquals;
+import static org.openecomp.mso.bpmn.common.DeleteAAIVfModuleTest.MockAAIDeleteVfModule;
+import static org.openecomp.mso.bpmn.common.DeleteAAIVfModuleTest.MockAAIGenericVnfSearch;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteGenericVnf;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfById;
+import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
+import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import org.camunda.bpm.engine.test.Deployment;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.openecomp.mso.bpmn.common.BPMNUtil;
+import org.openecomp.mso.bpmn.common.WorkflowTest;
+import org.openecomp.mso.bpmn.mock.FileUtil;
+
+public class DoDeleteVnfAndModulesTest extends WorkflowTest {
+ private final CallbackSet callbacks = new CallbackSet();
+ private static final String EOL = "\n";
+ private final String vnfAdapterDeleteCallback =
+ "<deleteVfModuleResponse>" + EOL +
+ " <vnfId>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnfId>" + EOL +
+ " <vfModuleId>973ed047-d251-4fb9-bf1a-65b8949e0a73</vfModuleId>" + EOL +
+ " <vfModuleDeleted>true</vfModuleDeleted>" + EOL +
+ " <messageId>{{MESSAGE-ID}}</messageId>" + EOL +
+ "</deleteVfModuleResponse>" + EOL;
+
+ public DoDeleteVnfAndModulesTest () throws IOException {
+ callbacks.put("deactivate", FileUtil.readResourceFile(
+ "__files/VfModularity/SDNCTopologyActivateCallback.xml"));
+ callbacks.put("unassign", FileUtil.readResourceFile(
+ "__files/VfModularity/SDNCTopologyActivateCallback.xml"));
+ callbacks.put("vnfDelete", vnfAdapterDeleteCallback);
+
+ }
+
+ @Test
+ @Deployment(resources = {"subprocess/DoDeleteVnfAndModules.bpmn", "subprocess/SDNCAdapterV1.bpmn", "subprocess/GenericGetVnf.bpmn", "subprocess/GenericDeleteVnf.bpmn", "subprocess/DoDeleteVnf.bpmn", "subprocess/DoDeleteVfModule.bpmn"})
+ public void testDoDeleteVnfAndModules_successVnfOnly() throws Exception{
+ MockGetGenericVnfById("testVnfId123.*", "GenericFlows/getGenericVnfByNameResponse.xml");
+ MockDeleteGenericVnf("testVnfId123", "testReVer123");
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ mockSDNCAdapter(200);
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<String, Object>();
+ setVariablesVnfOnly(variables);
+ invokeSubProcess("DoDeleteVnfAndModules", businessKey, variables);
+
+ injectSDNCCallbacks(callbacks, "deactivate");
+ injectSDNCCallbacks(callbacks, "unassign");
+
+ waitForProcessEnd(businessKey, 10000);
+
+ Assert.assertTrue(isProcessEnded(businessKey));
+
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnfAndModules", "WorkflowException");
+
+ assertEquals(null, workflowException);
+ }
+
+
+ private void setVariablesVnfOnly(Map<String, Object> variables) {
+ variables.put("mso-request-id", "testRequestId123");
+ variables.put("isDebugLogEnabled", "true");
+ variables.put("vnfId","testVnfId123");
+ variables.put("serviceInstanceId", "MIS%2F1604%2F0026%2FSW_INTERNET");
+ //variables.put("vnfName", "testVnfName123");
+ variables.put("disableRollback", "true");
+ variables.put("msoRequestId", "testVnfId123");
+ variables.put("testVnfId","testVnfId123");
+ //variables.put("vnfType", "STMTN");
+ variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
+ String vnfModelInfo = "{ "+ "\"modelType\": \"vnf\"," +
+ "\"modelInvariantUuid\": \"ff5256d2-5a33-55df-13ab-12abad84e7ff\"," +
+ "\"modelUuid\": \"fe6478e5-ea33-3346-ac12-ab121484a3fe\"," +
+ "\"modelName\": \"vSAMP12\"," +
+ "\"modelVersion\": \"1.0\"," +
+ "\"modelCustomizationUuid\": \"MODEL-ID-1234\"," +
+ "}";
+ //variables.put("vnfModelInfo", vnfModelInfo);
+
+ variables.put("lcpCloudRegionId", "mdt1");
+ variables.put("tenantId", "88a6ca3ee0394ade9403f075db23167e");
+
+ String serviceModelInfo = "{ "+ "\"modelType\": \"service\"," +
+ "\"modelInvariantUuid\": \"995256d2-5a33-55df-13ab-12abad84e7ff\"," +
+ "\"modelUuid\": \"ab6478e5-ea33-3346-ac12-ab121484a3fe\"," +
+ "\"modelName\": \"ServicevSAMP12\"," +
+ "\"modelVersion\": \"1.0\"," +
+ "}";
+ //variables.put("serviceModelInfo", serviceModelInfo);
+ variables.put("globalSubscriberId", "MSO-1610");
+ variables.put("sdncVersion", "1707");
+
+ }
+
+ @Test
+ @Deployment(resources = {"subprocess/DoDeleteVnfAndModules.bpmn", "subprocess/SDNCAdapterV1.bpmn", "subprocess/GenericGetVnf.bpmn", "subprocess/GenericDeleteVnf.bpmn", "subprocess/DoDeleteVnf.bpmn", "subprocess/DoDeleteVfModuleFromVnf.bpmn", "subprocess/VnfAdapterRestV1.bpmn", "subprocess/DeleteAAIVfModule.bpmn"})
+ public void testDoDeleteVnfAndModules_successVnfAndModules() throws Exception{
+ MockAAIGenericVnfSearch();
+ MockGetGenericVnfById("testVnfId123.*", "GenericFlows/getGenericVnfByNameResponse.xml");
+ MockDeleteGenericVnf("testVnfId123", "testReVer123");
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ mockSDNCAdapter(200);
+ MockDoDeleteVfModule_SDNCSuccess();
+ MockDoDeleteVfModule_DeleteVNFSuccess();
+ MockAAIDeleteVfModule();
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<String, Object>();
+ setVariablesVnfAndModules(variables);
+ invokeSubProcess("DoDeleteVnfAndModules", businessKey, variables);
+
+ injectSDNCCallbacks(callbacks, "deactivate");
+ injectSDNCCallbacks(callbacks, "deactivate");
+ injectVNFRestCallbacks(callbacks, "vnfDelete");
+ injectSDNCCallbacks(callbacks, "unassign");
+ MockGetGenericVnfById("a27ce5a9-29c4-4c22-a017-6615ac73c721", "GenericFlows/getGenericVnfByNameResponse.xml");
+ injectSDNCCallbacks(callbacks, "unassign");
+ //MockGetGenericVnfById("a27ce5a9-29c4-4c22-a017-6615ac73c721", "GenericFlows/getGenericVnfByNameResponse.xml");
+
+ waitForProcessEnd(businessKey, 10000);
+
+ Assert.assertTrue(isProcessEnded(businessKey));
+
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnfAndModules", "WorkflowException");
+
+ assertEquals(null, workflowException);
+ }
+
+
+ private void setVariablesVnfAndModules(Map<String, Object> variables) {
+ variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
+ variables.put("isDebugLogEnabled", "true");
+ variables.put("vnfId","a27ce5a9-29c4-4c22-a017-6615ac73c721");
+ variables.put("serviceInstanceId", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
+
+ variables.put("msoRequestId", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
+ //variables.put("testVnfId","testVnfId123");
+
+ variables.put("lcpCloudRegionId", "RDM2WAGPLCP");
+ variables.put("tenantId", "fba1bd1e195a404cacb9ce17a9b2b421");
+
+ variables.put("sdncVersion", "1707");
+
+ }
+
+
+ public static void MockDoDeleteVfModule_SDNCSuccess() {
+ stubFor(post(urlEqualTo("/SDNCAdapter"))
+ .withRequestBody(containing("SvcAction>deactivate"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("DeleteGenericVNFV1/sdncAdapterResponse.xml")));
+ stubFor(post(urlEqualTo("/SDNCAdapter"))
+ .withRequestBody(containing("SvcAction>unassign"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("DeleteGenericVNFV1/sdncAdapterResponse.xml")));
+ }
+
+
+ public static void MockDoDeleteVfModule_DeleteVNFSuccess() {
+ stubFor(delete(urlMatching("/vnfs/v1/vnfs/.*/vf-modules/.*"))
+ .willReturn(aResponse()
+ .withStatus(202)
+ .withHeader("Content-Type", "application/xml")));
+ stubFor(delete(urlMatching("/vnfs/v1/volume-groups/78987"))
+ .willReturn(aResponse()
+ .withStatus(202)
+ .withHeader("Content-Type", "application/xml")));
+ }
+} \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoUpdateVfModuleTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoUpdateVfModuleTest.java
index bba6f62adc..fa0bc4985c 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoUpdateVfModuleTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoUpdateVfModuleTest.java
@@ -22,10 +22,19 @@ package org.openecomp.mso.bpmn.infrastructure;
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.post;
+import static com.github.tomakehurst.wiremock.client.WireMock.put;
+import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockAAIVfModule;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithDepth;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithPriority;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetVfModuleIdNoResponse;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetVolumeGroupById;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchGenericVnf;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchVfModuleId;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutGenericVnf;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutVfModuleIdNoResponse;
import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
@@ -41,7 +50,6 @@ import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.openecomp.mso.bpmn.common.WorkflowTest;
-import org.openecomp.mso.bpmn.common.WorkflowTest.CallbackSet;
import org.openecomp.mso.bpmn.mock.FileUtil;
/**
@@ -112,5 +120,125 @@ public class DoUpdateVfModuleTest extends WorkflowTest {
logEnd();
}
+
+ /**
+ * Test the happy path through the flow with Building Blocks interface.
+ */
+ @Test
+
+ @Deployment(resources = {
+ "subprocess/DoUpdateVfModule.bpmn",
+ "subprocess/PrepareUpdateAAIVfModule.bpmn",
+ "subprocess/ConfirmVolumeGroupTenant.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/VnfAdapterRestV1.bpmn",
+ "subprocess/UpdateAAIGenericVnf.bpmn",
+ "subprocess/UpdateAAIVfModule.bpmn"
+ })
+ public void happyPathBB() throws IOException {
+
+ logStart();
+
+ MockAAIVfModule();
+ MockPatchGenericVnf("skask");
+ MockPatchVfModuleId("skask", ".*");
+ MockSDNCAdapterVfModule();
+ MockVNFAdapterRestVfModule();
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("mso-request-id", "DEV-VF-0011");
+ variables.put("isDebugLogEnabled","true");
+ variables.put("msoRequestId", "DEV-VF-0011");
+ variables.put("isBaseVfModule", "false");
+ variables.put("isDebugLogEnabled", "true");
+ variables.put("disableRollback", "true");
+ variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
+ variables.put("vnfId", "skask");
+ variables.put("vfModuleId", "supercool");
+ variables.put("vnfType", "pcrf-capacity");
+ variables.put("isVidRequest", "true");
+ variables.put("volumeGroupId", "78987");
+ variables.put("usePreload", true);
+
+ variables.put("sdncVersion", "1702");
+
+ variables.put("lcpCloudRegionId", "MDTWNJ21");
+ variables.put("tenantId", "fba1bd1e195a404cacb9ce17a9b2b421");
+
+ String vfModuleModelInfo = "{ "+ "\"modelType\": \"vfModule\"," +
+ "\"modelInvariantUuid\": \"introvert\"," +
+ "\"modelUuid\": \"3.14\"," +
+ "\"modelName\": \"STMTN5MMSC21-MMSC::model-1-0\"," +
+ "\"modelVersion\": \"1\"," +
+ "\"modelCustomizationUuid\": \"MODEL-123\"" + "}";
+ variables.put("vfModuleModelInfo", vfModuleModelInfo);
+
+ String vnfModelInfo = "{ "+ "\"modelType\": \"vnf\"," +
+ "\"modelInvariantUuid\": \"introvert\"," +
+ "\"modelUuid\": \"3.14\"," +
+ "\"modelName\": \"VNF-STMTN5MMSC21-MMSC::model-1-0\"," +
+ "\"modelVersion\": \"1\"," +
+ "\"modelCustomizationUuid\": \"VNF-MODEL-123\"" + "}";
+ variables.put("vnfModelInfo", vnfModelInfo);
+
+ invokeSubProcess("DoUpdateVfModule", businessKey, variables);
+
+ injectSDNCCallbacks(callbacks, "changeassign, query");
+ injectVNFRestCallbacks(callbacks, "vnfUpdate");
+ injectSDNCCallbacks(callbacks, "activate");
+
+ waitForProcessEnd(businessKey, 10000);
+
+ Assert.assertTrue(isProcessEnded(businessKey));
+ checkVariable(businessKey, "DoUpdateVfModuleSuccessIndicator", true);
+
+ String heatStackId = (String) getVariableFromHistory(businessKey, "DOUPVfMod_heatStackId");
+ System.out.println("Heat stack Id from AAI: " + heatStackId);
+
+ logEnd();
+ }
+
+ // start of mocks used locally and by other VF Module unit tests
+ public static void MockSDNCAdapterVfModule() {
+ // simplified the implementation to return "success" for all requests
+ stubFor(post(urlEqualTo("/SDNCAdapter"))
+// .withRequestBody(containing("SvcInstanceId><"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("VfModularity/StandardSDNCSynchResponse.xml")));
+// stubFor(post(urlEqualTo("/SDNCAdapter"))
+// .withRequestBody(containing("vnf-type>STMTN"))
+// .willReturn(aResponse()
+// .withStatus(200)
+// .withHeader("Content-Type", "text/xml")
+// .withBodyFile("VfModularity/StandardSDNCSynchResponse.xml")));
+// stubFor(post(urlEqualTo("/SDNCAdapter"))
+// .withRequestBody(containing("SvcAction>query"))
+// .willReturn(aResponse()
+// .withStatus(200)
+// .withHeader("Content-Type", "text/xml")
+// .withBodyFile("VfModularity/StandardSDNCSynchResponse.xml")));
+ }
+
+ public static void MockVNFAdapterRestVfModule() {
+ stubFor(put(urlEqualTo("/vnfs/v1/vnfs/skask/vf-modules/supercool"))
+ .willReturn(aResponse()
+ .withStatus(202)
+ .withHeader("Content-Type", "application/xml")));
+ stubFor(post(urlMatching("/vnfs/v1/vnfs/.*/vf-modules"))
+ .willReturn(aResponse()
+ .withStatus(202)
+ .withHeader("Content-Type", "application/xml")));
+ stubFor(post(urlEqualTo("/vnfs/v1/vnfs/skask/vf-modules"))
+ .willReturn(aResponse()
+ .withStatus(202)
+ .withHeader("Content-Type", "application/xml")));
+ stubFor(put(urlEqualTo("/vnfs/v1/volume-groups/78987"))
+ .willReturn(aResponse()
+ .withStatus(202)
+ .withHeader("Content-Type", "application/xml")));
+ }
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoUpdateVnfAndModulesTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoUpdateVnfAndModulesTest.java
new file mode 100644
index 0000000000..b7650af4b8
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoUpdateVnfAndModulesTest.java
@@ -0,0 +1,206 @@
+package org.openecomp.mso.bpmn.infrastructure;
+
+import static org.junit.Assert.assertEquals;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockAAIVfModule;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDBUpdateVfModule;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithDepth;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfById_404;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchGenericVnf;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchVfModuleId;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutGenericVnf;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockSDNCAdapterVfModule;
+import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
+import static org.openecomp.mso.bpmn.mock.StubResponseVNFAdapter.mockVNFPut;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockVNFAdapterRestVfModule;
+import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import org.camunda.bpm.engine.test.Deployment;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.openecomp.mso.bpmn.common.BPMNUtil;
+import org.openecomp.mso.bpmn.common.WorkflowTest;
+import org.openecomp.mso.bpmn.core.domain.ModelInfo;
+import org.openecomp.mso.bpmn.core.domain.ModuleResource;
+import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition;
+import org.openecomp.mso.bpmn.core.domain.VnfResource;
+import org.openecomp.mso.bpmn.mock.FileUtil;
+
+/**
+ * Unit Test for the DoUpdateVnfAndModules Flow
+ *
+ */
+public class DoUpdateVnfAndModulesTest extends WorkflowTest {
+
+ private final CallbackSet callbacks = new CallbackSet();
+
+ public DoUpdateVnfAndModulesTest() throws IOException {
+
+ callbacks.put("changeassign", FileUtil.readResourceFile(
+ "__files/VfModularity/SDNCTopologyChangeAssignCallback.xml"));
+ callbacks.put("activate", FileUtil.readResourceFile(
+ "__files/VfModularity/SDNCTopologyActivateCallback.xml"));
+ callbacks.put("query", FileUtil.readResourceFile(
+ "__files/VfModularity/SDNCTopologyQueryCallback.xml"));
+ callbacks.put("vnfUpdate", FileUtil.readResourceFile(
+ "__files/VfModularity/VNFAdapterRestUpdateCallback.xml"));
+ }
+
+ @Test
+
+ @Deployment(resources = {
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/PrepareUpdateAAIVfModule.bpmn",
+ "subprocess/DoUpdateVfModule.bpmn",
+ "subprocess/DoUpdateVnfAndModules.bpmn",
+ "subprocess/VnfAdapterRestV1.bpmn",
+ "subprocess/ConfirmVolumeGroupTenant.bpmn",
+ "subprocess/UpdateAAIVfModule.bpmn",
+ "subprocess/UpdateAAIGenericVnf.bpmn"})
+ public void testDoUpdateVnfAndModules_success() throws Exception{
+
+ MockNodeQueryServiceInstanceById("MIS%2F1604%2F0026%2FSW_INTERNET", "GenericFlows/getSIUrlByIdVipr.xml");
+ MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
+ //MockGetGenericVnfById_404("testVnfId");
+ MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
+ MockPutGenericVnf(".*");
+ MockAAIVfModule();
+ MockPatchGenericVnf("skask");
+ MockPatchVfModuleId("skask", ".*");
+ mockSDNCAdapter("VfModularity/StandardSDNCSynchResponse.xml");
+ mockVNFPut("skask", "/supercool", 202);
+ mockVNFPut("skask", "/lukewarm", 202);
+ MockVNFAdapterRestVfModule();
+ MockDBUpdateVfModule();
+
+ mockSDNCAdapter("VfModularity/StandardSDNCSynchResponse.xml");
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<String, Object>();
+ setVariablesSuccess(variables, "", "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
+ invokeSubProcess("DoUpdateVnfAndModules", businessKey, variables);
+
+ injectSDNCCallbacks(callbacks, "changeassign, query");
+ injectVNFRestCallbacks(callbacks, "vnfUpdate");
+ injectSDNCCallbacks(callbacks, "activate");
+ injectSDNCCallbacks(callbacks, "changeassign, query");
+ injectVNFRestCallbacks(callbacks, "vnfUpdate");
+ injectSDNCCallbacks(callbacks, "activate");
+ waitForProcessEnd(businessKey, 10000);
+
+ Assert.assertTrue(isProcessEnded(businessKey));
+ assertVariables("2", "200", null);
+
+ }
+
+
+
+ private void assertVariables(String exModuleCount, String exVnfFound, String exWorkflowException) {
+
+ String moduleCount = BPMNUtil.getVariable(processEngineRule, "DoUpdateVnfAndModules", "DUVAM_moduleCount");
+ String vnfFound = BPMNUtil.getVariable(processEngineRule, "DoUpdateVnfAndModules", "DUVAM_queryAAIVfModuleResponseCode");
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "DoUpdateVnfAndModules", "SavedWorkflowException1");
+
+ assertEquals(exModuleCount, moduleCount);
+ assertEquals(exVnfFound, vnfFound);
+ assertEquals(exWorkflowException, workflowException);
+ }
+
+ private void setVariables(Map<String, String> variables, String request, String requestId, String siId) {
+ variables.put("isDebugLogEnabled", "true");
+ variables.put("bpmnRequest", request);
+ variables.put("msoRequestUdid", requestId);
+ variables.put("serviceInstanceId",siId);
+ variables.put("testVnfId","testVnfId123");
+ variables.put("vnfType", "STMTN");
+
+ }
+
+ private void setVariablesSuccess(Map<String, Object> variables, String request, String requestId, String siId) {
+ variables.put("isDebugLogEnabled", "true");
+ variables.put("requestId", requestId);
+ variables.put("msoRequestId", requestId);
+ variables.put("serviceInstanceId",siId);
+ variables.put("disableRollback", "true");
+ //variables.put("testVnfId","testVnfId123");
+ variables.put("vnfType", "STMTN");
+ variables.put("vnfId", "skask");
+ variables.put("tenantId", "88a6ca3ee0394ade9403f075db23167e");
+ variables.put("lcpCloudRegionId", "mdt1");
+
+ String serviceModelInfo = "{ "+ "\"modelType\": \"service\"," +
+ "\"modelInvariantUuid\": \"995256d2-5a33-55df-13ab-12abad84e7ff\"," +
+ "\"modelUuid\": \"ab6478e5-ea33-3346-ac12-ab121484a3fe\"," +
+ "\"modelName\": \"ServicevSAMP12\"," +
+ "\"modelVersion\": \"1.0\"," +
+ "}";
+ variables.put("serviceModelInfo", serviceModelInfo);
+ variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
+ String vnfModelInfo = "{" + "\"modelType\": \"vnf\"," +
+ "\"modelInvariantUuid\": \"ff5256d2-5a33-55df-13ab-12abad84e7ff\"," +
+ "\"modelUuid\": \"fe6478e5-ea33-3346-ac12-ab121484a3fe\"," +
+ "\"modelName\": \"vSAMP12\"," +
+ "\"modelVersion\": \"1.0\"," +
+ "\"modelCustomizationUuid\": \"MODEL-ID-1234\"" + "}";
+ variables.put("vnfModelInfo", vnfModelInfo);
+
+ String cloudConfiguration = "{" + "\"cloudConfiguration\": { " +
+ "\"lcpCloudRegionId\": \"mdt1\"," +
+ "\"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\"" + "}}";
+ variables.put("cloudConfiguration", cloudConfiguration);
+ variables.put("sdncVersion", "1702");
+ variables.put("globalSubscriberId", "subscriber123");
+ variables.put("asdcServiceModelVersion", "serviceVersion01");
+
+ try {
+ VnfResource vr = new VnfResource();
+ ModelInfo mvr = new ModelInfo();
+ mvr.setModelName("vSAMP12");
+ mvr.setModelInstanceName("v123");
+ mvr.setModelInvariantUuid("extrovert");
+ mvr.setModelVersion("1.0");
+ mvr.setModelCustomizationUuid("MODEL-ID-1234");
+ vr.setModelInfo(mvr);
+ vr.constructVnfType("vnf1");
+ vr.setNfType("somenftype");
+ vr.setNfRole("somenfrole");
+ vr.setNfFunction("somenffunction");
+ vr.setNfNamingCode("somenamingcode");
+ ModuleResource mr = new ModuleResource();
+ ModelInfo mvmr = new ModelInfo();
+ mvmr.setModelInvariantUuid("introvert");
+ mvmr.setModelName("STMTN5MMSC21-MMSC::model-1-0");
+ mvmr.setModelVersion("1");
+ mvmr.setModelCustomizationUuid("MODEL-123");
+ mr.setModelInfo(mvmr);
+ mr.setIsBase(true);
+ mr.setVfModuleLabel("MODULELABEL");
+ vr.addVfModule(mr);
+ ModuleResource mr1 = new ModuleResource();
+ ModelInfo mvmr1 = new ModelInfo();
+ mvmr1.setModelInvariantUuid("extrovert");
+ mvmr1.setModelName("SECONDMODELNAME");
+ mvmr1.setModelVersion("1");
+ mvmr1.setModelCustomizationUuid("MODEL-123");
+ mr1.setModelInfo(mvmr1);
+ mr1.setIsBase(false);
+ mr1.setVfModuleLabel("MODULELABEL1");
+ vr.addVfModule(mr1);
+ variables.put("vnfResourceDecomposition", vr);
+ variables.put("isTest", true);
+ } catch(Exception e) {
+
+ }
+
+ }
+
+
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/ReplaceVnfInfraTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/ReplaceVnfInfraTest.java
new file mode 100644
index 0000000000..acccbf5788
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/ReplaceVnfInfraTest.java
@@ -0,0 +1,259 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.bpmn.infrastructure;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.containing;
+import static com.github.tomakehurst.wiremock.client.WireMock.delete;
+import static com.github.tomakehurst.wiremock.client.WireMock.post;
+import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
+import static org.openecomp.mso.bpmn.common.DeleteAAIVfModuleTest.MockAAIDeleteVfModule;
+import static org.openecomp.mso.bpmn.common.DeleteAAIVfModuleTest.MockAAIGenericVnfSearch;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockAAIVfModule;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDBUpdateVfModule;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteGenericVnf;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteVfModuleId;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfById;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithDepth;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithPriority;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetPserverByVnfId;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfsByVnfId;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchGenericVnf;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchVfModuleId;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutGenericVnf;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutVfModuleIdNoResponse;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockVNFAdapterRestVfModule;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockSetInMaintFlagByVnfId;
+import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.MockGetServiceResourcesCatalogData;
+import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
+import static org.openecomp.mso.bpmn.mock.StubResponsePolicy.MockPolicyAbort;
+import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
+import static org.openecomp.mso.bpmn.mock.StubResponseVNFAdapter.mockVNFPut;
+import static org.openecomp.mso.bpmn.mock.StubResponsePolicy.MockPolicySkip;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import org.camunda.bpm.engine.test.Deployment;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.openecomp.mso.bpmn.common.WorkflowTest;
+import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse;
+import org.openecomp.mso.bpmn.mock.FileUtil;
+
+/**
+ * Unit test cases for UpdateVnfInfra.bpmn
+ */
+public class ReplaceVnfInfraTest extends WorkflowTest {
+
+ private final CallbackSet callbacks = new CallbackSet();
+ private static final String EOL = "\n";
+ private final String vnfAdapterDeleteCallback =
+ "<deleteVfModuleResponse>" + EOL +
+ " <vnfId>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnfId>" + EOL +
+ " <vfModuleId>973ed047-d251-4fb9-bf1a-65b8949e0a73</vfModuleId>" + EOL +
+ " <vfModuleDeleted>true</vfModuleDeleted>" + EOL +
+ " <messageId>{{MESSAGE-ID}}</messageId>" + EOL +
+ "</deleteVfModuleResponse>" + EOL;
+
+ public ReplaceVnfInfraTest() throws IOException {
+ callbacks.put("deactivate", FileUtil.readResourceFile(
+ "__files/VfModularity/SDNCTopologyActivateCallback.xml"));
+ callbacks.put("unassign", FileUtil.readResourceFile(
+ "__files/VfModularity/SDNCTopologyActivateCallback.xml"));
+ callbacks.put("vnfDelete", vnfAdapterDeleteCallback);
+ callbacks.put("changeassign", FileUtil.readResourceFile(
+ "__files/VfModularity/SDNCTopologyChangeAssignCallback.xml"));
+ callbacks.put("activate", FileUtil.readResourceFile(
+ "__files/VfModularity/SDNCTopologyActivateCallback.xml"));
+ callbacks.put("query", FileUtil.readResourceFile(
+ "__files/VfModularity/SDNCTopologyQueryCallback.xml"));
+ callbacks.put("vnfUpdate", FileUtil.readResourceFile(
+ "__files/VfModularity/VNFAdapterRestUpdateCallback.xml"));
+ }
+
+ /**
+ * Sunny day scenario.
+ *
+ * @throws Exception
+ */
+ @Test
+ @Ignore
+ @Deployment(resources = {
+ "process/ReplaceVnfInfra.bpmn",
+ "subprocess/DoDeleteVfModule.bpmn",
+ "subprocess/DoDeleteVnfAndModules.bpmn",
+ "subprocess/DeleteAAIVfModule.bpmn",
+ "subprocess/PrepareUpdateAAIVfModule.bpmn",
+ "subprocess/ConfirmVolumeGroupTenant.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/DoDeleteVnfAndModules.bpmn",
+ "subprocess/GenericDeleteVnf.bpmn",
+ "subprocess/DoDeleteVnf.bpmn",
+ "subprocess/DoDeleteVfModule.bpmn",
+ "subprocess/VnfAdapterRestV1.bpmn",
+ "subprocess/UpdateAAIGenericVnf.bpmn",
+ "subprocess/UpdateAAIVfModule.bpmn",
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/GenericGetVnf.bpmn",
+ "subprocess/GenericPutVnf.bpmn",
+ "subprocess/DoCreateVnf.bpmn",
+ "subprocess/GenerateVfModuleName.bpmn",
+ "subprocess/DoCreateVfModule.bpmn",
+ "subprocess/DoCreateVnfAndModules.bpmn",
+ "subprocess/ConfirmVolumeGroupName.bpmn",
+ "subprocess/CreateAAIVfModule.bpmn",
+ "subprocess/CreateAAIVfModuleVolumeGroup.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoCreateVnfAndModulesRollback.bpmn",
+ "subprocess/BuildingBlock/DecomposeService.bpmn",
+ "subprocess/BuildingBlock/RainyDayHandler.bpmn",
+ "subprocess/BuildingBlock/ManualHandling.bpmn"
+
+ })
+ public void sunnyDay() throws Exception {
+
+ logStart();
+ MockAAIGenericVnfSearch();
+ MockGetGenericVnfById("testVnfId123.*", "GenericFlows/getGenericVnfByNameResponse.xml");
+ MockDeleteGenericVnf("testVnfId123", "testReVer123");
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ mockSDNCAdapter(200);
+ MockDoDeleteVfModule_SDNCSuccess();
+ MockDoDeleteVfModule_DeleteVNFSuccess();
+ MockAAIDeleteVfModule();
+
+ MockNodeQueryServiceInstanceById("MIS%2F1604%2F0026%2FSW_INTERNET", "GenericFlows/getSIUrlByIdVipr.xml");
+ MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
+ //MockGetGenericVnfById_404("testVnfId");
+ MockGetServiceResourcesCatalogData("995256d2-5a33-55df-13ab-12abad84e7ff", "1.0", "VIPR/getCatalogServiceResourcesDataForReplaceVnfInfra.json");
+ //MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
+ //MockPutGenericVnf(".*");
+ MockAAIVfModule();
+ MockPatchGenericVnf("a27ce5a9-29c4-4c22-a017-6615ac73c721");
+ MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", ".*");
+ //mockSDNCAdapter("VfModularity/StandardSDNCSynchResponse.xml");
+ //mockVNFPut("skask", "/supercool", 202);
+ //mockVNFPut("skask", "/lukewarm", 202);
+ //MockVNFAdapterRestVfModule();
+ //MockDBUpdateVfModule();
+ //MockGetPserverByVnfId("skask", "AAI/AAI_pserverByVnfId.json", 200);
+ //MockGetGenericVnfsByVnfId("skask", "AAI/AAI_genericVnfsByVnfId.json", 200);
+ MockSetInMaintFlagByVnfId("skask", 200);
+ MockPolicySkip();
+
+ //mockSDNCAdapter("VfModularity/StandardSDNCSynchResponse.xml");
+ //mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ String updaetVnfRequest =
+ FileUtil.readResourceFile("__files/InfrastructureFlows/ReplaceVnf_VID_request.json");
+
+ Map<String, Object> variables = setupVariablesSunnyDayVID();
+
+
+ TestAsyncResponse asyncResponse = invokeAsyncProcess("ReplaceVnfInfra",
+ "v1", businessKey, updaetVnfRequest, variables);
+
+ WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
+
+ String responseBody = response.getResponse();
+ System.out.println("Workflow (Synch) Response:\n" + responseBody);
+
+ //injectSDNCCallbacks(callbacks, "deactivate");
+ //injectSDNCCallbacks(callbacks, "deactivate");
+ injectVNFRestCallbacks(callbacks, "vnfDelete");
+ //injectSDNCCallbacks(callbacks, "unassign");
+ MockGetGenericVnfById("a27ce5a9-29c4-4c22-a017-6615ac73c721", "GenericFlows/getGenericVnfByNameResponse.xml");
+ injectSDNCCallbacks(callbacks, "unassign");
+
+
+ injectSDNCCallbacks(callbacks, "changeassign, query");
+ injectVNFRestCallbacks(callbacks, "vnfUpdate");
+ injectSDNCCallbacks(callbacks, "activate");
+ injectSDNCCallbacks(callbacks, "changeassign, query");
+ injectVNFRestCallbacks(callbacks, "vnfUpdate");
+ injectSDNCCallbacks(callbacks, "activate");
+
+ // TODO add appropriate assertions
+
+ waitForProcessEnd(businessKey, 10000);
+ checkVariable(businessKey, "ReplaceVfModuleInfraSuccessIndicator", true);
+
+ logEnd();
+ }
+
+ // Active Scenario
+ private Map<String, Object> setupVariablesSunnyDayVID() {
+ Map<String, Object> variables = new HashMap<String, Object>();
+ //try {
+ // variables.put("bpmnRequest", FileUtil.readResourceFile("__files/CreateVfModule_VID_request.json"));
+ //}
+ //catch (Exception e) {
+
+ //}
+ //variables.put("mso-request-id", "testRequestId");
+ variables.put("requestId", "testRequestId");
+ variables.put("isDebugLogEnabled", "true");
+ variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
+ variables.put("vnfId", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
+ variables.put("vnfType", "vSAMP12");
+ variables.put("serviceType", "MOG");
+
+ return variables;
+
+ }
+
+ public static void MockDoDeleteVfModule_SDNCSuccess() {
+ stubFor(post(urlEqualTo("/SDNCAdapter"))
+ .withRequestBody(containing("SvcAction>deactivate"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("DeleteGenericVNFV1/sdncAdapterResponse.xml")));
+ stubFor(post(urlEqualTo("/SDNCAdapter"))
+ .withRequestBody(containing("SvcAction>unassign"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("DeleteGenericVNFV1/sdncAdapterResponse.xml")));
+ }
+
+
+ public static void MockDoDeleteVfModule_DeleteVNFSuccess() {
+ stubFor(delete(urlMatching("/vnfs/v1/vnfs/.*/vf-modules/.*"))
+ .willReturn(aResponse()
+ .withStatus(202)
+ .withHeader("Content-Type", "application/xml")));
+ stubFor(delete(urlMatching("/vnfs/v1/volume-groups/78987"))
+ .willReturn(aResponse()
+ .withStatus(202)
+ .withHeader("Content-Type", "application/xml")));
+ }
+
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateNetworkInstanceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateNetworkInstanceTest.java
new file mode 100644
index 0000000000..39cdd72375
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateNetworkInstanceTest.java
@@ -0,0 +1,468 @@
+package org.openecomp.mso.bpmn.infrastructure;
+
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.*;
+import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.MockUpdateRequestDB;
+import static org.openecomp.mso.bpmn.mock.StubResponseNetworkAdapter.MockNetworkAdapterRestPut;
+import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapterTopology;
+import static org.openecomp.mso.bpmn.common.BPMNUtil.executeAsyncWorkflow;
+import static org.openecomp.mso.bpmn.common.BPMNUtil.getVariable;
+import static org.junit.Assert.assertEquals;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.camunda.bpm.engine.test.Deployment;
+import org.junit.Assert;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.openecomp.mso.bpmn.common.BPMNUtil;
+import org.openecomp.mso.bpmn.common.WorkflowTest;
+import org.openecomp.mso.bpmn.common.WorkflowTestTransformer;
+import org.openecomp.mso.bpmn.common.SDNCAdapterCallbackRule;
+import org.openecomp.mso.bpmn.mock.SDNCAdapterNetworkTopologyMockTransformer;
+
+import com.github.tomakehurst.wiremock.extension.ResponseTransformer;
+
+/**
+ * Unit test cases for DoUpdateNetworkInstance.bpmn
+ *
+ */
+public class UpdateNetworkInstanceTest extends WorkflowTest {
+ @WorkflowTestTransformer
+ public static final ResponseTransformer sdncAdapterMockTransformer =
+ new SDNCAdapterNetworkTopologyMockTransformer();
+
+ @Rule
+ public final SDNCAdapterCallbackRule sdncAdapterCallbackRule =
+ new SDNCAdapterCallbackRule(processEngineRule);
+
+ /**
+ * End-to-End flow - Unit test for DoUpdateNetworkInstance.bpmn
+ * - String input & String response
+ */
+
+ @Test
+ //@Ignore
+ @Deployment(resources = {"process/UpdateNetworkInstance.bpmn",
+ "subprocess/DoUpdateNetworkInstance.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn"})
+
+ public void shouldInvokeServiceUpdateNetworkInstance_SuccessVID1() throws Exception {
+
+ System.out.println("----------------------------------------------------------");
+ System.out.println(" Success1 - UpdateNetworkInstance flow Started! ");
+ System.out.println("----------------------------------------------------------");
+
+ // setup simulators
+ mockSDNCAdapterTopology("UpdateNetworkV2mock/sdncUpdateNetworkTopologySimResponse.xml", "SvcAction>changeassign");
+ MockNetworkAdapterRestPut("UpdateNetworkV2/updateNetworkResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4");
+ MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP");
+ MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "UpdateNetworkV2/updateNetwork_queryNetworkId_AAIResponse_Success.xml", "1");
+ MockPutNetworkIdWithDepth("UpdateNetworkV2/updateNetwork_updateContrail_AAIResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "1");
+ MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
+ MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6");
+ MockGetNetworkPolicy("UpdateNetworkV2/updateNetwork_queryNetworkPolicy_AAIResponse_Success.xml", "cee6d136-e378-4678-a024-2cd15f0ee0cg");
+ MockGetNetworkTableReference("UpdateNetworkV2/updateNetwork_queryNetworkTableRef1_AAIResponse_Success.xml", "refFQDN1");
+ MockGetNetworkTableReference("UpdateNetworkV2/updateNetwork_queryNetworkTableRef2_AAIResponse_Success.xml", "refFQDN2");
+ MockUpdateRequestDB("DBUpdateResponse.xml");
+ //MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "UpdateNetworkV2/updateNetwork_queryInstance_Success.xml", "v8");
+ MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "UpdateNetworkV2/updateNetwork_queryInstance_Success.xml");
+
+ Map<String, String> variables = setupVariablesVID1();
+ //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "UpdateNetworkInstance", variables);
+ executeAsyncWorkflow(processEngineRule, "UpdateNetworkInstance", variables);
+ System.out.println("----------------------------------------------------------");
+ System.out.println("- got workflow response -");
+ System.out.println("----------------------------------------------------------");
+ //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+
+ assertEquals("true", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_Success"));
+ Assert.assertNotNull("UPDNI_CompleteMsoProcessRequest - ", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_CompleteMsoProcessRequest"));
+
+ String workflowResp = BPMNUtil.getVariable(processEngineRule, "UpdateNetworkInstance", "WorkflowResponse");
+ Assert.assertNotNull(workflowResp);
+
+ System.out.println("----------------------------------------------------------");
+ System.out.println(" Success1 - UpdateNetworkInstance flow Completed ");
+ System.out.println("----------------------------------------------------------");
+
+ }
+
+ @Test
+ //@Ignore
+ @Deployment(resources = {"process/UpdateNetworkInstance.bpmn",
+ "subprocess/DoUpdateNetworkInstance.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn"})
+
+ public void shouldInvokeServiceUpdateNetworkInstance_SuccessVIPER1() throws Exception {
+
+ System.out.println("----------------------------------------------------------");
+ System.out.println(" Success2 - UpdateNetworkInstance flow Started! ");
+ System.out.println("----------------------------------------------------------");
+
+ // setup simulators
+ mockSDNCAdapterTopology("UpdateNetworkV2mock/sdncUpdateNetworkTopologySimResponse.xml", "SvcAction>changeassign");
+ MockNetworkAdapterRestPut("UpdateNetworkV2/updateNetworkResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4");
+ MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP");
+ MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "UpdateNetworkV2/updateNetwork_queryNetworkId_AAIResponse_Success.xml", "1");
+ MockPutNetworkIdWithDepth("UpdateNetworkV2/updateNetwork_updateContrail_AAIResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "1");
+ MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
+ MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6");
+ MockGetNetworkPolicy("UpdateNetworkV2/updateNetwork_queryNetworkPolicy_AAIResponse_Success.xml", "cee6d136-e378-4678-a024-2cd15f0ee0cg");
+ MockGetNetworkTableReference("UpdateNetworkV2/updateNetwork_queryNetworkTableRef1_AAIResponse_Success.xml", "refFQDN1");
+ MockGetNetworkTableReference("UpdateNetworkV2/updateNetwork_queryNetworkTableRef2_AAIResponse_Success.xml", "refFQDN2");
+ MockUpdateRequestDB("DBUpdateResponse.xml");
+ //MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "UpdateNetworkV2/updateNetwork_queryInstance_Success.xml", "v8");
+ MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "UpdateNetworkV2/updateNetwork_queryInstance_Success.xml");
+
+ Map<String, String> variables = setupVariablesVIPER1();
+ //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "UpdateNetworkInstance", variables);
+ executeAsyncWorkflow(processEngineRule, "UpdateNetworkInstance", variables);
+ //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+
+ assertEquals("true", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_Success"));
+ Assert.assertNotNull("UPDNI_CompleteMsoProcessRequest - ", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_CompleteMsoProcessRequest"));
+
+ String completeMsoProcessRequest =
+ "<aetgt:MsoCompletionRequest xmlns:aetgt=\"http://org.openecomp/mso/workflow/schema/v1\"" + '\n'
+ + " xmlns:ns=\"http://org.openecomp/mso/request/types/v1\"" + '\n'
+ + " xmlns=\"http://org.openecomp/mso/infra/vnf-request/v1\">" + '\n'
+ + " <request-info>" + '\n'
+ + " <request-id>testRequestId</request-id>" + '\n'
+ + " <action>UPDATE</action>" + '\n'
+ + " <source>VID</source>" + '\n'
+ + " </request-info>" + '\n'
+ + " <aetgt:status-message>Network has been updated successfully.</aetgt:status-message>" + '\n'
+ + " <aetgt:mso-bpel-name>BPMN Network action: UPDATE</aetgt:mso-bpel-name>" + '\n'
+ + "</aetgt:MsoCompletionRequest>";
+
+ Assert.assertEquals(completeMsoProcessRequest, getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_CompleteMsoProcessRequest"));
+
+ System.out.println("----------------------------------------------------------");
+ System.out.println(" Success2 - UpdateNetworkInstance flow Completed ");
+ System.out.println("----------------------------------------------------------");
+
+ }
+
+
+ @Test
+ //@Ignore
+ @Deployment(resources = {"process/UpdateNetworkInstance.bpmn",
+ "subprocess/DoUpdateNetworkInstance.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn"})
+
+ public void shouldInvokeServiceUpdateNetworkInstance_MissingNetworkId() throws Exception {
+
+ System.out.println("--------------------------------------------------------------------");
+ System.out.println(" Missing networkId - UpdateNetworkInstance flow Started! ");
+ System.out.println("--------------------------------------------------------------------");
+
+ // setup simulators
+ MockUpdateRequestDB("DBUpdateResponse.xml");
+ //MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "UpdateNetworkV2/updateNetwork_queryInstance_Success.xml", "v8");
+ MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "UpdateNetworkV2/updateNetwork_queryInstance_Success.xml");
+
+ Map<String, String> variables = setupVariablesMissingNetworkId();
+ //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "UpdateNetworkInstance", variables);
+ executeAsyncWorkflow(processEngineRule, "UpdateNetworkInstance", variables);
+ //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+
+ assertEquals("false", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_Success"));
+ Assert.assertNotNull("UPDNI_FalloutHandlerRequest - ", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_FalloutHandlerRequest"));
+
+ String falloutHandlerActual = getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_FalloutHandlerRequest");
+ String falloutHandlerExpected =
+"<aetgt:FalloutHandlerRequest xmlns:aetgt=\"http://org.openecomp/mso/workflow/schema/v1\"" + "\n" +
+" xmlns:ns=\"http://org.openecomp/mso/request/types/v1\"" + "\n" +
+" xmlns:wfsch=\"http://org.openecomp/mso/workflow/schema/v1\">" + "\n" +
+" <request-info xmlns=\"http://org.openecomp/mso/infra/vnf-request/v1\">" + "\n" +
+" <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>" + "\n" +
+" <action>UPDATE</action>" + "\n" +
+" <source>VID</source>" + "\n" +
+" </request-info>" + "\n" +
+" <aetgt:WorkflowException xmlns:aetgt=\"http://org.openecomp/mso/workflow/schema/v1\">" + "\n" +
+" <aetgt:ErrorMessage>Variable 'network-id' value/element is missing.</aetgt:ErrorMessage>" + "\n" +
+" <aetgt:ErrorCode>7000</aetgt:ErrorCode>" + "\n" +
+" </aetgt:WorkflowException>" + "\n" +
+" </aetgt:FalloutHandlerRequest>";
+
+ assertEquals("Response", falloutHandlerExpected, falloutHandlerActual);
+
+ System.out.println("------------------------------------------------------------------");
+ System.out.println(" Missing networkId - UpdateNetworkInstance flow Completed ");
+ System.out.println("------------------------------------------------------------------");
+
+ }
+
+
+ @Test
+ //@Ignore
+ @Deployment(resources = {"process/UpdateNetworkInstance.bpmn",
+ "subprocess/DoUpdateNetworkInstance.bpmn",
+ "subprocess/DoUpdateNetworkInstanceRollback.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn"})
+
+ public void shouldInvokeServiceUpdateNetworkInstance_Network_SDNC_Rollback() throws Exception {
+
+ System.out.println("---------------------------------------------------------------");
+ System.out.println(" Network and SDNC Rollback - UpdateNetworkInstance flow Started! ");
+ System.out.println("---------------------------------------------------------------");
+
+ // setup simulators
+ mockSDNCAdapterTopology("UpdateNetworkV2mock/sdncUpdateNetworkTopologySimResponse.xml", "SvcAction>changeassign");
+ mockSDNCAdapterTopology("UpdateNetworkV2mock/sdncUpdateNetworkTopologySimResponse.xml", "SvcAction>rollback");
+ MockNetworkAdapterRestPut("UpdateNetworkV2/updateNetworkResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4");
+ MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP");
+ MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "UpdateNetworkV2/updateNetwork_queryNetworkId_AAIResponse_Success.xml", "1");
+ MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
+ MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6");
+ MockGetNetworkPolicy("UpdateNetworkV2/updateNetwork_queryNetworkPolicy_AAIResponse_Success.xml", "cee6d136-e378-4678-a024-2cd15f0ee0cg");
+ MockGetNetworkTableReference("UpdateNetworkV2/updateNetwork_queryNetworkTableRef1_AAIResponse_Success.xml", "refFQDN1");
+ MockGetNetworkTableReference("UpdateNetworkV2/updateNetwork_queryNetworkTableRef2_AAIResponse_Success.xml", "refFQDN2");
+ MockUpdateRequestDB("DBUpdateResponse.xml");
+ //MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "UpdateNetworkV2/updateNetwork_queryInstance_Success.xml", "v8");
+ MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "UpdateNetworkV2/updateNetwork_queryInstance_Success.xml");
+
+ Map<String, String> variables = setupVariablesVID1();
+ //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "UpdateNetworkInstance", variables);
+ executeAsyncWorkflow(processEngineRule, "UpdateNetworkInstance", variables);
+ //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+
+ assertEquals("false", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_Success"));
+ Assert.assertNotNull("UPDNI_FalloutHandlerRequest - ", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_FalloutHandlerRequest"));
+
+ System.out.println("---------------------------------------------------------------------");
+ System.out.println(" Network and SCNC Rollback - UpdateNetworkInstance flow Completed ");
+ System.out.println("---------------------------------------------------------------------");
+
+ }
+
+ // *****************
+ // Utility Section
+ // *****************
+
+ String networkModelInfo =
+ " {\"modelUuid\": \"mod-inst-uuid-123\", " + '\n' +
+ " \"modelName\": \"mod_inst_z_123\", " + '\n' +
+ " \"modelVersion\": \"1.0\", " + '\n' +
+ " \"modelCustomizationUuid\": \"mod-inst-uuid-123\", " + '\n' +
+ " \"modelInvariantUuid\": \"mod-invar-uuid-123\" " + '\n' +
+ " }";
+
+ String serviceModelInfo =
+ " {\"modelUuid\": \"36a3a8ea-49a6-4ac8-b06c-89a54544b9b6\", " + '\n' +
+ " \"modelName\": \"HNGW Protected OAM\", " + '\n' +
+ " \"modelVersion\": \"1.0\", " + '\n' +
+ " \"modelInvariantUuid\": \"fcc85cb0-ad74-45d7-a5a1-17c8744fdb71\" " + '\n' +
+ " }";
+
+ // Success Scenario
+ private Map<String, String> setupVariablesVID1() {
+ Map<String, String> variables = new HashMap<String, String>();
+ variables.put("bpmnRequest", getCreateNetworkRequest1());
+ variables.put("mso-request-id", "testRequestId");
+ variables.put("requestId", "testRequestId");
+ variables.put("isBaseVfModule", "true");
+ variables.put("recipeTimeout", "0");
+ variables.put("requestAction", "UPDATE");
+ variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
+ variables.put("vnfId", "");
+ variables.put("vfModuleId", "");
+ variables.put("volumeGroupId", "");
+ variables.put("networkId", "49c86598-f766-46f8-84f8-8d1c1b10f9b4");
+ variables.put("serviceType", "vMOG");
+ variables.put("vfModuleType", "");
+ variables.put("networkType", "modelName");
+ return variables;
+
+ }
+
+ public String getCreateNetworkRequest1() {
+
+ String request =
+ "{ \"requestDetails\": { " + '\n' +
+ " \"modelInfo\": { " + '\n' +
+ " \"modelType\": \"modelType\", " + '\n' +
+ " \"modelCustomizationId\": \"f21df226-8093-48c3-be7e-0408fcda0422\", " + '\n' +
+ " \"modelName\": \"CONTRAIL_EXTERNAL\", " + '\n' +
+ " \"modelVersion\": \"1.0\" " + '\n' +
+ " }, " + '\n' +
+ " \"cloudConfiguration\": { " + '\n' +
+ " \"lcpCloudRegionId\": \"RDM2WAGPLCP\", " + '\n' +
+ " \"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\" " + '\n' +
+ " }, " + '\n' +
+ " \"requestInfo\": { " + '\n' +
+ " \"instanceName\": \"MNS-25180-L-01-dmz_direct_net_1\", " + '\n' +
+ " \"source\": \"VID\", " + '\n' +
+ " \"callbackUrl\": \"\", " + '\n' +
+ " \"suppressRollback\": \"false\" ," + '\n' +
+ " \"productFamilyId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\" " + '\n' +
+ " }, " + '\n' +
+ " \"requestParameters\": { " + '\n' +
+ " \"backoutOnFailure\": true, " + '\n' +
+ " \"serviceId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\", " + '\n' +
+ " \"userParams\": [] " + '\n' +
+ " } " + '\n' +
+ " } " + '\n' +
+ "}";
+
+ return request;
+ }
+
+ public String getCreateNetworkRequest2() {
+
+ String request =
+ "{ \"requestDetails\": { " + '\n' +
+ " \"modelInfo\": { " + '\n' +
+ " \"modelType\": \"modelType\", " + '\n' +
+ " \"modelId\": \"modelId\", " + '\n' +
+ " \"modelNameVersionId\": \"modelNameVersionId\", " + '\n' +
+ " \"modelName\": \"CONTRAIL_EXTERNAL\", " + '\n' +
+ " \"modelVersion\": \"1\" " + '\n' +
+ " }, " + '\n' +
+ " \"cloudConfiguration\": { " + '\n' +
+ " \"lcpCloudRegionId\": \"RDM2WAGPLCP\", " + '\n' +
+ " \"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\" " + '\n' +
+ " }, " + '\n' +
+ " \"requestInfo\": { " + '\n' +
+ " \"instanceName\": \"myOwn_Network\", " + '\n' +
+ " \"source\": \"VID\", " + '\n' +
+ " \"callbackUrl\": \"\", " + '\n' +
+ " \"suppressRollback\": \"true\" ," + '\n' +
+ " \"productFamilyId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\" " + '\n' +
+ " }, " + '\n' +
+ " \"requestParameters\": { " + '\n' +
+ " \"backoutOnFailure\": true, " + '\n' +
+ " \"serviceId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\", " + '\n' +
+ " \"userParams\": [] " + '\n' +
+ " } " + '\n' +
+ " } " + '\n' +
+ "}";
+
+ return request;
+
+ }
+
+ // Success Scenario
+ private Map<String, String> setupVariablesVIPER1() {
+ Map<String, String> variables = new HashMap<String, String>();
+ variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");
+ variables.put("msoRequestId", "testRequestId");
+ variables.put("requestId", "testRequestId");
+ variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
+ variables.put("networkId", "49c86598-f766-46f8-84f8-8d1c1b10f9b4");
+ variables.put("networkName", "MNS-25180-L-01-dmz_direct_net_1");
+ variables.put("lcpCloudRegionId", "RDM2WAGPLCP");
+ variables.put("tenantId", "88a6ca3ee0394ade9403f075db23167e");
+ variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
+ variables.put("disableRollback", "false"); // macro
+ variables.put("failIfExists", "false");
+ //variables.put("sdncVersion", "1702");
+ variables.put("sdncVersion", "1707");
+ variables.put("subscriptionServiceType", "MSO-dev-service-type");
+ variables.put("globalSubscriberId", "globalId_45678905678");
+ variables.put("networkModelInfo", networkModelInfo);
+ variables.put("serviceModelInfo", serviceModelInfo);
+ return variables;
+
+ }
+
+ // Missing Name Scenario
+ private Map<String, String> setupVariablesMissingNetworkId() {
+ Map<String, String> variables = new HashMap<String, String>();
+ variables.put("mso-request-id", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");
+ variables.put("bpmnRequest", getCreateNetworkRequestNetworkId());
+ variables.put("requestId", "testRequestId");
+ variables.put("isBaseVfModule", "true");
+ variables.put("recipeTimeout", "0");
+ variables.put("requestAction", "UPDATE");
+ variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
+ variables.put("vnfId", "");
+ variables.put("vfModuleId", "");
+ variables.put("volumeGroupId", "");
+ //variables.put("networkId", "49c86598-f766-46f8-84f8-8d1c1b10f9b4"); // missing, ok
+ variables.put("serviceType", "vMOG");
+ variables.put("vfModuleType", "");
+ variables.put("networkType", "modelName");
+
+ return variables;
+
+ }
+
+ public String getCreateNetworkRequestNetworkId() {
+
+ String request =
+ "{ \"requestDetails\": { " + '\n' +
+ " \"modelInfo\": { " + '\n' +
+ " \"modelType\": \"modelType\", " + '\n' +
+ " \"modelId\": \"modelId\", " + '\n' +
+ " \"modelNameVersionId\": \"modelNameVersionId\", " + '\n' +
+ " \"modelName\": \"CONTRAIL_EXTERNAL\", " + '\n' +
+ " \"modelVersion\": \"1\" " + '\n' +
+ " }, " + '\n' +
+ " \"cloudConfiguration\": { " + '\n' +
+ " \"lcpCloudRegionId\": \"RDM2WAGPLCP\", " + '\n' +
+ " \"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\" " + '\n' +
+ " }, " + '\n' +
+ " \"requestInfo\": { " + '\n' +
+ " \"source\": \"VID\", " + '\n' +
+ " \"callbackUrl\": \"\", " + '\n' +
+ " \"suppressRollback\": \"true\" ," + '\n' +
+ " \"productFamilyId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\" " + '\n' +
+ " }, " + '\n' +
+ " \"requestParameters\": { " + '\n' +
+ " \"userParams\": [] " + '\n' +
+ " } " + '\n' +
+ " } " + '\n' +
+ "}";
+
+ return request;
+
+ }
+
+ public String getCreateNetworkRequestSDNCRollback() {
+
+ String request =
+ "{ \"requestDetails\": { " + '\n' +
+ " \"modelInfo\": { " + '\n' +
+ " \"modelType\": \"modelType\", " + '\n' +
+ " \"modelId\": \"modelId\", " + '\n' +
+ " \"modelNameVersionId\": \"modelNameVersionId\", " + '\n' +
+ " \"modelName\": \"CONTRAIL_EXTERNAL\", " + '\n' +
+ " \"modelVersion\": \"1\" " + '\n' +
+ " }, " + '\n' +
+ " \"cloudConfiguration\": { " + '\n' +
+ " \"lcpCloudRegionId\": \"RDM2WAGPLCP\", " + '\n' +
+ " \"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\" " + '\n' +
+ " }, " + '\n' +
+ " \"requestInfo\": { " + '\n' +
+ " \"instanceName\": \"MNS-25180-L-01-dmz_direct_net_3\", " + '\n' +
+ " \"source\": \"VID\", " + '\n' +
+ " \"callbackUrl\": \"\", " + '\n' +
+ " \"suppressRollback\": \"true\" ," + '\n' +
+ " \"productFamilyId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\" " + '\n' +
+ " }, " + '\n' +
+ " \"requestParameters\": { " + '\n' +
+ " \"userParams\": [] " + '\n' +
+ " } " + '\n' +
+ " } " + '\n' +
+ "}";
+
+
+ return request;
+ }
+
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleInfraV2Test.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleInfraV2Test.java
new file mode 100644
index 0000000000..3997d0aaa0
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleInfraV2Test.java
@@ -0,0 +1,119 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.bpmn.infrastructure;
+
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithDepth;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithPriority;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutVfModuleIdNoResponse;
+import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
+import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
+import static org.openecomp.mso.bpmn.mock.StubResponseVNFAdapter.mockVNFPut;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import org.camunda.bpm.engine.test.Deployment;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.openecomp.mso.bpmn.common.WorkflowTest;
+import org.openecomp.mso.bpmn.common.WorkflowTest.CallbackSet;
+import org.openecomp.mso.bpmn.common.WorkflowTest.TestAsyncResponse;
+import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse;
+import org.openecomp.mso.bpmn.mock.FileUtil;
+
+/**
+ * Unit test cases for UpdateVfModuleV2.bpmn
+ */
+public class UpdateVfModuleInfraV2Test extends WorkflowTest {
+
+ private final CallbackSet callbacks = new CallbackSet();
+
+ public UpdateVfModuleInfraV2Test() throws IOException {
+ /*callbacks.put("changeassign", FileUtil.readResourceFile(
+ "__files/VfModularity/SDNCTopologyChangeAssignCallback.xml"));
+ callbacks.put("query", FileUtil.readResourceFile(
+ "__files/VfModularity/SDNCTopologyQueryCallback.xml"));
+ callbacks.put("activate", FileUtil.readResourceFile(
+ "__files/VfModularity/SDNCTopologyActivateCallback.xml"));
+ callbacks.put("vnfUpdate", FileUtil.readResourceFile(
+ "__files/VfModularity/VNFAdapterRestUpdateCallback.xml"));*/
+ }
+
+ @Test
+ @Ignore // IGNORED FOR 1710 MERGE TO ONAP
+ @Deployment(resources = {
+ "process/UpdateVfModuleInfraV2.bpmn",
+ "subprocess/DoUpdateVfModule.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+ })
+
+ public void sunnyDay() throws Exception {
+ //logStart();
+
+
+ MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
+ MockPutVfModuleIdNoResponse("skask", "PCRF", "supercool");
+ MockGetGenericVnfByIdWithPriority("skask", "supercool", 200, "VfModularity/VfModule-supercool.xml", 1);
+ mockSDNCAdapter("/SDNCAdapter", "SvcInstanceId><", 200, "VfModularity/StandardSDNCSynchResponse.xml");
+ mockSDNCAdapter("/SDNCAdapter", "vnf-type>STMTN", 200, "VfModularity/StandardSDNCSynchResponse.xml");
+ mockSDNCAdapter("/SDNCAdapter", "SvcAction>query", 200, "VfModularity/StandardSDNCSynchResponse.xml");
+ mockVNFPut("skask", "/supercool", 202);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = setupVariablesSunnyDayVID();
+
+ String updateVfModuleRequest =
+ FileUtil.readResourceFile("__files/InfrastructureFlows/UpdateVfModule_VID_request.json");
+ TestAsyncResponse asyncResponse = invokeAsyncProcess("UpdateVfModuleInfraV2",
+ "v1", businessKey, updateVfModuleRequest, variables);
+
+ WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
+
+ //String responseBody = response.getResponse();
+ //System.out.println("Workflow (Synch) Response:\n" + responseBody);
+
+ //logEnd();
+ }
+
+ // Active Scenario
+ private Map<String, Object> setupVariablesSunnyDayVID() {
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("requestId", "testRequestId");
+ variables.put("isBaseVfModule", false);
+ variables.put("isDebugLogEnabled", "true");
+ variables.put("recipeTimeout", "0");
+ variables.put("requestAction", "UPDATE_VF_MODULE");
+ variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
+ variables.put("vnfId", "skask");
+ variables.put("vnfType", "vSAMP12");
+ variables.put("vfModuleId", "supercool");
+ variables.put("volumeGroupId", "");
+ variables.put("serviceType", "MOG");
+ variables.put("vfModuleType", "");
+ variables.put("moduleUuid", "fe6985cd-ea33-3346-ac12-ab121484a3fe");
+ return variables;
+
+ }
+
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVnfInfraTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVnfInfraTest.java
new file mode 100644
index 0000000000..496dab4f83
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVnfInfraTest.java
@@ -0,0 +1,174 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.bpmn.infrastructure;
+
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockAAIVfModule;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDBUpdateVfModule;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithDepth;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithPriority;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetPserverByVnfId;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfsByVnfId;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchGenericVnf;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchVfModuleId;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutGenericVnf;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutVfModuleIdNoResponse;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockVNFAdapterRestVfModule;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockSetInMaintFlagByVnfId;
+import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.MockGetServiceResourcesCatalogData;
+import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
+import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
+import static org.openecomp.mso.bpmn.mock.StubResponseVNFAdapter.mockVNFPut;
+import static org.openecomp.mso.bpmn.mock.StubResponsePolicy.MockPolicySkip;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import org.camunda.bpm.engine.test.Deployment;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.openecomp.mso.bpmn.common.WorkflowTest;
+import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse;
+import org.openecomp.mso.bpmn.mock.FileUtil;
+
+/**
+ * Unit test cases for UpdateVnfInfra.bpmn
+ */
+public class UpdateVnfInfraTest extends WorkflowTest {
+
+ private final CallbackSet callbacks = new CallbackSet();
+
+ public UpdateVnfInfraTest() throws IOException {
+ callbacks.put("changeassign", FileUtil.readResourceFile(
+ "__files/VfModularity/SDNCTopologyChangeAssignCallback.xml"));
+ callbacks.put("activate", FileUtil.readResourceFile(
+ "__files/VfModularity/SDNCTopologyActivateCallback.xml"));
+ callbacks.put("query", FileUtil.readResourceFile(
+ "__files/VfModularity/SDNCTopologyQueryCallback.xml"));
+ callbacks.put("vnfUpdate", FileUtil.readResourceFile(
+ "__files/VfModularity/VNFAdapterRestUpdateCallback.xml"));
+ }
+
+ /**
+ * Sunny day scenario.
+ *
+ * @throws Exception
+ */
+ @Test
+ @Ignore // IGNORED FOR 1710 MERGE TO ONAP
+ @Deployment(resources = {
+ "process/UpdateVnfInfra.bpmn",
+ "subprocess/DoUpdateVfModule.bpmn",
+ "subprocess/DoUpdateVnfAndModules.bpmn",
+ "subprocess/PrepareUpdateAAIVfModule.bpmn",
+ "subprocess/ConfirmVolumeGroupTenant.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/VnfAdapterRestV1.bpmn",
+ "subprocess/UpdateAAIGenericVnf.bpmn",
+ "subprocess/UpdateAAIVfModule.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/BuildingBlock/DecomposeService.bpmn",
+ "subprocess/BuildingBlock/RainyDayHandler.bpmn",
+ "subprocess/BuildingBlock/ManualHandling.bpmn"
+
+ })
+ public void sunnyDay() throws Exception {
+
+ logStart();
+
+ MockNodeQueryServiceInstanceById("MIS%2F1604%2F0026%2FSW_INTERNET", "GenericFlows/getSIUrlByIdVipr.xml");
+ MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
+ //MockGetGenericVnfById_404("testVnfId");
+ MockGetServiceResourcesCatalogData("995256d2-5a33-55df-13ab-12abad84e7ff", "1.0", "VIPR/getCatalogServiceResourcesDataForUpdateVnfInfra.json");
+ MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
+ MockPutGenericVnf(".*");
+ MockAAIVfModule();
+ MockPatchGenericVnf("skask");
+ MockPatchVfModuleId("skask", ".*");
+ mockSDNCAdapter("VfModularity/StandardSDNCSynchResponse.xml");
+ mockVNFPut("skask", "/supercool", 202);
+ mockVNFPut("skask", "/lukewarm", 202);
+ MockVNFAdapterRestVfModule();
+ MockDBUpdateVfModule();
+ MockGetPserverByVnfId("skask", "AAI/AAI_pserverByVnfId.json", 200);
+ MockGetGenericVnfsByVnfId("skask", "AAI/AAI_genericVnfsByVnfId.json", 200);
+ MockSetInMaintFlagByVnfId("skask", 200);
+ MockPolicySkip();
+
+ mockSDNCAdapter("VfModularity/StandardSDNCSynchResponse.xml");
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ String updaetVnfRequest =
+ FileUtil.readResourceFile("__files/InfrastructureFlows/UpdateVnf_VID_request.json");
+
+ Map<String, Object> variables = setupVariablesSunnyDayVID();
+
+
+ TestAsyncResponse asyncResponse = invokeAsyncProcess("UpdateVnfInfra",
+ "v1", businessKey, updaetVnfRequest, variables);
+
+ WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
+
+ String responseBody = response.getResponse();
+ System.out.println("Workflow (Synch) Response:\n" + responseBody);
+
+ injectSDNCCallbacks(callbacks, "changeassign, query");
+ injectVNFRestCallbacks(callbacks, "vnfUpdate");
+ injectSDNCCallbacks(callbacks, "activate");
+ injectSDNCCallbacks(callbacks, "changeassign, query");
+ injectVNFRestCallbacks(callbacks, "vnfUpdate");
+ injectSDNCCallbacks(callbacks, "activate");
+
+ // TODO add appropriate assertions
+
+ waitForProcessEnd(businessKey, 10000);
+ checkVariable(businessKey, "UpdateVfModuleInfraSuccessIndicator", true);
+
+ logEnd();
+ }
+
+ // Active Scenario
+ private Map<String, Object> setupVariablesSunnyDayVID() {
+ Map<String, Object> variables = new HashMap<String, Object>();
+ //try {
+ // variables.put("bpmnRequest", FileUtil.readResourceFile("__files/CreateVfModule_VID_request.json"));
+ //}
+ //catch (Exception e) {
+
+ //}
+ //variables.put("mso-request-id", "testRequestId");
+ variables.put("requestId", "testRequestId");
+ variables.put("isDebugLogEnabled", "true");
+ variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
+ variables.put("vnfId", "skask");
+ variables.put("vnfType", "vSAMP12");
+ variables.put("serviceType", "MOG");
+
+ return variables;
+
+ }
+
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/AAI/AAI_genericVnfsByVnfId.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/AAI/AAI_genericVnfsByVnfId.json
new file mode 100644
index 0000000000..c7361f88ef
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/AAI/AAI_genericVnfsByVnfId.json
@@ -0,0 +1,329 @@
+{
+ "vnf-id": "example-vnf-id-val-90603",
+ "vnf-name": "example-vnf-name-val-56838",
+ "vnf-name2": "example-vnf-name2-val-56319",
+ "vnf-type": "example-vnf-type-val-30533",
+ "service-id": "example-service-id-val-28290",
+ "regional-resource-zone": "example-regional-resource-zone-val-11059",
+ "prov-status": "example-prov-status-val-59777",
+ "operational-status": "example-operational-status-val-22513",
+ "in-maint": true,
+
+ "equipment-role": "example-equipment-role-val-23396",
+ "orchestration-status": "example-orchestration-status-val-59435",
+ "heat-stack-id": "example-heat-stack-id-val-96869",
+ "mso-catalog-key": "example-mso-catalog-key-val-30721",
+ "management-option": "example-management-option-val-61927",
+ "ipv4-oam-address": "example-ipv4-oam-address-val-23494",
+ "ipv4-loopback0-address": "example-ipv4-loopback0-address-val-87072",
+ "nm-lan-v6-address": "example-nm-lan-v6-address-val-91063",
+ "management-v6-address": "example-management-v6-address-val-80466",
+ "vcpu": 45837298,
+ "vcpu-units": "example-vcpu-units-val-86249",
+ "vmemory": 57288956,
+ "vmemory-units": "example-vmemory-units-val-13291",
+ "vdisk": 16937143,
+ "vdisk-units": "example-vdisk-units-val-73197",
+
+ "is-closed-loop-disabled": true,
+ "summary-status": "example-summary-status-val-86438",
+ "encrypted-access-flag": true,
+
+
+
+
+ "model-invariant-id": "example-model-invariant-id-val-14704",
+ "model-version-id": "example-model-version-id-val-47847",
+ "model-customization-id": "example-model-customization-id-val-52688",
+ "widget-model-id": "example-widget-model-id-val-20939",
+ "widget-model-version": "example-widget-model-version-val-72210",
+ "as-number": "example-as-number-val-68358",
+ "regional-resource-subzone": "example-regional-resource-subzone-val-34391",
+ "nf-type": "example-nf-type-val-54866",
+ "nf-function": "example-nf-function-val-24790",
+ "nf-role": "example-nf-role-val-4780",
+ "nf-naming-code": "example-nf-naming-code-val-25118",
+ "selflink": "example-selflink-val-68404",
+
+
+
+
+ "l-interfaces": {
+ "l-interface": [
+ {
+ "interface-name": "example-interface-name-val-50593",
+ "interface-role": "example-interface-role-val-23375",
+ "v6-wan-link-ip": "example-v6-wan-link-ip-val-5921",
+ "selflink": "example-selflink-val-75663",
+ "interface-id": "example-interface-id-val-37465",
+ "macaddr": "example-macaddr-val-62657",
+ "network-name": "example-network-name-val-7252",
+ "management-option": "example-management-option-val-32963",
+ "interface-description": "example-interface-description-val-89453",
+ "is-port-mirrored": true,
+ "vlans": {
+ "vlan": [
+ {
+ "vlan-interface": "example-vlan-interface-val-16684",
+ "vlan-id-inner": 8602916,
+ "vlan-id-outer": 97348542,
+ "speed-value": "example-speed-value-val-90330",
+ "speed-units": "example-speed-units-val-15849",
+ "vlan-description": "example-vlan-description-val-46942",
+ "backdoor-connection": "example-backdoor-connection-val-78445",
+
+ "orchestration-status": "example-orchestration-status-val-44994",
+
+
+
+ "l3-interface-ipv4-address-list": [
+ {
+ "l3-interface-ipv4-address": "example-l3-interface-ipv4-address-val-90277",
+ "l3-interface-ipv4-prefix-length": 3364150,
+ "vlan-id-inner": 44021171,
+ "vlan-id-outer": 55708677,
+ "is-floating": true,
+ "neutron-network-id": "example-neutron-network-id-val-43267",
+ "neutron-subnet-id": "example-neutron-subnet-id-val-62870"
+ }
+ ],
+ "l3-interface-ipv6-address-list": [
+ {
+ "l3-interface-ipv6-address": "example-l3-interface-ipv6-address-val-45323",
+ "l3-interface-ipv6-prefix-length": 56688923,
+ "vlan-id-inner": 5703071,
+ "vlan-id-outer": 86682265,
+ "is-floating": true,
+ "neutron-network-id": "example-neutron-network-id-val-28366",
+ "neutron-subnet-id": "example-neutron-subnet-id-val-53034"
+ }
+ ]
+ }
+ ]
+ },
+ "sriov-vfs": {
+ "sriov-vf": [
+ {
+ "pci-id": "example-pci-id-val-4720",
+ "vf-vlan-filter": "example-vf-vlan-filter-val-42594",
+ "vf-mac-filter": "example-vf-mac-filter-val-13375",
+ "vf-vlan-strip": true,
+ "vf-vlan-anti-spoof-check": true,
+ "vf-mac-anti-spoof-check": true,
+ "vf-mirrors": "example-vf-mirrors-val-6057",
+ "vf-broadcast-allow": true,
+ "vf-unknown-multicast-allow": true,
+ "vf-unknown-unicast-allow": true,
+ "vf-insert-stag": true,
+ "vf-link-status": "example-vf-link-status-val-81448",
+ "neutron-network-id": "example-neutron-network-id-val-9504"
+ }
+ ]
+ },
+ "l-interfaces": {
+ "l-interface": [
+ {
+ "interface-name": "example-interface-name-val-16738",
+ "interface-role": "example-interface-role-val-13943",
+ "v6-wan-link-ip": "example-v6-wan-link-ip-val-63173",
+ "selflink": "example-selflink-val-43085",
+ "interface-id": "example-interface-id-val-51379",
+ "macaddr": "example-macaddr-val-16195",
+ "network-name": "example-network-name-val-45683",
+ "management-option": "example-management-option-val-78983",
+ "interface-description": "example-interface-description-val-34414",
+ "is-port-mirrored": true
+ }
+ ]
+ },
+ "l3-interface-ipv4-address-list": [
+ {
+ "l3-interface-ipv4-address": "example-l3-interface-ipv4-address-val-99078",
+ "l3-interface-ipv4-prefix-length": 55755841,
+ "vlan-id-inner": 81525473,
+ "vlan-id-outer": 90908072,
+ "is-floating": true,
+ "neutron-network-id": "example-neutron-network-id-val-47919",
+ "neutron-subnet-id": "example-neutron-subnet-id-val-84236"
+ }
+ ],
+ "l3-interface-ipv6-address-list": [
+ {
+ "l3-interface-ipv6-address": "example-l3-interface-ipv6-address-val-21939",
+ "l3-interface-ipv6-prefix-length": 50057584,
+ "vlan-id-inner": 75774660,
+ "vlan-id-outer": 4421090,
+ "is-floating": true,
+ "neutron-network-id": "example-neutron-network-id-val-46377",
+ "neutron-subnet-id": "example-neutron-subnet-id-val-16585"
+ }
+ ]
+ }
+ ]
+ },
+ "lag-interfaces": {
+ "lag-interface": [
+ {
+ "interface-name": "example-interface-name-val-39234",
+ "interface-description": "example-interface-description-val-1037",
+ "speed-value": "example-speed-value-val-1929",
+ "speed-units": "example-speed-units-val-74937",
+ "interface-id": "example-interface-id-val-91265",
+ "interface-role": "example-interface-role-val-19613",
+
+
+ "l-interfaces": {
+ "l-interface": [
+ {
+ "interface-name": "example-interface-name-val-10722",
+ "interface-role": "example-interface-role-val-95194",
+ "v6-wan-link-ip": "example-v6-wan-link-ip-val-24328",
+ "selflink": "example-selflink-val-24987",
+ "interface-id": "example-interface-id-val-75726",
+ "macaddr": "example-macaddr-val-36940",
+ "network-name": "example-network-name-val-65359",
+ "management-option": "example-management-option-val-49521",
+ "interface-description": "example-interface-description-val-70528",
+ "is-port-mirrored": true,
+ "vlans": {
+ "vlan": [
+ {
+ "vlan-interface": "example-vlan-interface-val-70827",
+ "vlan-id-inner": 55659612,
+ "vlan-id-outer": 90335612,
+ "speed-value": "example-speed-value-val-54761",
+ "speed-units": "example-speed-units-val-91398",
+ "vlan-description": "example-vlan-description-val-17018",
+ "backdoor-connection": "example-backdoor-connection-val-4021",
+
+ "orchestration-status": "example-orchestration-status-val-18315",
+
+
+ "l3-interface-ipv4-address-list": [
+ {
+ "l3-interface-ipv4-address": "example-l3-interface-ipv4-address-val-59336",
+ "l3-interface-ipv4-prefix-length": 57636053,
+ "vlan-id-inner": 34068397,
+ "vlan-id-outer": 48570286,
+ "is-floating": true,
+ "neutron-network-id": "example-neutron-network-id-val-69862",
+ "neutron-subnet-id": "example-neutron-subnet-id-val-75795"
+ }
+ ],
+ "l3-interface-ipv6-address-list": [
+ {
+ "l3-interface-ipv6-address": "example-l3-interface-ipv6-address-val-15038",
+ "l3-interface-ipv6-prefix-length": 42694503,
+ "vlan-id-inner": 15929806,
+ "vlan-id-outer": 87413856,
+ "is-floating": true,
+ "neutron-network-id": "example-neutron-network-id-val-52519",
+ "neutron-subnet-id": "example-neutron-subnet-id-val-24471"
+ }
+ ]
+ }
+ ]
+ },
+ "sriov-vfs": {
+ "sriov-vf": [
+ {
+ "pci-id": "example-pci-id-val-44669",
+ "vf-vlan-filter": "example-vf-vlan-filter-val-53436",
+ "vf-mac-filter": "example-vf-mac-filter-val-71902",
+ "vf-vlan-strip": true,
+ "vf-vlan-anti-spoof-check": true,
+ "vf-mac-anti-spoof-check": true,
+ "vf-mirrors": "example-vf-mirrors-val-54963",
+ "vf-broadcast-allow": true,
+ "vf-unknown-multicast-allow": true,
+ "vf-unknown-unicast-allow": true,
+ "vf-insert-stag": true,
+ "vf-link-status": "example-vf-link-status-val-1546",
+ "neutron-network-id": "example-neutron-network-id-val-92159"
+ }
+ ]
+ },
+ "l-interfaces": {
+ "l-interface": [
+ {
+ "interface-name": "example-interface-name-val-9327",
+ "interface-role": "example-interface-role-val-21859",
+ "v6-wan-link-ip": "example-v6-wan-link-ip-val-21445",
+ "selflink": "example-selflink-val-6085",
+ "interface-id": "example-interface-id-val-39854",
+ "macaddr": "example-macaddr-val-14433",
+ "network-name": "example-network-name-val-3722",
+ "management-option": "example-management-option-val-64739",
+ "interface-description": "example-interface-description-val-5814",
+ "is-port-mirrored": true
+
+
+
+ }
+ ]
+ },
+ "l3-interface-ipv4-address-list": [
+ {
+ "l3-interface-ipv4-address": "example-l3-interface-ipv4-address-val-64531",
+ "l3-interface-ipv4-prefix-length": 66545882,
+ "vlan-id-inner": 12194134,
+ "vlan-id-outer": 29589286,
+ "is-floating": true,
+ "neutron-network-id": "example-neutron-network-id-val-91108",
+ "neutron-subnet-id": "example-neutron-subnet-id-val-56984"
+ }
+ ],
+ "l3-interface-ipv6-address-list": [
+ {
+ "l3-interface-ipv6-address": "example-l3-interface-ipv6-address-val-37408",
+ "l3-interface-ipv6-prefix-length": 5116459,
+ "vlan-id-inner": 39229896,
+ "vlan-id-outer": 15091934,
+ "is-floating": true,
+ "neutron-network-id": "example-neutron-network-id-val-87700",
+ "neutron-subnet-id": "example-neutron-subnet-id-val-37352"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "vf-modules": {
+ "vf-module": [
+ {
+ "vf-module-id": "example-vf-module-id-val-56249",
+ "vf-module-name": "example-vf-module-name-val-18987",
+ "heat-stack-id": "example-heat-stack-id-val-80110",
+ "orchestration-status": "example-orchestration-status-val-8226",
+ "is-base-vf-module": true,
+ "model-invariant-id": "example-model-invariant-id-val-5071",
+ "model-version-id": "example-model-version-id-val-80793",
+ "model-customization-id": "example-model-customization-id-val-83277",
+ "widget-model-id": "example-widget-model-id-val-99814",
+ "widget-model-version": "example-widget-model-version-val-22799",
+ "contrail-service-instance-fqdn": "example-contrail-service-instance-fqdn-val-52133",
+ "module-index": 1933,
+ "selflink": "example-selflink-val-69992"
+ }
+ ]
+ },
+ "licenses": {
+ "license": [
+ {
+ "group-uuid": "example-group-uuid-val-73012",
+ "resource-uuid": "example-resource-uuid-val-80045"
+ }
+ ]
+ },
+ "entitlements": {
+ "entitlement": [
+ {
+ "group-uuid": "example-group-uuid-val-14874",
+ "resource-uuid": "example-resource-uuid-val-49146"
+ }
+ ]
+ }
+
+} \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/AAI/AAI_pserverByVnfId.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/AAI/AAI_pserverByVnfId.json
new file mode 100644
index 0000000000..1059d8c9a9
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/AAI/AAI_pserverByVnfId.json
@@ -0,0 +1,72 @@
+ {
+
+ "result": [{
+
+ "hostname": "8862-PserverHOSTNAME-LB1113",
+ "equipType": "JUNIPER UCPE",
+ "equipVendor": "JUNIPER",
+ "equipModel": "QFX51010-PNF",
+ "ipv4OamAddress": "190.8.5.199",
+ "serialNumber": "VX986001PNF",
+ "pserverId": "5715CE4F-8600-58E103FE60C79",
+ "internetTopology": "WAN",
+ "inMaint": false,
+ "resourceVersion": "1500495668780",
+ "pserverName2": "test81600",
+ "relationshipList": {
+ "relationship": [
+ {
+ "relatedTo": "vserver",
+ "relatedLink": "/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/tenants/tenant/8862-tenantl-LB1113/vservers/vserver/8862-Lvserver-LB1113",
+ "relationshipData": [
+ {
+ "relationshipKey": "cloud-region.cloud-owner",
+ "relationshipValue": "att-aic"
+ },
+ {
+ "relationshipKey": "cloud-region.cloud-region-id",
+ "relationshipValue": "AAIAIC25"
+ },
+ {
+ "relationshipKey": "tenant.tenant-id",
+ "relationshipValue": "8862-tenantl-LB1113"
+ },
+ {
+ "relationshipKey": "vserver.vserver-id",
+ "relationshipValue": "8862-Lvserver-LB1113"
+ }
+ ],
+ "relatedToProperty": [
+ {
+ "propertyKey": "vserver.vserver-name",
+ "propertyValue": "hjZAYKyl5LO"
+ }
+ ]
+ }
+ ]
+ },
+ "pinterfaces": {
+ "pinterface": [
+ {
+ "interfaceName": "ge-0/5/8",
+ "speedValue": "1",
+ "speedUnits": "GBPS",
+ "resourceVersion": "1500495668784",
+ "inMaint": false
+ },
+ {
+ "interfaceName": "ge-1/5/8",
+ "speedValue": "1",
+ "speedUnits": "GBPS",
+ "resourceVersion": "1500495668788",
+ "inMaint": false
+ }
+ ]
+ }
+ }
+
+
+
+ ]
+}
+ \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2mock/sdncCreateNetworkTopologyRsrcAssignResponse.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2mock/sdncCreateNetworkTopologyRsrcAssignResponse.xml
new file mode 100644
index 0000000000..e6af14123e
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2mock/sdncCreateNetworkTopologyRsrcAssignResponse.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:v1="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
+ <soapenv:Header />
+ <soapenv:Body>
+ <v1:SDNCAdapterCallback>
+ <SDNCAdapterCallbackRequest xmlns="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
+ <CallbackHeader>
+ <RequestId>79ec9006-3695-4fcc-93a8-be6f9e248beb</RequestId>
+ <ResponseCode>200</ResponseCode>
+ <ResponseMessage>OK</ResponseMessage>
+ </CallbackHeader>
+ <RequestData xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">&lt;output xmlns="com:att:sdnctl:generic-resource"&gt;&lt;response-message&gt;&lt;/response-message&gt;&lt;svc-request-id&gt;79ec9006-3695-4fcc-93a8-be6f9e248beb&lt;/svc-request-id&gt;&lt;service-response-information&gt;&lt;instance-id&gt;f805ec2b-b4d8-473e-8325-67f110139e5d&lt;/instance-id&gt;&lt;/service-response-information&gt;&lt;response-code&gt;200&lt;/response-code&gt;&lt;network-response-information&gt;&lt;instance-id&gt;49c86598-f766-46f8-84f8-8d1c1b10f9b4&lt;/instance-id&gt;&lt;object-path&gt;restconf/config/GENERIC-RESOURCE-API:services/service/f805ec2b-b4d8-473e-8325-67f110139e5d/service-data/networks/network/f7e4db56-aab5-4065-8e65-cec1cd1de24f&lt;/object-path&gt;&lt;/network-response-information&gt;&lt;ack-final-indicator&gt;Y&lt;/ack-final-indicator&gt;&lt;/output&gt;</RequestData>
+ </SDNCAdapterCallbackRequest>
+ </v1:SDNCAdapterCallback>
+ </soapenv:Body>
+</soapenv:Envelope>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2mock/sdncCreateNetworkTopologySimResponse.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2mock/sdncCreateNetworkTopologySimResponse.xml
new file mode 100644
index 0000000000..40bb93bda0
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2mock/sdncCreateNetworkTopologySimResponse.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:v1="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
+ <soapenv:Header />
+ <soapenv:Body>
+ <v1:SDNCAdapterCallback>
+ <SDNCAdapterCallbackRequest xmlns="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
+ <CallbackHeader>
+ <RequestId>testRequestId</RequestId>
+ <ResponseCode>200</ResponseCode>
+ <ResponseMessage>OK</ResponseMessage>
+ </CallbackHeader>
+ <RequestData xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:type="xs:string">&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;output xmlns="com:att:sdnctl:vnf"&gt;&lt;svc-request-id&gt;19174929-3809-49ca-89eb-17f84a035389&lt;/svc-request-id&gt;&lt;response-code&gt;200&lt;/response-code&gt;&lt;ack-final-indicator&gt;Y&lt;/ack-final-indicator&gt;&lt;network-information&gt;&lt;network-id&gt;49c86598-f766-46f8-84f8-8d1c1b10f9b4&lt;/network-id&gt;&lt;/network-information&gt;&lt;service-information&gt;&lt;service-type&gt;a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb&lt;/service-type&gt;&lt;service-instance-id&gt;HSL_direct_net_2&lt;/service-instance-id&gt;&lt;subscriber-name&gt;notsurewecare&lt;/subscriber-name&gt;&lt;/service-information&gt;&lt;/output&gt;</RequestData>
+ </SDNCAdapterCallbackRequest>
+ </v1:SDNCAdapterCallback>
+ </soapenv:Body>
+</soapenv:Envelope>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request.json
index 91048eca9b..5a7ef5e2c7 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request.json
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request.json
@@ -2,11 +2,11 @@
"requestDetails": {
"modelInfo": {
"modelType": "volumeGroup",
- "modelId": "ff5256d2-5a33-55df-13ab-12abad84e7ff",
- "modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
+ "modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff",
+ "modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
"modelName": "vSAMP12::base::module-0",
"modelVersion": "1",
- "modelCustomizationId": "ee6478e5-ea33-3346-ac12-ab121484a3fe"
+ "modelCustomizationUuid": "ee6478e5-ea33-3346-ac12-ab121484a3fe"
},
"cloudConfiguration": {
"lcpCloudRegionId": "mdt1",
@@ -23,8 +23,8 @@
"instanceId": "{service-instance-id}",
"modelInfo": {
"modelType": "service",
- "modelId": "ff3514e3-5a33-55df-13ab-12abad84e7ff",
- "modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
+ "modelInvariantUuid": "ff3514e3-5a33-55df-13ab-12abad84e7ff",
+ "modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
"modelName": "Test",
"modelVersion": "2.0"
}
@@ -34,11 +34,11 @@
"instanceId": "{vnf-instance-id}",
"modelInfo": {
"modelType": "vnf",
- "modelId": "ff5256d1-5a33-55df-13ab-12abad84e7ff",
- "modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
+ "modelInvariantUuid": "ff5256d1-5a33-55df-13ab-12abad84e7ff",
+ "modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
"modelName": "vSAMP12",
"modelVersion": "1",
- "modelCustomizationName": "vSAMP12"
+ "modelInstanceName": "vSAMP12"
}
}
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request_noreqparm.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request_noreqparm.json
index 72e41839fb..de99a6da56 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request_noreqparm.json
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request_noreqparm.json
@@ -3,7 +3,7 @@
"modelInfo": {
"modelType": "volumeGroup",
"modelId": "ff5256d2-5a33-55df-13ab-12abad84e7ff",
- "modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
+ "modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
"modelName": "vSAMP12::base::module-0",
"modelVersion": "1"
},
@@ -23,7 +23,7 @@
"modelInfo": {
"modelType": "service",
"modelId": "ff3514e3-5a33-55df-13ab-12abad84e7ff",
- "modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
+ "modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
"modelName": "{parent service model name}",
"modelVersion": "1"
}
@@ -34,7 +34,7 @@
"modelInfo": {
"modelType": "vnf",
"modelId": "ff5256d1-5a33-55df-13ab-12abad84e7ff",
- "modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
+ "modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
"modelName": "Test/vSAMP12",
"modelVersion": "1"
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_queryVolumeName_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_queryVolumeName_AAIResponse_Success.xml
index cb20a41ca0..8d9efb3b39 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_queryVolumeName_AAIResponse_Success.xml
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_queryVolumeName_AAIResponse_Success.xml
@@ -29,6 +29,7 @@
<heat-stack-id/>
<vnf-type>simple_cinder_master</vnf-type>
<orchestration-status>Pending</orchestration-status>
+ <vf-module-model-customization-id>ee6478e5-ea33-3346-ac12-ab121484a3fe</vf-module-model-customization-id>
<resource-version>1460134360</resource-version>
<relationship-list>
<relationship>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_HasVfModRelationship.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_HasVfModRelationship.xml
new file mode 100644
index 0000000000..8d9c5c0a43
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_HasVfModRelationship.xml
@@ -0,0 +1,62 @@
+<volume-group xmlns="http://com.att.aai.inventory/v8">
+ <volume-group-id>78987</volume-group-id>
+ <volume-group-name>MSOTESTVOL102a-vSAMP12_base_vol_module-0</volume-group-name>
+ <heat-stack-id/>
+ <vnf-type>Test/vSAMP12</vnf-type>
+ <orchestration-status>Pending</orchestration-status>
+ <resource-version>0000020</resource-version>
+ <relationship-list>
+ <relationship>
+ <related-to>generic-vnf</related-to>
+ <related-link>https://aai-ext1.test.att.com:8443/aai/v8/network/generic-vnfs/generic-vnf/9e48f6ea-f786-46de-800a-d480e5ccc846/</related-link>
+ <relationship-data>
+ <relationship-key>generic-vnf.vnf-id</relationship-key>
+ <relationship-value>9e48f6ea-f786-46de-800a-d480e5ccc846</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>generic-vnf.vnf-name</property-key>
+ <property-value>MSOSTSAMP12-10601</property-value>
+ </related-to-property>
+ </relationship>
+ <relationship>
+ <related-to>tenant</related-to>
+ <related-link>https://aai-ext1.test.att.com:8443/aai/v7/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mdt1/tenants/tenant/fba1bd1e195a404cacb9ce17a9b2b421/</related-link>
+ <relationship-data>
+ <relationship-key>tenant.tenant-id</relationship-key>
+ <relationship-value>fba1bd1e195a404cacb9ce17a9b2b421</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>cloud-region.cloud-owner</relationship-key>
+ <relationship-value>att-aic</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>cloud-region.cloud-region-id</relationship-key>
+ <relationship-value>mdt1</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>tenant.tenant-name</property-key>
+ <property-value>ECOMP_MDT1</property-value>
+ </related-to-property>
+ </relationship>
+ <relationship>
+ <related-to>vf-module</related-to>
+ <related-link>https://aai-ext1.test.att.com:8443/aai/v7/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mdt1/tenants/tenant/fba1bd1e195a404cacb9ce17a9b2b421/</related-link>
+ <relationship-data>
+ <relationship-key>vf-module.vf-module-id</relationship-key>
+ <relationship-value>fba1bd1e195a404cacb9ce17a9b2b421</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>cloud-region.cloud-owner</relationship-key>
+ <relationship-value>att-aic</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>cloud-region.cloud-region-id</relationship-key>
+ <relationship-value>mdt1</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>vf-module.vf-module-name</property-key>
+ <property-value>ECOMP_MDT1</property-value>
+ </related-to-property>
+ </relationship>
+ </relationship-list>
+</volume-group> \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModule_VID_request.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModule_VID_request.json
index 1b56dbddbc..d1e5ee1bc6 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModule_VID_request.json
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModule_VID_request.json
@@ -2,8 +2,8 @@
"requestDetails": {
"modelInfo": {
"modelType": "vfModule",
-"modelInvariantId": "ff5256d2-5a33-55df-13ab-12abad84e7ff",
-"modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
+"modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff",
+"modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
"modelName": "STMTN5MMSC21-MMSC::model-1-0",
"modelVersion": "1",
"modelCustomizationUuid": "ee6478e5-ea33-3346-ac12-ab121484a3fe"
@@ -28,8 +28,8 @@
"instanceName": "MSOTESTVOL103a-vSAMP12_base_module-0_vol",
"modelInfo": {
"modelType": "volumeGroup",
-"modelInvariantId": "ff5256d2-5a33-55df-13ab-12abad84e7ff",
-"modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
+"modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff",
+"modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
"modelName": "vSAMP12..base..module-0",
"modelVersion": "1"
}
@@ -40,8 +40,8 @@
"instanceId": "123456",
"modelInfo": {
"modelType": "service",
-"modelInvariantId": "ff3514e3-5a33-55df-13ab-12abad84e7ff",
-"modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
+"modelInvariantUuid": "ff3514e3-5a33-55df-13ab-12abad84e7ff",
+"modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
"modelName": "SERVICE_MODEL_NAME",
"modelVersion": "1.0"
}
@@ -53,11 +53,11 @@
"instanceName": "skask-test",
"modelInfo": {
"modelType": "vnf",
-"modelInvariantId": "skask",
-"modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
+"modelInvariantUuid": "skask",
+"modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
"modelName": "vSAMP12",
"modelVersion": "1.0",
-"modelCustomizationName": "vSAMP12 1"
+"modelInstanceName": "vSAMP12 1"
}
}
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModule_VID_request_noPreloads.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModule_VID_request_noPreloads.json
index f8cac48f1f..55dc31309b 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModule_VID_request_noPreloads.json
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModule_VID_request_noPreloads.json
@@ -2,8 +2,8 @@
"requestDetails": {
"modelInfo": {
"modelType": "vfModule",
-"modelInvariantId": "ff5256d2-5a33-55df-13ab-12abad84e7ff",
-"modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
+"modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff",
+"modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
"modelName": "STMTN5MMSC21-MMSC::model-1-0",
"modelVersion": "1",
"modelCustomizationUuid": "ee6478e5-ea33-3346-ac12-ab121484a3fe"
@@ -28,8 +28,8 @@
"instanceName": "MSOTESTVOL103a-vSAMP12_base_module-0_vol",
"modelInfo": {
"modelType": "volumeGroup",
-"modelInvariantId": "ff5256d2-5a33-55df-13ab-12abad84e7ff",
-"modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
+"modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff",
+"modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
"modelName": "vSAMP12..base..module-0",
"modelVersion": "1"
}
@@ -40,8 +40,8 @@
"instanceId": "123456",
"modelInfo": {
"modelType": "service",
-"modelInvariantId": "ff3514e3-5a33-55df-13ab-12abad84e7ff",
-"modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
+"modelInvariantUuid": "ff3514e3-5a33-55df-13ab-12abad84e7ff",
+"modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
"modelName": "SERVICE_MODEL_NAME",
"modelVersion": "1.0"
}
@@ -53,11 +53,11 @@
"instanceName": "skask-test",
"modelInfo": {
"modelType": "vnf",
-"modelInvariantId": "skask",
-"modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
+"modelInvariantUuid": "skask",
+"modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
"modelName": "vSAMP12",
"modelVersion": "1.0",
-"modelCustomizationName": "vSAMP12 1"
+"modelInstanceName": "vSAMP12 1"
}
}
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DBUpdateResponse.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DBUpdateResponse.xml
new file mode 100644
index 0000000000..40e2344f36
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DBUpdateResponse.xml
@@ -0,0 +1,4 @@
+
+
+<ns2:updateRequestResponse xmlns:ns2="http://org.openecomp/requestsdb"
+ xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"/> \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2mock/sdncDeleteNetworkTopologySimResponse.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2mock/sdncDeleteNetworkTopologySimResponse.xml
new file mode 100644
index 0000000000..8ec4f520c1
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2mock/sdncDeleteNetworkTopologySimResponse.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:v1="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
+ <soapenv:Header />
+ <soapenv:Body>
+ <v1:SDNCAdapterCallback>
+ <SDNCAdapterCallbackRequest xmlns="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
+ <CallbackHeader>
+ <RequestId>19174929-3809-49ca-89eb-17f84a035389</RequestId>
+ <ResponseCode>200</ResponseCode>
+ <ResponseMessage>OK</ResponseMessage>
+ </CallbackHeader>
+ <RequestData xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:type="xs:string">&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;output xmlns="com:att:sdnctl:vnf"&gt;&lt;svc-request-id&gt;19174929-3809-49ca-89eb-17f84a035389&lt;/svc-request-id&gt;&lt;response-code&gt;200&lt;/response-code&gt;&lt;ack-final-indicator&gt;Y&lt;/ack-final-indicator&gt;&lt;network-information&gt;&lt;network-id&gt;bdc5efe8-404a-409b-85f6-0dcc9eebae30&lt;/network-id&gt;&lt;/network-information&gt;&lt;service-information&gt;&lt;service-type&gt;a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb&lt;/service-type&gt;&lt;service-instance-id&gt;HSL_direct_net_2&lt;/service-instance-id&gt;&lt;subscriber-name&gt;notsurewecare&lt;/subscriber-name&gt;&lt;/service-information&gt;&lt;/output&gt;</RequestData>
+ </SDNCAdapterCallbackRequest>
+ </v1:SDNCAdapterCallback>
+ </soapenv:Body>
+</soapenv:Envelope>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2mock/sdncDeleteNetworkTopologySimResponse_noExtraTag.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2mock/sdncDeleteNetworkTopologySimResponse_noExtraTag.xml
new file mode 100644
index 0000000000..f180e61366
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2mock/sdncDeleteNetworkTopologySimResponse_noExtraTag.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:v1="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
+ <soapenv:Header />
+ <soapenv:Body>
+ <SDNCAdapterCallbackRequest xmlns="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
+ <CallbackHeader>
+ <RequestId>19174929-3809-49ca-89eb-17f84a035389</RequestId>
+ <ResponseCode>200</ResponseCode>
+ <ResponseMessage>OK</ResponseMessage>
+ </CallbackHeader>
+ <RequestData xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:type="xs:string">&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;output xmlns="com:att:sdnctl:vnf"&gt;&lt;svc-request-id&gt;19174929-3809-49ca-89eb-17f84a035389&lt;/svc-request-id&gt;&lt;response-code&gt;200&lt;/response-code&gt;&lt;ack-final-indicator&gt;Y&lt;/ack-final-indicator&gt;&lt;network-information&gt;&lt;network-id&gt;bdc5efe8-404a-409b-85f6-0dcc9eebae30&lt;/network-id&gt;&lt;/network-information&gt;&lt;service-information&gt;&lt;service-type&gt;a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb&lt;/service-type&gt;&lt;service-instance-id&gt;HSL_direct_net_2&lt;/service-instance-id&gt;&lt;subscriber-name&gt;notsurewecare&lt;/subscriber-name&gt;&lt;/service-information&gt;&lt;/output&gt;</RequestData>
+ </SDNCAdapterCallbackRequest>
+ </soapenv:Body>
+</soapenv:Envelope>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteVfModuleCallbackResponse.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteVfModuleCallbackResponse.xml
new file mode 100644
index 0000000000..74a3beb221
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteVfModuleCallbackResponse.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<deleteVfModuleResponse>
+ <messageId>86651f79-057e-4245-8f5f-174db3cef553-1502888133261</messageId>
+ <vfModuleDeleted>true</vfModuleDeleted>
+ <vfModuleId>20928949-5230-495d-86a6-f3690b9b5d60</vfModuleId>
+ <vfModuleOutputs>
+ <entry>
+ <key>shared_private_network_id</key>
+ <value>bcd04543-b3d7-4c64-a910-1735b875ebb2</value>
+ </entry>
+ <entry>
+ <key>server1_port</key>
+ <value>d1605e82-50ba-4544-9f8d-a8a37b678046</value>
+ </entry>
+ <entry>
+ <key>vnf_id</key>
+ <value>7da56895-6be1-4bec-856b-525e0e573199</value>
+ </entry>
+ </vfModuleOutputs>
+ <vnfId>7da56895-6be1-4bec-856b-525e0e573199</vnfId>
+</deleteVfModuleResponse>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteVfModuleVolumeInfraV1/deleteVfModuleVolume_VID_request_st.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteVfModuleVolumeInfraV1/deleteVfModuleVolume_VID_request_st.json
index 35ba121086..c6cc1ca428 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteVfModuleVolumeInfraV1/deleteVfModuleVolume_VID_request_st.json
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteVfModuleVolumeInfraV1/deleteVfModuleVolume_VID_request_st.json
@@ -2,7 +2,7 @@
"requestDetails": {
"modelInfo": {
"modelType": "volumeGroup",
- "modelInvariantId": "0b01b8c2-8416-11e6-ae22-56b6b6499611",
+ "modelInvariantUuid": "0b01b8c2-8416-11e6-ae22-56b6b6499611",
"modelName": "vSAMP12::base::module-0",
"modelVersion": "1.0"
},
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/createVfModuleVolume_VID_request.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/createVfModuleVolume_VID_request.json
index 5ff965f7e2..5a05061098 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/createVfModuleVolume_VID_request.json
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/createVfModuleVolume_VID_request.json
@@ -3,7 +3,7 @@
"modelInfo": {
"modelType": "volumeGroup",
"modelId": "ff5256d2-5a33-55df-13ab-12abad84e7ff",
- "modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
+ "modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
"modelName": "vSAMP12::base::module-0",
"modelVersion": "1"
},
@@ -23,7 +23,7 @@
"modelInfo": {
"modelType": "service",
"modelId": "ff3514e3-5a33-55df-13ab-12abad84e7ff",
- "modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
+ "modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
"modelName": "{parent service model name}",
"modelVersion": "1"
}
@@ -34,7 +34,7 @@
"modelInfo": {
"modelType": "vnf",
"modelId": "ff5256d1-5a33-55df-13ab-12abad84e7ff",
- "modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
+ "modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
"modelName": "Test/vSAMP12",
"modelVersion": "1"
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModule_getVnfResponse.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModule_getVnfResponse.xml
new file mode 100644
index 0000000000..021a8a73d1
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModule_getVnfResponse.xml
@@ -0,0 +1,26 @@
+<generic-vnf xmlns="http://org.openecomp.aai.inventory/v7">
+ <vnf-id>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnf-id>
+ <vnf-name>STMTN5MMSC21</vnf-name>
+ <vnf-type>mmsc-capacity</vnf-type>
+ <service-id>SDN-MOBILITY</service-id>
+ <equipment-role>vMMSC</equipment-role>
+ <orchestration-status>pending-create</orchestration-status>
+ <in-maint>false</in-maint>
+ <is-closed-loop-disabled>false</is-closed-loop-disabled>
+ <resource-version>1508691</resource-version>
+ <vf-modules>
+ <vf-module>
+ <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</vf-module-id>
+ <vf-module-name>STMTN5MMSC21-MMSC::module-0-0</vf-module-name>
+ <persona-model-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</persona-model-id>
+ <persona-model-version>1.0</persona-model-version>
+ <is-base-vf-module>true</is-base-vf-module>
+ <heat-stack-id>FILLED-IN-BY-MSO</heat-stack-id>
+ <orchestration-status>pending-create</orchestration-status>
+ <resource-version>1508692</resource-version>
+ </vf-module>
+ </vf-modules>
+ <relationship-list/>
+ <l-interfaces/>
+ <lag-interfaces/>
+ </generic-vnf> \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getSINoRelations.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getSINoRelations.xml
new file mode 100644
index 0000000000..adb7aab35f
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getSINoRelations.xml
@@ -0,0 +1,6 @@
+<service-instance>
+ <service-instance-id>MIS/1604/0026/SW_INTERNET</service-instance-id>
+ <resource-version>123456789</resource-version>
+ <relationship-list/>
+ <metadata/>
+</service-instance> \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getSIUrlByIdVipr.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getSIUrlByIdVipr.xml
new file mode 100644
index 0000000000..80b035979a
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getSIUrlByIdVipr.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search-results xmlns="http://org.openecomp.aai.inventory/v8">
+ <result-data>
+ <resource-type>service-instance</resource-type>
+ <resource-link>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/aa8428ac-7dd2-441f-aa3e-e175802574fb</resource-link>
+ </result-data>
+</search-results> \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/CreateVnfInfraRequest.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/CreateVnfInfraRequest.json
index 2b9c2879a7..3595c25584 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/CreateVnfInfraRequest.json
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/CreateVnfInfraRequest.json
@@ -2,11 +2,12 @@
"requestDetails": {
"modelInfo": {
"modelType": "vnf",
- "modelInvariantId": "ff5256d1-5a33-55df-13ab-12abad84e7ff",
- "modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
+ "modelInvariantUuid": "ff5256d1-5a33-55df-13ab-12abad84e7ff",
+ "modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
"modelName": "vSAMP12",
"modelVersion": "1.0",
- "modelCustomizationName": "vSAMP12 1"
+ "modelInstanceName": "vSAMP12 1",
+ "modelCustomizationUuid": "customizationId123"
},
"cloudConfiguration": {
"lcpCloudRegionId": "mdt1",
@@ -24,8 +25,8 @@
"instanceId": "{serviceInstanceId}",
"modelInfo": {
"modelType": "service",
- "modelInvariantId": "ff3514e3-5a33-55df-13ab-12abad84e7ff",
- "modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
+ "modelInvariantUuid": "ff3514e3-5a33-55df-13ab-12abad84e7ff",
+ "modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
"modelName": "{parent service model name}",
"modelVersion": "1.0"
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/DeleteVnfInfraRequestCascadeDelete.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/DeleteVnfInfraRequestCascadeDelete.json
index f90b9678f0..e8d9fc29b1 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/DeleteVnfInfraRequestCascadeDelete.json
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/DeleteVnfInfraRequestCascadeDelete.json
@@ -2,11 +2,11 @@
"requestDetails": {
"modelInfo": {
"modelType": "vnf",
- "modelInvariantId": "ff5256d1-5a33-55df-13ab-12abad84e7ff",
- "modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
+ "modelInvariantUuid": "ff5256d1-5a33-55df-13ab-12abad84e7ff",
+ "modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
"modelName": "vSAMP12",
"modelVersion": "1.0",
- "modelCustomizationName": "vSAMP12 1"
+ "modelInstanceName": "vSAMP12 1"
},
"cloudConfiguration": {
"lcpCloudRegionId": "mdt1",
@@ -24,8 +24,8 @@
"instanceId": "{serviceInstanceId}",
"modelInfo": {
"modelType": "service",
- "modelInvariantId": "ff3514e3-5a33-55df-13ab-12abad84e7ff",
- "modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
+ "modelInvariantUuid": "ff3514e3-5a33-55df-13ab-12abad84e7ff",
+ "modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
"modelName": "{parent service model name}",
"modelVersion": "1.0"
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/ReplaceVnf_VID_request.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/ReplaceVnf_VID_request.json
new file mode 100644
index 0000000000..7c9717244b
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/ReplaceVnf_VID_request.json
@@ -0,0 +1,49 @@
+{
+"requestDetails": {
+"modelInfo": {
+"modelType": "vnf",
+"modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff",
+"modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
+"modelName": "vSAMP12",
+"modelVersion": "1.0",
+"modelCustomizationUuid": "MODEL-ID-1234"
+},
+"cloudConfiguration": {
+"lcpCloudRegionId": "mdt1",
+"tenantId": "88a6ca3ee0394ade9403f075db23167e"
+},
+"requestInfo": {
+"instanceName": "STMTN",
+"instanceId": "a27ce5a9-29c4-4c22-a017-6615ac73c721",
+"source": "VID",
+"suppressRollback": true
+},
+"relatedInstanceList": [
+{
+"relatedInstance": {
+"instanceId": "MIS%2F1604%2F0026%2FSW_INTERNET",
+"modelInfo": {
+"modelType": "service",
+"modelInvariantUuid": "995256d2-5a33-55df-13ab-12abad84e7ff",
+"modelUuid": "ab6478e5-ea33-3346-ac12-ab121484a3fe",
+"modelName": "ServicevSAMP12",
+"modelVersion": "1.0"
+}
+}
+}
+],
+"requestParameters": {
+"usePreload": false,
+"userParams" : [
+ {
+ "name" : "someUserParam",
+ "value" : "someValue"
+ },
+ {
+ "name": "sgi_protected_subnet_id",
+ "value": "thisissomefakevalue"
+ }
+]
+}
+}
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/UpdateVfModule_VID_request.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/UpdateVfModule_VID_request.json
index e3556e7b4a..c40a99ef34 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/UpdateVfModule_VID_request.json
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/UpdateVfModule_VID_request.json
@@ -2,11 +2,11 @@
"requestDetails": {
"modelInfo": {
"modelType": "vfModule",
-"modelInvariantId": "introvert",
-"modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
+"modelInvariantUuid": "introvert",
+"modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
"modelName": "STMTN5MMSC21-MMSC::model-1-0",
"modelVersion": "1",
-"modelCustomizationId": "MODEL12345"
+"modelCustomizationUuid": "MODEL12345"
},
"cloudConfiguration": {
"lcpCloudRegionId": "MDTWNJ21",
@@ -24,8 +24,8 @@
"instanceId": "123456",
"modelInfo": {
"modelType": "service",
-"modelInvariantId": "ff3514e3-5a33-55df-13ab-12abad84e7ff",
-"modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
+"modelInvariantUuid": "ff3514e3-5a33-55df-13ab-12abad84e7ff",
+"modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
"modelName": "SERVICE_MODEL_NAME",
"modelVersion": "1.0"
}
@@ -36,16 +36,26 @@
"instanceId": "skask",
"modelInfo": {
"modelType": "vnf",
-"modelInvariantId": "skask",
-"modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
+"modelInvariantUuid": "skask",
+"modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
"modelName": "vSAMP12",
"modelVersion": "1.0",
-"modelCustomizationName": "vSAMP12 1"
+"modelInstanceName": "vSAMP12 1"
}
}
}
],
"requestParameters": {
-"userParams": {}
+"usePreload": false,
+"userParams" : [
+ {
+ "name" : "someUserParam",
+ "value" : "someValue"
+ },
+ {
+ "name": "sgi_protected_subnet_id",
+ "value": "thisissomefakevalue"
+ }
+]
}
} \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/UpdateVnf_VID_request.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/UpdateVnf_VID_request.json
new file mode 100644
index 0000000000..cdeaf92bb9
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/UpdateVnf_VID_request.json
@@ -0,0 +1,49 @@
+{
+"requestDetails": {
+"modelInfo": {
+"modelType": "vnf",
+"modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff",
+"modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
+"modelName": "vSAMP12",
+"modelVersion": "1.0",
+"modelCustomizationUuid": "MODEL-ID-1234"
+},
+"cloudConfiguration": {
+"lcpCloudRegionId": "mdt1",
+"tenantId": "88a6ca3ee0394ade9403f075db23167e"
+},
+"requestInfo": {
+"instanceName": "STMTN",
+"instanceId": "skask",
+"source": "VID",
+"suppressRollback": true
+},
+"relatedInstanceList": [
+{
+"relatedInstance": {
+"instanceId": "MIS%2F1604%2F0026%2FSW_INTERNET",
+"modelInfo": {
+"modelType": "service",
+"modelInvariantUuid": "995256d2-5a33-55df-13ab-12abad84e7ff",
+"modelUuid": "ab6478e5-ea33-3346-ac12-ab121484a3fe",
+"modelName": "ServicevSAMP12",
+"modelVersion": "1.0"
+}
+}
+}
+],
+"requestParameters": {
+"usePreload": false,
+"userParams" : [
+ {
+ "name" : "someUserParam",
+ "value" : "someValue"
+ },
+ {
+ "name": "sgi_protected_subnet_id",
+ "value": "thisissomefakevalue"
+ }
+]
+}
+}
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/Policy/policyAbortResponse.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/Policy/policyAbortResponse.json
new file mode 100644
index 0000000000..c315b1ed1d
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/Policy/policyAbortResponse.json
@@ -0,0 +1 @@
+{"decision":"PERMIT","details":"Abort"} \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/Policy/policySkipResponse.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/Policy/policySkipResponse.json
new file mode 100644
index 0000000000..7cbdebb6b3
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/Policy/policySkipResponse.json
@@ -0,0 +1 @@
+{"decision":"PERMIT","details":"Skip"} \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_Success.xml
index 244a51e160..c48c6a661f 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_Success.xml
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_Success.xml
@@ -9,7 +9,7 @@
<relationship-list>
<relationship>
<related-to>tenant</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v7/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mdt1/tenants/tenant/fba1bd1e195a404cacb9ce17a9b2b421/</related-link>
+ <related-link>/aai/v7/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mdt1/tenants/tenant/fba1bd1e195a404cacb9ce17a9b2b421/</related-link>
<relationship-data>
<relationship-key>tenant.tenant-id</relationship-key>
<relationship-value>fba1bd1e195a404cacb9ce17a9b2b421</relationship-value>
@@ -29,7 +29,7 @@
</relationship>
<relationship>
<related-to>vf-module</related-to>
- <related-link>http://localhost:28090/aai/v8/network/generic-vnfs/generic-vnf/9e48f6ea-f786-46de-800a-d480e5ccc846/vf-modules/vf-module/6a1dc898-b590-47b9-bbf0-34424a7a2ec3/</related-link>
+ <related-link>/aai/v8/network/generic-vnfs/generic-vnf/9e48f6ea-f786-46de-800a-d480e5ccc846/vf-modules/vf-module/6a1dc898-b590-47b9-bbf0-34424a7a2ec3/</related-link>
<relationship-data>
<relationship-key>generic-vnf.vnf-id</relationship-key>
<relationship-value>9e48f6ea-f786-46de-800a-d480e5ccc846</relationship-value>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/updateVfModuleVolume_VID_request.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/updateVfModuleVolume_VID_request.json
index 8ab460e24d..603c1f452f 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/updateVfModuleVolume_VID_request.json
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/updateVfModuleVolume_VID_request.json
@@ -2,8 +2,8 @@
"requestDetails": {
"modelInfo": {
"modelType": "volumeGroup",
- "modelInvariantId": "ff5256d2-5a33-55df-13ab-12abad84e7ff",
- "modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
+ "modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff",
+ "modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
"modelName": "vSAMP12::base::module-0",
"modelVersion": "1"
},
@@ -22,8 +22,8 @@
"instanceId": "{service-instance-id}",
"modelInfo": {
"modelType": "service",
- "modelInvariantId": "ff3514e3-5a33-55df-13ab-12abad84e7ff",
- "modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
+ "modelInvariantUuid": "ff3514e3-5a33-55df-13ab-12abad84e7ff",
+ "modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
"modelName": "Test",
"modelVersion": "2.0"
}
@@ -33,11 +33,11 @@
"instanceId": "{vnf-instance-id}",
"modelInfo": {
"modelType": "vnf",
- "modelInvariantId": "ff5256d1-5a33-55df-13ab-12abad84e7ff",
- "modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
+ "modelInvariantUuid": "ff5256d1-5a33-55df-13ab-12abad84e7ff",
+ "modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
"modelName": "Test/vSAMP12",
"modelVersion": "1",
- "modelCustomizationName": "vSAMP12"
+ "modelInstanceName": "vSAMP12"
}
}
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/updateVfModuleVolume_VID_request_2.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/updateVfModuleVolume_VID_request_2.json
index 963e2dd7d7..f32ba2994b 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/updateVfModuleVolume_VID_request_2.json
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/updateVfModuleVolume_VID_request_2.json
@@ -2,8 +2,8 @@
"requestDetails": {
"modelInfo": {
"modelType": "volumeGroup",
- "modelInvariantId": "ff5256d2-5a33-55df-13ab-12abad84e7ff",
- "modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
+ "modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff",
+ "modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
"modelName": "vSAMP12::base::module-0",
"modelVersion": "1"
},
@@ -22,8 +22,8 @@
"instanceId": "{service-instance-id}",
"modelInfo": {
"modelType": "service",
- "modelInvariantId": "ff3514e3-5a33-55df-13ab-12abad84e7ff-x",
- "modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
+ "modelInvariantUuid": "ff3514e3-5a33-55df-13ab-12abad84e7ff-x",
+ "modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
"modelName": "Test",
"modelVersion": "2.0"
}
@@ -33,11 +33,11 @@
"instanceId": "{vnf-instance-id}",
"modelInfo": {
"modelType": "vnf",
- "modelInvariantId": "ff5256d1-5a33-55df-13ab-12abad84e7ff",
- "modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
+ "modelInvariantUuid": "ff5256d1-5a33-55df-13ab-12abad84e7ff",
+ "modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
"modelName": "Test/vSAMP12",
"modelVersion": "1",
- "modelCustomizationName": "vSAMP12"
+ "modelInstanceName": "vSAMP12"
}
}
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/vf_module_aai_response.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/vf_module_aai_response.xml
index 58b8708809..85773cdb07 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/vf_module_aai_response.xml
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/vf_module_aai_response.xml
@@ -5,8 +5,8 @@
<orchestration-status>active</orchestration-status>
<is-base-vf-module>true</is-base-vf-module>
<resource-version>1475077639</resource-version>
- <persona-model-id>ff5256d2-5a33-55df-13ab-12abad84e7ff</persona-model-id>
- <persona-model-version>1.0</persona-model-version>
+ <model-invariant-id>ff5256d2-5a33-55df-13ab-12abad84e7ff</model-invariant-id>
+ <model-version-id>1.0</model-version-id>
<relationship-list>
<relationship>
<related-to>volume-group</related-to>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/getCatalogServiceResourcesDataForReplaceVnfInfra.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/getCatalogServiceResourcesDataForReplaceVnfInfra.json
new file mode 100644
index 0000000000..9126442ddb
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/getCatalogServiceResourcesDataForReplaceVnfInfra.json
@@ -0,0 +1,93 @@
+{ "serviceResources" : {
+ "modelInfo" : {
+ "modelName" : "MSO Test Network",
+ "modelUuid" : "aed5a5b7-20d3-44f7-90a3-ddbd16f14d1e",
+ "modelInvariantUuid" : "52b49b5d-3086-4ffd-b5e6-1b1e5e7e062f",
+ "modelVersion" : null
+ },
+ "serviceVnfs": [
+ { "modelInfo" : {
+ "modelName" : "vHNF for DHV Test",
+ "modelUuid" : "fe6478e5-ea33-3346-ac12-ab121484a3fe",
+ "modelInvariantUuid" : "ff5256d2-5a33-55df-13ab-12abad84e7ff",
+ "modelVersion" : "1.0",
+ "modelCustomizationUuid" : "MODEL-ID-1234",
+ "modelInstanceName" : "vHNF for DHV Test 17"
+ },
+ "toscaNodeType" : null,
+ "nfFunction" : null,
+ "nfType" : null,
+ "nfRole" : "vSCP",
+ "nfNamingCode" : null,
+ "vfModules": [
+ {
+ "modelInfo" : {
+ "modelName" : "VhnfForDhvTest..base_TEST..module-0",
+ "modelUuid" : "ebc3d18c-3e62-4c24-bcd6-961e98701a0a",
+ "modelInvariantUuid" : "introvert",
+ "modelVersion" : "1",
+ "modelCustomizationUuid" : "1740536a-742e-40f5-b9c8-83918849a787"
+ }, "isBase" : true,
+ "vfModuleLabel" : "base_TEST",
+ "initialCount" : 1,
+ "hasVolumeGroup" : true
+ }
+ ]
+ }
+ ],
+ "serviceNetworks": [
+ {
+ "modelInfo" : {
+ "modelName" : "CONTRAIL_BASIC",
+ "modelUuid" : "fe5be3a6-dbe0-46d6-bcac-44dc841a7edc",
+ "modelInvariantUuid" : "ab07fbd8-185a-45ac-be45-db3eb02e98d5",
+ "modelVersion" : null,
+ "modelCustomizationUuid" : "0cb9b26a-9820-48a7-86e5-16c510e993d9",
+ "modelInstanceName" : "CONTRAIL_BASIC 5"
+ },
+ "toscaNodeType" : null,
+ "networkType" : null,
+ "networkTechnology" : null,
+ "networkRole" : null,
+ "networkScope" : null
+ }
+ ],
+ "serviceAllottedResources": [
+ {
+ "modelInfo" : {
+ "modelName" : "IP_MUX_Demux",
+ "modelUuid" : "64a1a718-556b-48ce-b3b7-ed3237ccc94f",
+ "modelInvariantUuid" : "f110ef53-a0a6-4d72-ab91-fd88a835e8c4",
+ "modelVersion" : "2.0",
+ "modelCustomizationUuid" : "4bab0880-2f06-4aeb-87cb-3734c8e8bf93",
+ "modelInstanceName" : "Pri_IP_MUX_Demux 1"
+ },
+ "toscaNodeType" : null,
+ "allottedResourceType" : "ContrailRoute",
+ "allottedResourceRole" : null,
+ "providingServiceModelInvariantUuid" : null,
+ "nfFunction" : null,
+ "nfType" : null,
+ "nfRole" : null,
+ "nfNamingCode" : null
+ },
+ {
+ "modelInfo" : {
+ "modelName" : "Service_Admin",
+ "modelUuid" : "73501e03-ee76-4509-a8ce-96d2a9f33ee9",
+ "modelInvariantUuid" : "462edf71-1a3c-487b-bf55-497460ab7de3",
+ "modelVersion" : "2.0",
+ "modelCustomizationUuid" : "a896ffad-c8f9-404e-a527-7a8d0cc99ce6",
+ "modelInstanceName" : "Pri_Service_Admin 5"
+ },
+ "toscaNodeType" : null,
+ "allottedResourceType" : "SecurityZone",
+ "allottedResourceRole" : null,
+ "providingServiceModelInvariantUuid" : null,
+ "nfFunction" : null,
+ "nfType" : null,
+ "nfRole" : null,
+ "nfNamingCode" : null
+ }
+ ]
+ }} \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/getCatalogServiceResourcesDataForUpdateVnfInfra.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/getCatalogServiceResourcesDataForUpdateVnfInfra.json
new file mode 100644
index 0000000000..eac0957fd3
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/getCatalogServiceResourcesDataForUpdateVnfInfra.json
@@ -0,0 +1,105 @@
+{ "serviceResources" : {
+ "modelInfo" : {
+ "modelName" : "MSO Test Network",
+ "modelUuid" : "aed5a5b7-20d3-44f7-90a3-ddbd16f14d1e",
+ "modelInvariantUuid" : "52b49b5d-3086-4ffd-b5e6-1b1e5e7e062f",
+ "modelVersion" : null
+ },
+ "serviceVnfs": [
+ { "modelInfo" : {
+ "modelName" : "vHNF for DHV Test",
+ "modelUuid" : "7097d8bb-f6ad-4cf7-866e-6a04c8f1b332",
+ "modelInvariantUuid" : "ff5256d2-5a33-55df-13ab-12abad84e7ff",
+ "modelVersion" : "2.0",
+ "modelCustomizationUuid" : "da86dd87-43c5-458c-b226-5315b7be9ad5",
+ "modelInstanceName" : "vHNF for DHV Test 17"
+ },
+ "toscaNodeType" : null,
+ "nfFunction" : null,
+ "nfType" : null,
+ "nfRole" : "vSCP",
+ "nfNamingCode" : null,
+ "vfModules": [
+ {
+ "modelInfo" : {
+ "modelName" : "VhnfForDhvTest..base_TEST..module-0",
+ "modelUuid" : "ebc3d18c-3e62-4c24-bcd6-961e98701a0a",
+ "modelInvariantUuid" : "introvert",
+ "modelVersion" : "1",
+ "modelCustomizationUuid" : "1740536a-742e-40f5-b9c8-83918849a787"
+ }, "isBase" : true,
+ "vfModuleLabel" : "base_TEST",
+ "initialCount" : 1,
+ "hasVolumeGroup" : true
+ },
+ {
+ "modelInfo" : {
+ "modelName" : "VhnfForDhvTest..base_TEST..module-1",
+ "modelUuid" : "ebc3d18c-3e62-4c24-bcd6-961e98701a0b",
+ "modelInvariantUuid" : "extrovert",
+ "modelVersion" : "1",
+ "modelCustomizationUuid" : "1740536a-742e-40f5-b9c8-83918849a788"
+ }, "isBase" : false,
+ "vfModuleLabel" : "addon_TEST",
+ "initialCount" : 1,
+ "hasVolumeGroup" : true
+ }
+ ]
+ }
+ ],
+ "serviceNetworks": [
+ {
+ "modelInfo" : {
+ "modelName" : "CONTRAIL_BASIC",
+ "modelUuid" : "fe5be3a6-dbe0-46d6-bcac-44dc841a7edc",
+ "modelInvariantUuid" : "ab07fbd8-185a-45ac-be45-db3eb02e98d5",
+ "modelVersion" : null,
+ "modelCustomizationUuid" : "0cb9b26a-9820-48a7-86e5-16c510e993d9",
+ "modelInstanceName" : "CONTRAIL_BASIC 5"
+ },
+ "toscaNodeType" : null,
+ "networkType" : null,
+ "networkTechnology" : null,
+ "networkRole" : null,
+ "networkScope" : null
+ }
+ ],
+ "serviceAllottedResources": [
+ {
+ "modelInfo" : {
+ "modelName" : "IP_MUX_Demux",
+ "modelUuid" : "64a1a718-556b-48ce-b3b7-ed3237ccc94f",
+ "modelInvariantUuid" : "f110ef53-a0a6-4d72-ab91-fd88a835e8c4",
+ "modelVersion" : "2.0",
+ "modelCustomizationUuid" : "4bab0880-2f06-4aeb-87cb-3734c8e8bf93",
+ "modelInstanceName" : "Pri_IP_MUX_Demux 1"
+ },
+ "toscaNodeType" : null,
+ "allottedResourceType" : "ContrailRoute",
+ "allottedResourceRole" : null,
+ "providingServiceModelInvariantUuid" : null,
+ "nfFunction" : null,
+ "nfType" : null,
+ "nfRole" : null,
+ "nfNamingCode" : null
+ },
+ {
+ "modelInfo" : {
+ "modelName" : "Service_Admin",
+ "modelUuid" : "73501e03-ee76-4509-a8ce-96d2a9f33ee9",
+ "modelInvariantUuid" : "462edf71-1a3c-487b-bf55-497460ab7de3",
+ "modelVersion" : "2.0",
+ "modelCustomizationUuid" : "a896ffad-c8f9-404e-a527-7a8d0cc99ce6",
+ "modelInstanceName" : "Pri_Service_Admin 5"
+ },
+ "toscaNodeType" : null,
+ "allottedResourceType" : "SecurityZone",
+ "allottedResourceRole" : null,
+ "providingServiceModelInvariantUuid" : null,
+ "nfFunction" : null,
+ "nfType" : null,
+ "nfRole" : null,
+ "nfNamingCode" : null
+ }
+ ]
+ }} \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/serviceDecompositionATMFW.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/serviceDecompositionATMFW.json
new file mode 100644
index 0000000000..94c1152204
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/serviceDecompositionATMFW.json
@@ -0,0 +1,110 @@
+{
+"serviceResources" : {
+ "modelInfo" : {
+ "modelName" : "CMW_Service",
+ "modelUuid" : "",
+ "modelInvariantId" : "cmw-123-456-789",
+ "modelVersion" : "",
+ "modelCustomizationUuid" : "",
+ "modelInstanceName" : "",
+ "modelCustomizationName" : "",
+ "modelVersionId" : "Cmw_123",
+ "modelType" : ""
+ },
+ "serviceInstanceData" : {
+ "instanceId" : "ff5256d2-5a33-55df-13ab-12abad84e7ff"
+ },
+ "serviceNetworks" : [ {
+ "modelInfo" : {
+ "modelName" : "CONTRAIL30_BASIC",
+ "modelUuid" : "",
+ "modelInvariantId" : "not yet implemented",
+ "modelVersion" : "1.0",
+ "modelCustomizationUuid" : "z_network_123",
+ "modelInstanceName" : "",
+ "modelCustomizationName" : "",
+ "modelVersionId" : "mod-inst-uuid-123",
+ "modelType" : "network"
+ },
+ "instanceData" : { },
+ "networkType" : "CONTRAIL30_BASIC"
+ } ],
+ "serviceVnfs" : [ {
+ "modelInfo" : {
+ "modelName" : "vSAMP12",
+ "modelUuid" : "",
+ "modelInvariantId" : "ff5256d2-5a33-55df-13ab-12abad84e7ff",
+ "modelVersion" : "1.0",
+ "modelCustomizationUuid" : "ff5256d2-5a33-55df-13ab-12abad84e7ff",
+ "modelInstanceName" : "",
+ "modelCustomizationName" : "",
+ "modelVersionId" : "fe6478e5-ea33-3346-ac12-ab121484a3fe",
+ "modelType" : "vnf"
+ },
+ "instanceData" : { },
+ "vfModules" : [ {
+ "modelInfo" : {
+ "modelName" : "vSAMP12::base::module-0",
+ "modelUuid" : "",
+ "modelInvariantId" : "miu-1001",
+ "modelVersion" : "1",
+ "modelCustomizationUuid" : "1001",
+ "modelInstanceName" : "",
+ "modelCustomizationName" : "",
+ "modelVersionId" : "",
+ "modelType" : "vfModule"
+ },
+ "instanceData" : { },
+ "hasVolumeGroup" : false,
+ "isBase" : true,
+ "initialCount" : 1
+ }, {
+ "modelInfo" : {
+ "modelName" : "base::module-0",
+ "modelUuid" : "",
+ "modelInvariantId" : "miu-1002",
+ "modelVersion" : "1",
+ "modelCustomizationUuid" : "1002",
+ "modelInstanceName" : "",
+ "modelCustomizationName" : "",
+ "modelVersionId" : "",
+ "modelType" : "vfModule"
+ },
+ "instanceData" : { },
+ "hasVolumeGroup" : false,
+ "isBase" : true,
+ "initialCount" : 1
+ }, {
+ "modelInfo" : {
+ "modelName" : "vSAMP12DEV::base::module-0",
+ "modelUuid" : "",
+ "modelInvariantId" : "miu-1003",
+ "modelVersion" : "1",
+ "modelCustomizationUuid" : "f86e8800-7629-427f-b284-3dbfd04db01f",
+ "modelInstanceName" : "",
+ "modelCustomizationName" : "",
+ "modelVersionId" : "",
+ "modelType" : "vfModule"
+ },
+ "instanceData" : { },
+ "hasVolumeGroup" : false,
+ "isBase" : true,
+ "initialCount" : 0
+ } ]
+ } ],
+ "serviceAllottedResources" : [ {
+ "modelInfo" : {
+ "modelName" : "Bruce Wayne",
+ "modelUuid" : "",
+ "modelInvariantId" : "not yet implemented",
+ "modelVersion" : "1.0",
+ "modelCustomizationUuid" : "ar-mod-custid-456-456",
+ "modelInstanceName" : "Clark Kent",
+ "modelCustomizationName" : "",
+ "modelVersionId" : "123-123",
+ "modelType" : "allottedResource"
+ },
+ "instanceData" : { }
+ } ]
+ }
+} \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/DBUpdateResponse.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/DBUpdateResponse.xml
index 110e4327df..7c30f75497 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/DBUpdateResponse.xml
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/DBUpdateResponse.xml
@@ -1,4 +1,4 @@
-<ns2:updateRequestResponse xmlns:ns2="http://com.att.mso/requestsdb"
+<ns2:updateRequestResponse xmlns:ns2="http://org.openecomp.mso/requestsdb"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"/> \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/GenerateVfModuleName_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/GenerateVfModuleName_AAIResponse_Success.xml
index 181473543f..fe874717a8 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/GenerateVfModuleName_AAIResponse_Success.xml
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/GenerateVfModuleName_AAIResponse_Success.xml
@@ -1,4 +1,4 @@
-<generic-vnf xmlns="http://com.att.aai.inventory/v7">
+<generic-vnf xmlns="http://org.openecomp.aai.inventory/v7">
<vnf-id>12345678-f41f-4822-9323-b75962763d74</vnf-id>
<vnf-name>STMTN5MMSC20</vnf-name>
<vnf-type>pcrf-capacity</vnf-type>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/GenericVnf.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/GenericVnf.xml
index 85427e2fcc..4712a5a464 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/GenericVnf.xml
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/GenericVnf.xml
@@ -1,4 +1,4 @@
-<generic-vnf xmlns="http://com.att.aai.inventory/v7">
+<generic-vnf xmlns="http://org.openecomp.aai.inventory/v7">
<vnf-id>skask</vnf-id>
<vnf-name>STMTN5MMSC20</vnf-name>
<vnf-type>pcrf-capacity</vnf-type>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallback.xml
index 27cab6b422..10af29a210 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallback.xml
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallback.xml
@@ -6,7 +6,7 @@
<sdnc-request-header>
<svc-request-id>9ddf628a-9eca-430e-8974-22d520a31be1</svc-request-id>
<svc-action>assign</svc-action>
- <svc-notification-url>https://msojra.infra.aic.att.net:8443/adapters/rest/SDNCNotify</svc-notification-url>
+ <svc-notification-url>https://msojra.infra.aic.net:8443/adapters/rest/SDNCNotify</svc-notification-url>
</sdnc-request-header>
<service-information>
<subscriber-name>notsurewecare</subscriber-name>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallbackVfModule.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallbackVfModule.xml
index be6f973260..f96a073ef6 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallbackVfModule.xml
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallbackVfModule.xml
@@ -20,7 +20,7 @@
</service-information>
<sdnc-request-header>
<svc-request-id>5e168556-a5c6-4813-bff3-cc03007afbbc</svc-request-id>
- <svc-notification-url>http://mtanjv9moja01-eth1-0.aic.cip.att.com:8080/adapters/rest/SDNCNotify</svc-notification-url>
+ <svc-notification-url>http://mtanjv9moja01-eth1-0.aic.cip.com:8080/adapters/rest/SDNCNotify</svc-notification-url>
<svc-action>assign</svc-action>
</sdnc-request-header>
<vnf-request-information>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallbackVfModuleNoVnf.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallbackVfModuleNoVnf.xml
new file mode 100644
index 0000000000..50a71c110e
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallbackVfModuleNoVnf.xml
@@ -0,0 +1,81 @@
+<output xmlns="com:att:sdnctl:vnf">
+<vf-module-topology xmlns="com:att:sdnctl:generic-resource">
+ <vf-module-topology-identifier>
+ <vf-module-id>0725b072-b854-4705-bf8e-c1a1eb08651e</vf-module-id>
+ <vf-module-type>vSAMP10aDEV::base::module-0</vf-module-type>
+ <vf-module-name>zmtn6nf-code-111_base_0</vf-module-name>
+ </vf-module-topology-identifier>
+ <ecomp-model-information>
+ <model-name>vSAMP10aDEV::base::module-0</model-name>
+ <model-customization-uuid>819ef122-ca19-4141-a61e-62922f8fc279</model-customization-uuid>
+ <model-version>ff2ae348-214a-11e7-93ae-92361f002673</model-version>
+ <model-invariant-uuid>3a97db99-c4bb-498a-a13a-38f65f1ced3d</model-invariant-uuid>
+ <model-uuid>ff2ae348-214a-11e7-93ae-92361f002673</model-uuid>
+ </ecomp-model-information>
+ <tenant>19123c2924c648eb8e42a3c1f14b7682</tenant>
+ <aic-cloud-region>mtn6</aic-cloud-region>
+ <aic-clli>AUSTTXGR</aic-clli>
+ <vf-module-parameters>
+ <param>
+ <name>image</name>
+ <value>Ubuntu_Perf</value>
+ </param>
+ <param>
+ <name>flavor</name>
+ <value>m1.small</value>
+ </param>
+ </vf-module-parameters>
+ <vf-module-assignments>
+ <vms>
+ <vm>
+ <vm-type>cm</vm-type>
+ <vm-names>
+ <vm-name>ZVNN1MOGX01MCM001</vm-name>
+ </vm-names>
+ <vm-names>
+ <vm-name>ZVNN1MOGX01OAM002</vm-name>
+ </vm-names>
+ <vm-count>1</vm-count>
+ <vm-networks>
+ <network-role>mog_cor_B</network-role>
+ <network-ips>
+ <ip-address>107.224.36.249</ip-address>
+ </network-ips>
+ <network-ips>
+ <ip-address>107.224.36.250</ip-address>
+ </network-ips>
+ <network-ips-v6>
+ <ip-address-ipv6>2606:ae00:2e01:800::67</ip-address-ipv6>
+ </network-ips-v6>
+ <use-dhcp>N</use-dhcp>
+ <floating-ip>107.224.41.252</floating-ip>
+ <floating-ip-v6>2001:1890:1001:2B32::29:C</floating-ip-v6>
+ </vm-networks>
+ <vm-networks>
+ <network-role>mog_oam</network-role>
+ <network-ips>
+ <ip-address>107.239.167.250</ip-address>
+ </network-ips>
+ <network-ips>
+ <ip-address>107.239.167.251</ip-address>
+ </network-ips>
+ <network-ips-v6>
+ <ip-address-ipv6>aa::aa::aa::aa::aa::aa</ip-address-ipv6>
+ </network-ips-v6>
+ <network-ips-v6>
+ <ip-address-ipv6>bb::bb::bb::bb::bb::bb</ip-address-ipv6>
+ </network-ips-v6>
+ <interface-route-prefixes>
+ <interface-route-prefix-cidr>1.2.3.4/26</interface-route-prefix-cidr>
+ </interface-route-prefixes>
+ <interface-route-prefixes>
+ <interface-route-prefix-cidr>2002::/64</interface-route-prefix-cidr>
+ </interface-route-prefixes>
+ <use-dhcp>N</use-dhcp>
+ <floating-ip-v6>1111:1890:1001:2B32::29:D</floating-ip-v6>
+ </vm-networks>
+ </vm>
+ </vms>
+ </vf-module-assignments>
+</vf-module-topology>
+</output> \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallbackVnf.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallbackVnf.xml
new file mode 100644
index 0000000000..bc2c7b9e63
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallbackVnf.xml
@@ -0,0 +1,82 @@
+<output xmlns="com:att:sdnctl:vnf">
+<vnf-topology xmlns="com:att:sdnctl:generic-resource">
+ <vnf-topology-identifier-structure>
+ <nf-type>nf-type-1</nf-type>
+ <vnf-name>zmtn6nf-code-111</vnf-name>
+ <nf-role>nf-role-1</nf-role>
+ <nf-function>nf-function-1</nf-function>
+ <nf-code>nf-code-1</nf-code>
+ <vnf-id>eac30f85-f61f-4c5f-862e-2c62f9e135de</vnf-id>
+ <vnf-type>null</vnf-type>
+ </vnf-topology-identifier-structure>
+ <ecomp-model-information>
+ <model-name>vSAMP10a_macro</model-name>
+ <model-customization-uuid>819ef122-ca19-4141-a61e-62922f8fc279</model-customization-uuid>
+ <model-version>1.0</model-version>
+ <model-invariant-uuid>ef176121-f02c-4dd3-927c-22131d48446b</model-invariant-uuid>
+ <model-uuid>ff2ae348-214a-11e7-93ae-92361f002672</model-uuid>
+ </ecomp-model-information>
+ <vnf-resource-assignments>
+ <vnf-networks>
+ <network-role>mog_exn</network-role>
+ <network-id>03dbd833-785c-40c0-bf32-37594b5334bc</network-id>
+ <network-name>MNS-25180-P-VNNYCA01_exn_protected_net_1</network-name>
+ <contrail-network-fqdn/>
+ <subnet-id/>
+ <neutron-id>6f82d234-41a4-48e9-a9e8-415667a72929</neutron-id>
+ <sriov-vlan-filter-list>
+ <sriov-vlan-filter>filter1</sriov-vlan-filter>
+ </sriov-vlan-filter-list>
+ <sriov-vlan-filter-list>
+ <sriov-vlan-filter>filter2</sriov-vlan-filter>
+ </sriov-vlan-filter-list>
+ </vnf-networks>
+ <vnf-networks>
+ <network-role>mog_oam</network-role>
+ <network-id>3f181cde-9380-4c20-9d3a-e1a4ee74f994</network-id>
+ <network-name>MNS-25180-P-VNNYCA01_oam_protected_net_1</network-name>
+ <contrail-network-fqdn/>
+ <subnet-id/>
+ <neutron-id>713b6770-13fa-4949-8dbb-a1288c5e5932</neutron-id>
+ </vnf-networks>
+ <vnf-networks>
+ <network-role>mog_cor_B</network-role>
+ <network-id>821a550a-3f50-4725-995b-f212d5caec7c</network-id>
+ <network-name>MNS-25180-P-VNNYCA01_cor_direct_net_1</network-name>
+ <contrail-network-fqdn/>
+ <subnet-id/>
+ <neutron-id>18926e56-12b6-4a4d-98b6-37e0c05626ee</neutron-id>
+ </vnf-networks>
+ <vnf-networks>
+ <network-role>mog_cor_A</network-role>
+ <network-id>3dabf5c0-cffb-420c-8960-8499c74eb25f</network-id>
+ <network-name>MNS-25180-P-VNNYCA01_cor_direct_net_2</network-name>
+ <contrail-network-fqdn/>
+ <subnet-id/>
+ <neutron-id>35530b29-a4de-48ff-a014-111110ccc652</neutron-id>
+ </vnf-networks>
+ <vnf-networks>
+ <network-role>mog_gn</network-role>
+ <network-id>3ce97321-6e7f-49af-bd12-f833e377c310</network-id>
+ <network-name>MNS-25180-P-VNNYCA01_gn_direct_net_1</network-name>
+ <contrail-network-fqdn/>
+ <subnet-id/>
+ <neutron-id>32bfdd2c-28e1-4895-87a6-373bf12c3129</neutron-id>
+ </vnf-networks>
+ <vnf-networks>
+ <network-role>mog_dmz</network-role>
+ <network-id>d43ca910-02a5-47dc-8510-100a68a3c9e0</network-id>
+ <network-name>MNS-25180-P-VNNYCA01_dmz_protected_net_1</network-name>
+ <contrail-network-fqdn/>
+ <subnet-id/>
+ <neutron-id>cb9500fb-943f-412e-aea6-458711564a75</neutron-id>
+ </vnf-networks>
+ <availability-zones>
+ <availability-zone>nova</availability-zone>
+ </availability-zones>
+ </vnf-resource-assignments>
+ <tenant>19123c2924c648eb8e42a3c1f14b7682</tenant>
+ <aic-cloud-region>mtn6</aic-cloud-region>
+ <aic-clli>AUSTTXGR</aic-clli>
+</vnf-topology>
+</output> \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VfModule-lukewarm.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VfModule-lukewarm.xml
index 8de2f95901..8db8610501 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VfModule-lukewarm.xml
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VfModule-lukewarm.xml
@@ -1,4 +1,4 @@
-<vf-module xmlns="http://com.att.aai.inventory/v7">
+<vf-module xmlns="http://org.openecomp.aai.inventory/v7">
<vf-module-id>lukewarm</vf-module-id>
<vf-module-name>PCRF::module-1</vf-module-name>
<heat-stack-id>slowburn</heat-stack-id>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VfModule-new.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VfModule-new.xml
index e72d23d9d9..10e85c0568 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VfModule-new.xml
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VfModule-new.xml
@@ -1,4 +1,4 @@
-<vf-module xmlns="http://com.att.aai.inventory/v7">
+<vf-module xmlns="http://org.openecomp.aai.inventory/v7">
<vf-module-id>b37d96db-7d2c-47ce-bf61-a6c7b82fe161</vf-module-id>
<vf-module-name>PCRF::module-0-2</vf-module-name>
<model-invariant-id>00000000-0000-0000-0000-000000000000</model-invariant-id>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VfModule-supercool.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VfModule-supercool.xml
index 15a84aad05..4e7d567564 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VfModule-supercool.xml
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VfModule-supercool.xml
@@ -1,4 +1,4 @@
-<vf-module xmlns="http://com.att.aai.inventory/v7">
+<vf-module xmlns="http://org.openecomp.aai.inventory/v7">
<vf-module-id>supercool</vf-module-id>
<vf-module-name>PCRF::module-2</vf-module-name>
<heat-stack-id>fastburn</heat-stack-id>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/mso.bpmn.urn.properties b/bpmn/MSOInfrastructureBPMN/src/test/resources/mso.bpmn.urn.properties
index b14d49511a..8a557c433a 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/mso.bpmn.urn.properties
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/mso.bpmn.urn.properties
@@ -9,10 +9,12 @@ mso.csi.pwd=4EA237303511EFBBC37F17A351562131
mso.csi.usrname=mso
mso.msoKey=07a7159d3bf51a0e53be7a8f89699be7
+mso.healthcheck.log.debug=false
+
mso.adapters.completemsoprocess.endpoint=http://localhost:28090/CompleteMsoProcess
mso.workflow.message.endpoint=http://localhost:8080/mso/WorkflowMessage
-mso.catalog.db.endpoint=http://localhost:8090
-mso.adapters.db.endpoint=http://localhost:28090/dbadapters/RequestsDbAdapter
+mso.adapters.db.endpoint=http://localhost:28090/dbadapters/MsoRequestsDbAdapter
+mso.openecomp.adapters.db.endpoint=http://localhost:28090/dbadapters/RequestsDbAdapter
mso.adapters.db.auth=757A94191D685FD2092AC1490730A4FC
mso.adapters.network.endpoint=http://localhost:28090/networks/NetworkAdapter
@@ -24,6 +26,7 @@ mso.po.timeout=PT60S
aai.auth=757A94191D685FD2092AC1490730A4FC
+mso.default.adapter.namespace=http://org.openecomp.mso
mso.adapters.sdnc.endpoint=http://localhost:28090/SDNCAdapter
mso.adapters.sdnc.rest.endpoint=http://localhost:28090/SDNCAdapter/v1/sdnc
mso.adapters.sdnc.timeout=PT60S
@@ -38,7 +41,7 @@ mso.sdnc.timeout.ucpe.async.minutes=5
mso.workflow.message.endpoint=http://localhost:28080/mso/WorkflowMesssage
mso.workflow.sdncadapter.callback=http://localhost:28080/mso/SDNCAdapterCallbackService
-mso.catalog.db.endpoint=http://localhost:28090/
+mso.catalog.db.endpoint=http://localhost:28090
mso.adapters.tenant.endpoint=http://localhost:28090/tenantAdapterMock
mso.adapters.vnf-async.endpoint=http://localhost:28090/vnfs/VnfAdapterAsync
@@ -84,4 +87,31 @@ log.debug.FalloutHandler=true
log.debug.GenericGetService=true
log.debug.sdncAdapter=true
log.debug.UpdateNetworkInstanceInfra=true
-log.debug.VnfAdapterRestV1=true \ No newline at end of file
+log.debug.VnfAdapterRestV1=true
+log.debug.CreateNetworkInstance=true
+log.debug.DoCreateNetworkInstance=true
+log.debug.DoCreateNetworkInstanceRollback=true
+log.debug.DeleteNetworkInstance=true
+log.debug.DoDeleteNetworkInstance=true
+log.debug.DoDeleteNetworkInstanceRollback=true
+log.debug.UpdateNetworkInstance=true
+log.debug.DoUpdateNetworkInstance=true
+log.debug.DoUpdateNetworkInstanceRollback=true
+log.debug.CreateVnfInfra=true
+log.debug.DoCreateVnf=true
+
+policy.client.auth=Basic bTAzNzQzOnBvbGljeVIwY2sk
+policy.auth=Basic dGVzdHBkcDphbHBoYTEyMw==
+policy.environment=TEST
+policy.endpoint=http://localhost:28090/pdp/api/getDecision
+
+appc.topic.read=APPC-CL-FUSION-LCM-RESPONSE
+appc.topic.read.timeout=60000
+appc.client.response.timeout=3600000
+appc.topic.write=APPC-CL-FUSION-LCM
+appc.pool.members=uebsb91bodc.it.openecomp.org:3904,uebsb92bodc.it.openecomp.org:3904,uebsb93bodc.it.openecomp.org:3904
+appc.client.key=iaEMAfjsVsZnraBP
+appc.client.secret=wcivUjsjXzmGFBfxMmyJu9dz
+
+
+