aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOInfrastructureBPMN/src/test
diff options
context:
space:
mode:
authorRob Daugherty <rd472p@att.com>2017-09-21 15:25:28 -0400
committerRob Daugherty <rd472p@att.com>2017-09-21 15:25:28 -0400
commit43dc0ba3222a5751a1ea4ae06ed70262f3b061a7 (patch)
treef6fee89cfe19164d1b0434f8b7877e178489e684 /bpmn/MSOInfrastructureBPMN/src/test
parent4d8773a237d3c0b94b8aac3250946b7fff77fd62 (diff)
Initial commit of vCPE flows
Note: vCpeResCust isn't done yet. Waiting for Homing BB integration. Change-Id: I9c6bcbd13eb1857085cb44d9aabe96ffb600b9a1 Issue-id: SO-147 Signed-off-by: Rob Daugherty <rd472p@att.com>
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/test')
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy1131
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/CreateVcpeResCustServiceTest.java590
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGRollbackTest.java96
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGTest.java107
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceTXCRollbackTest.java96
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceTXCTest.java104
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoDeleteAllottedResourceBRGTest.java80
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoDeleteAllottedResourceTXCTest.java80
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/BuildingBlocks/sniroCallback2AR1Vnf107
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/BuildingBlocks/sniroCallback2AR1Vnf2Net165
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/BuildingBlocks/sniroCallbackNoSolutionFound15
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/BuildingBlocks/sniroCallbackPolicyException9
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/BuildingBlocks/sniroCallbackServiceException12
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getARUrlById.xml6
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getParentSIUrlById.xml6
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getParentServiceInstance.xml30
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateServiceInstance/createServiceInstance_AAIResponse_success.xml11
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/SDNCTopologyQueryCallback.xml37
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/getAR.xml8
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/getArBrg.xml31
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml31
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncActivateRollbackReq.xml51
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncAssignRollbackReq.xml51
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncCreateRollbackReq.xml51
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/SDNCTopologyQueryCallback.xml24
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml31
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncActivateRollbackReq.xml51
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncAssignRollbackReq.xml51
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncCreateRollbackReq.xml51
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoDeleteAllottedResourceBRG/arGetById.xml31
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoDeleteAllottedResourceTXC/arGetById.xml31
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/SDNCTopologyCreateCallback.xml16
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/SDNCTopologyDeactivateCallback.xml13
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/SDNCTopologyDeleteCallback.xml16
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/SDNCTopologyUnassignCallback.xml16
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/VNFAdapterRestCreateCallback.xml55
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/createServiceInstance_genericQueryByInstance_AAIResponse_200.xml13
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getARUrlById.xml6
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogNetworkData.json28
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogServiceResourcesData.json93
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogServiceResourcesDataNoNetwork.json62
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogServiceResourcesDataNoNetworkVnf.json26
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogServiceResourcesDataServiceAllotted.json84
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogServiceResourcesDataServiceInstanceOnly.json13
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogServiceResourcesServiceNetwork.json27
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogServiceResourcesServiceVnf.json40
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogVcpe.json76
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogVnfData.json1
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCustomer.xml7
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getNetwork.xml92
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getParentSIUrlById.xml6
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getParentServiceInstance.xml30
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/request.json40
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/serviceDecompositionATMFW.json110
54 files changed, 4045 insertions, 0 deletions
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy
new file mode 100644
index 0000000000..f34f84a5fd
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy
@@ -0,0 +1,1131 @@
+package org.openecomp.mso.bpmn.vcpe.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.BeforeClass
+import org.junit.Rule
+import org.junit.Test
+import org.junit.Ignore
+import org.mockito.MockitoAnnotations
+import org.mockito.ArgumentCaptor
+import org.camunda.bpm.engine.delegate.BpmnError
+import org.openecomp.mso.bpmn.common.scripts.MsoUtils
+import org.openecomp.mso.bpmn.core.WorkflowException
+import org.openecomp.mso.bpmn.mock.FileUtil
+
+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.patch
+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.urlMatching
+import static org.junit.Assert.*;
+import static org.mockito.Mockito.*
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource
+import org.openecomp.mso.bpmn.core.RollbackData
+
+import com.github.tomakehurst.wiremock.junit.WireMockRule
+
+class DoCreateAllottedResourceBRGTest {
+
+ @Rule
+ public WireMockRule wireMockRule = new WireMockRule(28090)
+
+ static def urnProps = new Properties()
+ static def aaiUriPfx
+
+ String Prefix="DCARBRG_"
+ def utils = new MsoUtils()
+
+ @BeforeClass
+ public static void setUpBeforeClass() {
+ def fr = new FileReader("src/test/resources/mso.bpmn.urn.properties")
+ urnProps.load(fr)
+ fr.close()
+
+ aaiUriPfx = urnProps.get("aai.endpoint")
+ }
+
+ @Before
+ public void init()
+ {
+ MockitoAnnotations.initMocks(this)
+ }
+
+
+ // ***** preProcessRequest *****
+
+ @Test
+// @Ignore
+ public void preProcessRequest() {
+ ExecutionEntity mex = setupMock()
+ initPreProcess(mex)
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+ DoCreateAllottedResourceBRG.preProcessRequest(mex)
+
+ verify(mex).getVariable("isDebugLogEnabled")
+ verify(mex).setVariable("prefix", Prefix)
+
+ assertTrue(checkMissingPreProcessRequest("URN_mso_workflow_sdncadapter_callback"))
+ assertTrue(checkMissingPreProcessRequest("serviceInstanceId"))
+ assertTrue(checkMissingPreProcessRequest("parentServiceInstanceId"))
+ assertTrue(checkMissingPreProcessRequest("allottedResourceModelInfo"))
+ assertTrue(checkMissingPreProcessRequest("vni"))
+ assertTrue(checkMissingPreProcessRequest("vgmuxBearerIP"))
+ assertTrue(checkMissingPreProcessRequest("brgWanMacAddress"))
+ assertTrue(checkMissingPreProcessRequest("allottedResourceRole"))
+ assertTrue(checkMissingPreProcessRequest("allottedResourceType"))
+ }
+
+
+ // ***** getAaiAR *****
+
+ @Test
+// @Ignore
+ public void getAaiAR() {
+ def arData = FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceBRG/getAR.xml")
+ def arBrg = FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceBRG/getArBrg.xml")
+
+ wireMockRule
+ .stubFor(get(urlMatching("/aai/v[0-9]+/mylink"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("VCPE/DoCreateAllottedResourceBRG/getArBrg.xml")))
+
+ ExecutionEntity mex = setupMock()
+
+ when(mex.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mex.getVariable("allottedResourceType")).thenReturn("BRGt")
+ when(mex.getVariable("allottedResourceRole")).thenReturn("BRGr")
+ when(mex.getVariable("CSI_service")).thenReturn(arData)
+ when(mex.getVariable("URN_aai_endpoint")).thenReturn(aaiUriPfx)
+ when(mex.getVariable("aaiAROrchStatus")).thenReturn("Active")
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+ DoCreateAllottedResourceBRG.getAaiAR(mex)
+
+ verify(mex).setVariable("foundActiveAR", true)
+ }
+
+ @Test
+// @Ignore
+ public void getAaiAR_Duplicate() {
+ def arData = FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceBRG/getAR.xml")
+ def arBrg = FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceBRG/getArBrg.xml")
+
+ wireMockRule
+ .stubFor(get(urlMatching("/aai/v[0-9]+/mylink"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("VCPE/DoCreateAllottedResourceBRG/getArBrg.xml")))
+
+ ExecutionEntity mex = setupMock()
+
+ when(mex.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mex.getVariable("allottedResourceType")).thenReturn("BRGt")
+ when(mex.getVariable("allottedResourceRole")).thenReturn("BRGr")
+ when(mex.getVariable("CSI_service")).thenReturn(arData)
+ when(mex.getVariable("URN_aai_endpoint")).thenReturn(aaiUriPfx)
+ when(mex.getVariable("aaiAROrchStatus")).thenReturn("Active")
+
+ // fail if duplicate
+ when(mex.getVariable("failExists")).thenReturn("true")
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+
+ assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRG.getAaiAR(mex) }))
+ }
+
+ @Test
+// @Ignore
+ public void getAaiAR_NotActive() {
+ def arData = FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceBRG/getAR.xml")
+ def arBrg = FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceBRG/getArBrg.xml")
+
+ wireMockRule
+ .stubFor(get(urlMatching("/aai/v[0-9]+/mylink"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("VCPE/DoCreateAllottedResourceBRG/getArBrg.xml")))
+
+ ExecutionEntity mex = setupMock()
+
+ when(mex.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mex.getVariable("allottedResourceType")).thenReturn("BRGt")
+ when(mex.getVariable("allottedResourceRole")).thenReturn("BRGr")
+ when(mex.getVariable("CSI_service")).thenReturn(arData)
+ when(mex.getVariable("URN_aai_endpoint")).thenReturn(aaiUriPfx)
+
+ // not active
+ when(mex.getVariable("aaiAROrchStatus")).thenReturn("not-active")
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+
+ assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRG.getAaiAR(mex) }))
+ }
+
+ @Test
+// @Ignore
+ public void getAaiAR_NoStatus() {
+ def arData = FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceBRG/getAR.xml")
+ def arBrg = FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceBRG/getArBrg.xml")
+
+ wireMockRule
+ .stubFor(get(urlMatching("/aai/v[0-9]+/mylink"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("VCPE/DoCreateAllottedResourceBRG/getArBrg.xml")))
+
+ ExecutionEntity mex = setupMock()
+
+ when(mex.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mex.getVariable("allottedResourceType")).thenReturn("BRGt")
+ when(mex.getVariable("allottedResourceRole")).thenReturn("BRGr")
+ when(mex.getVariable("CSI_service")).thenReturn(arData)
+ when(mex.getVariable("URN_aai_endpoint")).thenReturn(aaiUriPfx)
+
+ when(mex.getVariable("aaiAROrchStatus")).thenReturn(null)
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+ DoCreateAllottedResourceBRG.getAaiAR(mex)
+
+ verify(mex, never()).setVariable("foundActiveAR", true)
+ }
+
+
+ // ***** createAaiAR *****
+
+ @Test
+// @Ignore
+ public void createAaiAR() {
+ ExecutionEntity mex = setupMock()
+ initCreateAaiAr(mex)
+
+ wireMockRule
+ .stubFor(put(urlMatching("/aai/v[0-9]+/mypsi/allotted-resources/allotted-resource/myid"))
+ .willReturn(aResponse()
+ .withStatus(200)))
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+ DoCreateAllottedResourceBRG.createAaiAR(mex)
+
+ ArgumentCaptor<String> keycap = ArgumentCaptor.forClass(String.class)
+ ArgumentCaptor<Object> valcap = ArgumentCaptor.forClass(Object.class)
+
+ verify(mex, times(3)).setVariable(keycap.capture(), valcap.capture())
+
+ assertFalse(keycap.getAllValues().isEmpty())
+ assertEquals("rollbackData", keycap.getAllValues().get(keycap.getAllValues().size()-1))
+
+ def data = valcap.getAllValues().get(valcap.getAllValues().size()-1)
+ assertNotNull(data)
+ assertTrue(data instanceof RollbackData)
+
+ assertEquals("45", data.get(Prefix, "disableRollback"))
+ assertEquals("true", data.get(Prefix, "rollbackAAI"))
+ assertEquals("myid", data.get(Prefix, "allottedResourceId"))
+ assertEquals("sii", data.get(Prefix, "serviceInstanceId"))
+ assertEquals("psii", data.get(Prefix, "parentServiceInstanceId"))
+ assertEquals(aaiUriPfx+"/aai/v9/mypsi/allotted-resources/allotted-resource/myid", data.get(Prefix, "aaiARPath"))
+ }
+
+ @Test
+// @Ignore
+ public void createAaiAR_NoArid_NoModelUuids() {
+ ExecutionEntity mex = setupMock()
+ initCreateAaiAr(mex)
+
+ // no allottedResourceId - will be generated
+
+ when(mex.getVariable("allottedResourceId")).thenReturn(null)
+
+ wireMockRule
+ .stubFor(put(urlMatching("/aai/v[0-9]+/mypsi/allotted-resources/allotted-resource/.*"))
+ .willReturn(aResponse()
+ .withStatus(200)))
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+ DoCreateAllottedResourceBRG.createAaiAR(mex)
+
+ ArgumentCaptor<String> keycap = ArgumentCaptor.forClass(String.class)
+ ArgumentCaptor<Object> valcap = ArgumentCaptor.forClass(Object.class)
+
+ verify(mex, times(4)).setVariable(keycap.capture(), valcap.capture())
+
+ assertFalse(keycap.getAllValues().isEmpty())
+ assertEquals("allottedResourceId", keycap.getAllValues().get(0))
+ assertEquals("rollbackData", keycap.getAllValues().get(keycap.getAllValues().size()-1))
+
+ def arid = valcap.getAllValues().get(0)
+ assertNotNull(arid)
+ assertFalse(arid.isEmpty())
+
+ def data = valcap.getAllValues().get(valcap.getAllValues().size()-1)
+ assertNotNull(data)
+ assertTrue(data instanceof RollbackData)
+
+ assertEquals(arid, data.get(Prefix, "allottedResourceId"))
+ }
+
+ @Test
+// @Ignore
+ public void createAaiAR_MissingPsiLink() {
+ ExecutionEntity mex = setupMock()
+ initCreateAaiAr(mex)
+
+ when(mex.getVariable("PSI_resourceLink")).thenReturn(null)
+
+ wireMockRule
+ .stubFor(put(urlMatching("/aai/v[0-9]+/mypsi/allotted-resources/allotted-resource/myid"))
+ .willReturn(aResponse()
+ .withStatus(200)))
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+
+ assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceBRG.createAaiAR(mex) }))
+ }
+
+ @Test
+// @Ignore
+ public void createAaiAR_HttpFailed() {
+ ExecutionEntity mex = setupMock()
+ initCreateAaiAr(mex)
+
+ // return 500 status
+ wireMockRule
+ .stubFor(put(urlMatching("/aai/v[0-9]+/mypsi/allotted-resources/allotted-resource/myid"))
+ .willReturn(aResponse()
+ .withStatus(500)))
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+
+ assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceBRG.createAaiAR(mex) }))
+ }
+
+ @Test
+// @Ignore
+ public void createAaiAR_BpmnError() {
+ ExecutionEntity mex = setupMock()
+ initCreateAaiAr(mex)
+
+ when(mex.getVariable("URN_aai_endpoint")).thenThrow(new BpmnError("expected exception"))
+
+ wireMockRule
+ .stubFor(put(urlMatching("/aai/v[0-9]+/mypsi/allotted-resources/allotted-resource/myid"))
+ .willReturn(aResponse()
+ .withStatus(200)))
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+
+ assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceBRG.createAaiAR(mex) }))
+ }
+
+ @Test
+// @Ignore
+ public void createAaiAR_Ex() {
+ ExecutionEntity mex = setupMock()
+ initCreateAaiAr(mex)
+
+ when(mex.getVariable("URN_aai_endpoint")).thenThrow(new RuntimeException("expected exception"))
+
+ wireMockRule
+ .stubFor(put(urlMatching("/aai/v[0-9]+/mypsi/allotted-resources/allotted-resource/myid"))
+ .willReturn(aResponse()
+ .withStatus(200)))
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+
+ assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceBRG.createAaiAR(mex) }))
+ }
+
+
+ // ***** buildSDNCRequest *****
+
+ @Test
+// @Ignore
+ public void buildSDNCRequest() {
+ ExecutionEntity mex = setupMock()
+ initBuildSDNCRequest(mex)
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+
+ String result = DoCreateAllottedResourceBRG.buildSDNCRequest(mex, "myact", "myreq")
+
+ assertTrue(result.indexOf("<sdncadapter:RequestId>myreq</") >= 0)
+ assertTrue(result.indexOf("<sdncadapter:SvcAction>myact</") >= 0)
+ assertTrue(result.indexOf("<allotted-resource-id>ari</") >= 0)
+ assertTrue(result.indexOf("<sdncadapter:SvcInstanceId>sii</") >= 0)
+ assertTrue(result.indexOf("<service-instance-id>psii</") >= 0)
+ assertTrue(result.indexOf("<parent-service-instance-id>psii</") >= 0)
+ assertTrue(result.indexOf("<sdncadapter:CallbackUrl>scu</") >= 0)
+ assertTrue(result.indexOf("<request-id>mri</") >= 0)
+ assertTrue(result.indexOf("<brg-wan-mac-address>bwma</") >= 0)
+ assertTrue(result.indexOf("<vni>myvni</") >= 0)
+ assertTrue(result.indexOf("<vgmux-bearer-ip>vbi</") >= 0)
+ assertTrue(result.indexOf("<model-invariant-uuid>miu</") >= 0)
+ assertTrue(result.indexOf("<model-uuid>mu</") >= 0)
+ assertTrue(result.indexOf("<model-customization-uuid>mcu</") >= 0)
+ assertTrue(result.indexOf("<model-version>mv</") >= 0)
+ assertTrue(result.indexOf("<model-name>mn</") >= 0)
+ }
+
+ @Test
+// @Ignore
+ public void buildSDNCRequest_EmptyModelInfo() {
+ ExecutionEntity mex = setupMock()
+ initBuildSDNCRequest(mex)
+
+ when(mex.getVariable("allottedResourceModelInfo")).thenReturn("{}")
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+
+ String result = DoCreateAllottedResourceBRG.buildSDNCRequest(mex, "myact", "myreq")
+
+ assertTrue(result.indexOf("<sdncadapter:RequestId>myreq</") >= 0)
+ assertTrue(result.indexOf("<sdncadapter:SvcAction>myact</") >= 0)
+ assertTrue(result.indexOf("<allotted-resource-id>ari</") >= 0)
+ assertTrue(result.indexOf("<sdncadapter:SvcInstanceId>sii</") >= 0)
+ assertTrue(result.indexOf("<service-instance-id>psii</") >= 0)
+ assertTrue(result.indexOf("<parent-service-instance-id>psii</") >= 0)
+ assertTrue(result.indexOf("<sdncadapter:CallbackUrl>scu</") >= 0)
+ assertTrue(result.indexOf("<request-id>mri</") >= 0)
+ assertTrue(result.indexOf("<brg-wan-mac-address>bwma</") >= 0)
+ assertTrue(result.indexOf("<vni>myvni</") >= 0)
+ assertTrue(result.indexOf("<vgmux-bearer-ip>vbi</") >= 0)
+ assertTrue(result.indexOf("<model-invariant-uuid/>") >= 0)
+ assertTrue(result.indexOf("<model-uuid/>") >= 0)
+ assertTrue(result.indexOf("<model-customization-uuid/>") >= 0)
+ assertTrue(result.indexOf("<model-version/>") >= 0)
+ assertTrue(result.indexOf("<model-name/>") >= 0)
+ }
+
+ @Test
+// @Ignore
+ public void buildSDNCRequest_Ex() {
+ ExecutionEntity mex = setupMock()
+ initBuildSDNCRequest(mex)
+
+ when(mex.getVariable("allottedResourceId")).thenThrow(new RuntimeException("expected exception"))
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+
+ assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceBRG.buildSDNCRequest(mex, "myact", "myreq") }))
+ }
+
+
+ // ***** preProcessSDNCAssign *****
+
+ @Test
+// @Ignore
+ public void preProcessSDNCAssign() {
+ ExecutionEntity mex = setupMock()
+ def data = initPreProcessSDNC(mex)
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+ DoCreateAllottedResourceBRG.preProcessSDNCAssign(mex)
+
+ ArgumentCaptor<String> keycap = ArgumentCaptor.forClass(String.class)
+ ArgumentCaptor<Object> valcap = ArgumentCaptor.forClass(Object.class)
+
+ verify(mex, times(2)).setVariable(keycap.capture(), valcap.capture())
+
+ assertFalse(keycap.getAllValues().isEmpty())
+ assertEquals("sdncAssignRequest", keycap.getAllValues().get(0))
+ assertEquals("rollbackData", keycap.getAllValues().get(keycap.getAllValues().size()-1))
+
+ def req = valcap.getAllValues().get(0)
+ assertNotNull(req)
+
+ assertEquals(data, valcap.getAllValues().get(valcap.getAllValues().size()-1))
+
+ def rbreq = data.get(Prefix, "sdncAssignRollbackReq")
+
+ assertTrue(req.indexOf("<sdncadapter:SvcAction>assign</") >= 0)
+ assertTrue(req.indexOf("<request-action>CreateBRGInstance</") >= 0)
+ assertTrue(req.indexOf("<sdncadapter:RequestId>") >= 0)
+
+ assertTrue(rbreq.indexOf("<sdncadapter:SvcAction>unassign</") >= 0)
+ assertTrue(rbreq.indexOf("<request-action>DeleteBRGInstance</") >= 0)
+ assertTrue(rbreq.indexOf("<sdncadapter:RequestId>") >= 0)
+ }
+
+ @Test
+// @Ignore
+ public void preProcessSDNCAssign_BpmnError() {
+ ExecutionEntity mex = setupMock()
+ initPreProcessSDNC(mex)
+
+ when(mex.getVariable("rollbackData")).thenThrow(new BpmnError("expected exception"))
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+
+ assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceBRG.preProcessSDNCAssign(mex) }))
+ }
+
+ @Test
+// @Ignore
+ public void preProcessSDNCAssign_Ex() {
+ ExecutionEntity mex = setupMock()
+ initPreProcessSDNC(mex)
+
+ when(mex.getVariable("rollbackData")).thenThrow(new RuntimeException("expected exception"))
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+
+ assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceBRG.preProcessSDNCAssign(mex) }))
+ }
+
+
+ // ***** preProcessSDNCCreate *****
+
+ @Test
+// @Ignore
+ public void preProcessSDNCCreate() {
+ ExecutionEntity mex = setupMock()
+ def data = initPreProcessSDNC(mex)
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+ DoCreateAllottedResourceBRG.preProcessSDNCCreate(mex)
+
+ ArgumentCaptor<String> keycap = ArgumentCaptor.forClass(String.class)
+ ArgumentCaptor<Object> valcap = ArgumentCaptor.forClass(Object.class)
+
+ verify(mex, times(2)).setVariable(keycap.capture(), valcap.capture())
+
+ assertFalse(keycap.getAllValues().isEmpty())
+ assertEquals("sdncCreateRequest", keycap.getAllValues().get(0))
+ assertEquals("rollbackData", keycap.getAllValues().get(keycap.getAllValues().size()-1))
+
+ def req = valcap.getAllValues().get(0)
+ assertNotNull(req)
+
+ assertEquals(data, valcap.getAllValues().get(valcap.getAllValues().size()-1))
+
+ def rbreq = data.get(Prefix, "sdncCreateRollbackReq")
+
+ assertTrue(req.indexOf("<sdncadapter:SvcAction>create</") >= 0)
+ assertTrue(req.indexOf("<request-action>CreateBRGInstance</") >= 0)
+ assertTrue(req.indexOf("<sdncadapter:RequestId>") >= 0)
+
+ assertTrue(rbreq.indexOf("<sdncadapter:SvcAction>delete</") >= 0)
+ assertTrue(rbreq.indexOf("<request-action>DeleteBRGInstance</") >= 0)
+ assertTrue(rbreq.indexOf("<sdncadapter:RequestId>") >= 0)
+
+ }
+
+ @Test
+// @Ignore
+ public void preProcessSDNCCreate_BpmnError() {
+ ExecutionEntity mex = setupMock()
+ initPreProcessSDNC(mex)
+
+ when(mex.getVariable("rollbackData")).thenThrow(new BpmnError("expected exception"))
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+
+ assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceBRG.preProcessSDNCCreate(mex) }))
+ }
+
+ @Test
+// @Ignore
+ public void preProcessSDNCCreate_Ex() {
+ ExecutionEntity mex = setupMock()
+ initPreProcessSDNC(mex)
+
+ when(mex.getVariable("rollbackData")).thenThrow(new RuntimeException("expected exception"))
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+
+ assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceBRG.preProcessSDNCCreate(mex) }))
+ }
+
+
+ // ***** preProcessSDNCActivate *****
+
+ @Test
+// @Ignore
+ public void preProcessSDNCActivate() {
+ ExecutionEntity mex = setupMock()
+ def data = initPreProcessSDNC(mex)
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+ DoCreateAllottedResourceBRG.preProcessSDNCActivate(mex)
+
+ ArgumentCaptor<String> keycap = ArgumentCaptor.forClass(String.class)
+ ArgumentCaptor<Object> valcap = ArgumentCaptor.forClass(Object.class)
+
+ verify(mex, times(2)).setVariable(keycap.capture(), valcap.capture())
+
+ assertFalse(keycap.getAllValues().isEmpty())
+ assertEquals("sdncActivateRequest", keycap.getAllValues().get(0))
+ assertEquals("rollbackData", keycap.getAllValues().get(keycap.getAllValues().size()-1))
+
+ def req = valcap.getAllValues().get(0)
+ assertNotNull(req)
+
+ assertEquals(data, valcap.getAllValues().get(valcap.getAllValues().size()-1))
+
+ def rbreq = data.get(Prefix, "sdncActivateRollbackReq")
+
+ assertTrue(req.indexOf("<sdncadapter:SvcAction>activate</") >= 0)
+ assertTrue(req.indexOf("<request-action>CreateBRGInstance</") >= 0)
+ assertTrue(req.indexOf("<sdncadapter:RequestId>") >= 0)
+
+ assertTrue(rbreq.indexOf("<sdncadapter:SvcAction>deactivate</") >= 0)
+ assertTrue(rbreq.indexOf("<request-action>DeleteBRGInstance</") >= 0)
+ assertTrue(rbreq.indexOf("<sdncadapter:RequestId>") >= 0)
+
+ }
+
+ @Test
+// @Ignore
+ public void preProcessSDNCActivate_BpmnError() {
+ ExecutionEntity mex = setupMock()
+ initPreProcessSDNC(mex)
+
+ when(mex.getVariable("rollbackData")).thenThrow(new BpmnError("expected exception"))
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+
+ assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceBRG.preProcessSDNCActivate(mex) }))
+ }
+
+ @Test
+// @Ignore
+ public void preProcessSDNCActivate_Ex() {
+ ExecutionEntity mex = setupMock()
+ initPreProcessSDNC(mex)
+
+ when(mex.getVariable("rollbackData")).thenThrow(new RuntimeException("expected exception"))
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+
+ assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceBRG.preProcessSDNCActivate(mex) }))
+ }
+
+
+ // ***** validateSDNCResp *****
+
+ @Test
+// @Ignore
+ public void validateSDNCResp() {
+ ExecutionEntity mex = setupMock()
+ def data = initValidateSDNCResp(mex)
+ def resp = initValidateSDNCResp_Resp()
+
+ when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(true)
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+
+ DoCreateAllottedResourceBRG.validateSDNCResp(mex, resp, "create")
+
+ verify(mex).getVariable("WorkflowException")
+ verify(mex).getVariable("SDNCA_SuccessIndicator")
+ verify(mex).getVariable("rollbackData")
+
+ ArgumentCaptor<String> keycap = ArgumentCaptor.forClass(String.class)
+ ArgumentCaptor<Object> valcap = ArgumentCaptor.forClass(Object.class)
+
+ verify(mex, times(4)).setVariable(keycap.capture(), valcap.capture())
+
+ assertFalse(keycap.getAllValues().isEmpty())
+ assertEquals("rollbackData", keycap.getAllValues().get(keycap.getAllValues().size()-1))
+
+ assertEquals(data, valcap.getAllValues().get(valcap.getAllValues().size()-1))
+
+ assertEquals("true", data.get(Prefix, "rollback" + "SDNCcreate"))
+
+ }
+
+ @Test
+// @Ignore
+ public void validateSDNCResp_Get() {
+ ExecutionEntity mex = setupMock()
+ def data = initValidateSDNCResp(mex)
+ def resp = initValidateSDNCResp_Resp()
+
+ when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(true)
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+
+ DoCreateAllottedResourceBRG.validateSDNCResp(mex, resp, "get")
+
+ verify(mex).getVariable("WorkflowException")
+ verify(mex).getVariable("SDNCA_SuccessIndicator")
+
+ verify(mex, never()).getVariable("rollbackData")
+ }
+
+ @Test
+// @Ignore
+ public void validateSDNCResp_Unsuccessful() {
+ ExecutionEntity mex = setupMock()
+ initValidateSDNCResp(mex)
+ def resp = initValidateSDNCResp_Resp()
+
+ // unsuccessful
+ when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(false)
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+
+ assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceBRG.validateSDNCResp(mex, resp, "create") }))
+ }
+
+ @Test
+// @Ignore
+ public void validateSDNCResp_BpmnError() {
+ ExecutionEntity mex = setupMock()
+ initValidateSDNCResp(mex)
+ def resp = initValidateSDNCResp_Resp()
+
+ when(mex.getVariable("WorkflowException")).thenThrow(new BpmnError("expected exception"))
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+
+ assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceBRG.validateSDNCResp(mex, resp, "create") }))
+ }
+
+ @Test
+// @Ignore
+ public void validateSDNCResp_Ex() {
+ ExecutionEntity mex = setupMock()
+ initValidateSDNCResp(mex)
+ def resp = initValidateSDNCResp_Resp()
+
+ when(mex.getVariable("WorkflowException")).thenThrow(new RuntimeException("expected exception"))
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+
+ assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceBRG.validateSDNCResp(mex, resp, "create") }))
+ }
+
+
+ // ***** preProcessSDNCGet *****
+
+ @Test
+// @Ignore
+ public void preProcessSDNCGet_FoundAR() {
+ ExecutionEntity mex = setupMock()
+ initPreProcessSDNCGet(mex)
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+ DoCreateAllottedResourceBRG.preProcessSDNCGet(mex)
+
+ ArgumentCaptor<String> keycap = ArgumentCaptor.forClass(String.class)
+ ArgumentCaptor<Object> valcap = ArgumentCaptor.forClass(Object.class)
+
+ verify(mex, times(1)).setVariable(keycap.capture(), valcap.capture())
+
+ assertFalse(keycap.getAllValues().isEmpty())
+ assertEquals("sdncGetRequest", keycap.getAllValues().get(keycap.getAllValues().size()-1))
+
+ String req = valcap.getAllValues().get(valcap.getAllValues().size()-1)
+
+ assertTrue(req.indexOf("<sdncadapter:RequestId>") >= 0)
+ assertTrue(req.indexOf("<sdncadapter:SvcInstanceId>sii</") >= 0)
+ assertTrue(req.indexOf("<sdncadapter:SvcOperation>arlink</") >= 0)
+ assertTrue(req.indexOf("<sdncadapter:CallbackUrl>myurl</") >= 0)
+
+ }
+
+ @Test
+// @Ignore
+ public void preProcessSDNCGet_NotFoundAR() {
+ ExecutionEntity mex = setupMock()
+ initPreProcessSDNCGet(mex)
+
+ when(mex.getVariable("foundActiveAR")).thenReturn(false)
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+ DoCreateAllottedResourceBRG.preProcessSDNCGet(mex)
+
+ ArgumentCaptor<String> keycap = ArgumentCaptor.forClass(String.class)
+ ArgumentCaptor<Object> valcap = ArgumentCaptor.forClass(Object.class)
+
+ verify(mex, times(1)).setVariable(keycap.capture(), valcap.capture())
+
+ assertFalse(keycap.getAllValues().isEmpty())
+ assertEquals("sdncGetRequest", keycap.getAllValues().get(keycap.getAllValues().size()-1))
+
+ String req = valcap.getAllValues().get(valcap.getAllValues().size()-1)
+
+ assertTrue(req.indexOf("<sdncadapter:RequestId>") >= 0)
+ assertTrue(req.indexOf("<sdncadapter:SvcInstanceId>sii</") >= 0)
+ assertTrue(req.indexOf("<sdncadapter:SvcOperation>assignlink</") >= 0)
+ assertTrue(req.indexOf("<sdncadapter:CallbackUrl>myurl</") >= 0)
+
+ }
+
+ @Test
+// @Ignore
+ public void preProcessSDNCGet_Ex() {
+ ExecutionEntity mex = setupMock()
+ initPreProcessSDNCGet(mex)
+
+ when(mex.getVariable("foundActiveAR")).thenThrow(new RuntimeException("expected exception"))
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+
+ assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceBRG.preProcessSDNCGet(mex) }))
+ }
+
+
+ // ***** updateAaiAROrchStatus *****
+
+ @Test
+// @Ignore
+ public void updateAaiAROrchStatus() {
+ ExecutionEntity mex = setupMock()
+ initUpdateAaiAROrchStatus(mex)
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+ DoCreateAllottedResourceBRG.updateAaiAROrchStatus(mex, "success")
+ }
+
+
+ // ***** generateOutputs *****
+
+ @Test
+// @Ignore
+ public void generateOutputs() {
+ ExecutionEntity mex = setupMock()
+ def brgtop = FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceBRG/SDNCTopologyQueryCallback.xml")
+
+ when(mex.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mex.getVariable("enhancedCallbackRequestData")).thenReturn(brgtop)
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+ DoCreateAllottedResourceBRG.generateOutputs(mex)
+
+ verify(mex).setVariable("allotedResourceName", "namefromrequest")
+
+ }
+
+ @Test
+// @Ignore
+ public void generateOutputs_BadXml() {
+ ExecutionEntity mex = setupMock()
+
+ when(mex.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mex.getVariable("enhancedCallbackRequestData")).thenReturn("invalid xml")
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+ DoCreateAllottedResourceBRG.generateOutputs(mex)
+
+ verify(mex, never()).setVariable(anyString(), anyString())
+
+ }
+
+ @Test
+// @Ignore
+ public void generateOutputs_BpmnError() {
+ ExecutionEntity mex = setupMock()
+
+ when(mex.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mex.getVariable("enhancedCallbackRequestData")).thenThrow(new BpmnError("expected exception"))
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+
+ DoCreateAllottedResourceBRG.generateOutputs(mex)
+ verify(mex, never()).setVariable(anyString(), anyString())
+
+ }
+
+ @Test
+// @Ignore
+ public void generateOutputs_Ex() {
+ ExecutionEntity mex = setupMock()
+
+ when(mex.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mex.getVariable("enhancedCallbackRequestData")).thenThrow(new RuntimeException("expected exception"))
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+
+ DoCreateAllottedResourceBRG.generateOutputs(mex)
+ verify(mex, never()).setVariable(anyString(), anyString())
+
+ }
+
+
+ // ***** preProcessRollback *****
+
+ @Test
+// @Ignore
+ public void preProcessRollback() {
+ ExecutionEntity mex = setupMock()
+ WorkflowException wfe = mock(WorkflowException.class)
+
+ when(mex.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mex.getVariable("WorkflowException")).thenReturn(wfe)
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+ DoCreateAllottedResourceBRG.preProcessRollback(mex)
+
+ verify(mex).setVariable("prevWorkflowException", wfe)
+
+ }
+
+ @Test
+// @Ignore
+ public void preProcessRollback_NotWFE() {
+ ExecutionEntity mex = setupMock()
+
+ when(mex.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mex.getVariable("WorkflowException")).thenReturn("I'm not a WFE")
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+ DoCreateAllottedResourceBRG.preProcessRollback(mex)
+
+// verify(mex, never()).setVariable("prevWorkflowException", any())
+
+ }
+
+ @Test
+// @Ignore
+ public void preProcessRollback_BpmnError() {
+ ExecutionEntity mex = setupMock()
+
+ when(mex.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mex.getVariable("WorkflowException")).thenThrow(new BpmnError("expected exception"))
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+
+ DoCreateAllottedResourceBRG.preProcessRollback(mex)
+
+ }
+
+ @Test
+// @Ignore
+ public void preProcessRollback_Ex() {
+ ExecutionEntity mex = setupMock()
+
+ when(mex.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mex.getVariable("WorkflowException")).thenThrow(new RuntimeException("expected exception"))
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+
+ DoCreateAllottedResourceBRG.preProcessRollback(mex)
+
+ }
+
+
+ // ***** postProcessRollback *****
+
+ @Test
+// @Ignore
+ public void postProcessRollback() {
+ ExecutionEntity mex = setupMock()
+ WorkflowException wfe = mock(WorkflowException.class)
+
+ when(mex.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mex.getVariable("prevWorkflowException")).thenReturn(wfe)
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+ DoCreateAllottedResourceBRG.postProcessRollback(mex)
+
+ verify(mex).setVariable("WorkflowException", wfe)
+ verify(mex).setVariable("rollbackData", null)
+
+ }
+
+ @Test
+// @Ignore
+ public void postProcessRollback_NotWFE() {
+ ExecutionEntity mex = setupMock()
+
+ when(mex.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mex.getVariable("prevWorkflowException")).thenReturn("I'm not a WFE")
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+ DoCreateAllottedResourceBRG.postProcessRollback(mex)
+
+// verify(mex, never()).setVariable("WorkflowException", any())
+ verify(mex).setVariable("rollbackData", null)
+
+ }
+
+ @Test
+// @Ignore
+ public void postProcessRollback_BpmnError() {
+ ExecutionEntity mex = setupMock()
+
+ when(mex.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mex.getVariable("prevWorkflowException")).thenThrow(new BpmnError("expected exception"))
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+
+ assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceBRG.postProcessRollback(mex) }))
+ verify(mex, never()).setVariable("rollbackData", null)
+
+ }
+
+ @Test
+// @Ignore
+ public void postProcessRollback_Ex() {
+ ExecutionEntity mex = setupMock()
+
+ when(mex.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mex.getVariable("prevWorkflowException")).thenThrow(new RuntimeException("expected exception"))
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+
+ DoCreateAllottedResourceBRG.postProcessRollback(mex)
+ verify(mex, never()).setVariable("rollbackData", null)
+
+ }
+
+ private boolean checkMissingPreProcessRequest(String fieldnm) {
+ ExecutionEntity mex = setupMock()
+ initPreProcess(mex)
+
+ DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+
+ when(mex.getVariable(fieldnm)).thenReturn("")
+
+ return doBpmnError( { _ -> DoCreateAllottedResourceBRG.preProcessRequest(mex) })
+ }
+
+ private boolean doBpmnError(def func) {
+
+ try {
+ func()
+ return false;
+
+ } catch(BpmnError e) {
+ return true;
+ }
+ }
+
+ private void initPreProcess(ExecutionEntity mex) {
+ when(mex.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mex.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("sdncurn")
+ when(mex.getVariable("serviceInstanceId")).thenReturn("sii")
+ when(mex.getVariable("parentServiceInstanceId")).thenReturn("psii")
+ when(mex.getVariable("allottedResourceModelInfo")).thenReturn("armi")
+ when(mex.getVariable("vni")).thenReturn("myvni")
+ when(mex.getVariable("vgmuxBearerIP")).thenReturn("vbi")
+ when(mex.getVariable("brgWanMacAddress")).thenReturn("bwma")
+ when(mex.getVariable("allottedResourceRole")).thenReturn("arr")
+ when(mex.getVariable("allottedResourceType")).thenReturn("art")
+ }
+
+ private initCreateAaiAr(ExecutionEntity mex) {
+ when(mex.getVariable("disableRollback")).thenReturn(45)
+ when(mex.getVariable("serviceInstanceId")).thenReturn("sii")
+ when(mex.getVariable("parentServiceInstanceId")).thenReturn("psii")
+ when(mex.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mex.getVariable("allottedResourceId")).thenReturn("myid")
+ when(mex.getVariable("URN_aai_endpoint")).thenReturn(aaiUriPfx)
+ when(mex.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn(urnProps.get("mso.workflow.global.default.aai.namespace"))
+ when(mex.getVariable("PSI_resourceLink")).thenReturn(aaiUriPfx+"/aai/v9/mypsi")
+ when(mex.getVariable("allottedResourceType")).thenReturn("BRGt")
+ when(mex.getVariable("allottedResourceRole")).thenReturn("BRGr")
+ when(mex.getVariable("CSI_resourceLink")).thenReturn(aaiUriPfx+"/aai/v9/mycsi")
+ when(mex.getVariable("allottedResourceModelInfo")).thenReturn("""
+ {
+ "modelInvariantUuid":"modelinvuuid",
+ "modelUuid":"modeluuid",
+ "modelCustomizationUuid":"modelcustuuid"
+ }
+ """)
+ }
+
+ private initBuildSDNCRequest(ExecutionEntity mex) {
+ when(mex.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mex.getVariable("allottedResourceId")).thenReturn("ari")
+ when(mex.getVariable("serviceInstanceId")).thenReturn("sii")
+ when(mex.getVariable("parentServiceInstanceId")).thenReturn("psii")
+ when(mex.getVariable("sdncCallbackUrl")).thenReturn("scu")
+ when(mex.getVariable("msoRequestId")).thenReturn("mri")
+ when(mex.getVariable("brgWanMacAddress")).thenReturn("bwma")
+ when(mex.getVariable("vni")).thenReturn("myvni")
+ when(mex.getVariable("vgmuxBearerIP")).thenReturn("vbi")
+ when(mex.getVariable("allottedResourceModelInfo")).thenReturn("""
+ {
+ "modelInvariantUuid":"miu",
+ "modelUuid":"mu",
+ "modelCustomizationUuid":"mcu",
+ "modelVersion":"mv",
+ "modelName":"mn"
+ }
+ """)
+ }
+
+ private RollbackData initPreProcessSDNC(ExecutionEntity mex) {
+ def data = new RollbackData()
+
+ when(mex.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mex.getVariable("rollbackData")).thenReturn(data)
+
+ return data
+ }
+
+ private initPreProcessSDNCGet(ExecutionEntity mex) {
+ when(mex.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mex.getVariable("sdncCallbackUrl")).thenReturn("myurl")
+ when(mex.getVariable("foundActiveAR")).thenReturn(true)
+ when(mex.getVariable("aaiARGetResponse")).thenReturn("<selflink>arlink</selflink>")
+ when(mex.getVariable("sdncAssignResponse")).thenReturn("<response-data>&lt;object-path&gt;assignlink&lt;/object-path&gt;</response-data>")
+ when(mex.getVariable("serviceInstanceId")).thenReturn("sii")
+ when(mex.getVariable("junitSleepMs")).thenReturn("5")
+ when(mex.getVariable("sdncCallbackUrl")).thenReturn("myurl")
+ }
+
+ private RollbackData initValidateSDNCResp(ExecutionEntity mex) {
+ def data = new RollbackData()
+
+ when(mex.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mex.getVariable("prefix")).thenReturn(Prefix)
+ when(mex.getVariable("SDNCA_SuccessIndicator")).thenReturn(true)
+ when(mex.getVariable("rollbackData")).thenReturn(data)
+
+ return data
+ }
+
+ private String initValidateSDNCResp_Resp() {
+ return "<response-data>&lt;response-code&gt;200&lt;/response-code&gt;</response-data>"
+ }
+
+ private initUpdateAaiAROrchStatus(ExecutionEntity mex) {
+ when(mex.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mex.getVariable("aaiARPath")).thenReturn(aaiUriPfx+"/aai/v9/myurl")
+
+ wireMockRule
+ .stubFor(patch(urlMatching("/aai/v[0-9]+/myurl"))
+ .willReturn(aResponse()
+ .withStatus(200)))
+ }
+
+ private ExecutionEntity setupMock() {
+
+ ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class)
+ when(mockProcessDefinition.getKey()).thenReturn("DoCreateAllottedResourceBRG")
+ RepositoryService mockRepositoryService = mock(RepositoryService.class)
+ when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition)
+ when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("DoCreateAllottedResourceBRG")
+ when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100")
+ ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class)
+ when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService)
+
+ ExecutionEntity mex = mock(ExecutionEntity.class)
+
+ when(mex.getId()).thenReturn("100")
+ when(mex.getProcessDefinitionId()).thenReturn("DoCreateAllottedResourceBRG")
+ when(mex.getProcessInstanceId()).thenReturn("DoCreateAllottedResourceBRG")
+ when(mex.getProcessEngineServices()).thenReturn(mockProcessEngineServices)
+ when(mex.getProcessEngineServices().getRepositoryService().getProcessDefinition(mex.getProcessDefinitionId())).thenReturn(mockProcessDefinition)
+
+ return mex
+ }
+
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/CreateVcpeResCustServiceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/CreateVcpeResCustServiceTest.java
new file mode 100644
index 0000000000..893eceb1a9
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/CreateVcpeResCustServiceTest.java
@@ -0,0 +1,590 @@
+package org.openecomp.mso.bpmn.vcpe;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.post;
+import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetCustomer;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutAllottedResource;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutGenericVnf;
+import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.MockGetServiceResourcesCatalogData;
+import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
+import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
+// TODO: uncomment when Homing BB is merged
+// import static org.openecomp.mso.bpmn.mock.StubResponseSNIRO.mockSNIRO;
+
+import java.io.IOException;
+import java.util.HashMap;
+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;
+
+public class CreateVcpeResCustServiceTest extends WorkflowTest {
+
+ private final CallbackSet callbacks = new CallbackSet();
+ private final String request;
+
+ public CreateVcpeResCustServiceTest() throws IOException {
+ callbacks.put("assign", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyAssignCallback.xml"));
+ callbacks.put("query", FileUtil.readResourceFile("__files/VCPE/SDNCTopologyQueryCallbackNetworkInstance.xml"));
+ callbacks.put("activate", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyActivateCallback.xml"));
+ callbacks.put("vnfCreate", FileUtil.readResourceFile("__files/VCPE/VfModularity/VNFAdapterRestCreateCallback.xml"));
+ callbacks.put("create", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyCreateCallback.xml"));
+ callbacks.put("queryTXC", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceTXC/SDNCTopologyQueryCallback.xml"));
+ callbacks.put("queryBRG", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceBRG/SDNCTopologyQueryCallback.xml"));
+
+ callbacks.put("sniro", JSON, "SNIROResponse", FileUtil.readResourceFile("__files/BuildingBlocks/sniroCallback2AR1Vnf"));
+ callbacks.put("sniro2", JSON, "SNIROResponse", FileUtil.readResourceFile("__files/BuildingBlocks/sniroCallback2AR1Vnf2Net"));
+ callbacks.put("sniroNoSol", JSON, "SNIROResponse", FileUtil.readResourceFile("__files/BuildingBlocks/sniroCallbackNoSolutionFound"));
+ callbacks.put("sniroPolicyEx", JSON, "SNIROResponse", FileUtil.readResourceFile("__files/BuildingBlocks/sniroCallbackPolicyException"));
+ callbacks.put("sniroServiceEx", JSON, "SNIROResponse", FileUtil.readResourceFile("__files/BuildingBlocks/sniroCallbackServiceException"));
+
+ request = FileUtil.readResourceFile("__files/VCPE/request.json");
+ }
+
+
+// /**
+// * End-to-End flow - Unit test for CreateVcpeResCustService.bpmn
+// * - String input & String response
+// */
+//
+// @Test
+// @Ignore
+// @Deployment(resources = {"process/CreateVcpeResCustService.bpmn",
+// "subprocess/DoCreateServiceInstance.bpmn",
+// "subprocess/DoCreateServiceInstanceRollback.bpmn",
+// "subprocess/DoCreateNetworkInstance.bpmn",
+// "subprocess/DoCreateNetworkInstanceRollback.bpmn",
+// "subprocess/DoCreateVnfAndModules.bpmn",
+// "subprocess/DoCreateAllottedResourceTXC.bpmn",
+// "subprocess/DoCreateAllottedResourceTXCRollback.bpmn",
+// "subprocess/DoCreateAllottedResourceBRG.bpmn",
+// "subprocess/DoCreateAllottedResourceBRGRollback.bpmn",
+// "subprocess/BuildingBlock/DecomposeService.bpmn",
+// "subprocess/BuildingBlock/Homing.bpmn",
+// "subprocess/GenericGetService.bpmn",
+// "subprocess/GenericPutService.bpmn",
+// "subprocess/SDNCAdapterV1.bpmn",
+// "subprocess/DoCreateVnf.bpmn",
+// "subprocess/GenericGetVnf.bpmn",
+// "subprocess/GenericPutVnf.bpmn",
+// "subprocess/FalloutHandler.bpmn",
+// "subprocess/GenericDeleteService.bpmn",
+// "subprocess/ReceiveWorkflowMessage.bpmn",
+// "subprocess/CompleteMsoProcess.bpmn"})
+//
+// public void invokeCreateServiceInstanceInfra_Success() throws Exception {
+//
+// logStart();
+//
+// // setup simulators
+// //MockGetCustomer_VCPE();
+// MockGetCustomer("MCBH-1610", "VCPE/getCustomer.xml");
+// //MockGetNetworkCatalogData_VCPE();
+// MockGetNetworkCatalogData("uuid-miu-svc-011-abcdef", "2", "VCPE/getCatalogNetworkData.json");
+// //MockGetVnfCatalogData_VCPE();
+// MockGetVnfCatalogData("uuid-miu-svc-011-abcdef", "2", "VCPE/getCatalogVnfData.json");
+// //MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "VCPE/getCatalogServiceResourcesData.json");
+// MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "VCPE/getCatalogServiceResourcesDataNoNetworkVnf.json");
+// MockGetServiceInstanceById_VCPE();
+// MockPutServiceInstance_VCPE();
+//
+// //SDNC Adapter Mocks
+// mockSDNCAdapterRest();
+// mockSDNCAdapter();
+//
+// //from CreateNetworkInstanceTest
+// sdncAdapterNetworkTopologySimulator_CreateNetworkV2();
+// MockNetworkAdapterResponse_CreateSuccessV2();
+// MockAAIResponse_queryName_CreateNetwork_404V2(); // 'network-name' not in AAI , Ok to Create.
+// MockAAIResponse_cloudRegion25_Success();
+// MockAAIResponse_queryId_CreateNetwork_SuccessV2();
+// MockAAIResponse_queryVpnBinding_CreateNetwork_SuccessV2();
+// MockAAIResponse_queryVpnBinding2_CreateNetwork_SuccessV2();
+// MockAAIResponse_queryNetworkPolicy_CreateNetwork_SuccessV2();
+// MockAAIResponse_queryNetworkTableRef_CreateNetwork_SuccessV2();
+// MockAAIResponse_updateContrail_CreateNetwork_SuccessV2();
+// MockDBUpdate_Success();
+// MocksAAIResponse_queryNetworkInstance_CreateNetwork_Success();
+//
+// //network AAI Mocks
+// MockGetNetworkById("680b7453-0ec4-4d96-b355-280d981d418f", "VCPE/getNetwork.xml");
+// MockGetNetworkById("444a701a-6419-45b2-aa52-b45a1b719cf6", "VCPE/getNetwork.xml");
+// MockGetNetworkById("cf82a73f-de7f-4f84-8dfc-16a487c63a36", "VCPE/getNetwork.xml");
+// MockPutNetwork("680b7453-0ec4-4d96-b355-280d981d418f");
+// MockPutNetwork("cf82a73f-de7f-4f84-8dfc-16a487c63a36");
+//
+// MockPutGenericVnf("9c61db87-345c-49ae-ac80-472211df5deb");
+//
+// mockSNIRO();
+//
+// String businessKey = UUID.randomUUID().toString();
+//// String createVfModuleRequest =
+//// FileUtil.readResourceFile("__files/VCPE/CreateVfModule_VID_request.json");
+//
+// Map<String, Object> variables = setupVariablesObjectMap();
+//
+// TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVcpeResCustService",
+// "v1", businessKey, getRequest(), variables);
+//
+// WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
+//
+// String responseBody = response.getResponse();
+// System.out.println("Workflow (Synch) Response:\n" + responseBody);
+//
+// injectSDNCCallbacks(callbacks, "assign, query");
+// injectSDNCCallbacks(callbacks, "activate");
+//
+// // TODO add appropriate assertions
+//
+// waitForProcessEnd(businessKey, 10000);
+// checkVariable(businessKey, "CreateVcpeResCustServiceSuccessIndicator", true);
+//
+// logEnd();
+// }
+
+
+ /**
+ * TEST Decompose + Homing - Unit test for CreateVcpeResCustService.bpmn
+ * - String input & String response
+ */
+
+ @Test
+// TODO: run this test when Homing BB is merged
+ @Ignore
+ @Deployment(resources = {"process/CreateVcpeResCustService.bpmn",
+ "subprocess/DoCreateServiceInstance.bpmn",
+ "subprocess/DoCreateServiceInstanceRollback.bpmn",
+ "subprocess/DoCreateNetworkInstance.bpmn",
+ "subprocess/DoCreateNetworkInstanceRollback.bpmn",
+ "subprocess/BuildingBlock/DecomposeService.bpmn",
+ "subprocess/BuildingBlock/Homing.bpmn",
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/GenericPutService.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/DoCreateVnf.bpmn",
+ "subprocess/GenericGetVnf.bpmn",
+ "subprocess/GenericPutVnf.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/GenericDeleteService.bpmn",
+ "subprocess/DoCreateAllottedResourceBRG.bpmn",
+ "subprocess/DoCreateAllottedResourceBRGRollback.bpmn",
+ "subprocess/DoCreateAllottedResourceTXC.bpmn",
+ "subprocess/DoCreateAllottedResourceTXCRollback.bpmn",
+ "subprocess/CompleteMsoProcess.bpmn"})
+
+ public void invokeDecompositionHomingCreateServiceInstanceNetwork() throws Exception {
+
+ logStart();
+
+ // setup simulators
+ MockGetCustomer("MCBH-1610", "VCPE/getCustomer.xml");
+
+ MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "2", "VCPE/getCatalogVcpe.json");
+
+// MockPutServiceInstance_VCPE();
+
+// MockGetNetworkByIdWithDepth("680b7453-0ec4-4d96-b355-280d981d418f", "VCPE/CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml", "1");
+// MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "VCPE/CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml", "1");
+
+ MockPutGenericVnf("39ae1b77-4edd-4e94-846a-d087a35a2260");
+
+ // stuff to satisfy TXC & BRG subflows
+ MockNodeQueryServiceInstanceById("MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getSIUrlById.xml");
+ MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
+ MockNodeQueryServiceInstanceById("MIS%252F1604%252F0027%252FSW_INTERNET", "GenericFlows/getParentSIUrlById.xml");
+ MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0027%252FSW_INTERNET", "GenericFlows/getParentServiceInstance.xml");
+ MockPutAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0027%252FSW_INTERNET", "arId-1");
+ MockPatchAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0027%252FSW_INTERNET", "arId-1");
+
+ mockSDNCAdapter(200);
+
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+// TODO: uncomment when Homing BB is merged
+// mockSNIRO();
+
+ //Below works for Homing/Sniro
+
+ Map<String, Object> variables = setupVariablesObjectMap();
+
+ String businessKey = UUID.randomUUID().toString();
+ TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVcpeResCustService",
+ "v1", businessKey, request, variables);
+
+ WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
+
+ String responseBody = response.getResponse();
+ System.out.println("Workflow (Synch) Response:\n" + responseBody);
+
+ injectWorkflowMessages(callbacks, "sniro");
+ injectSDNCCallbacks(callbacks, "assign, create, activate, queryTXC");
+ injectSDNCCallbacks(callbacks, "assign, create, activate, queryBRG");
+
+ waitForProcessEnd(businessKey, 10000);
+ checkVariable(businessKey, "CreateVcpeResCustServiceSuccessIndicator", true);
+
+ logEnd();
+ }
+
+
+ /**
+ * TEST Decompose + Homing - Unit test for CreateVcpeResCustService.bpmn
+ * - String input & String response
+ */
+
+// @Test
+// @Deployment(resources = {"process/CreateVcpeResCustService.bpmn",
+// "subprocess/DoCreateServiceInstance.bpmn",
+// "subprocess/DoCreateServiceInstanceRollback.bpmn",
+// "subprocess/DoCreateNetworkInstance.bpmn",
+// "subprocess/DoCreateNetworkInstanceRollback.bpmn",
+// "subprocess/BuildingBlock/DecomposeService.bpmn",
+// "subprocess/BuildingBlock/Homing.bpmn",
+// "subprocess/DoCreateAllottedResourceTXC.bpmn",
+// "subprocess/DoCreateAllottedResourceTXCRollback.bpmn",
+// "subprocess/DoCreateAllottedResourceBRG.bpmn",
+// "subprocess/DoCreateAllottedResourceBRGRollback.bpmn",
+// "subprocess/GenericGetService.bpmn",
+// "subprocess/GenericPutService.bpmn",
+// "subprocess/SDNCAdapterV1.bpmn",
+// "subprocess/DoCreateVnf.bpmn",
+// "subprocess/GenericGetVnf.bpmn",
+// "subprocess/GenericPutVnf.bpmn",
+// "subprocess/FalloutHandler.bpmn",
+// "subprocess/GenericDeleteService.bpmn",
+// "subprocess/ReceiveWorkflowMessage.bpmn",
+// "subprocess/CompleteMsoProcess.bpmn"})
+//
+// public void invokeDecompositionHomingCreateServiceInstanceARs() throws Exception {
+//
+// logStart();
+//
+// // setup simulators
+// MockGetCustomer("MCBH-1610", "VCPE/getCustomer.xml");
+//
+// MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "VCPE/getCatalogServiceResourcesDataServiceAllotted.json");
+//
+// MockPutServiceInstance_VCPE();
+// //network AAI Mocks
+// MockGetNetworkById("cf82a73f-de7f-4f84-8dfc-16a487c63a36", "VCPE/getNetwork.xml");
+// MockPutNetwork("cf82a73f-de7f-4f84-8dfc-16a487c63a36");
+//
+// MockNodeQueryServiceInstanceById("c763d462-dfe4-4577-9706-fa3a9db640be", "VCPE/getSIUrlById.xml");
+//
+// mockSDNCAdapter();
+//
+// MockNodeQueryServiceInstanceById("MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getSIUrlById.xml");
+// MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET");
+// MockPutAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "arId-1");
+// MockPutAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET_in-use", "arId-1");
+// MockPatchAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET_in-use", "arId-1");
+//
+//
+// MockDBUpdateVfModule();
+//
+// mockSNIRO();
+//
+// String businessKey = UUID.randomUUID().toString();
+//
+// //Below works for Homing/Sniro
+//
+// Map<String, Object> variables = setupVariablesObjectMap();
+// TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVcpeResCustService", "v1", businessKey, getRequest(), variables);
+// WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
+// String responseBody = response.getResponse();
+// System.out.println("Workflow (Synch) Response:\n" + responseBody);
+//
+// //Below is from CreateVcpeResCustService
+//// Map<String, String> variables = setupVariables();
+//// WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CreateVcpeResCustService", variables);
+//// waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+//// String workflowResp = BPMNUtil.getVariable(processEngineRule, "CreateVcpeResCustService", "WorkflowResponse");
+//
+// injectWorkflowMessages(callbacks, "sniro");
+// // TODO add appropriate assertions
+// injectSDNCCallbacks(callbacks, "assign, query, create, activate, queryTXC, assign, create, activate, queryBRG");
+// waitForProcessEnd(businessKey, 10000);
+//
+//// checkVariable(businessKey, "CreateVcpeResCustServiceSuccessIndicator", true);
+//
+// logEnd();
+// }
+//
+//
+// /**
+// * TEST Decompose + Homing - Unit test for CreateVcpeResCustService.bpmn
+// * - String input & String response
+// */
+//
+// @Test
+// //@Ignore
+// @Deployment(resources = {"process/CreateVcpeResCustService.bpmn",
+// "subprocess/DoCreateServiceInstance.bpmn",
+// "subprocess/DoCreateServiceInstanceRollback.bpmn",
+// "subprocess/DoCreateNetworkInstance.bpmn",
+// "subprocess/DoCreateNetworkInstanceRollback.bpmn",
+// "subprocess/BuildingBlock/DecomposeService.bpmn",
+// "subprocess/BuildingBlock/Homing.bpmn",
+// "subprocess/DoCreateVnfAndModules.bpmn",
+// "subprocess/DoCreateVnfAndModulesRollback.bpmn",
+// "subprocess/DoCreateAllottedResourceTXC.bpmn",
+// "subprocess/DoCreateAllottedResourceTXCRollback.bpmn",
+// "subprocess/DoCreateAllottedResourceBRG.bpmn",
+// "subprocess/DoCreateAllottedResourceBRGRollback.bpmn",
+// "subprocess/GenericGetService.bpmn",
+// "subprocess/GenericPutService.bpmn",
+// "subprocess/SDNCAdapterV1.bpmn",
+// "subprocess/DoCreateVnf.bpmn",
+// "subprocess/GenericGetVnf.bpmn",
+// "subprocess/GenericPutVnf.bpmn",
+// "subprocess/FalloutHandler.bpmn",
+// "subprocess/GenericDeleteService.bpmn",
+// "subprocess/ReceiveWorkflowMessage.bpmn",
+// "subprocess/CompleteMsoProcess.bpmn"})
+//
+// public void invokeDecompositionHomingCreateServiceVnf() throws Exception {
+//
+// logStart();
+//
+// // setup simulators
+// MockGetCustomer("MCBH-1610", "VCPE/getCustomer.xml");
+//
+// MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "VCPE/getCatalogServiceResourcesServiceVnf.json");
+//
+// MockPutServiceInstance_VCPE();
+// //network AAI Mocks
+// MockGetNetworkById("cf82a73f-de7f-4f84-8dfc-16a487c63a36", "VCPE/getNetwork.xml");
+// MockPutNetwork("cf82a73f-de7f-4f84-8dfc-16a487c63a36");
+//
+// MockNodeQueryServiceInstanceById("c763d462-dfe4-4577-9706-fa3a9db640be", "VCPE/getSIUrlById.xml");
+//
+//
+// MockNodeQueryServiceInstanceById("MIS%2F1604%2F0026%2FSW_INTERNET", "GenericFlows/getSIUrlByIdVcpe.xml");
+// MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET");
+// MockGetGenericVnfById_404("testVnfId");
+// MockPutGenericVnf(".*");
+// MockAAIVfModule();
+// MockPatchGenericVnf("skask");
+// MockPatchVfModuleId("skask", ".*");
+// MockSDNCAdapterVfModule();
+// MockVNFAdapterRestVfModule();
+// MockDBUpdateVfModule();
+//
+//
+// mockSDNCAdapter();
+// //mockSDNCAdapterRest();
+//
+// //MockSDNCAdapterServiceInstanceModule();
+//
+// //mockSDNCAdapterTopology("CreateNetworkV2mock/sdncCreateNetworkTopologyRsrcAssignResponse.xml", "SvcAction>assign");
+//
+// MockDBUpdateVfModule();
+//
+// mockSNIRO();
+//
+// String businessKey = UUID.randomUUID().toString();
+//
+// //Below works for Homing/Sniro
+//
+// Map<String, Object> variables = setupVariablesObjectMap();
+// TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVcpeResCustService", "v1", businessKey, getRequest(), variables);
+// WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
+// String responseBody = response.getResponse();
+// System.out.println("Workflow (Synch) Response:\n" + responseBody);
+//
+// //Below is from CreateVcpeResCustService
+//// Map<String, String> variables = setupVariables();
+//// WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CreateVcpeResCustService", variables);
+//// waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+//// String workflowResp = BPMNUtil.getVariable(processEngineRule, "CreateVcpeResCustService", "WorkflowResponse");
+//
+// injectWorkflowMessages(callbacks, "sniro");
+// // TODO add appropriate assertions
+// injectSDNCCallbacks(callbacks, "assign, query");
+// waitForProcessEnd(businessKey, 10000);
+//
+//// checkVariable(businessKey, "CreateVcpeResCustServiceSuccessIndicator", true);
+//
+// logEnd();
+// }
+//
+//
+// /**
+// * TEST Decompose + Homing - Unit test for CreateVcpeResCustService.bpmn
+// * - String input & String response
+// */
+//
+// @Test
+// //@Ignore
+// @Deployment(resources = {"process/CreateVcpeResCustService.bpmn",
+// "subprocess/DoCreateServiceInstance.bpmn",
+// "subprocess/DoCreateServiceInstanceRollback.bpmn",
+// "subprocess/DoCreateNetworkInstance.bpmn",
+// "subprocess/DoCreateNetworkInstanceRollback.bpmn",
+// "subprocess/BuildingBlock/DecomposeService.bpmn",
+// "subprocess/BuildingBlock/Homing.bpmn",
+// "subprocess/DoCreateVnfAndModules.bpmn",
+// "subprocess/DoCreateVnfAndModulesRollback.bpmn",
+// "subprocess/DoCreateAllottedResourceTXC.bpmn",
+// "subprocess/DoCreateAllottedResourceTXCRollback.bpmn",
+// "subprocess/DoCreateAllottedResourceBRG.bpmn",
+// "subprocess/DoCreateAllottedResourceBRGRollback.bpmn",
+// "subprocess/GenericGetService.bpmn",
+// "subprocess/GenericPutService.bpmn",
+// "subprocess/SDNCAdapterV1.bpmn",
+// "subprocess/DoCreateVnf.bpmn",
+// "subprocess/GenericGetVnf.bpmn",
+// "subprocess/GenericPutVnf.bpmn",
+// "subprocess/FalloutHandler.bpmn",
+// "subprocess/GenericDeleteService.bpmn",
+// "subprocess/ReceiveWorkflowMessage.bpmn",
+// "subprocess/CompleteMsoProcess.bpmn"})
+//
+// public void invokeCreateAll() throws Exception {
+//
+// logStart();
+//
+// // setup simulators
+// MockGetCustomer("MCBH-1610", "VCPE/getCustomer.xml");
+//
+// MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "VCPE/getCatalogServiceResourcesData.json");
+//
+// MockPutServiceInstance_VCPE();
+// //network AAI Mocks
+// MockGetNetworkById("cf82a73f-de7f-4f84-8dfc-16a487c63a36", "VCPE/getNetwork.xml");
+// MockPutNetwork("cf82a73f-de7f-4f84-8dfc-16a487c63a36");
+//
+// MockNodeQueryServiceInstanceById("c763d462-dfe4-4577-9706-fa3a9db640be", "VCPE/getSIUrlById.xml");
+//
+// MockGetNetworkByIdWithDepth("680b7453-0ec4-4d96-b355-280d981d418f", "VCPE/CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml", "1");
+// MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "VCPE/CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml", "1");
+// MockNetworkAdapterPost("CreateNetworkV2/createNetworkResponse_Success.xml", "VCPE/createNetworkRequest");
+// MockGetNetworkVpnBindingWithDepth("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017", "all");
+// MockGetNetworkVpnBindingWithDepth("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6", "all");
+// MockGetNetworkPolicyWithDepth("CreateNetworkV2/createNetwork_queryNetworkPolicy_AAIResponse_Success.xml", "cee6d136-e378-4678-a024-2cd15f0ee0cg", "all");
+// MockGetNetworkTableReferenceWithDepth("CreateNetworkV2/createNetwork_queryNetworkTableRef1_AAIResponse_Success.xml", "refFQDN1", "all");
+// MockGetNetworkTableReferenceWithDepth("CreateNetworkV2/createNetwork_queryNetworkTableRef1_AAIResponse_Success.xml", "refFQDN2", "all");
+// MockPutNetworkIdWithDepth("CreateNetworkV2/createNetwork_updateContrail_AAIResponse_Success.xml", "680b7453-0ec4-4d96-b355-280d981d418f", "1");
+// MockPutNetworkIdWithDepth("CreateNetworkV2/createNetwork_updateContrail_AAIResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "1");
+//
+//
+// MockNodeQueryServiceInstanceById("MIS%2F1604%2F0026%2FSW_INTERNET", "GenericFlows/getSIUrlByIdVcpe.xml");
+// MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET");
+// MockGetGenericVnfById_404("testVnfId");
+// MockPutGenericVnf(".*");
+// MockAAIVfModule();
+// MockPatchGenericVnf("skask");
+// MockPatchVfModuleId("skask", ".*");
+// MockSDNCAdapterVfModule();
+// MockVNFAdapterRestVfModule();
+// MockDBUpdateVfModule();
+//
+//
+// mockSDNCAdapter();
+// //mockSDNCAdapterRest();
+//
+// //MockSDNCAdapterServiceInstanceModule();
+//
+// //mockSDNCAdapterTopology("CreateNetworkV2mock/sdncCreateNetworkTopologyRsrcAssignResponse.xml", "SvcAction>assign");
+//
+// MockDBUpdateVfModule();
+//
+// mockSNIRO();
+//
+// String businessKey = UUID.randomUUID().toString();
+//
+// //Below works for Homing/Sniro
+//
+// Map<String, Object> variables = setupVariablesObjectMap();
+// TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVcpeResCustService", "v1", businessKey, getRequest(), variables);
+// WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
+// String responseBody = response.getResponse();
+// System.out.println("Workflow (Synch) Response:\n" + responseBody);
+//
+// //Below is from CreateVcpeResCustService
+//// Map<String, String> variables = setupVariables();
+//// WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CreateVcpeResCustService", variables);
+//// waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
+//// String workflowResp = BPMNUtil.getVariable(processEngineRule, "CreateVcpeResCustService", "WorkflowResponse");
+//
+// injectWorkflowMessages(callbacks, "sniro");
+// // TODO add appropriate assertions
+// injectSDNCCallbacks(callbacks, "assign, query");
+// waitForProcessEnd(businessKey, 10000);
+//
+//// checkVariable(businessKey, "CreateVcpeResCustServiceSuccessIndicator", true);
+//
+// logEnd();
+// }
+
+ // *****************
+ // Utility Section
+ // *****************
+
+ // Success Scenario
+ private Map<String, Object> setupVariablesObjectMap() {
+ Map<String, Object> variables = new HashMap<>();
+ variables.put("requestId", "testRequestId");
+ variables.put("request-id", "testRequestId");
+ variables.put("CREVAS_testServiceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4"); // assigned for testing
+ variables.put("serviceInstanceId", "c763d462-dfe4-4577-9706-fa3a9db640be");// unit test
+ variables.put("sourceNetworkId", "c763d462-dfe4-4577-9706-fa3a9db640be");// unit test
+ variables.put("networkId", "c763d462-dfe4-4577-9706-fa3a9db640be");// unit test
+ variables.put("sourceNetworkRole", "whoknows");// unit test
+ variables.put("allottedResourceId", "arId-1");
+ variables.put("junitSleepMs", "5");
+ return variables;
+
+ }
+
+// private Map<String, String> setupVariables() {
+// Map<String, String> variables = new HashMap<String, String>();
+// variables.put("bpmnRequest", getRequest());
+// variables.put("mso-request-id", "testRequestId");
+// variables.put("CREVAS_testServiceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4"); // assigned for testing
+// variables.put("serviceInstanceId", "c763d462-dfe4-4577-9706-fa3a9db640be");// unit test
+// variables.put("sourceNetworkId", "c763d462-dfe4-4577-9706-fa3a9db640be");// unit test
+// variables.put("sourceNetworkRole", "whoknows");// unit test
+// variables.put("allottedResourceId", "arId-1");
+// variables.put("junitSleepMs", "5");
+// return variables;
+//
+// }
+
+ // start of mocks used locally and by other VF Module unit tests
+ public static void MockSDNCAdapterVfModule() {
+ // simplified the implementation to return "success" for all requests
+ stubFor(post(urlEqualTo("/SDNCAdapter"))
+// .withRequestBody(containing("SvcInstanceId><"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("VfModularity/StandardSDNCSynchResponse.xml")));
+// stubFor(post(urlEqualTo("/SDNCAdapter"))
+// .withRequestBody(containing("vnf-type>STMTN"))
+// .willReturn(aResponse()
+// .withStatus(200)
+// .withHeader("Content-Type", "text/xml")
+// .withBodyFile("VfModularity/StandardSDNCSynchResponse.xml")));
+// stubFor(post(urlEqualTo("/SDNCAdapter"))
+// .withRequestBody(containing("SvcAction>query"))
+// .willReturn(aResponse()
+// .withStatus(200)
+// .withHeader("Content-Type", "text/xml")
+// .withBodyFile("VfModularity/StandardSDNCSynchResponse.xml")));
+ }
+
+
+
+
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGRollbackTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGRollbackTest.java
new file mode 100644
index 0000000000..b702313670
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGRollbackTest.java
@@ -0,0 +1,96 @@
+/*
+ * © 2014 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property.
+ */
+package org.openecomp.mso.bpmn.vcpe;
+
+import static org.junit.Assert.assertEquals;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteAllottedResource;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource;
+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;
+import org.openecomp.mso.bpmn.mock.FileUtil;
+
+
+public class DoCreateAllottedResourceBRGRollbackTest extends WorkflowTest {
+
+ private static final String RbType = "DCARBRG_";
+ private final CallbackSet callbacks = new CallbackSet();
+
+ public DoCreateAllottedResourceBRGRollbackTest() throws IOException {
+ callbacks.put("deactivate", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyDeactivateCallback.xml"));
+ callbacks.put("delete", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyDeleteCallback.xml"));
+ callbacks.put("unassign", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyUnassignCallback.xml"));
+ }
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoCreateAllottedResourceBRGRollback.bpmn"})
+ public void testDoCreateAllottedResourceBRGRollback_success() throws Exception {
+
+ MockGetAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "arId-1", "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml");
+ MockPatchAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "arId-1");
+ MockDeleteAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "arId-1", "1490627351232");
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ setVariablesSuccess(variables, "testRequestId1");
+
+ invokeSubProcess("DoCreateAllottedResourceBRGRollback", businessKey, variables);
+
+ injectSDNCCallbacks(callbacks, "deactivate");
+ injectSDNCCallbacks(callbacks, "delete");
+ injectSDNCCallbacks(callbacks, "unassign");
+
+ waitForProcessEnd(businessKey, 10000);
+
+ Assert.assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "DoCreateAllottedResourceBRGRollback", "WorkflowException");
+ System.out.println("workflowException:\n" + workflowException);
+ assertEquals(null, workflowException);
+ }
+
+ private void setVariablesSuccess(Map<String, Object> variables, String requestId) {
+ variables.put("isDebugLogEnabled", "true");
+ variables.put("failNotFound", "true");
+ variables.put("msoRequestId", requestId);
+ variables.put("mso-request-id", "requestId");
+ variables.put("allottedResourceId", "arId-1");
+
+ variables.put("serviceInstanceId", "MIS%252F1604%252F0026%252FSW_INTERNET");
+ variables.put("parentServiceInstanceId","MIS%252F1604%252F0026%252FSW_INTERNET");
+ RollbackData rollbackData = new RollbackData();
+
+ rollbackData.put(RbType, "serviceInstanceId", "MIS%252F1604%252F0026%252FSW_INTERNET");
+ rollbackData.put(RbType, "serviceSubscriptionType", "123456789");
+ rollbackData.put(RbType, "disablerollback", "false");
+ rollbackData.put(RbType, "rollbackAAI", "true");
+ rollbackData.put(RbType, "rollbackSDNCassign", "true");
+ rollbackData.put(RbType, "rollbackSDNCactivate", "true");
+ rollbackData.put(RbType, "rollbackSDNCcreate", "true");
+ rollbackData.put(RbType, "aaiARPath", "http://localhost:28090/aai/v9/business/customers/customer/SDN-ETHERNET-INTERNET/service-subscriptions/service-subscription/123456789/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET/allotted-resources/allotted-resource/arId-1");
+
+ rollbackData.put(RbType, "sdncActivateRollbackReq", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncActivateRollbackReq.xml"));
+ rollbackData.put(RbType, "sdncCreateRollbackReq", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncCreateRollbackReq.xml"));
+ rollbackData.put(RbType, "sdncAssignRollbackReq", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncAssignRollbackReq.xml"));
+
+ variables.put("rollbackData",rollbackData);
+ }
+
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGTest.java
new file mode 100644
index 0000000000..bc3bdd2d46
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGTest.java
@@ -0,0 +1,107 @@
+/*
+ * © 2014 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property.
+ */
+package org.openecomp.mso.bpmn.vcpe;
+
+import static org.junit.Assert.assertEquals;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutAllottedResource;
+import static org.openecomp.mso.bpmn.mock.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.mock.FileUtil;
+
+
+public class DoCreateAllottedResourceBRGTest extends WorkflowTest {
+
+ private final CallbackSet callbacks = new CallbackSet();
+
+ public DoCreateAllottedResourceBRGTest() throws IOException {
+ callbacks.put("assign", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyAssignCallback.xml"));
+ callbacks.put("create", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyCreateCallback.xml"));
+ callbacks.put("activate", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyActivateCallback.xml"));
+ callbacks.put("query", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceBRG/SDNCTopologyQueryCallback.xml"));
+ }
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoCreateAllottedResourceBRG.bpmn",
+ "subprocess/DoCreateAllottedResourceBRGRollback.bpmn"})
+ public void testDoCreateAllottedResourceBRG_success() throws Exception{
+
+ MockNodeQueryServiceInstanceById("MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getSIUrlById.xml");
+ MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
+ MockNodeQueryServiceInstanceById("MIS%252F1604%252F0027%252FSW_INTERNET", "GenericFlows/getParentSIUrlById.xml");
+ MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0027%252FSW_INTERNET", "GenericFlows/getParentServiceInstance.xml");
+ MockPutAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0027%252FSW_INTERNET", "arId-1");
+ MockPatchAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0027%252FSW_INTERNET", "arId-1");
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ setVariablesSuccess(variables, "testRequestId123");
+
+ invokeSubProcess("DoCreateAllottedResourceBRG", businessKey, variables);
+
+ injectSDNCCallbacks(callbacks, "assign");
+ injectSDNCCallbacks(callbacks, "create");
+ injectSDNCCallbacks(callbacks, "activate");
+ injectSDNCCallbacks(callbacks, "query");
+
+ waitForProcessEnd(businessKey, 10000);
+
+ Assert.assertTrue(isProcessEnded(businessKey));
+ String allotedResourceName = BPMNUtil.getVariable(processEngineRule, "DoCreateAllottedResourceBRG", "allotedResourceName");
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "DoCreateAllottedResourceBRG", "WorkflowException");
+ assertEquals("namefromrequest", allotedResourceName);
+ assertEquals(null, workflowException);
+ }
+
+ private void setVariablesSuccess(Map<String, Object> variables, String requestId) {
+ // TODO: need all of these?
+ variables.put("isDebugLogEnabled", "true");
+ variables.put("failExists", "true");
+ variables.put("disableRollback", "true");
+ variables.put("msoRequestId", requestId);
+ variables.put("mso-request-id", "requestId");
+ variables.put("sourceNetworkId", "snId");
+ variables.put("sourceNetworkRole", "snRole");
+ variables.put("allottedResourceRole", "txc");
+ variables.put("allottedResourceType", "BRG");
+ variables.put("allottedResourceId", "arId-1");
+ variables.put("vni", "BRG");
+ variables.put("vgmuxBearerIP", "bearerip");
+ variables.put("brgWanMacAddress", "wanmac");
+ variables.put("junitSleepMs", "5");
+
+ variables.put("serviceInstanceId", "MIS%252F1604%252F0026%252FSW_INTERNET");
+ variables.put("parentServiceInstanceId","MIS%252F1604%252F0027%252FSW_INTERNET");
+ variables.put("serviceChainServiceInstanceId", "scsiId");
+
+ String arModelInfo = "{ "+ "\"modelType\": \"allotted-resource\"," +
+ "\"modelInvariantUuid\": \"ff5256d2-5a33-55df-13ab-12abad84e7ff\"," +
+ "\"modelUuid\": \"fe6478e5-ea33-3346-ac12-ab121484a3fe\"," +
+ "\"modelName\": \"vSAMP12\"," +
+ "\"modelVersion\": \"1.0\"," +
+ "\"modelCustomizationUuid\": \"MODEL-ID-1234\"," +
+ "}";
+ variables.put("allottedResourceModelInfo", arModelInfo);
+ }
+
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceTXCRollbackTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceTXCRollbackTest.java
new file mode 100644
index 0000000000..de5e0f226e
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceTXCRollbackTest.java
@@ -0,0 +1,96 @@
+/*
+ * © 2014 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property.
+ */
+package org.openecomp.mso.bpmn.vcpe;
+
+import static org.junit.Assert.assertEquals;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteAllottedResource;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource;
+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;
+import org.openecomp.mso.bpmn.mock.FileUtil;
+
+
+public class DoCreateAllottedResourceTXCRollbackTest extends WorkflowTest {
+
+ private static final String RbType = "DCARTXC_";
+ private final CallbackSet callbacks = new CallbackSet();
+
+ public DoCreateAllottedResourceTXCRollbackTest() throws IOException {
+ callbacks.put("deactivate", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyDeactivateCallback.xml"));
+ callbacks.put("delete", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyDeleteCallback.xml"));
+ callbacks.put("unassign", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyUnassignCallback.xml"));
+ }
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoCreateAllottedResourceTXCRollback.bpmn"})
+ public void testDoCreateAllottedResourceTXCRollback_success() throws Exception{
+
+ MockGetAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "arId-1", "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml");
+ MockPatchAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "arId-1");
+ MockDeleteAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "arId-1", "1490627351232");
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ setVariablesSuccess(variables, "testRequestId1");
+
+ invokeSubProcess("DoCreateAllottedResourceTXCRollback", businessKey, variables);
+
+ injectSDNCCallbacks(callbacks, "deactivate");
+ injectSDNCCallbacks(callbacks, "delete");
+ injectSDNCCallbacks(callbacks, "unassign");
+
+ waitForProcessEnd(businessKey, 10000);
+
+ Assert.assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "DoCreateAllottedResourceTXCRollback", "WorkflowException");
+ System.out.println("workflowException:\n" + workflowException);
+ assertEquals(null, workflowException);
+ }
+
+ private void setVariablesSuccess(Map<String, Object> variables, String requestId) {
+ variables.put("isDebugLogEnabled", "true");
+ variables.put("failNotFound", "true");
+ variables.put("msoRequestId", requestId);
+ variables.put("mso-request-id", "requestId");
+ variables.put("allottedResourceId", "arId-1");
+
+ variables.put("serviceInstanceId", "MIS%252F1604%252F0026%252FSW_INTERNET");
+ variables.put("parentServiceInstanceId","MIS%252F1604%252F0026%252FSW_INTERNET");
+ RollbackData rollbackData = new RollbackData();
+
+ rollbackData.put(RbType, "serviceInstanceId", "MIS%252F1604%252F0026%252FSW_INTERNET");
+ rollbackData.put(RbType, "serviceSubscriptionType", "123456789");
+ rollbackData.put(RbType, "disablerollback", "false");
+ rollbackData.put(RbType, "rollbackAAI", "true");
+ rollbackData.put(RbType, "rollbackSDNCassign", "true");
+ rollbackData.put(RbType, "rollbackSDNCactivate", "true");
+ rollbackData.put(RbType, "rollbackSDNCcreate", "true");
+ rollbackData.put(RbType, "aaiARPath", "http://localhost:28090/aai/v9/business/customers/customer/SDN-ETHERNET-INTERNET/service-subscriptions/service-subscription/123456789/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET/allotted-resources/allotted-resource/arId-1");
+
+ rollbackData.put(RbType, "sdncActivateRollbackReq", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncActivateRollbackReq.xml"));
+ rollbackData.put(RbType, "sdncCreateRollbackReq", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncCreateRollbackReq.xml"));
+ rollbackData.put(RbType, "sdncAssignRollbackReq", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncAssignRollbackReq.xml"));
+
+ variables.put("rollbackData",rollbackData);
+ }
+
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceTXCTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceTXCTest.java
new file mode 100644
index 0000000000..936cb4a706
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceTXCTest.java
@@ -0,0 +1,104 @@
+/*
+ * © 2014 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property.
+ */
+package org.openecomp.mso.bpmn.vcpe;
+
+import static org.junit.Assert.assertEquals;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutAllottedResource;
+import static org.openecomp.mso.bpmn.mock.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.mock.FileUtil;
+
+
+public class DoCreateAllottedResourceTXCTest extends WorkflowTest {
+
+ private final CallbackSet callbacks = new CallbackSet();
+
+ public DoCreateAllottedResourceTXCTest() throws IOException {
+ callbacks.put("assign", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyAssignCallback.xml"));
+ callbacks.put("create", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyCreateCallback.xml"));
+ callbacks.put("activate", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyActivateCallback.xml"));
+ callbacks.put("query", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceTXC/SDNCTopologyQueryCallback.xml"));
+ }
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/GenericGetService.bpmn",
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoCreateAllottedResourceTXC.bpmn",
+ "subprocess/DoCreateAllottedResourceTXCRollback.bpmn"})
+ public void testDoCreateAllottedResourceTXC_success() throws Exception{
+
+ MockNodeQueryServiceInstanceById("MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getSIUrlById.xml");
+ MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
+ MockNodeQueryServiceInstanceById("MIS%252F1604%252F0027%252FSW_INTERNET", "GenericFlows/getParentSIUrlById.xml");
+ MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0027%252FSW_INTERNET", "GenericFlows/getParentServiceInstance.xml");
+ MockPutAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0027%252FSW_INTERNET", "arId-1");
+ MockPatchAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0027%252FSW_INTERNET", "arId-1");
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<String, Object>();
+ setVariablesSuccess(variables, "testRequestId123");
+
+ invokeSubProcess("DoCreateAllottedResourceTXC", businessKey, variables);
+
+ injectSDNCCallbacks(callbacks, "assign");
+ injectSDNCCallbacks(callbacks, "create");
+ injectSDNCCallbacks(callbacks, "activate");
+ injectSDNCCallbacks(callbacks, "query");
+
+ waitForProcessEnd(businessKey, 10000);
+
+ Assert.assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "DoCreateAllottedResourceTXC", "WorkflowException");
+ System.out.println("workflowException:\n" + workflowException);
+ assertEquals(null, workflowException);
+ logEnd();
+ }
+
+ private void setVariablesSuccess(Map<String, Object> variables, String requestId) {
+ variables.put("isDebugLogEnabled", "true");
+ variables.put("failExists", "true");
+ variables.put("disableRollback", "true");
+ variables.put("msoRequestId", requestId);
+ variables.put("mso-request-id", "requestId");
+ variables.put("sourceNetworkId", "snId");
+ variables.put("sourceNetworkRole", "snRole");
+ variables.put("allottedResourceRole", "txc");
+ variables.put("allottedResourceType", "TunnelXConn");
+ variables.put("allottedResourceId", "arId-1");
+ variables.put("brgWanMacAddress", "wanmac");
+ variables.put("junitSleepMs", "5");
+
+ variables.put("serviceInstanceId", "MIS%252F1604%252F0026%252FSW_INTERNET");
+ variables.put("parentServiceInstanceId","MIS%252F1604%252F0027%252FSW_INTERNET");
+ variables.put("serviceChainServiceInstanceId", "scsiId");
+
+ String arModelInfo = "{ "+ "\"modelType\": \"allotted-resource\"," +
+ "\"modelInvariantUuid\": \"ff5256d2-5a33-55df-13ab-12abad84e7ff\"," +
+ "\"modelUuid\": \"fe6478e5-ea33-3346-ac12-ab121484a3fe\"," +
+ "\"modelName\": \"vSAMP12\"," +
+ "\"modelVersion\": \"1.0\"," +
+ "\"modelCustomizationUuid\": \"MODEL-ID-1234\"," +
+ "}";
+ variables.put("allottedResourceModelInfo", arModelInfo);
+ }
+
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoDeleteAllottedResourceBRGTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoDeleteAllottedResourceBRGTest.java
new file mode 100644
index 0000000000..054b6f5ed2
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoDeleteAllottedResourceBRGTest.java
@@ -0,0 +1,80 @@
+/*
+ * © 2014 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property.
+ */
+package org.openecomp.mso.bpmn.vcpe;
+
+import static org.junit.Assert.assertEquals;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteAllottedResource;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockQueryAllottedResourceById;
+import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
+import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
+
+import java.io.IOException;
+import java.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.mock.FileUtil;
+
+
+public class DoDeleteAllottedResourceBRGTest extends WorkflowTest {
+
+ private final CallbackSet callbacks = new CallbackSet();
+
+ public DoDeleteAllottedResourceBRGTest() throws IOException {
+ callbacks.put("deactivate", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyDeactivateCallback.xml"));
+ callbacks.put("delete", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyDeleteCallback.xml"));
+ callbacks.put("unassign", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyUnassignCallback.xml"));
+ }
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoDeleteAllottedResourceBRG.bpmn"})
+ public void testDoDeleteAllottedResourceBRG_success() throws Exception {
+
+ MockQueryAllottedResourceById("arId-1", "GenericFlows/getARUrlById.xml");
+ MockGetAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "arId-1", "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml");
+ MockPatchAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "arId-1");
+ MockDeleteAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "arId-1", "1490627351232");
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ setVariablesSuccess(variables, "testRequestId1");
+
+ invokeSubProcess("DoDeleteAllottedResourceBRG", businessKey, variables);
+
+ injectSDNCCallbacks(callbacks, "deactivate");
+ injectSDNCCallbacks(callbacks, "delete");
+ injectSDNCCallbacks(callbacks, "unassign");
+
+ waitForProcessEnd(businessKey, 10000);
+
+ Assert.assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "DoDeleteAllottedResourceBRG", "WorkflowException");
+ System.out.println("workflowException:\n" + workflowException);
+ assertEquals(null, workflowException);
+ }
+
+ private void setVariablesSuccess(Map<String, Object> variables, String requestId) {
+ variables.put("isDebugLogEnabled", "true");
+ variables.put("failNotFound", "true");
+ variables.put("msoRequestId", requestId);
+ variables.put("mso-request-id", "requestId");
+ variables.put("allottedResourceId", "arId-1");
+
+ variables.put("serviceInstanceId", "MIS%252F1604%252F0026%252FSW_INTERNET");
+ variables.put("parentServiceInstanceId","MIS%252F1604%252F0026%252FSW_INTERNET");
+ }
+
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoDeleteAllottedResourceTXCTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoDeleteAllottedResourceTXCTest.java
new file mode 100644
index 0000000000..a3faef1e67
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoDeleteAllottedResourceTXCTest.java
@@ -0,0 +1,80 @@
+/*
+ * © 2014 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property.
+ */
+package org.openecomp.mso.bpmn.vcpe;
+
+import static org.junit.Assert.assertEquals;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteAllottedResource;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource;
+import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockQueryAllottedResourceById;
+import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
+import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
+
+import java.io.IOException;
+import java.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.mock.FileUtil;
+
+
+public class DoDeleteAllottedResourceTXCTest extends WorkflowTest {
+
+ private final CallbackSet callbacks = new CallbackSet();
+
+ public DoDeleteAllottedResourceTXCTest() throws IOException {
+ callbacks.put("deactivate", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyDeactivateCallback.xml"));
+ callbacks.put("delete", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyDeleteCallback.xml"));
+ callbacks.put("unassign", FileUtil.readResourceFile("__files/VCPE/VfModularity/SDNCTopologyUnassignCallback.xml"));
+ }
+
+ @Test
+ @Deployment(resources = {
+ "subprocess/SDNCAdapterV1.bpmn",
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/DoDeleteAllottedResourceTXC.bpmn"})
+ public void testDoDeleteAllottedResourceTXC_success() throws Exception {
+
+ MockQueryAllottedResourceById("arId-1", "GenericFlows/getARUrlById.xml");
+ MockGetAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "arId-1", "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml");
+ MockPatchAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "arId-1");
+ MockDeleteAllottedResource("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "arId-1", "1490627351232");
+ mockSDNCAdapter(200);
+ mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+
+ String businessKey = UUID.randomUUID().toString();
+ Map<String, Object> variables = new HashMap<>();
+ setVariablesSuccess(variables, "testRequestId1");
+
+ invokeSubProcess("DoDeleteAllottedResourceTXC", businessKey, variables);
+
+ injectSDNCCallbacks(callbacks, "deactivate");
+ injectSDNCCallbacks(callbacks, "delete");
+ injectSDNCCallbacks(callbacks, "unassign");
+
+ waitForProcessEnd(businessKey, 10000);
+
+ Assert.assertTrue(isProcessEnded(businessKey));
+ String workflowException = BPMNUtil.getVariable(processEngineRule, "DoDeleteAllottedResourceTXC", "WorkflowException");
+ System.out.println("workflowException:\n" + workflowException);
+ assertEquals(null, workflowException);
+ }
+
+ private void setVariablesSuccess(Map<String, Object> variables, String requestId) {
+ variables.put("isDebugLogEnabled", "true");
+ variables.put("failNotFound", "true");
+ variables.put("msoRequestId", requestId);
+ variables.put("mso-request-id", "requestId");
+ variables.put("allottedResourceId", "arId-1");
+
+ variables.put("serviceInstanceId", "MIS%252F1604%252F0026%252FSW_INTERNET");
+ variables.put("parentServiceInstanceId","MIS%252F1604%252F0026%252FSW_INTERNET");
+ }
+
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/BuildingBlocks/sniroCallback2AR1Vnf b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/BuildingBlocks/sniroCallback2AR1Vnf
new file mode 100644
index 0000000000..19f18cce52
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/BuildingBlocks/sniroCallback2AR1Vnf
@@ -0,0 +1,107 @@
+{
+ "transactionId": "testRequestId",
+ "requestId": "testRequestId",
+ "requestState": "complete",
+ "statusMessage": "",
+ "solutionInfo": {
+ "licenseInfo": [
+ {
+ "entitlementPoolList": [
+ "f1d563e8-e714-4393-8f99-cc480144a05e",
+ "j1d563e8-e714-4393-8f99-cc480144a05e"
+ ],
+ "licenseKeyGroupList": [
+ "s1d563e8-e714-4393-8f99-cc480144a05e",
+ "b1d563e8-e714-4393-8f99-cc480144a05e"
+ ],
+ "resourceModuleName": "vHNPortalaaS_primary_1",
+ "serviceResourceId": "testResourceIdAR"
+ },
+ {
+ "entitlementPoolList": [
+ "91d563e8-e714-4393-8f99-cc480144a05e",
+ "21d563e8-e714-4393-8f99-cc480144a05e"
+ ],
+ "licenseKeyGroupList": [
+ "31d563e8-e714-4393-8f99-cc480144a05e",
+ "71d563e8-e714-4393-8f99-cc480144a05e"
+ ],
+ "resourceModuleName": "vHNPortalaaS_secondary_1",
+ "serviceResourceId": "testResourceIdVNF"
+ }
+ ],
+ "placement": [
+ {
+ "assignmentInfo": [
+ {
+ "variableName": "cloudOwner",
+ "variableValue": "aic"
+ },
+ {
+ "variableName": "vnfHostName",
+ "variableValue": "MDTNJ01"
+ },
+ {
+ "variableName": "aicClli",
+ "variableValue": "KDTNJ01"
+ },
+ {
+ "variableName": "aicVersion",
+ "variableValue": "3.0"
+ }
+ ],
+ "cloudRegionId": "dfwtx",
+ "inventoryType": "service",
+ "resourceModuleName": "ALLOTTED_RESOURCE",
+ "serviceInstanceId": "testSIID1",
+ "serviceResourceId": "testResourceIdAR"
+ },
+ {
+ "assignmentInfo": [
+ {
+ "variableName": "cloudOwner",
+ "variableValue": "aic"
+ },
+ {
+ "variableName": "vnfHostName",
+ "variableValue": "testVnfHostname2"
+ },
+ {
+ "variableName": "aicClli",
+ "variableValue": "testAicClli2"
+ },
+ {
+ "variableName": "aicVersion",
+ "variableValue": "3.0"
+ }
+ ],
+ "cloudRegionId": "testCloudRegionId2",
+ "inventoryType": "service",
+ "resourceModuleName": "ALLOTTED_RESOURCE",
+ "serviceInstanceId": "testSIID2",
+ "serviceResourceId": "testResourceIdAR2"
+ },
+ {
+ "assignmentInfo": [
+ {
+ "variableName": "cloudOwner",
+ "variableValue": "aic"
+ },
+ {
+ "variableName": "aicClli",
+ "variableValue": "testAicClli3"
+ },
+ {
+ "variableName": "aicVersion",
+ "variableValue": "3.0"
+ }
+ ],
+ "cloudRegionId": "testCloudRegionId3",
+ "inventoryType": "cloud",
+ "resourceModuleName": "VNF",
+ "serviceInstanceId": "",
+ "serviceResourceId": "testResourceIdVNF"
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/BuildingBlocks/sniroCallback2AR1Vnf2Net b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/BuildingBlocks/sniroCallback2AR1Vnf2Net
new file mode 100644
index 0000000000..5a9ef4b4f9
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/BuildingBlocks/sniroCallback2AR1Vnf2Net
@@ -0,0 +1,165 @@
+{
+ "transactionId": "testRequestId",
+ "requestId": "testRequestId",
+ "requestState": "complete",
+ "statusMessage": "",
+ "solutionInfo": {
+ "licenseInfo": [
+ {
+ "entitlementPoolList": [
+ "f1d563e8-e714-4393-8f99-cc480144a05e",
+ "j1d563e8-e714-4393-8f99-cc480144a05e"
+ ],
+ "licenseKeyGroupList": [
+ "s1d563e8-e714-4393-8f99-cc480144a05e",
+ "b1d563e8-e714-4393-8f99-cc480144a05e"
+ ],
+ "resourceModuleName": "vHNPortalaaS_primary_1",
+ "serviceResourceId": "testResourceIdAR"
+ },
+ {
+ "entitlementPoolList": [
+ "f1d563e8-e714-4393-8f99-cc480144a05n",
+ "j1d563e8-e714-4393-8f99-cc480144a05n"
+ ],
+ "licenseKeyGroupList": [
+ "s1d563e8-e714-4393-8f99-cc480144a05n",
+ "b1d563e8-e714-4393-8f99-cc480144a05n"
+ ],
+ "resourceModuleName": "net",
+ "serviceResourceId": "testResourceIdNet2"
+ },
+ {
+ "entitlementPoolList": [
+ "91d563e8-e714-4393-8f99-cc480144a05e",
+ "21d563e8-e714-4393-8f99-cc480144a05e"
+ ],
+ "licenseKeyGroupList": [
+ "31d563e8-e714-4393-8f99-cc480144a05e",
+ "71d563e8-e714-4393-8f99-cc480144a05e"
+ ],
+ "resourceModuleName": "vHNPortalaaS_secondary_1",
+ "serviceResourceId": "testResourceIdVNF"
+ }
+ ],
+ "placement": [
+ {
+ "assignmentInfo": [
+ {
+ "variableName": "cloudOwner",
+ "variableValue": "aic"
+ },
+ {
+ "variableName": "vnfHostName",
+ "variableValue": "MDTNJ01"
+ },
+ {
+ "variableName": "aicClli",
+ "variableValue": "KDTNJ01"
+ },
+ {
+ "variableName": "aicVersion",
+ "variableValue": "3.0"
+ }
+ ],
+ "cloudRegionId": "dfwtx",
+ "inventoryType": "service",
+ "resourceModuleName": "ALLOTTED_RESOURCE",
+ "serviceInstanceId": "testSIID1",
+ "serviceResourceId": "testResourceIdAR"
+ },
+ {
+ "assignmentInfo": [
+ {
+ "variableName": "cloudOwner",
+ "variableValue": "aic"
+ },
+ {
+ "variableName": "vnfHostName",
+ "variableValue": "testVnfHostname2"
+ },
+ {
+ "variableName": "aicClli",
+ "variableValue": "testAicClli2"
+ },
+ {
+ "variableName": "aicVersion",
+ "variableValue": "3.0"
+ }
+ ],
+ "cloudRegionId": "testCloudRegionId2",
+ "inventoryType": "service",
+ "resourceModuleName": "ALLOTTED_RESOURCE",
+ "serviceInstanceId": "testSIID2",
+ "serviceResourceId": "testResourceIdAR2"
+ },
+ {
+ "assignmentInfo": [
+ {
+ "variableName": "cloudOwner",
+ "variableValue": "aic"
+ },
+ {
+ "variableName": "vnfHostName",
+ "variableValue": "testVnfHostNameNet"
+ },
+ {
+ "variableName": "aicClli",
+ "variableValue": "testAicClliNet"
+ },
+ {
+ "variableName": "aicVersion",
+ "variableValue": "3.0"
+ }
+ ],
+ "cloudRegionId": "testCloudRegionIdNet",
+ "inventoryType": "service",
+ "resourceModuleName": "NETWORK",
+ "serviceInstanceId": "testServiceInstanceIdNet",
+ "serviceResourceId": "testResourceIdNet"
+ },
+ {
+ "assignmentInfo": [
+ {
+ "variableName": "cloudOwner",
+ "variableValue": "aic"
+ },
+ {
+ "variableName": "aicClli",
+ "variableValue": "testAicClliNet2"
+ },
+ {
+ "variableName": "aicVersion",
+ "variableValue": "3.0"
+ }
+ ],
+ "cloudRegionId": "testCloudRegionIdNet2",
+ "inventoryType": "cloud",
+ "resourceModuleName": "NETWORK",
+ "serviceInstanceId": "",
+ "serviceResourceId": "testResourceIdNet2"
+ },
+ {
+ "assignmentInfo": [
+ {
+ "variableName": "cloudOwner",
+ "variableValue": "aic"
+ },
+ {
+ "variableName": "aicClli",
+ "variableValue": "testAicClli3"
+ },
+ {
+ "variableName": "aicVersion",
+ "variableValue": "3.0"
+ }
+ ],
+ "cloudRegionId": "testCloudRegionId3",
+ "inventoryType": "cloud",
+ "resourceModuleName": "VNF",
+ "serviceInstanceId": "",
+ "serviceResourceId": "testResourceIdVNF"
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/BuildingBlocks/sniroCallbackNoSolutionFound b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/BuildingBlocks/sniroCallbackNoSolutionFound
new file mode 100644
index 0000000000..5cb748ae9d
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/BuildingBlocks/sniroCallbackNoSolutionFound
@@ -0,0 +1,15 @@
+{
+ "requestState": "",
+ "responseTime": "",
+ "solutionInfo": {
+ "placement": [],
+ "licenseInfo": {
+ "featureGroupId": ""
+ }
+ },
+ "percentProgress": "",
+ "requestId": "02c2e322-5839-4c97-9d46-0a5fa6bb642e",
+ "startTime": "",
+ "statusMessage": "No solution found for plan 08e1b8cf-144a-4bac-b293-d5e2eedc97e8",
+ "requestType": ""
+} \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/BuildingBlocks/sniroCallbackPolicyException b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/BuildingBlocks/sniroCallbackPolicyException
new file mode 100644
index 0000000000..b82688428e
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/BuildingBlocks/sniroCallbackPolicyException
@@ -0,0 +1,9 @@
+{
+ "requestError": {
+ "policyException": {
+ "requestId": "ae81d9a8-c949-493a-999c-f76c80503233",
+ "text": "Message content size exceeds the allowable limit",
+ "messageId": "SVC0001"
+ }
+ }
+} \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/BuildingBlocks/sniroCallbackServiceException b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/BuildingBlocks/sniroCallbackServiceException
new file mode 100644
index 0000000000..6cc78a7cdb
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/BuildingBlocks/sniroCallbackServiceException
@@ -0,0 +1,12 @@
+{
+ "requestError": {
+ "serviceException": {
+ "variables": [
+ "severity", 400
+ ],
+ "requestId": "ae81d9a8-c949-493a-999c-f76c80503233",
+ "text": "SNIROPlacementError: requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://135.21.171.200:8091/v1/plans/97b4e303-5f75-492c-8fb2-21098281c8b8",
+ "messageId": "SVC0001"
+ }
+ }
+} \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getARUrlById.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getARUrlById.xml
new file mode 100644
index 0000000000..e178583a34
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getARUrlById.xml
@@ -0,0 +1,6 @@
+<search-results xmlns="http://org.openecomp.aai.inventory">
+ <result-data>
+ <resource-type>allotted-resource</resource-type>
+ <resource-link>https://aai-ext1.test.com:8443/aai/v7/business/customers/customer/SDN-ETHERNET-INTERNET/service-subscriptions/service-subscription/123456789/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET/allotted-resources/allotted-resource/arId-1</resource-link>
+ </result-data>
+</search-results> \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getParentSIUrlById.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getParentSIUrlById.xml
new file mode 100644
index 0000000000..c29133e539
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getParentSIUrlById.xml
@@ -0,0 +1,6 @@
+<search-results xmlns="http://org.openecomp.aai.inventory">
+ <result-data>
+ <resource-type>service-instance</resource-type>
+ <resource-link>https://aai-ext1.test.com:8443/aai/v7/business/customers/customer/SDN-ETHERNET-INTERNET/service-subscriptions/service-subscription/123456789/service-instances/service-instance/MIS%252F1604%252F0027%252FSW_INTERNET</resource-link>
+ </result-data>
+</search-results> \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getParentServiceInstance.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getParentServiceInstance.xml
new file mode 100644
index 0000000000..bc810c6014
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getParentServiceInstance.xml
@@ -0,0 +1,30 @@
+<service-instance>
+ <service-instance-id>MIS/1604/0027/SW_INTERNET</service-instance-id>
+ <resource-version>123456789</resource-version>
+ <relationship-list>
+ <relationship>
+ <related-to>cvlan-tag</related-to>
+ <related-link>https://aai-ext1.test.com:8443/aai/v2/network/vces/vce/832bace2-3fb0-49e0-a6a4-07c47223c535/port-groups/port-group/slcp1447vbc.ipag/cvlan-tags/cvlan-tag/2003/</related-link>
+ <relationship-data>
+ <relationship-key>cvlan-tag.cvlan-tag</relationship-key>
+ <relationship-value>2003</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>port-group.interface-id</relationship-key>
+ <relationship-value>slcp1447vbc.ipag</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>vce.vnf-id</relationship-key>
+ <relationship-value>832bace2-3fb0-49e0-a6a4-07c47223c535</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>vce</related-to>
+ <related-link>https://aai-ext1.test.com:8443/aai/v2/network/vces/vce/832bace2-3fb0-49e0-a6a4-07c47223c535/</related-link>
+ <relationship-data>
+ <relationship-key>vce.vnf-id</relationship-key>
+ <relationship-value>832bace2-3fb0-49e0-a6a4-07c47223c535</relationship-value>
+ </relationship-data>
+ </relationship>
+ </relationship-list>
+</service-instance>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateServiceInstance/createServiceInstance_AAIResponse_success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateServiceInstance/createServiceInstance_AAIResponse_success.xml
new file mode 100644
index 0000000000..5f810bab4c
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateServiceInstance/createServiceInstance_AAIResponse_success.xml
@@ -0,0 +1,11 @@
+<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> \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/SDNCTopologyQueryCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/SDNCTopologyQueryCallback.xml
new file mode 100644
index 0000000000..410ba05e5f
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/SDNCTopologyQueryCallback.xml
@@ -0,0 +1,37 @@
+<output xmlns="org:openecomp:sdnctl:vnf">
+<brg-topology xmlns="org:openecomp:sdnctl:vnf">
+ <ecomp-model-information>
+ <model-invariant-uuid>36e20198-c67a-464b-96d0-aaa99eb2639e</model-invariant-uuid>
+ <model-uuid>5b9b15d0-5dd7-47dc-95b9-0440c340a3ba</model-uuid>
+ <model-version>1.0</model-version>
+ <model-name>BRGmodelname</model-name>
+ <model-customization-uuid>013bd784-9bca-4919-ae2f-ae57af27bad9</model-customization-uuid>
+ </ecomp-model-information>
+ <allotted-resource-identifiers>
+ <parent-service-instance-id>parent-service-instance-id</parent-service-instance-id>
+ <consuming-service-intance-id>consuming-service-instance-id</consuming-service-intance-id>
+ <allotted-resource-name>namefromrequest</allotted-resource-name>
+ <allotted-resource-type>brg</allotted-resource-type>
+ <allotted-resource-id>allottedresourceidfromrequest</allotted-resource-id>
+ </allotted-resource-identifiers>
+ <brg-assignments>
+ <fq-name>fq-name</fq-name>
+ <dest-network>
+ <network-id>d1</network-id>
+ <network-role>drole</network-role>
+ </dest-network>
+ <vlan-tag>vlan-tag</vlan-tag>
+ <source-network>
+ <network-id>s2</network-id>
+ <network-role>srole</network-role>
+ </source-network>
+ <txc-id>txc-id</txc-id>
+ <txc-applied-service>
+ <service-instance-id>1</service-instance-id>
+ <vnf-id>123</vnf-id>
+ <txc-fqdn>a.b.c.d</txc-fqdn>
+ </txc-applied-service>
+ </brg-assignments>
+</brg-topology>
+
+</output>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/getAR.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/getAR.xml
new file mode 100644
index 0000000000..b6da551d23
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/getAR.xml
@@ -0,0 +1,8 @@
+<allotted-resource xmlns="http://org.openecomp.aai.inventory/v9">
+ <relationship-list>
+ <relationship>
+ <related-to>allotted-resource</related-to>
+ <related-link>http://localhost:28090/aai/v9/mylink</related-link>
+ </relationship>
+ </relationship-list>
+</allotted-resource>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/getArBrg.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/getArBrg.xml
new file mode 100644
index 0000000000..361d44032b
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/getArBrg.xml
@@ -0,0 +1,31 @@
+<allotted-resource xmlns="http://org.openecomp.aai.inventory/v9">
+ <id>ar-1</id>
+ <orchestration-status>Active</orchestration-status>
+ <role>BRGr</role>
+ <type>BRGt</type>
+ <description>BRG</description>
+ <selflink/>
+ <resource-version>1490627351232</resource-version>
+ <relationship-list>
+ <relationship>
+ <related-to>service-instance</related-to>
+ <related-link>http://localhost:28090/aai/v9/business/customers/customer/SDN-ETHERNET-INTERNET/service-subscriptions/service-subscription/123456789/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET/allotted-resources/allotted-resource/arId-1</related-link>
+ <relationship-data>
+ <relationship-key>customer.global-customer-id</relationship-key>
+ <relationship-value>MCBH-1610</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>service-subscription.service-type</relationship-key>
+ <relationship-value>vcpesvc</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>service-instance.service-instance-id</relationship-key>
+ <relationship-value>88819355-9a71-4ddc-9e22-373f0644b40b</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>service-instance.service-instance-name</property-key>
+ <property-value>vcpe-1702-m010904-name4</property-value>
+ </related-to-property>
+ </relationship>
+ </relationship-list>
+</allotted-resource>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml
new file mode 100644
index 0000000000..6a35247b09
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml
@@ -0,0 +1,31 @@
+<allotted-resource xmlns="http://org.openecomp.aai.inventory/v9">
+ <id>ar-1</id>
+ <orchestration-status>Active</orchestration-status>
+ <role>BRG</role>
+ <type>BRG</type>
+ <description>BRG</description>
+ <selflink/>
+ <resource-version>1490627351232</resource-version>
+ <relationship-list>
+ <relationship>
+ <related-to>service-instance</related-to>
+ <related-link>http://localhost:28090/aai/v9/business/customers/customer/SDN-ETHERNET-INTERNET/service-subscriptions/service-subscription/123456789/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET/allotted-resources/allotted-resource/arId-1</related-link>
+ <relationship-data>
+ <relationship-key>customer.global-customer-id</relationship-key>
+ <relationship-value>MCBH-1610</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>service-subscription.service-type</relationship-key>
+ <relationship-value>vcpesvc</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>service-instance.service-instance-id</relationship-key>
+ <relationship-value>88819355-9a71-4ddc-9e22-373f0644b40b</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>service-instance.service-instance-name</property-key>
+ <property-value>vcpe-1702-m010904-name4</property-value>
+ </related-to-property>
+ </relationship>
+ </relationship-list>
+</allotted-resource>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncActivateRollbackReq.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncActivateRollbackReq.xml
new file mode 100644
index 0000000000..6f86e0fb86
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncActivateRollbackReq.xml
@@ -0,0 +1,51 @@
+<sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:ns5="http://org.openecomp/mso/request/types/v1"
+ xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:sdncadapter="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>b043d290-140d-4a38-a9b6-95d3b8bd27d1</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>MIS%252F1604%252F0026%252FSW_INTERNET</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>deactvate</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>brg-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>http://localhost:28090/mso/SDNCAdapterCallbackService</sdncadapter:CallbackUrl>
+ </sdncadapter:RequestHeader>
+ <sdncadapterworkflow:SDNCRequestData>
+ <request-information>
+ <request-id>RaaTestRequestId1</request-id>
+ <request-action>DeleteBRGInstance</request-action>
+ <source>MSO</source>
+ <notification-url/>
+ <order-number/>
+ <order-version/>
+ </request-information>
+ <service-information>
+ <service-id></service-id>
+ <subscription-service-type></subscription-service-type>
+ <ecomp-model-information></ecomp-model-information>
+ <service-instance-id>MIS%252F1604%252F0026%252FSW_INTERNET</service-instance-id>
+ <subscriber-name/>
+ <global-customer-id></global-customer-id>
+ </service-information>
+ <allotted-resource-information>
+ <allotted-resource-id>arId-1</allotted-resource-id>
+ <allotted-resource-type>brg</allotted-resource-type>
+ <parent-service-instance-id>MIS%252F1604%252F0026%252FSW_INTERNET</parent-service-instance-id>
+ <ecomp-model-information>
+ <model-invariant-uuid></model-invariant-uuid>
+ <model-uuid></model-uuid>
+ <model-customization-uuid></model-customization-uuid>
+ <model-version></model-version>
+ <model-name></model-name>
+ </ecomp-model-information>
+ </allotted-resource-information>
+ <brg-request-input>
+ <source-network>
+ <network-id>${sourceNetworkId}</network-id>
+ <network-role>${sourceNetworkRole}</network-role>
+ </source-network>
+ <dest-network>
+ <network-id/>
+ <network-role></network-role>
+ </dest-network>
+ </brg-request-input>
+ </sdncadapterworkflow:SDNCRequestData>
+</sdncadapterworkflow:SDNCAdapterWorkflowRequest>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncAssignRollbackReq.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncAssignRollbackReq.xml
new file mode 100644
index 0000000000..30d4c7ae49
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncAssignRollbackReq.xml
@@ -0,0 +1,51 @@
+<sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:ns5="http://org.openecomp/mso/request/types/v1"
+ xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:sdncadapter="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>b043d290-140d-4a38-a9b6-95d3b8bd27d3</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>MIS%252F1604%252F0026%252FSW_INTERNET</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>unassign</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>brg-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>http://localhost:28090/mso/SDNCAdapterCallbackService</sdncadapter:CallbackUrl>
+ </sdncadapter:RequestHeader>
+ <sdncadapterworkflow:SDNCRequestData>
+ <request-information>
+ <request-id>RaaTestRequestId1</request-id>
+ <request-action>DeleteBRGInstance</request-action>
+ <source>MSO</source>
+ <notification-url/>
+ <order-number/>
+ <order-version/>
+ </request-information>
+ <service-information>
+ <service-id></service-id>
+ <subscription-service-type></subscription-service-type>
+ <ecomp-model-information></ecomp-model-information>
+ <service-instance-id>MIS%252F1604%252F0026%252FSW_INTERNET</service-instance-id>
+ <subscriber-name/>
+ <global-customer-id></global-customer-id>
+ </service-information>
+ <allotted-resource-information>
+ <allotted-resource-id>arId-1</allotted-resource-id>
+ <allotted-resource-type>brg</allotted-resource-type>
+ <parent-service-instance-id>MIS%252F1604%252F0026%252FSW_INTERNET</parent-service-instance-id>
+ <ecomp-model-information>
+ <model-invariant-uuid></model-invariant-uuid>
+ <model-uuid></model-uuid>
+ <model-customization-uuid></model-customization-uuid>
+ <model-version></model-version>
+ <model-name></model-name>
+ </ecomp-model-information>
+ </allotted-resource-information>
+ <brg-request-input>
+ <source-network>
+ <network-id>${sourceNetworkId}</network-id>
+ <network-role>${sourceNetworkRole}</network-role>
+ </source-network>
+ <dest-network>
+ <network-id/>
+ <network-role></network-role>
+ </dest-network>
+ </brg-request-input>
+ </sdncadapterworkflow:SDNCRequestData>
+</sdncadapterworkflow:SDNCAdapterWorkflowRequest>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncCreateRollbackReq.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncCreateRollbackReq.xml
new file mode 100644
index 0000000000..e20850a7b9
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncCreateRollbackReq.xml
@@ -0,0 +1,51 @@
+<sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:ns5="http://org.openecomp/mso/request/types/v1"
+ xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:sdncadapter="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>b043d290-140d-4a38-a9b6-95d3b8bd27d2</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>MIS%252F1604%252F0026%252FSW_INTERNET</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>delete</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>brg-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>http://localhost:28090/mso/SDNCAdapterCallbackService</sdncadapter:CallbackUrl>
+ </sdncadapter:RequestHeader>
+ <sdncadapterworkflow:SDNCRequestData>
+ <request-information>
+ <request-id>RaaTestRequestId1</request-id>
+ <request-action>DeleteBRGInstance</request-action>
+ <source>MSO</source>
+ <notification-url/>
+ <order-number/>
+ <order-version/>
+ </request-information>
+ <service-information>
+ <service-id></service-id>
+ <subscription-service-type></subscription-service-type>
+ <ecomp-model-information></ecomp-model-information>
+ <service-instance-id>MIS%252F1604%252F0026%252FSW_INTERNET</service-instance-id>
+ <subscriber-name/>
+ <global-customer-id></global-customer-id>
+ </service-information>
+ <allotted-resource-information>
+ <allotted-resource-id>arId-1</allotted-resource-id>
+ <allotted-resource-type>brg</allotted-resource-type>
+ <parent-service-instance-id>MIS%252F1604%252F0026%252FSW_INTERNET</parent-service-instance-id>
+ <ecomp-model-information>
+ <model-invariant-uuid></model-invariant-uuid>
+ <model-uuid></model-uuid>
+ <model-customization-uuid></model-customization-uuid>
+ <model-version></model-version>
+ <model-name></model-name>
+ </ecomp-model-information>
+ </allotted-resource-information>
+ <brg-request-input>
+ <source-network>
+ <network-id>${sourceNetworkId}</network-id>
+ <network-role>${sourceNetworkRole}</network-role>
+ </source-network>
+ <dest-network>
+ <network-id/>
+ <network-role></network-role>
+ </dest-network>
+ </brg-request-input>
+ </sdncadapterworkflow:SDNCRequestData>
+</sdncadapterworkflow:SDNCAdapterWorkflowRequest>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/SDNCTopologyQueryCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/SDNCTopologyQueryCallback.xml
new file mode 100644
index 0000000000..ac85be4e97
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/SDNCTopologyQueryCallback.xml
@@ -0,0 +1,24 @@
+<output xmlns="org:openecomp:sdnctl:vnf">
+<tunnelxconn-topology xmlns="org:openecomp:sdnctl:vnf">
+ <ecomp-model-information>
+ <model-invariant-uuid>36e20198-c67a-464b-96d0-aaa99eb2639e</model-invariant-uuid>
+ <model-uuid>5b9b15d0-5dd7-47dc-95b9-0440c340a3ba</model-uuid>
+ <model-version>1.0</model-version>
+ <model-name>TXCmodelname</model-name>
+ <model-customization-uuid>013bd784-9bca-4919-ae2f-ae57af27bad9</model-customization-uuid>
+ </ecomp-model-information>
+ <allotted-resource-identifiers>
+ <parent-service-instance-id>parent-service-instance-id</parent-service-instance-id>
+ <consuming-service-intance-id>consuming-service-instance-id</consuming-service-intance-id>
+ <allotted-resource-name>namefromrequest</allotted-resource-name>
+ <allotted-resource-type>tunnelxconn</allotted-resource-type>
+ <allotted-resource-id>allottedresourceidfromrequest</allotted-resource-id>
+ </allotted-resource-identifiers>
+ <tunnelxconn-assignments>
+ <vni>my-vni</vni>
+ <vgmux_bearer_ip>my-bearer-ip</vgmux_bearer_ip>
+ <vgmux_lan_ip>my-lan-ip</vgmux_lan_ip>
+ </tunnelxconn-assignments>
+</tunnelxconn-topology>
+
+</output>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml
new file mode 100644
index 0000000000..713ef56b50
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml
@@ -0,0 +1,31 @@
+<allotted-resource xmlns="http://org.openecomp.aai.inventory/v9">
+ <id>ar-1</id>
+ <orchestration-status>Active</orchestration-status>
+ <role>TunnelXConn</role>
+ <type>TunnelXConn</type>
+ <description>TunnelXConn</description>
+ <selflink/>
+ <resource-version>1490627351232</resource-version>
+ <relationship-list>
+ <relationship>
+ <related-to>service-instance</related-to>
+ <related-link>http://localhost:28090/aai/v9/business/customers/customer/SDN-ETHERNET-INTERNET/service-subscriptions/service-subscription/123456789/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET/allotted-resources/allotted-resource/arId-1</related-link>
+ <relationship-data>
+ <relationship-key>customer.global-customer-id</relationship-key>
+ <relationship-value>MCBH-1610</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>service-subscription.service-type</relationship-key>
+ <relationship-value>vcpesvc</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>service-instance.service-instance-id</relationship-key>
+ <relationship-value>88819355-9a71-4ddc-9e22-373f0644b40b</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>service-instance.service-instance-name</property-key>
+ <property-value>vcpe-1702-m010904-name4</property-value>
+ </related-to-property>
+ </relationship>
+ </relationship-list>
+</allotted-resource>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncActivateRollbackReq.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncActivateRollbackReq.xml
new file mode 100644
index 0000000000..efec7eb001
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncActivateRollbackReq.xml
@@ -0,0 +1,51 @@
+<sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:ns5="http://org.openecomp/mso/request/types/v1"
+ xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:sdncadapter="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>b043d290-140d-4a38-a9b6-95d3b8bd27d1</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>MIS%252F1604%252F0026%252FSW_INTERNET</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>deactvate</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>tunnelxconn-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>http://localhost:8080/mso/SDNCAdapterCallbackService</sdncadapter:CallbackUrl>
+ </sdncadapter:RequestHeader>
+ <sdncadapterworkflow:SDNCRequestData>
+ <request-information>
+ <request-id>RaaTestRequestId1</request-id>
+ <request-action>DeleteTunnelXConnInstance</request-action>
+ <source>MSO</source>
+ <notification-url/>
+ <order-number/>
+ <order-version/>
+ </request-information>
+ <service-information>
+ <service-id></service-id>
+ <subscription-service-type></subscription-service-type>
+ <ecomp-model-information></ecomp-model-information>
+ <service-instance-id>MIS%252F1604%252F0026%252FSW_INTERNET</service-instance-id>
+ <subscriber-name/>
+ <global-customer-id></global-customer-id>
+ </service-information>
+ <allotted-resource-information>
+ <allotted-resource-id>arId-1</allotted-resource-id>
+ <allotted-resource-type>tunnelxconn</allotted-resource-type>
+ <parent-service-instance-id>MIS%252F1604%252F0026%252FSW_INTERNET</parent-service-instance-id>
+ <ecomp-model-information>
+ <model-invariant-uuid></model-invariant-uuid>
+ <model-uuid></model-uuid>
+ <model-customization-uuid></model-customization-uuid>
+ <model-version></model-version>
+ <model-name></model-name>
+ </ecomp-model-information>
+ </allotted-resource-information>
+ <tunnelxconn-request-input>
+ <source-network>
+ <network-id>${sourceNetworkId}</network-id>
+ <network-role>${sourceNetworkRole}</network-role>
+ </source-network>
+ <dest-network>
+ <network-id/>
+ <network-role></network-role>
+ </dest-network>
+ </tunnelxconn-request-input>
+ </sdncadapterworkflow:SDNCRequestData>
+</sdncadapterworkflow:SDNCAdapterWorkflowRequest>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncAssignRollbackReq.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncAssignRollbackReq.xml
new file mode 100644
index 0000000000..9f52758750
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncAssignRollbackReq.xml
@@ -0,0 +1,51 @@
+<sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:ns5="http://org.openecomp/mso/request/types/v1"
+ xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:sdncadapter="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>b043d290-140d-4a38-a9b6-95d3b8bd27d3</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>MIS%252F1604%252F0026%252FSW_INTERNET</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>unassign</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>tunnelxconn-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>http://localhost:8080/mso/SDNCAdapterCallbackService</sdncadapter:CallbackUrl>
+ </sdncadapter:RequestHeader>
+ <sdncadapterworkflow:SDNCRequestData>
+ <request-information>
+ <request-id>RaaTestRequestId1</request-id>
+ <request-action>DeleteTunnelXConnInstance</request-action>
+ <source>MSO</source>
+ <notification-url/>
+ <order-number/>
+ <order-version/>
+ </request-information>
+ <service-information>
+ <service-id></service-id>
+ <subscription-service-type></subscription-service-type>
+ <ecomp-model-information></ecomp-model-information>
+ <service-instance-id>MIS%252F1604%252F0026%252FSW_INTERNET</service-instance-id>
+ <subscriber-name/>
+ <global-customer-id></global-customer-id>
+ </service-information>
+ <allotted-resource-information>
+ <allotted-resource-id>arId-1</allotted-resource-id>
+ <allotted-resource-type>tunnelxconn</allotted-resource-type>
+ <parent-service-instance-id>MIS%252F1604%252F0026%252FSW_INTERNET</parent-service-instance-id>
+ <ecomp-model-information>
+ <model-invariant-uuid></model-invariant-uuid>
+ <model-uuid></model-uuid>
+ <model-customization-uuid></model-customization-uuid>
+ <model-version></model-version>
+ <model-name></model-name>
+ </ecomp-model-information>
+ </allotted-resource-information>
+ <tunnelxconn-request-input>
+ <source-network>
+ <network-id>${sourceNetworkId}</network-id>
+ <network-role>${sourceNetworkRole}</network-role>
+ </source-network>
+ <dest-network>
+ <network-id/>
+ <network-role></network-role>
+ </dest-network>
+ </tunnelxconn-request-input>
+ </sdncadapterworkflow:SDNCRequestData>
+</sdncadapterworkflow:SDNCAdapterWorkflowRequest>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncCreateRollbackReq.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncCreateRollbackReq.xml
new file mode 100644
index 0000000000..025195e326
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncCreateRollbackReq.xml
@@ -0,0 +1,51 @@
+<sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:ns5="http://org.openecomp/mso/request/types/v1"
+ xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:sdncadapter="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>b043d290-140d-4a38-a9b6-95d3b8bd27d2</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>MIS%252F1604%252F0026%252FSW_INTERNET</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>delete</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>tunnelxconn-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>http://localhost:8080/mso/SDNCAdapterCallbackService</sdncadapter:CallbackUrl>
+ </sdncadapter:RequestHeader>
+ <sdncadapterworkflow:SDNCRequestData>
+ <request-information>
+ <request-id>RaaTestRequestId1</request-id>
+ <request-action>DeleteTunnelXConnInstance</request-action>
+ <source>MSO</source>
+ <notification-url/>
+ <order-number/>
+ <order-version/>
+ </request-information>
+ <service-information>
+ <service-id></service-id>
+ <subscription-service-type></subscription-service-type>
+ <ecomp-model-information></ecomp-model-information>
+ <service-instance-id>MIS%252F1604%252F0026%252FSW_INTERNET</service-instance-id>
+ <subscriber-name/>
+ <global-customer-id></global-customer-id>
+ </service-information>
+ <allotted-resource-information>
+ <allotted-resource-id>arId-1</allotted-resource-id>
+ <allotted-resource-type>tunnelxconn</allotted-resource-type>
+ <parent-service-instance-id>MIS%252F1604%252F0026%252FSW_INTERNET</parent-service-instance-id>
+ <ecomp-model-information>
+ <model-invariant-uuid></model-invariant-uuid>
+ <model-uuid></model-uuid>
+ <model-customization-uuid></model-customization-uuid>
+ <model-version></model-version>
+ <model-name></model-name>
+ </ecomp-model-information>
+ </allotted-resource-information>
+ <tunnelxconn-request-input>
+ <source-network>
+ <network-id>${sourceNetworkId}</network-id>
+ <network-role>${sourceNetworkRole}</network-role>
+ </source-network>
+ <dest-network>
+ <network-id/>
+ <network-role></network-role>
+ </dest-network>
+ </tunnelxconn-request-input>
+ </sdncadapterworkflow:SDNCRequestData>
+</sdncadapterworkflow:SDNCAdapterWorkflowRequest>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoDeleteAllottedResourceBRG/arGetById.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoDeleteAllottedResourceBRG/arGetById.xml
new file mode 100644
index 0000000000..6a35247b09
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoDeleteAllottedResourceBRG/arGetById.xml
@@ -0,0 +1,31 @@
+<allotted-resource xmlns="http://org.openecomp.aai.inventory/v9">
+ <id>ar-1</id>
+ <orchestration-status>Active</orchestration-status>
+ <role>BRG</role>
+ <type>BRG</type>
+ <description>BRG</description>
+ <selflink/>
+ <resource-version>1490627351232</resource-version>
+ <relationship-list>
+ <relationship>
+ <related-to>service-instance</related-to>
+ <related-link>http://localhost:28090/aai/v9/business/customers/customer/SDN-ETHERNET-INTERNET/service-subscriptions/service-subscription/123456789/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET/allotted-resources/allotted-resource/arId-1</related-link>
+ <relationship-data>
+ <relationship-key>customer.global-customer-id</relationship-key>
+ <relationship-value>MCBH-1610</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>service-subscription.service-type</relationship-key>
+ <relationship-value>vcpesvc</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>service-instance.service-instance-id</relationship-key>
+ <relationship-value>88819355-9a71-4ddc-9e22-373f0644b40b</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>service-instance.service-instance-name</property-key>
+ <property-value>vcpe-1702-m010904-name4</property-value>
+ </related-to-property>
+ </relationship>
+ </relationship-list>
+</allotted-resource>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoDeleteAllottedResourceTXC/arGetById.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoDeleteAllottedResourceTXC/arGetById.xml
new file mode 100644
index 0000000000..713ef56b50
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoDeleteAllottedResourceTXC/arGetById.xml
@@ -0,0 +1,31 @@
+<allotted-resource xmlns="http://org.openecomp.aai.inventory/v9">
+ <id>ar-1</id>
+ <orchestration-status>Active</orchestration-status>
+ <role>TunnelXConn</role>
+ <type>TunnelXConn</type>
+ <description>TunnelXConn</description>
+ <selflink/>
+ <resource-version>1490627351232</resource-version>
+ <relationship-list>
+ <relationship>
+ <related-to>service-instance</related-to>
+ <related-link>http://localhost:28090/aai/v9/business/customers/customer/SDN-ETHERNET-INTERNET/service-subscriptions/service-subscription/123456789/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET/allotted-resources/allotted-resource/arId-1</related-link>
+ <relationship-data>
+ <relationship-key>customer.global-customer-id</relationship-key>
+ <relationship-value>MCBH-1610</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>service-subscription.service-type</relationship-key>
+ <relationship-value>vcpesvc</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>service-instance.service-instance-id</relationship-key>
+ <relationship-value>88819355-9a71-4ddc-9e22-373f0644b40b</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>service-instance.service-instance-name</property-key>
+ <property-value>vcpe-1702-m010904-name4</property-value>
+ </related-to-property>
+ </relationship>
+ </relationship-list>
+</allotted-resource>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/SDNCTopologyCreateCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/SDNCTopologyCreateCallback.xml
new file mode 100644
index 0000000000..11022f6aec
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/SDNCTopologyCreateCallback.xml
@@ -0,0 +1,16 @@
+ <output xmlns="org:openecomp:sdnctl:vnf">
+ <vnf-information>
+ <vnf-id>skask</vnf-id>
+ </vnf-information>
+ <response-code>200</response-code>
+ <svc-request-id>{{REQUEST-ID}}</svc-request-id>
+ <ack-final-indicator>Y</ack-final-indicator>
+ <service-information>
+ <subscriber-name>dontcare</subscriber-name>
+ <service-instance-id>0</service-instance-id>
+ <service-type>SDN-MOBILITY</service-type>
+ </service-information>
+ <instance-reference>
+ <object-path>restconf/SDNCObjectPath</object-path>
+ </instance-reference>
+ </output> \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/SDNCTopologyDeactivateCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/SDNCTopologyDeactivateCallback.xml
new file mode 100644
index 0000000000..acea1459bc
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/SDNCTopologyDeactivateCallback.xml
@@ -0,0 +1,13 @@
+<output xmlns="org:openecomp:sdnctl:vnf">
+ <vnf-information>
+ <vnf-id>skask</vnf-id>
+ </vnf-information>
+ <response-code>200</response-code>
+ <svc-request-id>{{REQUEST-ID}}</svc-request-id>
+ <ack-final-indicator>Y</ack-final-indicator>
+ <service-information>
+ <subscriber-name>dontcare</subscriber-name>
+ <service-instance-id>0</service-instance-id>
+ <service-type>SDN-MOBILITY</service-type>
+ </service-information>
+</output> \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/SDNCTopologyDeleteCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/SDNCTopologyDeleteCallback.xml
new file mode 100644
index 0000000000..11022f6aec
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/SDNCTopologyDeleteCallback.xml
@@ -0,0 +1,16 @@
+ <output xmlns="org:openecomp:sdnctl:vnf">
+ <vnf-information>
+ <vnf-id>skask</vnf-id>
+ </vnf-information>
+ <response-code>200</response-code>
+ <svc-request-id>{{REQUEST-ID}}</svc-request-id>
+ <ack-final-indicator>Y</ack-final-indicator>
+ <service-information>
+ <subscriber-name>dontcare</subscriber-name>
+ <service-instance-id>0</service-instance-id>
+ <service-type>SDN-MOBILITY</service-type>
+ </service-information>
+ <instance-reference>
+ <object-path>restconf/SDNCObjectPath</object-path>
+ </instance-reference>
+ </output> \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/SDNCTopologyUnassignCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/SDNCTopologyUnassignCallback.xml
new file mode 100644
index 0000000000..11022f6aec
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/SDNCTopologyUnassignCallback.xml
@@ -0,0 +1,16 @@
+ <output xmlns="org:openecomp:sdnctl:vnf">
+ <vnf-information>
+ <vnf-id>skask</vnf-id>
+ </vnf-information>
+ <response-code>200</response-code>
+ <svc-request-id>{{REQUEST-ID}}</svc-request-id>
+ <ack-final-indicator>Y</ack-final-indicator>
+ <service-information>
+ <subscriber-name>dontcare</subscriber-name>
+ <service-instance-id>0</service-instance-id>
+ <service-type>SDN-MOBILITY</service-type>
+ </service-information>
+ <instance-reference>
+ <object-path>restconf/SDNCObjectPath</object-path>
+ </instance-reference>
+ </output> \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/VNFAdapterRestCreateCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/VNFAdapterRestCreateCallback.xml
new file mode 100644
index 0000000000..49ecd0bf3f
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/VNFAdapterRestCreateCallback.xml
@@ -0,0 +1,55 @@
+<createVfModuleResponse>
+ <vnfId>skask</vnfId>
+ <vfModuleId>supercool</vfModuleId>
+ <vfModuleStackId>slowburn</vfModuleStackId>
+ <vfModuleCreated>true</vfModuleCreated>
+ <vfModuleOutputs>
+ <entry>
+ <key>key1</key>
+ <value>value1</value>
+ </entry>
+ <entry>
+ <key>key2</key>
+ <value>value2</value>
+ </entry>
+ <entry>
+<key>server1_private_ip</key>
+<value>192.168.28.3</value>
+</entry>
+<entry>
+<key>contrail-service-instance-fqdn</key>
+<value>default-domain:MSOTest:MsoNW-RA</value>
+</entry>
+<entry>
+<key>policyKey1_contrail_network_policy_fqdn</key>
+<value>MSOTest:DefaultPolicyFQDN1</value>
+</entry>
+<entry>
+<key>policyKey2_contrail_network_policy_fqdn</key>
+<value>MSOTest:DefaultPolicyFQDN2</value>
+</entry>
+<entry>
+<key>oam_management_v6_address</key>
+<value>2000:abc:bce:1111</value>
+</entry>
+<entry>
+<key>oam_management_v4_address</key>
+<value>127.0.0.1</value>
+</entry>
+ </vfModuleOutputs>
+ <rollback> <!-- JC's doc has "vfModuleRollback" -->
+ <vnfId>skask</vnfId>
+ <vfModuleId>supercool</vfModuleId>
+ <vfModuleStackId>slowburn</vfModuleStackId>
+ <vfModuleCreated>true</vfModuleCreated>
+ <tenantId>tenantId</tenantId>
+ <cloudSiteId>cloudSiteId</cloudSiteId>
+ <msoRequest>
+ <requestId>requestId</requestId>
+ <serviceInstanceId>serviceInstanceId</serviceInstanceId>
+ </msoRequest>
+ <messageId>{{MESSAGE-ID}}</messageId> <!-- JC's doc does not have this -->
+ </rollback>
+ <messageId>{{MESSAGE-ID}}</messageId>
+</createVfModuleResponse>
+
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/createServiceInstance_genericQueryByInstance_AAIResponse_200.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/createServiceInstance_genericQueryByInstance_AAIResponse_200.xml
new file mode 100644
index 0000000000..2f38a4f535
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/createServiceInstance_genericQueryByInstance_AAIResponse_200.xml
@@ -0,0 +1,13 @@
+<search-results xmlns="http://org.openecomp.aai.inventory">
+ <service-instances>
+ <service-instance>
+ <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
+ <persona-model-id>gg0e927b-6087-5574-9ef8-c5e4d5847db5</persona-model-id>
+ <persona-model-version>V1.0</persona-model-version>
+ <service-instance-name>vMOG-AKRON-1234</service-instance-name>
+ <resource-version>1462561835</resource-version>
+ <relationship-list/>
+ <metadata/>
+ </service-instance>
+ </service-instances>
+ </search-results>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getARUrlById.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getARUrlById.xml
new file mode 100644
index 0000000000..e178583a34
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getARUrlById.xml
@@ -0,0 +1,6 @@
+<search-results xmlns="http://org.openecomp.aai.inventory">
+ <result-data>
+ <resource-type>allotted-resource</resource-type>
+ <resource-link>https://aai-ext1.test.com:8443/aai/v7/business/customers/customer/SDN-ETHERNET-INTERNET/service-subscriptions/service-subscription/123456789/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET/allotted-resources/allotted-resource/arId-1</resource-link>
+ </result-data>
+</search-results> \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogNetworkData.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogNetworkData.json
new file mode 100644
index 0000000000..cab2637955
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogNetworkData.json
@@ -0,0 +1,28 @@
+{
+ "serviceNetworks": [
+ {
+ "version": null,
+ "modelCustomizationUuid": "93a5f915-403f-487d-89e4-7107359635b0",
+ "modelName": "VIPR_TENANT_OAM_NET",
+ "modelInstanceName": "VIPR_TENANT_OAM_NET 1",
+ "modelUuid": "6524c8ad-dc17-44c0-ad24-08c4d2df52e6",
+ "modelVersion": "1.0",
+ "modelInvariantUuid": "b2667e06-1ec1-4a2a-a916-991b5510b603",
+ "networkResourceId": 100,
+ "created": 1484943975000,
+ "networkResource": {
+ "version": "1",
+ "id": 100,
+ "networkType": "VIPR_TENANT_OAM_NET",
+ "orchestrationMode": "HEAT",
+ "description": "manual record pointing to existing CONTRAIL30_BASIC template",
+ "templateId": 1,
+ "neutronNetworkType": "BASIC",
+ "aicVersionMin": "3.0",
+ "aicVersionMax": null,
+ "created": 1484936027000
+ },
+ "networkType": "VIPR_TENANT_OAM_NET"
+ }
+ ]
+} \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogServiceResourcesData.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogServiceResourcesData.json
new file mode 100644
index 0000000000..be0dfc8954
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogServiceResourcesData.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" : "7097d8bb-f6ad-4cf7-866e-6a04c8f1b332",
+ "modelInvariantUuid" : "6ea0b528-e303-4686-aa77-aa2fcbdccb96",
+ "modelVersion" : "2.0",
+ "modelCustomizationUuid" : "da86dd87-43c5-458c-b226-5315b7be9ad5",
+ "modelInstanceName" : "vHNF for DHV Test 17"
+ },
+ "toscaNodeType" : null,
+ "nfFunction" : null,
+ "nfType" : null,
+ "nfRole" : null,
+ "nfNamingCode" : null,
+ "vfModules": [
+ {
+ "modelInfo" : {
+ "modelName" : "VhnfForDhvTest..base_TEST..module-0",
+ "modelUuid" : "ebc3d18c-3e62-4c24-bcd6-961e98701a0a",
+ "modelInvariantUuid" : "f5696ec0-ec71-4916-bf3b-93a654efcba4",
+ "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/VCPE/getCatalogServiceResourcesDataNoNetwork.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogServiceResourcesDataNoNetwork.json
new file mode 100644
index 0000000000..2003acf9ea
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogServiceResourcesDataNoNetwork.json
@@ -0,0 +1,62 @@
+{ "serviceResources" : {
+ "modelName" : "CMW_Service",
+ "modelUuid" : "Cmw_123",
+ "modelInvariantUuid" : "cmw-123-456-789",
+ "modelVersion" : null,
+ "serviceVnfs": [
+ { "vnf" : {
+ "modelName" : "MANUAL RECORD",
+ "modelUuid" : null,
+ "modelInvariantUuid" : "miu-vnf-15190",
+ "modelVersion" : "1.0",
+ "modelCustomizationUuid" : "123456-789012-cmwabd",
+ "modelInstanceName" : null,
+ "vfModules": [
+ { "vfModule" : {
+ "modelName" : "vSAMP12::base::module-0",
+ "modelUuid" : null,
+ "modelInvariantUuid" : "miu-1001",
+ "modelVersion" : "1",
+ "modelCustomizationUuid" : "1001",
+ "vfModuleType" : "Test/vSAMP12::vSAMP12::base::module-0",
+ "isBase" : true,
+ "vfModuleLabel" : "base",
+ "initialCount" : 1
+ }},
+ { "vfModule" : {
+ "modelName" : "base::module-0",
+ "modelUuid" : null,
+ "modelInvariantUuid" : "miu-1002",
+ "modelVersion" : "1",
+ "modelCustomizationUuid" : "1002",
+ "vfModuleType" : "Test/vSAMP12::base::module-0",
+ "isBase" : true,
+ "vfModuleLabel" : "module-0",
+ "initialCount" : 1
+ }},
+ { "vfModule" : {
+ "modelName" : "vSAMP12DEV::base::module-0",
+ "modelUuid" : null,
+ "modelInvariantUuid" : "miu-1003",
+ "modelVersion" : "1",
+ "modelCustomizationUuid" : "f86e8800-7629-427f-b284-3dbfd04db01f",
+ "vfModuleType" : "Test/vSAMP12::vSAMP12DEV::base::module-0",
+ "isBase" : true,
+ "vfModuleLabel" : "base",
+ "initialCount" : 0
+ }}
+ ]
+ }}
+ ],
+ "serviceNetworks": [],
+ "serviceAllottedResources": [
+ { "allottedResource" : {
+ "modelName" : "Bruce Wayne",
+ "modelUuid" : "123-123",
+ "modelInvariantUuid" : "not yet implemented",
+ "modelVersion" : "1.0",
+ "modelCustomizationUuid" : "ar-mod-custid-456-456",
+ "modelInstanceName" : "Clark Kent"
+ }}
+ ]
+ }} \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogServiceResourcesDataNoNetworkVnf.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogServiceResourcesDataNoNetworkVnf.json
new file mode 100644
index 0000000000..4364eaf594
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogServiceResourcesDataNoNetworkVnf.json
@@ -0,0 +1,26 @@
+{
+ "serviceResources": {
+ "modelName": "CMW_Service",
+ "modelUuid": "Cmw_123",
+ "modelInvariantUuid": "cmw-123-456-789",
+ "modelVersion": null,
+ "serviceVnfs": [],
+ "serviceNetworks": [],
+ "serviceAllottedResources": [
+ {
+ "allottedResource": {
+ "modelName": "Bruce Wayne",
+ "modelUuid": "123-123",
+ "modelInvariantUuid": "not yet implemented",
+ "modelVersion": "1.0",
+ "modelCustomizationUuid": "ar-mod-custid-456-456",
+ "modelInstanceName": "Clark Kent",
+ "toscaModelType": "undefined",
+ "allottedResourceType": "ContrailRoute",
+ "allottedResourceRole": "ALLOTTED_RESROUCE_ROLE",
+ "providingServiceModelInvariantUuid": "PROVIDING_SERVICE_MODEL_INVARIANT_UUID"
+ }
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogServiceResourcesDataServiceAllotted.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogServiceResourcesDataServiceAllotted.json
new file mode 100644
index 0000000000..e865210713
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogServiceResourcesDataServiceAllotted.json
@@ -0,0 +1,84 @@
+{
+ "serviceResources": {
+ "modelInfo": {
+ "modelName": "SD-WAN",
+ "modelUuid": "ee9807ef-9814-4067-b997-5eee54c9e719",
+ "modelInvariantUuid": "7b0fafc1-83df-4590-9460-b5a8d9f9f277",
+ "modelVersion": null
+ },
+ "serviceVnfs": [],
+ "serviceNetworks": [],
+ "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": "ContrailRoute",
+ "providingServiceModelInvariantUuid": null,
+ "nfFunction": null,
+ "nfType": null,
+ "nfRole": null,
+ "nfNamingCode": null,
+ "homingSolution": {
+ "inventoryType": "service",
+ "serviceInstanceId": "c763d462-dfe4-4577-9706-fa3a9db640be",
+ "vnfHostname": "MDTNJ01",
+ "cloudOwner": "aic",
+ "cloudRegionId": "dfwtx",
+ "aicClli": "KDTNJ01",
+ "aicVersion": "3.0",
+ "entitlementPoolList": [
+ "f1d563e8-e714-4393-8f99-cc480144a05e",
+ "j1d563e8-e714-4393-8f99-cc480144a05e"
+ ],
+ "licenseKeyGroupList": [
+ "s1d563e8-e714-4393-8f99-cc480144a05e",
+ "b1d563e8-e714-4393-8f99-cc480144a05e"
+ ]
+ }
+ },
+ {
+ "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": "SecurityZone",
+ "providingServiceModelInvariantUuid": null,
+ "nfFunction": null,
+ "nfType": null,
+ "nfRole": null,
+ "nfNamingCode": null,
+ "homingSolution": {
+ "inventoryType": "service",
+ "serviceInstanceId": "c763d462-dfe4-4577-9706-fa3a9db640be",
+ "vnfHostname": "MDTNJ01",
+ "cloudOwner": "aic",
+ "cloudRegionId": "dfwtx",
+ "aicClli": "KDTNJ01",
+ "aicVersion": "3.0",
+ "entitlementPoolList": [
+ "f1d563e8-e714-4393-8f99-cc480144a05e",
+ "j1d563e8-e714-4393-8f99-cc480144a05e"
+ ],
+ "licenseKeyGroupList": [
+ "s1d563e8-e714-4393-8f99-cc480144a05e",
+ "b1d563e8-e714-4393-8f99-cc480144a05e"
+ ]
+ }
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogServiceResourcesDataServiceInstanceOnly.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogServiceResourcesDataServiceInstanceOnly.json
new file mode 100644
index 0000000000..56af494d49
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogServiceResourcesDataServiceInstanceOnly.json
@@ -0,0 +1,13 @@
+{
+ "serviceResources": {
+ "modelInfo" : {
+ "modelName" : "MSO Test Network",
+ "modelUuid" : "aed5a5b7-20d3-44f7-90a3-ddbd16f14d1e",
+ "modelInvariantUuid" : "52b49b5d-3086-4ffd-b5e6-1b1e5e7e062f",
+ "modelVersion" : null
+ },
+ "serviceVnfs": [],
+ "serviceNetworks": [],
+ "serviceAllottedResources": []
+ }
+} \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogServiceResourcesServiceNetwork.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogServiceResourcesServiceNetwork.json
new file mode 100644
index 0000000000..821bd04c19
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogServiceResourcesServiceNetwork.json
@@ -0,0 +1,27 @@
+{ "serviceResources" : {
+ "modelInfo" : {
+ "modelName" : "MSO Test Network",
+ "modelUuid" : "aed5a5b7-20d3-44f7-90a3-ddbd16f14d1e",
+ "modelInvariantUuid" : "52b49b5d-3086-4ffd-b5e6-1b1e5e7e062f",
+ "modelVersion" : null
+ },
+ "serviceVnfs": [],
+ "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": []
+ }} \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogServiceResourcesServiceVnf.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogServiceResourcesServiceVnf.json
new file mode 100644
index 0000000000..7893aff693
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogServiceResourcesServiceVnf.json
@@ -0,0 +1,40 @@
+{ "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" : "6ea0b528-e303-4686-aa77-aa2fcbdccb96",
+ "modelVersion" : "2.0",
+ "modelCustomizationUuid" : "da86dd87-43c5-458c-b226-5315b7be9ad5",
+ "modelInstanceName" : "vHNF for DHV Test 17"
+ },
+ "toscaNodeType" : null,
+ "nfFunction" : null,
+ "nfType" : null,
+ "nfRole" : null,
+ "nfNamingCode" : null,
+ "vfModules": [
+ {
+ "modelInfo" : {
+ "modelName" : "VhnfForDhvTest..base_TEST..module-0",
+ "modelUuid" : "ebc3d18c-3e62-4c24-bcd6-961e98701a0a",
+ "modelInvariantUuid" : "f5696ec0-ec71-4916-bf3b-93a654efcba4",
+ "modelVersion" : "1",
+ "modelCustomizationUuid" : "1740536a-742e-40f5-b9c8-83918849a787"
+ }, "isBase" : true,
+ "vfModuleLabel" : "base_TEST",
+ "initialCount" : 1,
+ "hasVolumeGroup" : true
+ }
+ ]
+ }
+ ],
+ "serviceNetworks": [],
+ "serviceAllottedResources": []
+ }} \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogVcpe.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogVcpe.json
new file mode 100644
index 0000000000..b95e45ac46
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogVcpe.json
@@ -0,0 +1,76 @@
+{ "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" : "6ea0b528-e303-4686-aa77-aa2fcbdccb96",
+ "modelVersion" : "2.0",
+ "modelCustomizationUuid" : "da86dd87-43c5-458c-b226-5315b7be9ad5",
+ "modelInstanceName" : "vHNF for DHV Test 17"
+ },
+ "toscaNodeType" : null,
+ "nfFunction" : null,
+ "nfType" : null,
+ "nfRole" : null,
+ "nfNamingCode" : null,
+ "vfModules": [
+ {
+ "modelInfo" : {
+ "modelName" : "VhnfForDhvTest..base_TEST..module-0",
+ "modelUuid" : "ebc3d18c-3e62-4c24-bcd6-961e98701a0a",
+ "modelInvariantUuid" : "f5696ec0-ec71-4916-bf3b-93a654efcba4",
+ "modelVersion" : "1",
+ "modelCustomizationUuid" : "1740536a-742e-40f5-b9c8-83918849a787"
+ }, "isBase" : true,
+ "vfModuleLabel" : "base_TEST",
+ "initialCount" : 1,
+ "hasVolumeGroup" : true
+ }
+ ]
+ }
+ ],
+ "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" : "TunnelXConn",
+ "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" : "BRG",
+ "allottedResourceRole" : null,
+ "providingServiceModelInvariantUuid" : null,
+ "nfFunction" : null,
+ "nfType" : null,
+ "nfRole" : null,
+ "nfNamingCode" : null
+ }
+ ]
+ }}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogVnfData.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogVnfData.json
new file mode 100644
index 0000000000..d95b313583
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCatalogVnfData.json
@@ -0,0 +1 @@
+{"serviceVnfs":[]} \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCustomer.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCustomer.xml
new file mode 100644
index 0000000000..6e35f24205
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getCustomer.xml
@@ -0,0 +1,7 @@
+<customer xmlns="http://org.openecomp.aai.inventory/v8">
+ <global-customer-id>MCBH-1610</global-customer-id>
+ <subscriber-name>MCBH-1610</subscriber-name>
+ <resource-version>1465943440</resource-version>
+ <service-subscriptions/>
+ <relationship-list/>
+</customer>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getNetwork.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getNetwork.xml
new file mode 100644
index 0000000000..32a01b6973
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getNetwork.xml
@@ -0,0 +1,92 @@
+<l3-network xmlns="http://org.openecomp.aai.inventory/v8">
+ <network-id>cf82a73f-de7f-4f84-8dfc-16a487c63a36</network-id>
+ <network-name>Dev_NoBinding-2001</network-name>
+ <network-type>CONTRAIL30_BASIC</network-type>
+ <network-role>GN_EVPN_direct</network-role>
+ <network-technology>contrail</network-technology>
+ <neutron-network-id>968a47e3-e238-4158-af87-6be7f508a6c0</neutron-network-id>
+ <is-bound-to-vpn>false</is-bound-to-vpn>
+ <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
+ <network-role-instance>0</network-role-instance>
+ <resource-version>1476384388</resource-version>
+ <orchestration-status>active</orchestration-status>
+ <heat-stack-id>Dev_NoBinding-2001/11c429ac-eab3-4566-a9d3-d8ca6fb4e803</heat-stack-id>
+ <contrail-network-fqdn>default-domain:IST_Automation_AAI_updated:Dev_NoBinding-2001</contrail-network-fqdn>
+ <physical-network-name/>
+ <is-provider-network>false</is-provider-network>
+ <is-shared-network>false</is-shared-network>
+ <is-external-network>false</is-external-network>
+ <subnets>
+ <subnet>
+ <subnet-id>5c559cd8-1ef2-45a8-b342-b4c9307d33ff</subnet-id>
+ <subnet-name/>
+ <neutron-subnet-id>48267a65-2209-4e10-ad44-fc30d4fcb508</neutron-subnet-id>
+ <gateway-address>218.210.11.1</gateway-address>
+ <network-start-address>218.210.11.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>
+ <dhcp-start>218.210.11.3</dhcp-start>
+ <dhcp-end>218.210.11.64</dhcp-end>
+ <resource-version>1476384386</resource-version>
+ </subnet>
+ </subnets>
+ <relationship-list>
+ <relationship>
+ <related-to>tenant</related-to>
+ <related-link>https://aai-int1.test.openecomp.com:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mtn6/tenants/tenant/fe4400a8e96e4caa85ccdca8a850255b</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>mtn6</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>tenant.tenant-id</relationship-key>
+ <relationship-value>fe4400a8e96e4caa85ccdca8a850255b</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>tenant.tenant-name</property-key>
+ <property-value>IST_Automation_AAI_updated</property-value>
+ </related-to-property>
+ </relationship>
+ <relationship>
+ <related-to>cloud-region</related-to>
+ <related-link>https://aai-int1.test.openecomp.com:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mtn6</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>mtn6</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>cloud-region.owner-defined-type</property-key>
+ </related-to-property>
+ </relationship>
+ <relationship>
+ <related-to>service-instance</related-to>
+ <related-link>https://aai-int1.test.openecomp.com:8443/aai/v8/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/ffdfebef-9cf0-4be4-ab29-0380f0da0341</related-link>
+ <relationship-data>
+ <relationship-key>customer.global-customer-id</relationship-key>
+ <relationship-value>MSO_1610_dev</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>ffdfebef-9cf0-4be4-ab29-0380f0da0341</relationship-value>
+ </relationship-data>
+ <related-to-property>
+ <property-key>service-instance.service-instance-name</property-key>
+ <property-value>dm4251_SERVICE1</property-value>
+ </related-to-property>
+ </relationship>
+ </relationship-list>
+</l3-network>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getParentSIUrlById.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getParentSIUrlById.xml
new file mode 100644
index 0000000000..c29133e539
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getParentSIUrlById.xml
@@ -0,0 +1,6 @@
+<search-results xmlns="http://org.openecomp.aai.inventory">
+ <result-data>
+ <resource-type>service-instance</resource-type>
+ <resource-link>https://aai-ext1.test.com:8443/aai/v7/business/customers/customer/SDN-ETHERNET-INTERNET/service-subscriptions/service-subscription/123456789/service-instances/service-instance/MIS%252F1604%252F0027%252FSW_INTERNET</resource-link>
+ </result-data>
+</search-results> \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getParentServiceInstance.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getParentServiceInstance.xml
new file mode 100644
index 0000000000..bc810c6014
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/getParentServiceInstance.xml
@@ -0,0 +1,30 @@
+<service-instance>
+ <service-instance-id>MIS/1604/0027/SW_INTERNET</service-instance-id>
+ <resource-version>123456789</resource-version>
+ <relationship-list>
+ <relationship>
+ <related-to>cvlan-tag</related-to>
+ <related-link>https://aai-ext1.test.com:8443/aai/v2/network/vces/vce/832bace2-3fb0-49e0-a6a4-07c47223c535/port-groups/port-group/slcp1447vbc.ipag/cvlan-tags/cvlan-tag/2003/</related-link>
+ <relationship-data>
+ <relationship-key>cvlan-tag.cvlan-tag</relationship-key>
+ <relationship-value>2003</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>port-group.interface-id</relationship-key>
+ <relationship-value>slcp1447vbc.ipag</relationship-value>
+ </relationship-data>
+ <relationship-data>
+ <relationship-key>vce.vnf-id</relationship-key>
+ <relationship-value>832bace2-3fb0-49e0-a6a4-07c47223c535</relationship-value>
+ </relationship-data>
+ </relationship>
+ <relationship>
+ <related-to>vce</related-to>
+ <related-link>https://aai-ext1.test.com:8443/aai/v2/network/vces/vce/832bace2-3fb0-49e0-a6a4-07c47223c535/</related-link>
+ <relationship-data>
+ <relationship-key>vce.vnf-id</relationship-key>
+ <relationship-value>832bace2-3fb0-49e0-a6a4-07c47223c535</relationship-value>
+ </relationship-data>
+ </relationship>
+ </relationship-list>
+</service-instance>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/request.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/request.json
new file mode 100644
index 0000000000..9141d5074a
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/request.json
@@ -0,0 +1,40 @@
+{
+ "requestDetails":
+ {
+ "modelInfo":
+ {
+ "modelType":"service",
+ "modelInvariantUuid":"uuid-miu-svc-011-abcdef",
+ "modelVersionId":"ASDC_TOSCA_UUID",
+ "modelName":"SIModelName1",
+ "modelVersion":"2"
+ },
+ "subscriberInfo":
+ {
+ "globalSubscriberId":"MCBH-1610",
+ "subscriberName":"Kaneohe"
+ },
+ "requestInfo":
+ {
+ "instanceName":"VCPE1",
+ "source":"VID",
+ "suppressRollback":"false",
+ "productFamilyId":"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"
+ },
+ "cloudConfiguration":
+ {
+ "lcpCloudRegionId":"mdt1",
+ "tenantId":"8b1df54faa3b49078e3416e21370a3ba"
+ },
+ "requestParameters":
+ {
+ "subscriptionServiceType":"vcpesvc",
+ "aLaCarte":"false",
+ "userParams":
+ {
+ "BRG_WAN_MAC_Address" : "brgmac"
+ }
+ }
+
+ }
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/serviceDecompositionATMFW.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/serviceDecompositionATMFW.json
new file mode 100644
index 0000000000..bc54c557e1
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/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