diff options
author | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2018-07-30 15:56:09 -0400 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2018-07-31 11:09:25 -0400 |
commit | 5a6a6de6f1a26a1897e4917a0df613e25a24eb70 (patch) | |
tree | 59a968f27b4b603aacc9d5e7b51fb598aeec5321 /bpmn/MSOInfrastructureBPMN/src/test | |
parent | b6dc38501f3b746426b42d9de4cc883d894149e8 (diff) |
Containerization feature of SO
Change-Id: I95381232eeefcd247a66a5cec370a8ce1c288e18
Issue-ID: SO-670
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/test')
305 files changed, 0 insertions, 41519 deletions
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericAlaCarteServiceInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericAlaCarteServiceInstanceTest.groovy deleted file mode 100644 index adab1bf739..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericAlaCarteServiceInstanceTest.groovy +++ /dev/null @@ -1,215 +0,0 @@ -package org.openecomp.mso.bpmn.infrastructure.scripts
-
-import org.camunda.bpm.engine.ProcessEngineServices
-import org.camunda.bpm.engine.RepositoryService
-import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
-import org.camunda.bpm.engine.repository.ProcessDefinition
-import org.camunda.bpm.engine.delegate.DelegateExecution
-import org.junit.Before
-import org.junit.Rule
-import org.junit.Test
-import org.mockito.MockitoAnnotations
-import org.openecomp.mso.bpmn.common.scripts.MsoUtils
-import org.openecomp.mso.bpmn.core.WorkflowException
-import org.openecomp.mso.bpmn.core.json.JsonUtils
-import org.openecomp.mso.bpmn.common.scripts.VidUtils
-
-import static org.junit.Assert.*;
-import static org.mockito.Mockito.*
-
-import com.github.tomakehurst.wiremock.junit.WireMockRule
-
-class CreateGenericAlaCarteServiceInstanceTest {
-
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(8090);
-
- String Prefix="CRESI_"
- def utils = new MsoUtils()
- JsonUtils jsonUtil = new JsonUtils()
- VidUtils vidUtils = new VidUtils()
-
- String createDBRequestError =
-"""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
- <soapenv:Header/>
- <soapenv:Body>
- <ns:updateInfraRequest xmlns:ns="http://org.openecomp.mso/requestsdb">
- <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
- <lastModifiedBy>BPMN</lastModifiedBy>
- <statusMessage>Received error from SDN-C: No availability zone available</statusMessage>
- <responseBody></responseBody>
- <requestStatus>FAILED</requestStatus>
- <vnfOutputs><network-id></network-id><network-name></network-names></vnfOutputs>
- </ns:updateInfraRequest>
- </soapenv:Body>
- </soapenv:Envelope>"""
-
- String falloutHandlerRequest =
- """<aetgt:FalloutHandlerRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:ns="http://org.openecomp/mso/request/types/v1"
- xmlns:wfsch="http://org.openecomp/mso/workflow/schema/v1">
- <request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
- <request-id>b69c9054-da09-4a2c-adf5-51042b62bfac</request-id>
- <action>CREATE</action>
- <source>VID</source>
- </request-info>
- <aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">
- <aetgt:ErrorMessage>Received error from SDN-C: No availability zone available.</aetgt:ErrorMessage>
- <aetgt:ErrorCode>5300</aetgt:ErrorCode>
- </aetgt:WorkflowException>
- </aetgt:FalloutHandlerRequest>"""
-
- String completeMsoProcessRequest =
- """<aetgt:MsoCompletionRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:ns="http://org.openecomp/mso/request/types/v1"
- xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
- <request-info>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <action>CREATE</action>
- <source>VID</source>
- </request-info>
- <aetgt:status-message>Network has been created successfully.</aetgt:status-message>
- <aetgt:mso-bpel-name>BPMN Network action: CREATE</aetgt:mso-bpel-name>
-</aetgt:MsoCompletionRequest>"""
-
- String jsonIncomingRequest =
- """{
- "requestDetails": {
- "modelInfo": {
- "modelType": "service",
- "modelInvariantId": "1de901ed-17af-4b03-bc1f-41659cfa27cb",
- "modelVersionId": "ace39141-09ec-4068-b06d-ac6b23bdc6e0",
- "modelName": "demoVLB",
- "modelVersion": "1.0"
- },
- "cloudConfiguration" : {
- "lcpCloudRegionId": "RegionOne",
- "tenantId": "onap"
- },
- "subscriberInfo": {
- "globalSubscriberId": "Demonstration",
- "subscriberName": "Demonstration"
- },
- "requestInfo": {
- "instanceName": "sample-instance-2",
- "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
- "source": "VID",
- "requestorId":"1234",
- "suppressRollback": "false"
- },
- "requestParameters": {
- "subscriptionServiceType": "vLB"
- }
- }
- }"""
-
- @Before
- public void init()
- {
- MockitoAnnotations.initMocks(this)
-
- }
-
- public void initializeVariables(DelegateExecution mockExecution) {
-
- //verify(mockExecution).setVariable(Prefix + "Success", false)
-
- //verify(mockExecution).setVariable(Prefix + "CompleteMsoProcessRequest", "")
- //verify(mockExecution).setVariable(Prefix + "FalloutHandlerRequest", "")
- //verify(mockExecution).setVariable(Prefix + "isSilentSuccess", false)
-
- }
-
- @Test
- //@Ignore
- public void preProcessRequest() {
-
- println "************ preProcessRequest() ************* "
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("bpmnRequest")).thenReturn(jsonIncomingRequest)
- try{
-
- // preProcessRequest(DelegateExecution execution)
- CreateGenericALaCarteServiceInstance createGenericALaCarteServiceInstance = new CreateGenericALaCarteServiceInstance()
- createGenericALaCarteServiceInstance.preProcessRequest(mockExecution)
-
- //verify(mockExecution).getVariable("isDebugLogEnabled")
- //verify(mockExecution).setVariable("prefix", Prefix)
-
- initializeVariables(mockExecution)
- //verify(mockExecution).setVariable(Prefix + "Success", false)
- }catch(Exception e){
- //ignore
- }
- }
-
- @Test
- //@Ignore
- public void sendSyncResponse() {
-
- println "************ sendSyncResponse ************* "
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("isAsyncProcess")).thenReturn(true)
- when(mockExecution.getVariable("mso-request-id")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- try{
- // preProcessRequest(DelegateExecution execution)
- CreateGenericALaCarteServiceInstance createGenericALaCarteServiceInstance = new CreateGenericALaCarteServiceInstance()
- createGenericALaCarteServiceInstance.sendSyncResponse(mockExecution)
-
- //verify(mockExecution).setVariable("prefix", Prefix)
- //verify(mockExecution).setVariable("createServiceRestRequest", "202")
- }catch(Exception e){
- //ignore
- }
- }
-
- @Test
- //@Ignore
- public void sendSyncError() {
-
- println "************ sendSyncError ************* "
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("isAsyncProcess")).thenReturn(true)
- when(mockExecution.getVariable("mso-request-id")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- try{
- CreateGenericALaCarteServiceInstance createGenericALaCarteServiceInstance = new CreateGenericALaCarteServiceInstance()
- createGenericALaCarteServiceInstance.sendSyncError(mockExecution)
-
- //verify(mockExecution).setVariable("prefix", Prefix)
- //verify(mockExecution).setVariable("createServiceRestRequest", "500")
- }catch(Exception e){
- //ignore
- }
- }
-
- private ExecutionEntity setupMock() {
-
- ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class)
- when(mockProcessDefinition.getKey()).thenReturn("CreateGenericALaCarteSeviceInstance")
- RepositoryService mockRepositoryService = mock(RepositoryService.class)
- when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition)
- when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("CreateGenericALaCarteSeviceInstance")
- when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100")
- ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class)
- when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService)
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
-
- when(mockExecution.getId()).thenReturn("100")
- when(mockExecution.getProcessDefinitionId()).thenReturn("CreateGenericALaCarteSeviceInstance")
- when(mockExecution.getProcessInstanceId()).thenReturn("CreateGenericALaCarteSeviceInstance")
- when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices)
- when(mockExecution.getProcessEngineServices().getRepositoryService().getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(mockProcessDefinition)
-
- return mockExecution
- }
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateNetworkInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateNetworkInstanceTest.groovy deleted file mode 100644 index 7c5aec3641..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateNetworkInstanceTest.groovy +++ /dev/null @@ -1,360 +0,0 @@ -package org.openecomp.mso.bpmn.infrastructure.scripts
-
-import org.camunda.bpm.engine.ProcessEngineServices
-import org.camunda.bpm.engine.RepositoryService
-import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
-import org.camunda.bpm.engine.repository.ProcessDefinition
-import org.camunda.bpm.engine.delegate.DelegateExecution
-import org.junit.Before
-import org.junit.Rule
-import org.junit.Test
-import org.mockito.MockitoAnnotations
-import org.openecomp.mso.bpmn.common.scripts.MsoUtils
-import org.openecomp.mso.bpmn.core.WorkflowException
-
-import static org.junit.Assert.*;
-import static org.mockito.Mockito.*
-
-import com.github.tomakehurst.wiremock.junit.WireMockRule
-
-class CreateNetworkInstanceTest {
-
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(8090);
-
- String Prefix="CRENI_"
- def utils = new MsoUtils()
-
- String createDBRequestError =
-"""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
- <soapenv:Header/>
- <soapenv:Body>
- <ns:updateInfraRequest xmlns:ns="http://org.openecomp.mso/requestsdb">
- <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
- <lastModifiedBy>BPMN</lastModifiedBy>
- <statusMessage>Received error from SDN-C: No availability zone available</statusMessage>
- <responseBody></responseBody>
- <requestStatus>FAILED</requestStatus>
- <vnfOutputs><network-id></network-id><network-name></network-names></vnfOutputs>
- </ns:updateInfraRequest>
- </soapenv:Body>
- </soapenv:Envelope>"""
-
- String falloutHandlerRequest =
- """<aetgt:FalloutHandlerRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:ns="http://org.openecomp/mso/request/types/v1"
- xmlns:wfsch="http://org.openecomp/mso/workflow/schema/v1">
- <request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
- <request-id>b69c9054-da09-4a2c-adf5-51042b62bfac</request-id>
- <action>CREATE</action>
- <source>VID</source>
- </request-info>
- <aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">
- <aetgt:ErrorMessage>Received error from SDN-C: No availability zone available.</aetgt:ErrorMessage>
- <aetgt:ErrorCode>5300</aetgt:ErrorCode>
- </aetgt:WorkflowException>
- </aetgt:FalloutHandlerRequest>"""
-
- String completeMsoProcessRequest =
- """<aetgt:MsoCompletionRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:ns="http://org.openecomp/mso/request/types/v1"
- xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
- <request-info>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <action>CREATE</action>
- <source>VID</source>
- </request-info>
- <aetgt:status-message>Network has been created successfully.</aetgt:status-message>
- <aetgt:mso-bpel-name>BPMN Network action: CREATE</aetgt:mso-bpel-name>
-</aetgt:MsoCompletionRequest>"""
-
-
-String jsonIncomingRequest =
-"""{ "requestDetails": {
- "modelInfo": {
- "modelType": "networkTyp",
- "modelId": "modelId",
- "modelNameVersionId": "modelNameVersionId",
- "modelName": "CONTRAIL_EXTERNAL",
- "modelVersion": "1"
- },
- "cloudConfiguration": {
- "lcpCloudRegionId": "RDM2WAGPLCP",
- "tenantId": "7dd5365547234ee8937416c65507d266"
- },
- "requestInfo": {
- "instanceName": "MNS-25180-L-01-dmz_direct_net_1",
- "source": "VID",
- "callbackUrl": "",
- "suppressRollback": true,
- "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"
- },
- "relatedInstanceList": [
- {
- "relatedInstance": {
- "instanceId": "f70e927b-6087-4974-9ef8-c5e4d5847ca4",
- "modelInfo": {
- "modelType": "serviceT",
- "modelId": "modelI",
- "modelNameVersionId": "modelNameVersionI",
- "modelName": "modleNam",
- "modelVersion": "1"
- }
- }
- }
- ],
- "requestParameters": {
- "userParams": [
- {
- "name": "someUserParam1",
- "value": "someValue1"
- }
- ]
- }
- }}"""
-
- @Before
- public void init()
- {
- MockitoAnnotations.initMocks(this)
-
- }
-
- public void initializeVariables(DelegateExecution mockExecution) {
-
- verify(mockExecution).setVariable(Prefix + "Success", false)
-
- verify(mockExecution).setVariable(Prefix + "CompleteMsoProcessRequest", "")
- verify(mockExecution).setVariable(Prefix + "FalloutHandlerRequest", "")
- verify(mockExecution).setVariable(Prefix + "isSilentSuccess", false)
-
- }
-
- @Test
- //@Ignore
- public void preProcessRequest() {
-
- println "************ preProcessRequest() ************* "
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("bpmnRequest")).thenReturn(jsonIncomingRequest)
-
-
- // preProcessRequest(DelegateExecution execution)
- CreateNetworkInstance CreateNetworkInstance = new CreateNetworkInstance()
- CreateNetworkInstance.preProcessRequest(mockExecution)
-
- verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix)
-
- initializeVariables(mockExecution)
- //verify(mockExecution).setVariable(Prefix + "Success", false)
-
- }
-
-
- @Test
- //@Ignore
- public void getNetworkModelInfo() {
-
- println "************ getNetworkModelInfo() ************* "
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
-
- // preProcessRequest(DelegateExecution execution)
- CreateNetworkInstance CreateNetworkInstance = new CreateNetworkInstance()
- CreateNetworkInstance.getNetworkModelInfo(mockExecution)
-
- verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix)
-
- }
-
- @Test
- //@Ignore
- public void sendSyncResponse() {
-
- println "************ sendSyncResponse ************* "
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("isAsyncProcess")).thenReturn(true)
- when(mockExecution.getVariable("mso-request-id")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
-
- // preProcessRequest(DelegateExecution execution)
- CreateNetworkInstance CreateNetworkInstance = new CreateNetworkInstance()
- CreateNetworkInstance.sendSyncResponse(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable("CreateNetworkInstanceResponseCode", "202")
-
- }
-
- @Test
- //@Ignore
- public void sendSyncError() {
-
- println "************ sendSyncError ************* "
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("isAsyncProcess")).thenReturn(true)
- when(mockExecution.getVariable("mso-request-id")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
-
- CreateNetworkInstance CreateNetworkInstance = new CreateNetworkInstance()
- CreateNetworkInstance.sendSyncError(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable("CreateNetworkInstanceResponseCode", "500")
-
- }
-
- @Test
- //@Ignore
- public void prepareDBRequestError() {
-
- println "************ prepareDBRequestError ************* "
-
- WorkflowException sndcWorkflowException = new WorkflowException("CreateNetworkInstance", 500, "Received error from SDN-C: No availability zone available")
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable("WorkflowException")).thenReturn(sndcWorkflowException)
- //when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable(Prefix + "requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("networkId")).thenReturn("")
- when(mockExecution.getVariable("networkName")).thenReturn("")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_adapters_db_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
-
- // preProcessRequest(DelegateExecution execution)
- CreateNetworkInstance CreateNetworkInstance = new CreateNetworkInstance()
- CreateNetworkInstance.prepareDBRequestError(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "createDBRequest", createDBRequestError)
-
- }
-
-
- @Test
- //@Ignore
- public void prepareCompletion() {
-
- println "************ postProcessResponse ************* "
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable(Prefix + "dbReturnCode")).thenReturn("200")
-
- // postProcessResponse(DelegateExecution execution)
- CreateNetworkInstance CreateNetworkInstance = new CreateNetworkInstance()
- CreateNetworkInstance.prepareCompletion(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "Success", true)
- verify(mockExecution).setVariable(Prefix + "CompleteMsoProcessRequest", completeMsoProcessRequest)
-
- }
-
- @Test
- //@Ignore
- public void buildErrorResponse() {
-
- println "************ buildErrorResponse ************* "
-
-
- WorkflowException sndcWorkflowException = new WorkflowException("CreateNetworkInstance", 5300, "Received error from SDN-C: No availability zone available.")
-
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso-request-id")).thenReturn("b69c9054-da09-4a2c-adf5-51042b62bfac")
- //when(mockExecution.getVariable("WorkflowException")).thenReturn(sndcWorkflowException)
- when(mockExecution.getVariable("WorkflowException")).thenReturn(sndcWorkflowException)
-
- // buildErrorResponse(DelegateExecution execution)
- CreateNetworkInstance CreateNetworkInstance = new CreateNetworkInstance()
- CreateNetworkInstance.buildErrorResponse(mockExecution)
-
- verify(mockExecution, atLeast(1)).setVariable("prefix", "CRENI_")
- verify(mockExecution).setVariable(Prefix + "FalloutHandlerRequest", falloutHandlerRequest)
-
- //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
- //debugger.printInvocations(mockExecution)
-
- }
-
- @Test
- //@Ignore
- public void postProcessResponse() {
-
- println "************ postProcessResponse() ************* "
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("CMSO_ResponseCode")).thenReturn("200")
-
- // postProcessResponse(DelegateExecution execution)
- CreateNetworkInstance CreateNetworkInstance = new CreateNetworkInstance()
- CreateNetworkInstance.postProcessResponse(mockExecution)
-
- //verify(mockExecution).getVariable("isDebugLogEnabled")
- //verify(mockExecution).setVariable("prefix", Prefix)
-
- verify(mockExecution).setVariable(Prefix + "Success", true)
-
- }
-
- @Test
- //@Ignore
- public void processRollbackData() {
-
- println "************ callDBCatalog() ************* "
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
-
- // preProcessRequest(DelegateExecution execution)
- CreateNetworkInstance CreateNetworkInstance = new CreateNetworkInstance()
- CreateNetworkInstance.processRollbackData(mockExecution)
-
- verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix)
-
- }
-
- private ExecutionEntity setupMock() {
-
- ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class)
- when(mockProcessDefinition.getKey()).thenReturn("CreateNetworkInstance")
- RepositoryService mockRepositoryService = mock(RepositoryService.class)
- when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition)
- when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("CreateNetworkInstance")
- when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100")
- ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class)
- when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService)
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
-
- when(mockExecution.getId()).thenReturn("100")
- when(mockExecution.getProcessDefinitionId()).thenReturn("CreateNetworkInstance")
- when(mockExecution.getProcessInstanceId()).thenReturn("CreateNetworkInstance")
- when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices)
- when(mockExecution.getProcessEngineServices().getRepositoryService().getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(mockProcessDefinition)
-
- return mockExecution
- }
-
-}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVfModuleVolumeInfraV1Test.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVfModuleVolumeInfraV1Test.groovy deleted file mode 100644 index df0613185f..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVfModuleVolumeInfraV1Test.groovy +++ /dev/null @@ -1,212 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure.scripts; - -import static org.junit.Assert.*; -import static org.mockito.Mockito.* - -import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity -import org.mockito.ArgumentCaptor -import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner -import org.openecomp.mso.bpmn.common.scripts.MsoGroovyTest -import org.junit.Before -import org.junit.Ignore; -import org.junit.Test -import org.junit.runner.RunWith - - -@RunWith(MockitoJUnitRunner.class) -import org.apache.commons.lang3.* - - -class CreateVfModuleVolumeInfraV1Test extends MsoGroovyTest { - - def jsonRequest = """ -{ - "requestDetails": { - "modelInfo": { - "modelType": "volumeGroup", - "modelId": "ff5256d2-5a33-55df-13ab-12abad84e7ff", - "modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe", - "modelName": "vSAMP12::base::module-0", - "modelVersion": "1" - }, - "cloudConfiguration": { - "lcpCloudRegionId": "mdt1", - "tenantId": "88a6ca3ee0394ade9403f075db23167e" - }, - "requestInfo": { - "instanceName": "MSOTESTVOL101a-vSAMP12_base_vol_module-0", - "source": "VID", - "suppressRollback": false - }, - "relatedInstanceList": [ - { - "relatedInstance": { - "instanceId": "{service-instance-id}", - "modelInfo": { - "modelType": "service", - "modelInvariantUuid": "ff5256d1-5a33-55df-13ab-12abad84e7ff", - "modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe", - "modelName": "Test", - "modelVersion": "2.0" - } - } - }, { - "relatedInstance": { - "instanceId": "{vnf-instance-id}", - "modelInfo": { - "modelType": "vnf", - "modelId": "ff5256d1-5a33-55df-13ab-12abad84e7ff", - "modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe", - "modelName": "vSAMP12", - "modelVersion": "1", - "modelInstanceName": "vSAMP12" - } - } - } - ], - "requestParameters": { - "serviceId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", - "userParams": [ - {"name": "vnfName", "value": "STMTN5MMSC20" }, - {"name": "vnfName2", "value": "US1117MTSNJVBR0246" }, - {"name": "vnfNmInformation", "value": "" }, - {"name": "vnfType", "value": "pcrf-capacity" }, - {"name": "vnfId", "value": "skask" }, - {"name": "vnfStackId", "value": "slowburn" }, - {"name": "vnfStatus", "value": "created" }, - {"name": "aicCloudRegion", "value": "MDTWNJ21" }, - {"name": "availabilityZone", "value": "slcp3-esx-az01" }, - {"name": "oamNetworkName", "value": "VLAN-OAM-1323" }, - {"name": "vmName", "value": "slcp34246vbc246ceb" }, - {"name": "ipagNetworkId", "value": "970cd2b9-7f09-4a12-af47-182ea38ba1f0" }, - {"name": "vpeNetworkId", "value": "545cc2c3-1930-4100-b534-5d82d0e12bb6" } - ] - } - } -} -""" - - def volumeRequestXml = """<volume-request xmlns="http://www.w3.org/2001/XMLSchema"> - <request-info> - <action>CREATE_VF_MODULE_VOL</action> - <source>VID</source> - <service-instance-id/> - </request-info> - <volume-inputs> - <volume-group-id/> - <volume-group-name>MSOTESTVOL101a-vSAMP12_base_vol_module-0</volume-group-name> - <vnf-type>Test/vSAMP12</vnf-type> - <vf-module-model-name>vSAMP12::base::module-0</vf-module-model-name> - <asdc-service-model-version>2.0</asdc-service-model-version> - <aic-cloud-region>mdt1</aic-cloud-region> - <tenant-id>88a6ca3ee0394ade9403f075db23167e</tenant-id> - <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id> - <backout-on-failure>true</backout-on-failure> - <model-customization-id/> - </volume-inputs> - <volume-params> - <param name="vnf_name">STMTN5MMSC20</param> - <param name="vnf_name2">US1117MTSNJVBR0246</param> - <param name="vnf_nm_information"/> - <param name="vnf_type">pcrf-capacity</param> - <param name="vnf_id">skask</param> - <param name="vnf_stack_id">slowburn</param> - <param name="vnf_status">created</param> - <param name="aic_cloud_region">MDTWNJ21</param> - <param name="availability_zone">slcp3-esx-az01</param> - <param name="oam_network_name">VLAN-OAM-1323</param> - <param name="vm_name">slcp34246vbc246ceb</param> - <param name="ipag_network_id">970cd2b9-7f09-4a12-af47-182ea38ba1f0</param> - <param name="vpe_network_id">545cc2c3-1930-4100-b534-5d82d0e12bb6</param> - </volume-params> -</volume-request>""" - - def completeMsoRequestXml = """<aetgt:MsoCompletionRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1" - xmlns:ns="http://org.openecomp/mso/request/types/v1" - xmlns="http://org.openecomp/mso/infra/vnf-request/v1"> - <request-info> - <request-id>1234</request-id> - <action>CREATE</action> - <source>VID</source> - </request-info> - <aetgt:status-message>Volume Group has been created successfully.</aetgt:status-message> - <aetgt:mso-bpel-name>BPMN VF Module Volume action: CREATE</aetgt:mso-bpel-name> -</aetgt:MsoCompletionRequest>""" - - - @Before - public void init() - { - MockitoAnnotations.initMocks(this) - } - - - @Test - @Ignore - public void testPreProcessRequest() { - - ExecutionEntity mockExecution = setupMock('CreateVfModuleVolumeInfraV1') - - when(mockExecution.getVariable("prefix")).thenReturn('CVMVINFRAV1_') - when(mockExecution.getVariable("bpmnRequest")).thenReturn(jsonRequest) - when(mockExecution.getVariable("serviceInstanceId")).thenReturn('') - when(mockExecution.getVariable("vnfId")).thenReturn('test-vnf-id') - when(mockExecution.getVariable("mso-request-id")).thenReturn('1234') - when(mockExecution.getVariable("URN_mso_rollback")).thenReturn('true') - - CreateVfModuleVolumeInfraV1 createVfModuleVolumeInfraV1 = new CreateVfModuleVolumeInfraV1() - createVfModuleVolumeInfraV1.preProcessRequest(mockExecution, 'true') - - // Capture the arguments to setVariable - ArgumentCaptor<String> captor1 = ArgumentCaptor.forClass(String.class); - ArgumentCaptor<String> captor2 = ArgumentCaptor.forClass(String.class); - - verify(mockExecution, times(15)).setVariable(captor1.capture(), captor2.capture()) - - List<String> arg2List = captor2.getAllValues() - String volumeRequestActual = arg2List.get(6) - String isVidRequestActual = arg2List.get(8) - - assertEquals(volumeRequestXml, volumeRequestActual.trim()) - assertEquals('true', isVidRequestActual) - } - - @Test - public void testPostProcessResponse() { - - ExecutionEntity mockExecution = setupMock('CreateVfModuleVolumeInfraV1') - when(mockExecution.getVariable("dbReturnCode")).thenReturn('000') - when(mockExecution.getVariable("CVMVINFRAV1_createDBResponse")).thenReturn('') - when(mockExecution.getVariable("mso-request-id")).thenReturn('1234') - when(mockExecution.getVariable("CVMVINFRAV1_source")).thenReturn('VID') - - CreateVfModuleVolumeInfraV1 createVfModuleVolumeInfraV1 = new CreateVfModuleVolumeInfraV1() - createVfModuleVolumeInfraV1.postProcessResponse(mockExecution, 'true') - - verify(mockExecution).setVariable('CVMVINFRAV1_Success', true) - verify(mockExecution).setVariable('CVMVINFRAV1_CompleteMsoProcessRequest', completeMsoRequestXml) - } - - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstanceTest.groovy deleted file mode 100644 index e2175216c0..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstanceTest.groovy +++ /dev/null @@ -1,161 +0,0 @@ -package org.openecomp.mso.bpmn.infrastructure.scripts - -import com.github.tomakehurst.wiremock.junit.WireMockRule -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.junit.Before -import org.junit.BeforeClass -import org.junit.Ignore -import org.junit.Rule -import org.junit.Test -import org.mockito.MockitoAnnotations -import org.openecomp.mso.bpmn.core.json.JsonUtils -import org.openecomp.mso.bpmn.infrastructure.scripts.DeleteCustomE2EServiceInstance -import org.openecomp.mso.bpmn.mock.FileUtil -import org.openecomp.mso.bpmn.vcpe.scripts.GroovyTestBase - -import static org.junit.Assert.assertTrue -import static org.junit.Assert.assertTrue -import static org.junit.Assert.assertTrue -import static org.mockito.Mockito.mock -import static org.mockito.Mockito.mock -import static org.mockito.Mockito.mock -import static org.mockito.Mockito.mock -import static org.mockito.Mockito.verify -import static org.mockito.Mockito.verify -import static org.mockito.Mockito.verify -import static org.mockito.Mockito.verify -import static org.mockito.Mockito.verify -import static org.mockito.Mockito.verify -import static org.mockito.Mockito.verify -import static org.mockito.Mockito.verify -import static org.mockito.Mockito.verify -import static org.mockito.Mockito.verify -import static org.mockito.Mockito.verify -import static org.mockito.Mockito.verify -import static org.mockito.Mockito.verify -import static org.mockito.Mockito.verify -import static org.mockito.Mockito.verify -import static org.mockito.Mockito.when -import static org.mockito.Mockito.when -import static org.mockito.Mockito.when -import static org.mockito.Mockito.when -import static org.mockito.Mockito.when -import static org.mockito.Mockito.when -import static org.mockito.Mockito.when -import static org.mockito.Mockito.when -import static org.mockito.Mockito.when -import static org.mockito.Mockito.when -import static org.mockito.Mockito.when -import static org.mockito.Mockito.when - -class DeleteCustomE2EServiceInstanceTest extends GroovyTestBase { - - private static String request - - @Rule - public WireMockRule wireMockRule = new WireMockRule(GroovyTestBase.PORT) - - String Prefix = "CVRCS_" - String RbType = "DCRENI_" - - @BeforeClass - public static void setUpBeforeClass() { - request = FileUtil.readResourceFile("__files/InfrastructureFlows/DeleteCustomE2EService.json") - } - - @Before - public void init() - { - MockitoAnnotations.initMocks(this) - } - - public DeleteCustomE2EServiceInstanceTest(){ - super("DeleteCustomE2EServiceInstance") - } - @Test - @Ignore // 1802 merge - public void preProcessRequestTest () { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPreProcess(mex) - DeleteCustomE2EServiceInstance instance = new DeleteCustomE2EServiceInstance() - mex.setVariable("isDebugLogEnabled","true") - instance.preProcessRequest(mex); - - verify(mex).getVariable(GroovyTestBase.DBGFLAG) - - verify(mex).setVariable("globalSubscriberId", "38829939920000") - verify(mex).setVariable("operationId", "59960003992") - verify(mex).setVariable("URN_mso_adapters_openecomp_db_endpoint", "http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter") - } - - @Test - public void sendSyncResponseTest() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPreProcess(mex) - DeleteCustomE2EServiceInstance instance = new DeleteCustomE2EServiceInstance() - instance.sendSyncResponse(mex) - verify(mex).setVariable("DeleteCustomE2EServiceInstanceWorkflowResponseSent", "true") - } - - @Test - public void prepareCompletionRequestTest(){ - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPreProcess(mex) - DeleteCustomE2EServiceInstance instance = new DeleteCustomE2EServiceInstance() - instance.prepareCompletionRequest(mex) - String msoComplitionRequest = FileUtil.readResourceFile("__files/GenericFlows/MsoCompletionRequest.xml") - //verify(mex).setVariable("completionRequest", msoComplitionRequest) - } - - @Test - public void sendSyncErrorTest(){ - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPreProcess(mex) - DeleteCustomE2EServiceInstance instance = new DeleteCustomE2EServiceInstance() - instance.sendSyncError(mex) - - } - - @Test - public void prepareFalloutRequest(){ - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPreProcess(mex) - DeleteCustomE2EServiceInstance instance = new DeleteCustomE2EServiceInstance() - instance.prepareFalloutRequest(mex) - String requestInfo = - """<request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1"> - <request-id>null</request-id> - <action>DELETE</action> - <source>null</source> - </request-info>""" - //verify(mex).setVariable("falloutRequest", requestInfo) - } - - @Test - public void processJavaExceptionTest(){ - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPreProcess(mex) - DeleteCustomE2EServiceInstance instance = new DeleteCustomE2EServiceInstance() - instance.processJavaException() - } - - - private void initPreProcess(ExecutionEntity mex) { - when(mex.getVariable(GroovyTestBase.DBGFLAG)).thenReturn("true") - when(mex.getVariable("bpmnRequest")).thenReturn(request) - when(mex.getVariable("mso-request-id")).thenReturn("mri") - when(mex.getVariable("serviceType")).thenReturn("VoLTE") - when(mex.getVariable("serviceInstanceId")).thenReturn("sii") - when(mex.getVariable("requestAction")).thenReturn("ra") - when(mex.getVariable("operationId")).thenReturn("59960003992") - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteGenericAlaCarteServiceInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteGenericAlaCarteServiceInstanceTest.groovy deleted file mode 100644 index 3b0e43957c..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteGenericAlaCarteServiceInstanceTest.groovy +++ /dev/null @@ -1,105 +0,0 @@ -package org.openecomp.mso.bpmn.infrastructure.scripts
-
-import org.camunda.bpm.engine.ProcessEngineServices
-import org.camunda.bpm.engine.RepositoryService
-import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
-import org.camunda.bpm.engine.repository.ProcessDefinition
-import org.camunda.bpm.engine.delegate.DelegateExecution
-import org.junit.Before
-import org.junit.Rule
-import org.junit.Test
-import org.mockito.MockitoAnnotations
-import org.openecomp.mso.bpmn.common.scripts.MsoUtils
-import org.openecomp.mso.bpmn.core.WorkflowException
-import org.openecomp.mso.bpmn.core.json.JsonUtils
-import org.openecomp.mso.bpmn.common.scripts.VidUtils
-
-import static org.junit.Assert.*;
-import static org.mockito.Mockito.*
-
-import com.github.tomakehurst.wiremock.junit.WireMockRule
-
-class DeleteGenericAlaCarteServiceInstanceTest {
-
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(8090);
-
- String Prefix="DELSI_"
- def utils = new MsoUtils()
- JsonUtils jsonUtil = new JsonUtils()
- VidUtils vidUtils = new VidUtils()
-
- String jsonIncomingRequest =
- """{
- "requestDetails": {
- "modelInfo": {
- "modelType": "service",
- "modelInvariantId": "1de901ed-17af-4b03-bc1f-41659cfa27cb",
- "modelVersionId": "ace39141-09ec-4068-b06d-ac6b23bdc6e0",
- "modelName": "demoVLB",
- "modelVersion": "1.0"
- },
- "cloudConfiguration" : {
- "lcpCloudRegionId": "RegionOne",
- "tenantId": "onap"
- },
- "subscriberInfo": {
- "globalSubscriberId": "Demonstration",
- "subscriberName": "Demonstration"
- },
- "requestInfo": {
- "instanceName": "sample-instance-2",
- "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
- "source": "VID",
- "requestorId":"1234",
- "suppressRollback": "false"
- },
- "requestParameters": {
- "subscriptionServiceType": "vLB"
- }
- }
- }"""
-
- @Before
- public void init()
- {
- MockitoAnnotations.initMocks(this)
-
- }
-
- public void initializeVariables(DelegateExecution mockExecution) {
-
- verify(mockExecution).setVariable(Prefix + "Success", false)
-
- verify(mockExecution).setVariable(Prefix + "CompleteMsoProcessRequest", "")
- verify(mockExecution).setVariable(Prefix + "FalloutHandlerRequest", "")
- verify(mockExecution).setVariable(Prefix + "isSilentSuccess", false)
-
- }
-
- @Test
- //@Ignore
- public void preProcessRequest() {
-
- println "************ preProcessRequest() ************* "
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("bpmnRequest")).thenReturn(jsonIncomingRequest)
-
- try {
- // preProcessRequest(DelegateExecution execution)
- DeleteGenericALaCarteServiceInstance deleteGenericALaCarteServiceInstance = new DeleteGenericALaCarteServiceInstance()
- deleteGenericALaCarteServiceInstance.preProcessRequest(mockExecution)
-
- verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix)
-
- initializeVariables(mockExecution)
- //verify(mockExecution).setVariable(Prefix + "Success", false)
- }catch(Exception e){
- //ignore
- }
-
- }
-}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteNetworkInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteNetworkInstanceTest.groovy deleted file mode 100644 index 46a737f3e1..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteNetworkInstanceTest.groovy +++ /dev/null @@ -1,397 +0,0 @@ -package org.openecomp.mso.bpmn.infrastructure.scripts
-
-import static org.mockito.Mockito.*
-
-import org.apache.commons.lang3.*
-import org.camunda.bpm.engine.ProcessEngineServices
-import org.camunda.bpm.engine.RepositoryService
-import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
-import org.camunda.bpm.engine.repository.ProcessDefinition
-import org.camunda.bpm.engine.delegate.DelegateExecution
-import org.junit.Before
-import org.junit.Rule
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.mockito.MockitoAnnotations
-import org.mockito.runners.MockitoJUnitRunner
-import org.openecomp.mso.bpmn.common.scripts.MsoUtils
-import org.openecomp.mso.bpmn.core.WorkflowException
-
-import com.github.tomakehurst.wiremock.junit.WireMockRule
-
-
-@RunWith(MockitoJUnitRunner.class)
-class DeleteNetworkInstanceTest {
-
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(8090);
-
- String Prefix="DELNI_"
- def utils = new MsoUtils()
-
- String falloutHandlerRequest =
- """<aetgt:FalloutHandlerRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:ns="http://org.openecomp/mso/request/types/v1"
- xmlns:wfsch="http://org.openecomp/mso/workflow/schema/v1">
- <request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
- <request-id>b69c9054-da09-4a2c-adf5-51042b62bfac</request-id>
- <action>DELETE</action>
- <source>PORTAL</source>
- </request-info>
- <aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">
- <aetgt:ErrorMessage>Received error from SDN-C: No availability zone available</aetgt:ErrorMessage>
- <aetgt:ErrorCode>5300</aetgt:ErrorCode>
- <aetgt:SourceSystemErrorCode>200</aetgt:SourceSystemErrorCode>
-</aetgt:WorkflowException>
- </aetgt:FalloutHandlerRequest>"""
-
- String falloutHandlerRequestObj =
- """<aetgt:FalloutHandlerRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:ns="http://org.openecomp/mso/request/types/v1"
- xmlns:wfsch="http://org.openecomp/mso/workflow/schema/v1">
- <request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
- <request-id>b69c9054-da09-4a2c-adf5-51042b62bfac</request-id>
- <action>DELETE</action>
- <source>PORTAL</source>
- </request-info>
- <aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">
- <aetgt:ErrorMessage>Received error from SDN-C: No availability zone available</aetgt:ErrorMessage>
- <aetgt:ErrorCode>7000</aetgt:ErrorCode>
- </aetgt:WorkflowException>
- </aetgt:FalloutHandlerRequest>"""
-
- String completeMsoProcessRequest =
- """<aetgt:MsoCompletionRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:ns="http://org.openecomp/mso/request/types/v1"
- xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
- <request-info>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <action>DELETE</action>
- <source>VID</source>
- </request-info>
- <aetgt:status-message>Network has been deleted successfully.</aetgt:status-message>
- <aetgt:mso-bpel-name>BPMN Network action: DELETE</aetgt:mso-bpel-name>
-</aetgt:MsoCompletionRequest>"""
-
-String deleteDBRequest =
-"""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:ns="http://org.openecomp.mso/requestsdb">
- <soapenv:Header/>
- <soapenv:Body>
- <ns:updateInfraRequest>
- <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
- <lastModifiedBy>BPMN</lastModifiedBy>
- <statusMessage>Network successfully deleted.</statusMessage>
- <responseBody/>
- <requestStatus>COMPLETED</requestStatus>
- <progress>100</progress>
- <vnfOutputs><network-outputs xmlns="http://org.openecomp/mso/infra/vnf-request/v1" xmlns:aetgt="http://org.openecomp/mso/infra/vnf-request/v1" xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"/></vnfOutputs>
- </ns:updateInfraRequest>
- </soapenv:Body>
-</soapenv:Envelope>"""
-
-String deleteDBRequestErrorObj =
-"""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
- <soapenv:Header/>
- <soapenv:Body>
- <ns:updateInfraRequest xmlns:ns="http://org.openecomp.mso/requestsdb">
- <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
- <lastModifiedBy>BPMN</lastModifiedBy>
- <statusMessage>Received error from SDN-C: No availability zone available</statusMessage>
- <responseBody></responseBody>
- <requestStatus>FAILED</requestStatus>
- <progress></progress>
- <vnfOutputs><network-outputs xmlns="http://org.openecomp/mso/infra/vnf-request/v1" xmlns:aetgt="http://org.openecomp/mso/infra/vnf-request/v1" xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"/></vnfOutputs>
- </ns:updateInfraRequest>
- </soapenv:Body>
- </soapenv:Envelope>"""
-
-String deleteDBRequestErrorString =
-"""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
- <soapenv:Header/>
- <soapenv:Body>
- <ns:updateInfraRequest xmlns:ns="http://org.openecomp.mso/requestsdb">
- <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
- <lastModifiedBy>BPMN</lastModifiedBy>
- <statusMessage>Received error from SDN-C: No availability zone available</statusMessage>
- <responseBody></responseBody>
- <requestStatus>FAILED</requestStatus>
- <progress></progress>
- <vnfOutputs><network-outputs xmlns="http://org.openecomp/mso/infra/vnf-request/v1" xmlns:aetgt="http://org.openecomp/mso/infra/vnf-request/v1" xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"/></vnfOutputs>
- </ns:updateInfraRequest>
- </soapenv:Body>
- </soapenv:Envelope>"""
-
- String jsonIncomingRequest =
- """{ "requestDetails": {
- "modelInfo": {
- "modelType": "networkTyp",
- "modelId": "modelId",
- "modelNameVersionId": "modelNameVersionId",
- "modelName": "CONTRAIL_EXTERNAL",
- "modelVersion": "1"
- },
- "cloudConfiguration": {
- "lcpCloudRegionId": "RDM2WAGPLCP",
- "tenantId": "7dd5365547234ee8937416c65507d266"
- },
- "requestInfo": {
- "instanceName": "MNS-25180-L-01-dmz_direct_net_1",
- "source": "VID",
- "callbackUrl": "",
- "suppressRollback": true,
- "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"
- },
- "relatedInstanceList": [
- {
- "relatedInstance": {
- "instanceId": "f70e927b-6087-4974-9ef8-c5e4d5847ca4",
- "modelInfo": {
- "modelType": "serviceT",
- "modelId": "modelI",
- "modelNameVersionId": "modelNameVersionI",
- "modelName": "modleNam",
- "modelVersion": "1"
- }
- }
- }
- ],
- "requestParameters": {
- "userParams": [
- {
- "name": "someUserParam1",
- "value": "someValue1"
- }
- ]
- }
- }}"""
-
-// - - - - - - - -
-
-
- @Before
- public void init()
- {
- MockitoAnnotations.initMocks(this)
- }
-
- @Test
- //@Ignore
- public void preProcessRequest() {
-
- println "************ preProcessRequest_Payload ************* "
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("bpmnRequest")).thenReturn(jsonIncomingRequest)
-
- DeleteNetworkInstance DeleteNetworkInstance = new DeleteNetworkInstance()
- DeleteNetworkInstance.preProcessRequest(mockExecution)
-
- verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix)
-
- //verify variable initialization
- initializeVariables(mockExecution)
-
-
- }
-
- public void initializeVariables (DelegateExecution mockExecution) {
-
-
- verify(mockExecution).setVariable(Prefix + "Success", false)
-
- verify(mockExecution).setVariable(Prefix + "CompleteMsoProcessRequest", "")
- verify(mockExecution).setVariable(Prefix + "FalloutHandlerRequest", "")
- verify(mockExecution).setVariable(Prefix + "isSilentSuccess", false)
-
- }
-
-
- @Test
- //@Ignore
- public void getNetworkModelInfo() {
-
- println "************ getNetworkModelInfo() ************* "
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
-
- // preProcessRequest(DelegateExecution execution)
- DeleteNetworkInstance DeleteNetworkInstance = new DeleteNetworkInstance()
- DeleteNetworkInstance.getNetworkModelInfo(mockExecution)
-
- verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix)
-
- }
-
- @Test
- //@Ignore
- public void sendSyncResponse() {
-
- println "************ sendSyncResponse ************* "
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("isAsyncProcess")).thenReturn(true)
- when(mockExecution.getVariable("mso-request-id")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
-
- // preProcessRequest(DelegateExecution execution)
- DeleteNetworkInstance DeleteNetworkInstance = new DeleteNetworkInstance()
- DeleteNetworkInstance.sendSyncResponse(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable("DeleteNetworkInstanceResponseCode", "202")
-
- }
-
-
- @Test
- //@Ignore
- public void sendSyncError() {
-
- println "************ sendSyncError ************* "
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("isAsyncProcess")).thenReturn(true)
- when(mockExecution.getVariable("mso-request-id")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
-
- DeleteNetworkInstance DeleteNetworkInstance = new DeleteNetworkInstance()
- DeleteNetworkInstance.sendSyncError(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable("DeleteNetworkInstanceResponseCode", "500")
-
- }
-
-
- @Test
- //@Ignore
- public void prepareCompletion() {
-
- println "************ postProcessResponse ************* "
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "source")).thenReturn("PORTAL")
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
-
- // postProcessResponse(DelegateExecution execution)
- DeleteNetworkInstance DeleteNetworkInstance = new DeleteNetworkInstance()
- DeleteNetworkInstance.prepareCompletion(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "CompleteMsoProcessRequest", completeMsoProcessRequest)
-
- }
-
-
- @Test
- //@Ignore
- public void prepareDBRequestError() {
-
- println "************ prepareDBRequestError ************* "
-
- WorkflowException sndcWorkflowExceptionObj = new WorkflowException("CreateNetworkV2", 500, "Received error from SDN-C: No availability zone available")
-
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable(Prefix + "requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("WorkflowException")).thenReturn(sndcWorkflowExceptionObj)
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_adapters_db_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
-
- // preProcessRequest(DelegateExecution execution)
- DeleteNetworkInstance DeleteNetworkInstance = new DeleteNetworkInstance()
- DeleteNetworkInstance.prepareDBRequestError(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "deleteDBRequest", deleteDBRequestErrorObj)
-
- }
-
-
- @Test
- //@Ignore
- public void postProcessResponse() {
-
- println "************ postProcessResponse ************* "
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("CMSO_ResponseCode")).thenReturn("200")
-
- // postProcessResponse(DelegateExecution execution)
- DeleteNetworkInstance DeleteNetworkInstance = new DeleteNetworkInstance()
- DeleteNetworkInstance.postProcessResponse(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "Success", true)
-
-
- }
-
-
- @Test
- //@Ignore
- public void buildErrorResponse_FalloutHandlerRequest() {
-
- println "************ buildErrorResponse ************* "
-
- WorkflowException sndcWorkflowExceptionObj = new WorkflowException("DeleteNetworkInstance", 7000, "Received error from SDN-C: No availability zone available")
-
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso-request-id")).thenReturn("b69c9054-da09-4a2c-adf5-51042b62bfac")
- when(mockExecution.getVariable("WorkflowException")).thenReturn(sndcWorkflowExceptionObj)
- when(mockExecution.getVariable(Prefix + "source")).thenReturn("PORTAL")
-
- // buildErrorResponse(DelegateExecution execution)
- DeleteNetworkInstance DeleteNetworkInstance = new DeleteNetworkInstance()
- DeleteNetworkInstance.buildErrorResponse(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "Success", false)
- verify(mockExecution).setVariable(Prefix + "FalloutHandlerRequest", falloutHandlerRequestObj)
-
- }
-
-
- private ExecutionEntity setupMock() {
-
- ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class)
- when(mockProcessDefinition.getKey()).thenReturn("DeleteNetworkInstance")
- RepositoryService mockRepositoryService = mock(RepositoryService.class)
- when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition)
- when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("DeleteNetworkInstance")
- when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100")
- ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class)
- when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService)
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
-
- when(mockExecution.getId()).thenReturn("100")
- when(mockExecution.getProcessDefinitionId()).thenReturn("DeleteNetworkInstance")
- when(mockExecution.getProcessInstanceId()).thenReturn("DeleteNetworkInstance")
- when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices)
- when(mockExecution.getProcessEngineServices().getRepositoryService().getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(mockProcessDefinition)
-
- return mockExecution
-
- }
-
-}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteVfModuleVolumeInfraV1Test.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteVfModuleVolumeInfraV1Test.groovy deleted file mode 100644 index 19c72fd7c6..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteVfModuleVolumeInfraV1Test.groovy +++ /dev/null @@ -1,170 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure.scripts; - -import static org.junit.Assert.* -import static org.mockito.Mockito.* - -import org.apache.commons.lang3.* -import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity -import org.junit.Before -import org.junit.Ignore -import org.junit.Test -import org.junit.runner.RunWith -import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner -import org.openecomp.mso.bpmn.common.scripts.MsoGroovyTest -import org.openecomp.mso.bpmn.core.WorkflowException - - -@RunWith(MockitoJUnitRunner.class) -class DeleteVfModuleVolumeInfraV1Test extends MsoGroovyTest { - - def deleteVnfAdapterRequestXml = """<deleteVolumeGroupRequest> - <cloudSiteId>RDM2WAGPLCP</cloudSiteId> - <tenantId>fba1bd1e195a404cacb9ce17a9b2b421</tenantId> - <volumeGroupId>78987</volumeGroupId> - <volumeGroupStackId/> - <skipAAI>true</skipAAI> - <msoRequest> - <requestId>TEST-REQUEST-ID-0123</requestId> - <serviceInstanceId>1234</serviceInstanceId> - </msoRequest> - <messageId>ebb9ef7b-a6a5-40e6-953e-f868f1767677</messageId> - <notificationUrl>http://localhost:28080/mso/WorkflowMessage/VNFAResponse/ebb9ef7b-a6a5-40e6-953e-f868f1767677</notificationUrl> -</deleteVolumeGroupRequest>""" - - def dbRequestXml = """<soapenv:Envelope xmlns:req="http://org.openecomp.mso/requestsdb" - xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> - <soapenv:Header/> - <soapenv:Body> - <req:updateInfraRequest> - <requestId>TEST-REQUEST-ID-0123</requestId> - <lastModifiedBy>BPMN</lastModifiedBy> - <statusMessage>VolumeGroup successfully deleted</statusMessage> - <requestStatus>COMPLETE</requestStatus> - <progress>100</progress> - <vnfOutputs/> - </req:updateInfraRequest> - </soapenv:Body> -</soapenv:Envelope>""" - - def completionRequestXml = """<aetgt:MsoCompletionRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1" - xmlns:ns="http://org.openecomp/mso/request/types/v1" - xmlns="http://org.openecomp/mso/infra/vnf-request/v1"> - <request-info> - <request-id>TEST-REQUEST-ID-0123</request-id> - <action>DELETE</action> - <source>VID</source> - </request-info> - <aetgt:status-message>Volume Group has been deleted successfully.</aetgt:status-message> - <aetgt:mso-bpel-name>BPMN VF Module Volume action: DELETE</aetgt:mso-bpel-name> -</aetgt:MsoCompletionRequest>""" - - def falloutHandlerRequestXml = """<aetgt:FalloutHandlerRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1" - xmlns:ns="http://org.openecomp/mso/request/types/v1" - xmlns="http://org.openecomp/mso/infra/vnf-request/v1"> - <request-info> - <request-id>TEST-REQUEST-ID-0123</request-id> - <action>DELETE</action> - <source>VID</source> - </request-info> - <aetgt:WorkflowException> - <aetgt:ErrorMessage>Unexpected Error</aetgt:ErrorMessage> - <aetgt:ErrorCode>5000</aetgt:ErrorCode> - </aetgt:WorkflowException> -</aetgt:FalloutHandlerRequest>""" - - @Before - public void init() - { - MockitoAnnotations.initMocks(this) - } - - - @Test - public void testPrepareVnfAdapterDeleteRequest() { - - ExecutionEntity mockExecution = setupMock('DeleteVfModuleVolumeInfraV1') - when(mockExecution.getVariable("DELVfModVol_cloudRegion")).thenReturn('RDM2WAGPLCP') - when(mockExecution.getVariable("DELVfModVol_tenantId")).thenReturn('fba1bd1e195a404cacb9ce17a9b2b421') - when(mockExecution.getVariable("DELVfModVol_volumeGroupId")).thenReturn('78987') - when(mockExecution.getVariable("DELVfModVol_volumeGroupHeatStackId")).thenReturn('') - when(mockExecution.getVariable("DELVfModVol_requestId")).thenReturn('TEST-REQUEST-ID-0123') - when(mockExecution.getVariable("DELVfModVol_serviceId")).thenReturn('1234') - when(mockExecution.getVariable("DELVfModVol_messageId")).thenReturn('ebb9ef7b-a6a5-40e6-953e-f868f1767677') - when(mockExecution.getVariable("URN_mso_workflow_message_endpoint")).thenReturn('http://localhost:28080/mso/WorkflowMessage') - when(mockExecution.getVariable("URN_mso_use_qualified_host")).thenReturn('') - - DeleteVfModuleVolumeInfraV1 myproc = new DeleteVfModuleVolumeInfraV1() - myproc.prepareVnfAdapterDeleteRequest(mockExecution, 'true') - - verify(mockExecution).setVariable("DELVfModVol_deleteVnfARequest", deleteVnfAdapterRequestXml) - - } - - @Test - //@Ignore - public void testPrepareDbRequest() { - - ExecutionEntity mockExecution = setupMock('DeleteVfModuleVolumeInfraV1') - when(mockExecution.getVariable("DELVfModVol_requestId")).thenReturn('TEST-REQUEST-ID-0123') - when(mockExecution.getVariable("DELVfModVol_volumeOutputs")).thenReturn('') - when(mockExecution.getVariable("URN_mso_adapters_db_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") - - DeleteVfModuleVolumeInfraV1 myproc = new DeleteVfModuleVolumeInfraV1() - myproc.prepareDBRequest(mockExecution, 'true') - - verify(mockExecution).setVariable("DELVfModVol_updateInfraRequest", dbRequestXml) - } - - @Test - public void testPrepareCompletionHandlerRequest() { - - ExecutionEntity mockExecution = setupMock('DeleteVfModuleVolumeInfraV1') - when(mockExecution.getVariable("mso-request-id")).thenReturn('TEST-REQUEST-ID-0123') - when(mockExecution.getVariable("DELVfModVol_source")).thenReturn('VID') - - DeleteVfModuleVolumeInfraV1 myproc = new DeleteVfModuleVolumeInfraV1() - myproc.prepareCompletionHandlerRequest(mockExecution, 'true') - - verify(mockExecution).setVariable("DELVfModVol_CompleteMsoProcessRequest", completionRequestXml) - } - - @Test - public void testPrepareFalloutHandler() { - - WorkflowException workflowException = new WorkflowException('DeleteVfModuleVolumeInfraV1', 5000, 'Unexpected Error') - - ExecutionEntity mockExecution = setupMock('DeleteVfModuleVolumeInfraV1') - - when(mockExecution.getVariable("DELVfModVol_requestId")).thenReturn('TEST-REQUEST-ID-0123') - when(mockExecution.getVariable("WorkflowException")).thenReturn(workflowException) - when(mockExecution.getVariable("DELVfModVol_source")).thenReturn('VID') - - DeleteVfModuleVolumeInfraV1 myproc = new DeleteVfModuleVolumeInfraV1() - myproc.prepareFalloutHandler(mockExecution, 'true') - - verify(mockExecution).setVariable("DELVfModVol_Success", false) - verify(mockExecution).setVariable("DELVfModVol_FalloutHandlerRequest", falloutHandlerRequestXml) - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollbackTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollbackTest.groovy deleted file mode 100644 index 157e7db234..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollbackTest.groovy +++ /dev/null @@ -1,349 +0,0 @@ -package org.openecomp.mso.bpmn.infrastructure.scripts
-
-import static org.mockito.Mockito.*
-
-import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.ProcessEngineServices
-import org.camunda.bpm.engine.RepositoryService
-import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
-import org.camunda.bpm.engine.impl.pvm.process.ProcessDefinitionImpl
-import org.camunda.bpm.engine.repository.ProcessDefinition
-import org.camunda.bpm.engine.delegate.DelegateExecution;
-import org.mockito.MockitoAnnotations
-import org.mockito.runners.MockitoJUnitRunner
-import org.mockito.internal.debugging.MockitoDebuggerImpl
-import org.openecomp.mso.bpmn.common.scripts.MsoUtils
-import org.openecomp.mso.bpmn.core.WorkflowException
-import org.junit.Before
-import org.junit.Rule;
-import org.junit.Test
-import org.junit.Ignore
-import org.junit.runner.RunWith
-
-import static org.openecomp.mso.bpmn.mock.StubResponseNetworkAdapter.MockNetworkAdapterRestRollbackDelete;
-import static org.junit.Assert.*;
-
-import com.github.tomakehurst.wiremock.client.WireMock;
-import com.github.tomakehurst.wiremock.junit.WireMockRule;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-import org.apache.commons.lang3.*
-
-
-@RunWith(MockitoJUnitRunner.class)
-class DoCreateNetworkInstanceRollbackTest {
-
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090);
-
- def utils = new MsoUtils()
- String Prefix="CRENWKIR_"
-
-
- String rollbackNetworkRequest =
- """<NetworkAdapter:rollbackNetwork xmlns:NetworkAdapter="http://org.openecomp.mso/network">
- <rollback>
- <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
- <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
- <networkStackId/>
- <networkType>CONTRAIL_EXTERNAL</networkType>
- <networkCreated>true</networkCreated>
- <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
- <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
- <msoRequest>
- <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId>
- <serviceInstanceId/>
- </msoRequest>
- </rollback>
-</NetworkAdapter:rollbackNetwork>"""
-
- String rollbackActivateSDNCRequest =
- """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:ns5="http://org.openecomp/mso/request/types/v1"
- xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
- <sdncadapter:RequestHeader>
- <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
- <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
- <sdncadapter:SvcAction>rollback</sdncadapter:SvcAction>
- <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
- <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
- <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
- </sdncadapter:RequestHeader>
- <aetgt:SDNCRequestData>
- <request-information>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <request-action>CreateNetworkInstance</request-action>
- <source>VID</source>
- <notification-url/>
- <order-number/>
- <order-version/>
- </request-information>
- <service-information>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <service-type>MSO-dev-service-type</service-type>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- <subscriber-name>MSO_1610_dev</subscriber-name>
- </service-information>
- <network-information>
- <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <onap-model-information>
- <model-invariant-uuid>invariant-uuid</model-invariant-uuid>
- <model-customization-uuid>customization-uuid</model-customization-uuid>
- <model-uuid>uuid</model-uuid>
- <model-version>version</model-version>
- <model-name>CONTRAIL_EXTERNAL</model-name>
- </onap-model-information>
- </network-information>
- <network-request-information>
- <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <tenant>7dd5365547234ee8937416c65507d266</tenant>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- </network-request-information>
- </aetgt:SDNCRequestData>
-</aetgt:SDNCAdapterWorkflowRequest>"""
-
- String rollbackSDNCRequest =
- """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:ns5="http://org.openecomp/mso/request/types/v1"
- xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
- <sdncadapter:RequestHeader>
- <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
- <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
- <sdncadapter:SvcAction>rollback</sdncadapter:SvcAction>
- <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
- <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
- <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
- </sdncadapter:RequestHeader>
- <aetgt:SDNCRequestData>
- <request-information>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <request-action>CreateNetworkInstance</request-action>
- <source>VID</source>
- <notification-url/>
- <order-number/>
- <order-version/>
- </request-information>
- <service-information>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <service-type>MSO-dev-service-type</service-type>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- <subscriber-name>MSO_1610_dev</subscriber-name>
- </service-information>
- <network-information>
- <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <onap-model-information>
- <model-invariant-uuid>invariant-uuid</model-invariant-uuid>
- <model-customization-uuid>customization-uuid</model-customization-uuid>
- <model-uuid>uuid</model-uuid>
- <model-version>version</model-version>
- <model-name>CONTRAIL_EXTERNAL</model-name>
- </onap-model-information>
- </network-information>
- <network-request-information>
- <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <tenant>7dd5365547234ee8937416c65507d266</tenant>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- </network-request-information>
- </aetgt:SDNCRequestData>
-</aetgt:SDNCAdapterWorkflowRequest>"""
-
-// - - - - - - - -
-
-
- @Before
- public void init()
- {
- MockitoAnnotations.initMocks(this)
-
- }
-
- public void initializeVariables (DelegateExecution mockExecution) {
-
- verify(mockExecution).setVariable(Prefix + "WorkflowException", null)
-
- verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", null)
- verify(mockExecution).setVariable(Prefix + "rollbackNetworkResponse", "")
- verify(mockExecution).setVariable(Prefix + "rollbackNetworkReturnCode", "")
-
- verify(mockExecution).setVariable(Prefix + "rollbackSDNCRequest", null)
- verify(mockExecution).setVariable(Prefix + "rollbackSDNCResponse", "")
- verify(mockExecution).setVariable(Prefix + "rollbackSDNCReturnCode", "")
-
- verify(mockExecution).setVariable(Prefix + "rollbackActivateSDNCRequest", null)
- verify(mockExecution).setVariable(Prefix + "rollbackActivateSDNCResponse", "")
- verify(mockExecution).setVariable(Prefix + "rollbackActivateSDNCReturnCode", "")
-
- verify(mockExecution).setVariable(Prefix + "Success", false)
- verify(mockExecution).setVariable(Prefix + "fullRollback", false)
- verify(mockExecution).setVariable(Prefix + "networkId", "")
- verify(mockExecution).setVariable(Prefix + "urlRollbackPoNetwork", "")
-
- }
-
- @Test
- //@Ignore
- public void preProcessRequest() {
-
- println "************ preProcessRequest ************* "
-
- WorkflowException workflowException = new WorkflowException("DoCreateNetworkInstance", 2500, "Received error from Network Adapter: JBWEB000065: HTTP Status 500.")
- Map<String, String> rollbackData = new HashMap<String, String>();
- rollbackData.put("rollbackSDNCRequest", rollbackSDNCRequest)
- rollbackData.put("rollbackActivateSDNCRequest", rollbackActivateSDNCRequest)
- rollbackData.put("rollbackNetworkRequest", rollbackNetworkRequest)
-
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
- when(mockExecution.getVariable("WorkflowException")).thenReturn(workflowException)
- when(mockExecution.getVariable("rollbackData")).thenReturn(rollbackData)
- when(mockExecution.getVariable("sdncVersion")).thenReturn("1702")
-
- when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
-
- when(mockExecution.getVariable("URN_mso_adapters_sdnc_endpoint")).thenReturn("http://localhost:28090/SDNCAdapter")
- when(mockExecution.getVariable("URN_mso_adapters_network_rest_endpoint")).thenReturn("http://localhost:28090/networks/NetworkAdapter")
- when(mockExecution.getVariable("URN_mso_adapters_sdnc_resource_endpoint")).thenReturn("http://localhost:28090/SDNCAdapterRpc")
-
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstanceRollback DoCreateNetworkInstanceRollback = new DoCreateNetworkInstanceRollback()
- DoCreateNetworkInstanceRollback.preProcessRequest(mockExecution)
-
- verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix)
-
- //verify variable initialization
- initializeVariables(mockExecution)
-
- }
-
- @Test
- //@Ignore
- public void callPONetworkAdapter() {
-
- MockNetworkAdapterRestRollbackDelete("deleteNetworkResponse_Success.xml","8abc633a-810b-4ca5-8b3a-09511d13a2ce");
-
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
- when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn( rollbackNetworkRequest)
- when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn(rollbackSDNCRequest)
- when(mockExecution.getVariable("URN_mso_adapters_network_rest_endpoint")).thenReturn("http://localhost:28090/networks/NetworkAdapter")
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstanceRollback DoCreateNetworkInstanceRollback = new DoCreateNetworkInstanceRollback()
- DoCreateNetworkInstanceRollback.callPONetworkAdapter(mockExecution)
-
- verify(mockExecution, atLeast(1)).setVariable(Prefix + "urlRollbackPoNetwork", "http://localhost:28090/networks/NetworkAdapter/8abc633a-810b-4ca5-8b3a-09511d13a2ce/rollback")
-
- }
-
- @Test
- //@Ignore
- public void validateRollbackResponses_Good() {
-
- WorkflowException workflowException = new WorkflowException("DoCreateNetworkInstanceRollback", 2500, "AAI Update Contrail Failed. Error 404.")
- WorkflowException expectedWorkflowException = new WorkflowException("DoCreateNetworkInstanceRollback", 2500, "AAI Update Contrail Failed. Error 404. + SNDC activate rollback completed. + PO Network rollback completed. + SNDC assign rollback completed.")
-
- println "************ validateRollbackResponses_Good() ************* "
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
- when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn("Good")
- when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn("Good")
- when(mockExecution.getVariable(Prefix + "rollbackActivateSDNCRequest")).thenReturn("Good")
- when(mockExecution.getVariable(Prefix + "rollbackNetworkReturnCode")).thenReturn("200")
- when(mockExecution.getVariable(Prefix + "rollbackNetworkResponse")).thenReturn("GoodResponse")
- when(mockExecution.getVariable(Prefix + "rollbackSDNCReturnCode")).thenReturn("200")
- when(mockExecution.getVariable(Prefix + "rollbackSDNCResponse")).thenReturn("GoodResponse")
- when(mockExecution.getVariable(Prefix + "rollbackActivateSDNCReturnCode")).thenReturn("200")
- when(mockExecution.getVariable(Prefix + "rollbackActivateSDNCResponse")).thenReturn("GoodResponse")
- when(mockExecution.getVariable(Prefix + "WorkflowException")).thenReturn(workflowException)
- when(mockExecution.getVariable(Prefix + "fullRollback")).thenReturn(false)
-
- DoCreateNetworkInstanceRollback DoCreateNetworkInstanceRollback = new DoCreateNetworkInstanceRollback()
- DoCreateNetworkInstanceRollback.validateRollbackResponses(mockExecution)
-
- // verify set prefix = Prefix + ""
- verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix)
- verify(mockExecution, atLeast(1)).setVariable("rolledBack", true)
- verify(mockExecution, atLeast(1)).setVariable("wasDeleted", true)
- verify(mockExecution).setVariable("WorkflowException", refEq(expectedWorkflowException, any(WorkflowException.class)))
- //verify(mockExecution).setVariable("WorkflowException", expectedWorkflowException)
- }
-
- @Test
- //@Ignore
- public void validateRollbackResponses_FullRollback() {
-
- Map<String, String> rollbackData = new HashMap<String, String>();
- rollbackData.put("rollbackSDNCRequest", rollbackSDNCRequest)
- rollbackData.put("rollbackActivateSDNCRequest", rollbackActivateSDNCRequest)
- rollbackData.put("rollbackNetworkRequest", rollbackNetworkRequest)
-
- println "************ validateRollbackResponses_FullRollback() ************* "
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
- when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn("Good")
- when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn("Good")
- when(mockExecution.getVariable(Prefix + "rollbackActivateSDNCRequest")).thenReturn("Good")
- when(mockExecution.getVariable(Prefix + "rollbackNetworkReturnCode")).thenReturn("200")
- when(mockExecution.getVariable(Prefix + "rollbackNetworkResponse")).thenReturn("GoodResponse")
- when(mockExecution.getVariable(Prefix + "rollbackSDNCReturnCode")).thenReturn("200")
- when(mockExecution.getVariable(Prefix + "rollbackSDNCResponse")).thenReturn("GoodResponse")
- when(mockExecution.getVariable(Prefix + "rollbackActivateSDNCReturnCode")).thenReturn("200")
- when(mockExecution.getVariable(Prefix + "rollbackActivateSDNCResponse")).thenReturn("GoodResponse")
- when(mockExecution.getVariable(Prefix + "workflowException")).thenReturn(null)
- when(mockExecution.getVariable(Prefix + "fullRollback")).thenReturn(true)
- when(mockExecution.getVariable("rollbackData")).thenReturn(rollbackData)
-
- DoCreateNetworkInstanceRollback DoCreateNetworkInstanceRollback = new DoCreateNetworkInstanceRollback()
- DoCreateNetworkInstanceRollback.validateRollbackResponses(mockExecution)
-
- // verify set prefix = Prefix + ""
- verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix)
- verify(mockExecution, atLeast(1)).setVariable("rollbackSuccessful", true)
- verify(mockExecution, atLeast(1)).setVariable("rollbackError", false)
-
- }
-
-
- private ExecutionEntity setupMock() {
-
- ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class)
- when(mockProcessDefinition.getKey()).thenReturn("DoCreateNetworkInstanceRollback")
- RepositoryService mockRepositoryService = mock(RepositoryService.class)
- when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition)
- when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("DoCreateNetworkInstanceRollback")
- when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100")
- ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class)
- when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService)
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
-
- when(mockExecution.getId()).thenReturn("100")
- when(mockExecution.getProcessDefinitionId()).thenReturn("DoCreateNetworkInstanceRollback")
- when(mockExecution.getProcessInstanceId()).thenReturn("DoCreateNetworkInstanceRollback")
- when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices)
- when(mockExecution.getProcessEngineServices().getRepositoryService().getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(mockProcessDefinition)
-
- return mockExecution
- }
-
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateNetworkInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateNetworkInstanceTest.groovy deleted file mode 100644 index dafbe3c8ac..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateNetworkInstanceTest.groovy +++ /dev/null @@ -1,4305 +0,0 @@ -package org.openecomp.mso.bpmn.infrastructure.scripts
-
-import static org.mockito.Mockito.*
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkByName;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkByName_404;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkByIdWithDepth;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkCloudRegion;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkCloudRegion_404;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutNetworkIdWithDepth;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkPolicy;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkTableReference;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkVpnBinding;
-import org.camunda.bpm.engine.ProcessEngineServices
-import org.camunda.bpm.engine.RepositoryService
-import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
-import org.camunda.bpm.engine.repository.ProcessDefinition
-import org.camunda.bpm.engine.delegate.DelegateExecution
-import org.junit.Before
-import org.junit.Ignore
-import org.junit.Rule
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.mockito.MockitoAnnotations
-import org.mockito.runners.MockitoJUnitRunner
-import org.openecomp.mso.bpmn.common.scripts.MsoUtils
-import org.openecomp.mso.bpmn.core.WorkflowException
-
-import com.github.tomakehurst.wiremock.client.WireMock
-import com.github.tomakehurst.wiremock.junit.WireMockRule
-import org.apache.commons.lang3.*
-
-@RunWith(MockitoJUnitRunner.class)
-class DoCreateNetworkInstanceTest {
-
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(8090);
-
- def utils = new MsoUtils()
- String Prefix="CRENWKI_"
-
-// ---- Start XML Zone ----
- String xmlIncomingRequest =
- """<rest:payload contentType="text/xml" xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd">
- <network-request xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
- <request-info>
- <request-id>1ef47428-cade-45bd-a103-0751e8b2deb0</request-id>
- <action>CREATE</action>
- <source>PORTAL</source>
- </request-info>
- <network-inputs>
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
- <physicalNetworkName>dvs-slcp3-01</physicalNetworkName>
- <vlans>3008</vlans>
- <service-instance-id>MNS-25180-L-01-dmz_direct_net_1</service-instance-id>
- <backout-on-failure>true</backout-on-failure>
- </network-inputs>
- <network-params xmlns:vnfreq="http://org.openecomp/mso/infra/vnf-request/v1">
- <param xmlns="" xmlns:ns3="http://org.openecomp/mso/infra/vnf-request/v1" name="shared">1</param>
- <param xmlns="" xmlns:ns3="http://org.openecomp/mso/infra/vnf-request/v1" name="external">0</param>
- </network-params>
- </network-request>
- </rest:payload>"""
-
- String expectedXMLNetworkRequest =
-"""<rest:payload xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- xmlns:vnfreq="http://org.openecomp/mso/infra/vnf-request/v1"
- contentType="text/xml">
- <vnfreq:network-request>
- <vnfreq:request-info>
- <vnfreq:request-id>1ef47428-cade-45bd-a103-0751e8b2deb0</vnfreq:request-id>
- <vnfreq:action>CREATE</vnfreq:action>
- <vnfreq:source>PORTAL</vnfreq:source>
- </vnfreq:request-info>
- <vnfreq:network-inputs>
- <vnfreq:network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</vnfreq:network-id>
- <vnfreq:network-name>MNS-25180-L-01-dmz_direct_net_1</vnfreq:network-name>
- <vnfreq:network-type>CONTRAIL_EXTERNAL</vnfreq:network-type>
- <vnfreq:service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</vnfreq:service-id>
- <vnfreq:aic-cloud-region>RDM2WAGPLCP</vnfreq:aic-cloud-region>
- <vnfreq:tenant-id>7dd5365547234ee8937416c65507d266</vnfreq:tenant-id>
- <vnfreq:physicalNetworkName>dvs-slcp3-01</vnfreq:physicalNetworkName>
- <vnfreq:vlans>3008</vnfreq:vlans>
- <vnfreq:service-instance-id>MNS-25180-L-01-dmz_direct_net_1</vnfreq:service-instance-id>
- <vnfreq:backout-on-failure>true</vnfreq:backout-on-failure>
- </vnfreq:network-inputs>
- <vnfreq:network-params>
- <param name="shared">1</param>
- <param name="external">0</param>
- </vnfreq:network-params>
- </vnfreq:network-request>
-</rest:payload>"""
-
- String expectedXMLNetworkInputs =
-"""<vnfreq:network-inputs xmlns:vnfreq="http://org.openecomp/mso/infra/vnf-request/v1">
- <vnfreq:network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</vnfreq:network-id>
- <vnfreq:network-name>MNS-25180-L-01-dmz_direct_net_1</vnfreq:network-name>
- <vnfreq:network-type>CONTRAIL_EXTERNAL</vnfreq:network-type>
- <vnfreq:service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</vnfreq:service-id>
- <vnfreq:aic-cloud-region>RDM2WAGPLCP</vnfreq:aic-cloud-region>
- <vnfreq:tenant-id>7dd5365547234ee8937416c65507d266</vnfreq:tenant-id>
- <vnfreq:physicalNetworkName>dvs-slcp3-01</vnfreq:physicalNetworkName>
- <vnfreq:vlans>3008</vnfreq:vlans>
- <vnfreq:service-instance-id>MNS-25180-L-01-dmz_direct_net_1</vnfreq:service-instance-id>
- <vnfreq:backout-on-failure>true</vnfreq:backout-on-failure>
-</vnfreq:network-inputs>"""
-
- String networkXMLOutputs =
-""""""
-
-// ---- End XML Zone ----
-
-// ---- Start JSON Zone ----
- // JSON format Input
- String jsonIncomingRequest =
- """{ "requestDetails": {
- "modelInfo": {
- "modelType": "network",
- "modelCustomizationId": "f21df226-8093-48c3-be7e-0408fcda0422",
- "modelName": "CONTRAIL_EXTERNAL",
- "modelVersion": "1.0"
- },
- "cloudConfiguration": {
- "lcpCloudRegionId": "RDM2WAGPLCP",
- "tenantId": "7dd5365547234ee8937416c65507d266"
- },
- "requestInfo": {
- "instanceName": "MNS-25180-L-01-dmz_direct_net_1",
- "source": "VID",
- "callbackUrl": "",
- "suppressRollback": true,
- "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"
- },
- "relatedInstanceList": [
- {
- "relatedInstance": {
- "instanceId": "f70e927b-6087-4974-9ef8-c5e4d5847ca4",
- "modelInfo": {
- "modelType": "serviceT",
- "modelId": "modelI",
- "modelNameVersionId": "modelNameVersionI",
- "modelName": "modleNam",
- "modelVersion": "1"
- }
- }
- }
- ],
- "requestParameters": {
- "userParams": [
- {
- "name": "someUserParam1",
- "value": "someValue1"
- }
- ]
- }
- }}"""
-
- String expectedJSONNetworkRequest =
- """<network-request xmlns="http://www.w3.org/2001/XMLSchema">
- <request-info>
- <request-id>null</request-id>
- <action>CREATE</action>
- <source>VID</source>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- </request-info>
- <network-inputs>
- <network-id>networkId</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <modelCustomizationId>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationId>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <backout-on-failure>false</backout-on-failure>
- <sdncVersion>1610</sdncVersion>
- </network-inputs>
- <network-params>
- <param name="some_user_param1">someValue1</param>
- </network-params>
-</network-request>"""
-
- String expectedJSONNetworkInputs =
-"""<network-inputs xmlns="http://www.w3.org/2001/XMLSchema">
- <network-id>networkId</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <modelCustomizationId>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationId>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <backout-on-failure>false</backout-on-failure>
- <sdncVersion>1610</sdncVersion>
-</network-inputs>"""
-
- String networkJSONOutputs =
-"""<network-outputs>
- <network-id>networkId</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- </network-outputs>"""
-
-// ---- End JSON Zone ----
-
-// ---- Start vPIR Zone ----
- // expectedNetworkRequest
- String expectedvIPRNetworkRequest =
- """<network-request xmlns="http://www.w3.org/2001/XMLSchema">
- <request-info>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <action>CREATE</action>
- <source>VID</source>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- </request-info>
- <network-inputs>
- <network-id>networkId</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <subscription-service-type>MSO-dev-service-type</subscription-service-type>
- <global-customer-id>globalId_45678905678</global-customer-id>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <backout-on-failure>false</backout-on-failure>
- <failIfExist>false</failIfExist>
- <networkModelInfo>
- <modelName>CONTRAIL_EXTERNAL</modelName>
- <modelUuid>sn5256d1-5a33-55df-13ab-12abad84e111</modelUuid>
- <modelInvariantUuid>sn5256d1-5a33-55df-13ab-12abad84e764</modelInvariantUuid>
- <modelVersion>1</modelVersion>
- <modelCustomizationUuid>sn5256d1-5a33-55df-13ab-12abad84e222</modelCustomizationUuid>
- </networkModelInfo>
- <serviceModelInfo>
- <modelName>HNGW Protected OAM</modelName>
- <modelUuid>36a3a8ea-49a6-4ac8-b06c-89a54544b9b6</modelUuid>
- <modelInvariantUuid>fcc85cb0-ad74-45d7-a5a1-17c8744fdb71</modelInvariantUuid>
- <modelVersion>1.0</modelVersion>
- <modelCustomizationUuid/>
- </serviceModelInfo>
- <sdncVersion>1702</sdncVersion>
- </network-inputs>
- <network-params/>
-</network-request>"""
-
- String expectedvIPRNetworkInputs =
-"""<network-inputs xmlns="http://www.w3.org/2001/XMLSchema">
- <network-id>networkId</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <subscription-service-type>MSO-dev-service-type</subscription-service-type>
- <global-customer-id>globalId_45678905678</global-customer-id>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <backout-on-failure>false</backout-on-failure>
- <failIfExist>false</failIfExist>
- <networkModelInfo>
- <modelName>CONTRAIL_EXTERNAL</modelName>
- <modelUuid>sn5256d1-5a33-55df-13ab-12abad84e111</modelUuid>
- <modelInvariantUuid>sn5256d1-5a33-55df-13ab-12abad84e764</modelInvariantUuid>
- <modelVersion>1</modelVersion>
- <modelCustomizationUuid>sn5256d1-5a33-55df-13ab-12abad84e222</modelCustomizationUuid>
- </networkModelInfo>
- <serviceModelInfo>
- <modelName>HNGW Protected OAM</modelName>
- <modelUuid>36a3a8ea-49a6-4ac8-b06c-89a54544b9b6</modelUuid>
- <modelInvariantUuid>fcc85cb0-ad74-45d7-a5a1-17c8744fdb71</modelInvariantUuid>
- <modelVersion>1.0</modelVersion>
- <modelCustomizationUuid/>
- </serviceModelInfo>
- <sdncVersion>1702</sdncVersion>
-</network-inputs>"""
-
- String networkvIPROutputs =
-"""<network-outputs>
- <network-id>networkId</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- </network-outputs>"""
-
-// ---- End vPIR Zone ----
-
- String vnfRequestFakeRegion =
- """<vnfreq:network-request xmlns:vnfreq="http://org.openecomp/mso/infra/vnf-request/v1">
- <vnfreq:request-info>
- <vnfreq:request-id>1ef47428-cade-45bd-a103-0751e8b2deb0</vnfreq:request-id>
- <vnfreq:action>CREATE</vnfreq:action>
- <vnfreq:source>PORTAL</vnfreq:source>
- </vnfreq:request-info>
- <vnfreq:network-inputs>
- <vnfreq:network-name>MNS-25180-L-01-dmz_direct_net_1</vnfreq:network-name>
- <vnfreq:network-type>CONTRAIL_EXTERNAL</vnfreq:network-type>
- <subscriptionServiceType>MSO-dev-service-type</subscriptionServiceType>
- <vnfreq:service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</vnfreq:service-id>
- <vnfreq:aic-cloud-region>MDTWNJ21</vnfreq:aic-cloud-region>
- <vnfreq:tenant-id>7dd5365547234ee8937416c65507d266</vnfreq:tenant-id>
- </vnfreq:network-inputs>
- <vnfreq:network-params>
- <param name="shared">1</param>
- <param name="external">0</param>
- </vnfreq:network-params>
-</vnfreq:network-request>"""
-
- // expectedNetworkRequest
- String expectedNetworkRequest_Outputs =
- """<vnfreq:network-request xmlns:vnfreq="http://org.openecomp/mso/infra/vnf-request/v1">
- <vnfreq:request-info>
- <vnfreq:request-id>1ef47428-cade-45bd-a103-0751e8b2deb0</vnfreq:request-id>
- <vnfreq:action>CREATE</vnfreq:action>
- <vnfreq:source>PORTAL</vnfreq:source>
- </vnfreq:request-info>
- <vnfreq:network-inputs>
- <vnfreq:network-name>MNS-25180-L-01-dmz_direct_net_1</vnfreq:network-name>
- <vnfreq:network-type>CONTRAIL_EXTERNAL</vnfreq:network-type>
- <subscriptionServiceType>MSO-dev-service-type</subscriptionServiceType>
- <vnfreq:service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</vnfreq:service-id>
- <vnfreq:aic-cloud-region>RDM2WAGPLCP</vnfreq:aic-cloud-region>
- <vnfreq:tenant-id>7dd5365547234ee8937416c65507d266</vnfreq:tenant-id>
- </vnfreq:network-inputs>
- <vnfreq:network-outputs>
- <vnfreq:network-name>MNS-25180-L-01-dmz_direct_net_1</vnfreq:network-name>
- <vnfreq:network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</vnfreq:network-id>
- </vnfreq:network-outputs>
- <vnfreq:network-params>
- <param name="shared">1</param>
- <param name="external">0</param>
- </vnfreq:network-params>
-</vnfreq:network-request>"""
-
-
- // expectedNetworkRequest
- String networkInputs_404 =
- """<network-inputs xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
- <network-name>myOwn_Network</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
- </network-inputs>"""
-
- String networkInputs =
- """<network-inputs xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
-</network-inputs>"""
-
-
-
- String queryAAIResponse =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v3">
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name>HSL_direct_net_2</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>contrail</network-technology>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <orchestration-status>pending-create</orchestration-status>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-create</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <relationship-list/>
- </subnet>
- </subnets>
- <relationship-list>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </l3-network>
- </rest:payload>
-</rest:RESTResponse>"""
-
- String queryIdAIIResponse =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v6">
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>Contrail</network-technology>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <resource-version>l3-version</resource-version>
- <orchestration-status>pending-create</orchestration-status>
- <physical-network-name>networkName</physical-network-name>
- <is-provider-network>false</is-provider-network>
- <is-shared-network>true</is-shared-network>
- <is-external-network>false</is-external-network>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-create</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <subnet-name>subnetName</subnet-name>
- <ip-assignment-direction>true</ip-assignment-direction>
- <host-routes>
- <host-route>
- <host-route-id>string</host-route-id>
- <route-prefix>192.10.16.0/24</route-prefix>
- <next-hop>192.10.16.100/24</next-hop>
- <next-hop-type>ip-address</next-hop-type>
- <resource-version>1505857301954</resource-version>
- </host-route>
- <host-route>
- <host-route-id>string</host-route-id>
- <route-prefix>192.110.17.0/24</route-prefix>
- <next-hop>192.110.17.110/24</next-hop>
- <next-hop-type>ip-address</next-hop-type>
- <resource-version>1505857301954</resource-version>
- </host-route>
- </host-routes>
- <relationship-list/>
- </subnet>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-create</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <subnet-name>subnetName</subnet-name>
- <ip-assignment-direction>true</ip-assignment-direction>
- <host-routes>
- <host-route>
- <host-route-id>string</host-route-id>
- <route-prefix>192.10.16.0/24</route-prefix>
- <next-hop>192.10.16.100/24</next-hop>
- <next-hop-type>ip-address</next-hop-type>
- <resource-version>1505857301954</resource-version>
- </host-route>
- </host-routes>
- <relationship-list/>
- </subnet>
- </subnets>
- <segmentation-assignments>
- <segmentation-id>414</segmentation-id>
- <resource-version>4132176</resource-version>
- </segmentation-assignments>
- <segmentation-assignments>
- <segmentation-id>415</segmentation-id>
- <resource-version>4132176</resource-version>
- </segmentation-assignments>
- <ctag-assignments>
- <ctag-assignment>
- <vlan-id-inner>inner</vlan-id-inner>
- <resource-version>ctag-version</resource-version>
- <relationship-list>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/897deadc2b954a6bac6d3c197fb3525e/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>897deadc2b954a6bac6d3c197fb3525e</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>tenant.tenant-name</property-key>
- <property-value>MSOTest1</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/a290b841-f672-44dd-b9cd-6f8c20d7d8c8/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>a290b841-f672-44dd-b9cd-6f8c20d7d8c8</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vpn-binding.vpn-name</property-key>
- <property-value>oam_protected_net_6_MTN5_msotest2</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/24a4b507-853a-4a38-99aa-05fcc54be24d/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>24a4b507-853a-4a38-99aa-05fcc54be24d</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vpn-binding.vpn-name</property-key>
- <property-value>oam_protected_net_6_MTN5_msotest1</property-value>
- </related-to-property>
- </relationship>
- </relationship-list>
- </ctag-assignment>
- </ctag-assignments>
- <relationship-list>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>network-policy</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg</related-link>
- <relationship-data>
- <relationship-key>network-policy.network-policy-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0cg</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN1</related-link>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN2</related-link>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </l3-network>
- </rest:payload>
-</rest:RESTResponse>"""
-
-String queryIdAIIResponse_AlaCarte =
-"""<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v6">
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>Contrail</network-technology>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <resource-version>l3-version</resource-version>
- <orchestration-status>pending-create</orchestration-status>
- <physical-network-name>networkName</physical-network-name>
- <is-provider-network>false</is-provider-network>
- <is-shared-network>true</is-shared-network>
- <is-external-network>false</is-external-network>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-create</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <subnet-name>subnetName</subnet-name>
- <relationship-list/>
- </subnet>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-create</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <subnet-name>subnetName</subnet-name>
- <relationship-list/>
- </subnet>
- </subnets>
- <segmentation-assignments>
- <segmentation-id>414</segmentation-id>
- <resource-version>4132176</resource-version>
- </segmentation-assignments>
- <segmentation-assignments>
- <segmentation-id>415</segmentation-id>
- <resource-version>4132176</resource-version>
- </segmentation-assignments>
- <ctag-assignments>
- <ctag-assignment>
- <vlan-id-inner>inner</vlan-id-inner>
- <resource-version>ctag-version</resource-version>
- <relationship-list>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/897deadc2b954a6bac6d3c197fb3525e/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>897deadc2b954a6bac6d3c197fb3525e</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>tenant.tenant-name</property-key>
- <property-value>MSOTest1</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/a290b841-f672-44dd-b9cd-6f8c20d7d8c8/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>a290b841-f672-44dd-b9cd-6f8c20d7d8c8</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vpn-binding.vpn-name</property-key>
- <property-value>oam_protected_net_6_MTN5_msotest2</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/24a4b507-853a-4a38-99aa-05fcc54be24d/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>24a4b507-853a-4a38-99aa-05fcc54be24d</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vpn-binding.vpn-name</property-key>
- <property-value>oam_protected_net_6_MTN5_msotest1</property-value>
- </related-to-property>
- </relationship>
- </relationship-list>
- </ctag-assignment>
- </ctag-assignments>
- <relationship-list>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>network-policy</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg</related-link>
- <relationship-data>
- <relationship-key>network-policy.network-policy-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0cg</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN1</related-link>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN2</related-link>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </l3-network>
- </rest:payload>
-</rest:RESTResponse>"""
-
-String queryIdAIIResponse_segmentation =
-"""<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v6">
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>Contrail</network-technology>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <resource-version>l3-version</resource-version>
- <orchestration-status>pending-create</orchestration-status>
- <physical-network-name>networkName</physical-network-name>
- <is-provider-network>false</is-provider-network>
- <is-shared-network>true</is-shared-network>
- <is-external-network>false</is-external-network>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-create</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <subnet-name>subnetName</subnet-name>
- <relationship-list/>
- </subnet>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-create</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <subnet-name>subnetName</subnet-name>
- <relationship-list/>
- </subnet>
- </subnets>
- <segmentation-assignments>
- <segmentation-assignment>
- <segmentation-id>1</segmentation-id>
- <resource-version>1498507569188</resource-version>
- </segmentation-assignment>
- </segmentation-assignments>
- <ctag-assignments>
- <ctag-assignment>
- <vlan-id-inner>inner</vlan-id-inner>
- <resource-version>ctag-version</resource-version>
- <relationship-list>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/897deadc2b954a6bac6d3c197fb3525e/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>897deadc2b954a6bac6d3c197fb3525e</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>tenant.tenant-name</property-key>
- <property-value>MSOTest1</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/a290b841-f672-44dd-b9cd-6f8c20d7d8c8/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>a290b841-f672-44dd-b9cd-6f8c20d7d8c8</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vpn-binding.vpn-name</property-key>
- <property-value>oam_protected_net_6_MTN5_msotest2</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/24a4b507-853a-4a38-99aa-05fcc54be24d/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>24a4b507-853a-4a38-99aa-05fcc54be24d</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vpn-binding.vpn-name</property-key>
- <property-value>oam_protected_net_6_MTN5_msotest1</property-value>
- </related-to-property>
- </relationship>
- </relationship-list>
- </ctag-assignment>
- </ctag-assignments>
- <relationship-list>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>network-policy</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg</related-link>
- <relationship-data>
- <relationship-key>network-policy.network-policy-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0cg</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN1</related-link>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN2</related-link>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </l3-network>
- </rest:payload>
-</rest:RESTResponse>"""
-
-String queryIdAIIResponse_Ipv4 =
-"""<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v6">
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>Contrail</network-technology>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <resource-version>l3-version</resource-version>
- <orchestration-status>pending-create</orchestration-status>
- <physical-network-name>networkName</physical-network-name>
- <is-provider-network>false</is-provider-network>
- <is-shared-network>true</is-shared-network>
- <is-external-network>false</is-external-network>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>ipv4</ip-version>
- <orchestration-status>pending-create</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <subnet-name>subnetName</subnet-name>
- <relationship-list/>
- </subnet>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>ipv4</ip-version>
- <orchestration-status>pending-create</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <subnet-name>subnetName</subnet-name>
- <relationship-list/>
- </subnet>
- </subnets>
- <segmentation-assignments>
- <segmentation-id>414</segmentation-id>
- <resource-version>4132176</resource-version>
- </segmentation-assignments>
- <segmentation-assignments>
- <segmentation-id>415</segmentation-id>
- <resource-version>4132176</resource-version>
- </segmentation-assignments>
- <ctag-assignments>
- <ctag-assignment>
- <vlan-id-inner>inner</vlan-id-inner>
- <resource-version>ctag-version</resource-version>
- <relationship-list>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/897deadc2b954a6bac6d3c197fb3525e/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>897deadc2b954a6bac6d3c197fb3525e</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>tenant.tenant-name</property-key>
- <property-value>MSOTest1</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/a290b841-f672-44dd-b9cd-6f8c20d7d8c8/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>a290b841-f672-44dd-b9cd-6f8c20d7d8c8</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vpn-binding.vpn-name</property-key>
- <property-value>oam_protected_net_6_MTN5_msotest2</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/24a4b507-853a-4a38-99aa-05fcc54be24d/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>24a4b507-853a-4a38-99aa-05fcc54be24d</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vpn-binding.vpn-name</property-key>
- <property-value>oam_protected_net_6_MTN5_msotest1</property-value>
- </related-to-property>
- </relationship>
- </relationship-list>
- </ctag-assignment>
- </ctag-assignments>
- <relationship-list>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>network-policy</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg</related-link>
- <relationship-data>
- <relationship-key>network-policy.network-policy-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0cg</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN1</related-link>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN2</related-link>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </l3-network>
- </rest:payload>
-</rest:RESTResponse>"""
-
-String queryIdAIIResponse_SRIOV =
-"""<?xml version="1.0" encoding="UTF-8"?>
-<l3-network xmlns="http://org.openecomp.aai.inventory/v8">
- <network-id>6cb1ae5a-d2db-4eb6-97bf-d52a506a53d8</network-id>
- <network-name>MSO_TEST_1702_A_HnportalProviderNetwork.HNPortalPROVIDERNETWORK.SR_IOV_Provider2_1_net_17</network-name>
- <network-type>SR_IOV_Provider2_1</network-type>
- <network-role>HnportalProviderNetwork.HNPortalPROVIDERNETWORK.SR_IOV_Provider2_1</network-role>
- <network-technology>AIC_SR_IOV</network-technology>
- <is-bound-to-vpn>false</is-bound-to-vpn>
- <service-id/>
- <resource-version>1487336177672</resource-version>
- <orchestration-status>PendingCreate</orchestration-status>
- <persona-model-id>f70d7a32-0ac8-4bd5-a0fb-3c9336540d78</persona-model-id>
- <persona-model-version>1.0</persona-model-version>
- <physical-network-name>Physnet21</physical-network-name>
- <is-provider-network>true</is-provider-network>
- <is-shared-network>false</is-shared-network>
- <is-external-network>false</is-external-network>
- <subnets>
- <subnet>
- <subnet-id>10437</subnet-id>
- <subnet-name>MSO_TEST_1702_A_HnportalProviderNetwork.HNPortalPROVIDERNETWORK.SR_IOV_Provider2_1_net_17_S0</subnet-name>
- <gateway-address>192.168.6.1</gateway-address>
- <network-start-address>192.168.6.0</network-start-address>
- <cidr-mask>26</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>PendingCreate</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <dhcp-start>192.168.6.3</dhcp-start>
- <dhcp-end>192.168.6.62</dhcp-end>
- <resource-version>1487336177359</resource-version>
- </subnet>
- </subnets>
- <relationship-list>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mtn16/tenants/tenant/6accefef3cb442ff9e644d589fb04107</related-link>
- <relationship-data>
- <relationship-key>cloud-region.cloud-owner</relationship-key>
- <relationship-value>att-aic</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-region-id</relationship-key>
- <relationship-value>mtn16</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>6accefef3cb442ff9e644d589fb04107</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>tenant.tenant-name</property-key>
- <property-value>MSO_TEST_1702_A</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>cloud-region</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mtn16</related-link>
- <relationship-data>
- <relationship-key>cloud-region.cloud-owner</relationship-key>
- <relationship-value>att-aic</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-region-id</relationship-key>
- <relationship-value>mtn16</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>cloud-region.owner-defined-type</property-key>
- <property-value>lcp</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>service-instance</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/business/customers/customer/MSO_1610_ST/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/51d8336b-a993-4afe-a5fc-10b3afbd6560</related-link>
- <relationship-data>
- <relationship-key>customer.global-customer-id</relationship-key>
- <relationship-value>MSO_1610_ST</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>service-subscription.service-type</relationship-key>
- <relationship-value>MSO-dev-service-type</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>service-instance.service-instance-id</relationship-key>
- <relationship-value>51d8336b-a993-4afe-a5fc-10b3afbd6560</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>service-instance.service-instance-name</property-key>
- <property-value>HnportalProviderNetwork_17</property-value>
- </related-to-property>
- </relationship>
- </relationship-list>
-</l3-network>"""
-
- String queryIdAIIResponseTestScenario01 =
- """<?xml version="1.0" encoding="UTF-8"?>
-<l3-network xmlns="http://org.openecomp.aai.inventory/v7">
- <network-id>4da55fe4-7a9e-478c-a434-8a98d62265ab</network-id>
- <network-name>GN_EVPN_direct_net_0_ST1</network-name>
- <network-type>CONTRAIL30_BASIC</network-type>
- <network-role>GN_EVPN_direct</network-role>
- <network-technology>contrail</network-technology>
- <is-bound-to-vpn>false</is-bound-to-vpn>
- <service-id>9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <resource-version>1465398611</resource-version>
- <orchestration-status>pending-create</orchestration-status>
- <physical-network-name>networkName</physical-network-name>
- <is-provider-network>false</is-provider-network>
- <is-shared-network>true</is-shared-network>
- <is-external-network>false</is-external-network>
- <subnets>
- <subnet>
- <subnet-id>cb1a7b47-5428-44c9-89c2-8b17541c3228</subnet-id>
- <gateway-address>108.239.40.1</gateway-address>
- <network-start-address>108.239.40.0</network-start-address>
- <cidr-mask>28</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-create</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <dhcp-start>108.239.40.0</dhcp-start>
- <dhcp-end>108.239.40.0</dhcp-end>
- <resource-version>1465398611</resource-version>
- <subnet-name>subnetName</subnet-name>
- <relationship-list />
- </subnet>
- <subnet>
- <subnet-id>e2cc7c14-90f0-4205-840d-b4e07f04e621</subnet-id>
- <gateway-address>2606:ae00:2e01:604::1</gateway-address>
- <network-start-address>2606:ae00:2e01:604::</network-start-address>
- <cidr-mask>64</cidr-mask>
- <ip-version>6</ip-version>
- <orchestration-status>pending-create</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <dhcp-start>2606:ae00:2e01:604::</dhcp-start>
- <dhcp-end>2606:ae00:2e01:604::</dhcp-end>
- <resource-version>1465398611</resource-version>
- <subnet-name>subnetName</subnet-name>
- <relationship-list />
- </subnet>
- </subnets>
- <ctag-assignments />
- <segmentation-assignments>
- <segmentation-id>416</segmentation-id>
- <resource-version>4132176</resource-version>
- </segmentation-assignments>
- <relationship-list>
- <relationship>
- <related-to>cloud-region</related-to>
- <related-link>https://mtanjv9aaas03.aic.cip.com:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/
- </related-link>
- <relationship-data>
- <relationship-key>cloud-region.cloud-region-id</relationship-key>
- <relationship-value>AAIAIC25</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-owner</relationship-key>
- <relationship-value>att-aic</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>cloud-region.owner-defined-type</property-key>
- <property-value></property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://mtanjv9aaas03.aic.cip.com:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/tenants/tenant/4ae1d3446a4c48b2bec44b6cfba06d68/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>4ae1d3446a4c48b2bec44b6cfba06d68
- </relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-owner</relationship-key>
- <relationship-value>att-aic</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-region-id</relationship-key>
- <relationship-value>AAIAIC25</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>tenant.tenant-name</property-key>
- <property-value>Ruchira Contrail 3.0 test</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://mtanjv9aaas03.aic.cip.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>9a7b327d9-287aa00-82c4b0-100001</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vpn-binding.vpn-name</property-key>
- <property-value>GN_EVPN_direct_net_0_ST1</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN1</related-link>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN2</related-link>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
-</l3-network>"""
-
- String queryIdAIIResponseVpnNotPresent =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v8">
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>contrail</network-technology>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <orchestration-status>pending-create</orchestration-status>
- <physical-network-name>networkName</physical-network-name>
- <is-provider-network>false</is-provider-network>
- <is-shared-network>true</is-shared-network>
- <is-external-network>false</is-external-network>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-create</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <subnet-name>subnetName</subnet-name>
- <relationship-list/>
- </subnet>
- </subnets>
- <relationship-list/>
- </l3-network>
- </rest:payload>
-</rest:RESTResponse>"""
-
- String queryNameAIIResponse =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v6">
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>contrail</network-technology>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <orchestration-status>pending-create</orchestration-status>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-create</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <relationship-list/>
- </subnet>
- </subnets>
- <relationship-list>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </l3-network>
- </rest:payload>
- </rest:RESTResponse>"""
-
- String queryNameAIIResponseVpnNotPresent =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v6>
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>contrail</network-technology>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <orchestration-status>pending-create</orchestration-status>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-create</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <relationship-list/>
- </subnet>
- </subnets>
- </l3-network>
- </rest:payload>
- </rest:RESTResponse>"""
-
- String aaiVpnResponseStub =
- """<rest:payload xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- xmlns="http://org.openecomp.aai.inventory/v8"
- contentType="text/xml">
- <vpn-binding>
- <global-route-target/>
- </vpn-binding>
-</rest:payload>"""
-
- String queryVpnBindingAAIResponse =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Mon,14 Mar 2016 20:53:33 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID"
- value="mtcnjv9aaas01.mtcnj.aic.cip.com-20160314-20:53:33:487-134392"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <vpn-binding xmlns="http://org.openecomp.aai.inventory/v6">
- <vpn-id>9a7b327d9-287aa00-82c4b0-105757</vpn-id>
- <vpn-name>GN_EVPN_Test</vpn-name>
- <global-route-target>13979:105757</global-route-target>
- <relationship-list>
- <relationship>
- <related-to>l3-network</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/689ec39e-c5fc-4462-8db2-4f760763ad28/</related-link>
- <relationship-data>
- <relationship-key>l3-network.network-id</relationship-key>
- <relationship-value>689ec39e-c5fc-4462-8db2-4f760763ad28</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>l3-network</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/1a49396b-19b3-40a4-8792-aa2fbd0f0704/</related-link>
- <relationship-data>
- <relationship-key>l3-network.network-id</relationship-key>
- <relationship-value>1a49396b-19b3-40a4-8792-aa2fbd0f0704</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>l3-network</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/774f3329-3c83-4771-86c7-9e6207cd50fd/</related-link>
- <relationship-data>
- <relationship-key>l3-network.network-id</relationship-key>
- <relationship-value>774f3329-3c83-4771-86c7-9e6207cd50fd</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </vpn-binding>
- </rest:payload>
-</rest:RESTResponse>"""
-
- String createDBRequestError01 =
- """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
- <soapenv:Header/>
- <soapenv:Body>
- <ns:updateInfraRequest xmlns:ns="http://org.openecomp.mso/requestsdb">
- <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
- <lastModifiedBy>BPMN</lastModifiedBy>
- <statusMessage>Received error unexpectedly from SDN-C.</statusMessage>
- <responseBody></responseBody>
- <requestStatus>FAILED</requestStatus>
- <vnfOutputs><network-id></network-id><network-name></network-names></vnfOutputs>
- </ns:updateInfraRequest>
- </soapenv:Body>
- </soapenv:Envelope>"""
-
- String createDBRequest_Outputs =
- """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:ns="http://org.openecomp.mso/requestsdb">
- <soapenv:Header/>
- <soapenv:Body>
- <ns:updateInfraRequest>
- <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
- <lastModifiedBy>BPMN</lastModifiedBy>
- <statusMessage>Network successfully created.</statusMessage>
- <responseBody/>
- <requestStatus>COMPLETED</requestStatus>
- <progress>100</progress>
- <vnfOutputs><network-id>networkId</network-id><network-name>MNS-25180-L-01-dmz_direct_net_1</network-names></vnfOutputs>
- <networkId>networkId</networkId>
- </ns:updateInfraRequest>
- </soapenv:Body>
-</soapenv:Envelope>"""
-
- String createNetworkRequest =
- """<createNetworkRequest>
- <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
- <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
- <networkId>49c86598-f766-46f8-84f8-8d1c1b10f9b4</networkId>
- <networkName>MNS-25180-L-01-dmz_direct_net_1</networkName>
- <networkType>CONTRAIL_EXTERNAL</networkType>
- <modelCustomizationUuid>sn5256d1-5a33-55df-13ab-12abad84e222</modelCustomizationUuid>
- <networkTechnology>CONTRAIL</networkTechnology>
- <providerVlanNetwork>
- <physicalNetworkName>networkName</physicalNetworkName>
- <vlans>414,415</vlans>
- </providerVlanNetwork>
- <contrailNetwork>
- <shared>true</shared>
- <external>false</external>
- <routeTargets>13979:105757</routeTargets>
- <routeTargets>13979:105757</routeTargets>
- <policyFqdns>GN_EVPN_Test</policyFqdns>
- <routeTableFqdns>refFQDN1</routeTableFqdns>
- <routeTableFqdns>refFQDN2</routeTableFqdns>
- </contrailNetwork>
- <subnets>
- <allocationPools>
- <start/>
- <end/>
- </allocationPools>
- <cidr>107.239.52.0/24</cidr>
- <enableDHCP>true</enableDHCP>
- <gatewayIp>107.239.52.1</gatewayIp>
- <ipVersion>4</ipVersion>
- <subnetId>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnetId>
- <subnetName>subnetName</subnetName>
- <addrFromStart>true</addrFromStart>
- <hostRoutes>
- <prefix>192.10.16.0/24</prefix>
- <nextHop>192.10.16.100/24</nextHop>
- </hostRoutes>
- <hostRoutes>
- <prefix>192.110.17.0/24</prefix>
- <nextHop>192.110.17.110/24</nextHop>
- </hostRoutes>
- </subnets>
- <subnets>
- <allocationPools>
- <start/>
- <end/>
- </allocationPools>
- <cidr>107.239.52.0/24</cidr>
- <enableDHCP>true</enableDHCP>
- <gatewayIp>107.239.52.1</gatewayIp>
- <ipVersion>4</ipVersion>
- <subnetId>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnetId>
- <subnetName>subnetName</subnetName>
- <addrFromStart>true</addrFromStart>
- <hostRoutes>
- <prefix>192.10.16.0/24</prefix>
- <nextHop>192.10.16.100/24</nextHop>
- </hostRoutes>
- </subnets>
- <skipAAI>true</skipAAI>
- <backout>true</backout>
- <failIfExists>false</failIfExists>
- <msoRequest>
- <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
- <serviceInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</serviceInstanceId>
- </msoRequest>
- <messageId>messageId_generated</messageId>
- <notificationUrl/>
-</createNetworkRequest>"""
-
-String createNetworkRequest_Ipv4 =
-"""<createNetworkRequest>
- <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
- <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
- <networkId>49c86598-f766-46f8-84f8-8d1c1b10f9b4</networkId>
- <networkName>MNS-25180-L-01-dmz_direct_net_1</networkName>
- <networkType>CONTRAIL_EXTERNAL</networkType>
- <modelCustomizationUuid>sn5256d1-5a33-55df-13ab-12abad84e222</modelCustomizationUuid>
- <networkTechnology>CONTRAIL</networkTechnology>
- <providerVlanNetwork>
- <physicalNetworkName>networkName</physicalNetworkName>
- <vlans>414,415</vlans>
- </providerVlanNetwork>
- <contrailNetwork>
- <shared>true</shared>
- <external>false</external>
- <routeTargets>13979:105757</routeTargets>
- <routeTargets>13979:105757</routeTargets>
- <policyFqdns>GN_EVPN_Test</policyFqdns>
- <routeTableFqdns>refFQDN1</routeTableFqdns>
- <routeTableFqdns>refFQDN2</routeTableFqdns>
- </contrailNetwork>
- <subnets>
- <allocationPools>
- <start/>
- <end/>
- </allocationPools>
- <cidr>107.239.52.0/24</cidr>
- <enableDHCP>true</enableDHCP>
- <gatewayIp>107.239.52.1</gatewayIp>
- <ipVersion>4</ipVersion>
- <subnetId>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnetId>
- <subnetName>subnetName</subnetName>
- </subnets>
- <subnets>
- <allocationPools>
- <start/>
- <end/>
- </allocationPools>
- <cidr>107.239.52.0/24</cidr>
- <enableDHCP>true</enableDHCP>
- <gatewayIp>107.239.52.1</gatewayIp>
- <ipVersion>4</ipVersion>
- <subnetId>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnetId>
- <subnetName>subnetName</subnetName>
- </subnets>
- <skipAAI>true</skipAAI>
- <backout>true</backout>
- <failIfExists>false</failIfExists>
- <msoRequest>
- <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
- <serviceInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</serviceInstanceId>
- </msoRequest>
- <messageId>messageId_generated</messageId>
- <notificationUrl/>
-</createNetworkRequest>"""
-
-String createNetworkRequestAlaCarte =
-"""<createNetworkRequest>
- <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
- <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
- <networkId>49c86598-f766-46f8-84f8-8d1c1b10f9b4</networkId>
- <networkName>MNS-25180-L-01-dmz_direct_net_1</networkName>
- <networkType>CONTRAIL_EXTERNAL</networkType>
- <modelCustomizationUuid>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationUuid>
- <networkTechnology>CONTRAIL</networkTechnology>
- <providerVlanNetwork>
- <physicalNetworkName>networkName</physicalNetworkName>
- <vlans>414,415</vlans>
- </providerVlanNetwork>
- <contrailNetwork>
- <shared>true</shared>
- <external>false</external>
- <routeTargets>13979:105757</routeTargets>
- <routeTargets>13979:105757</routeTargets>
- <policyFqdns>GN_EVPN_Test</policyFqdns>
- <routeTableFqdns>refFQDN1</routeTableFqdns>
- <routeTableFqdns>refFQDN2</routeTableFqdns>
- </contrailNetwork>
- <subnets>
- <allocationPools>
- <start/>
- <end/>
- </allocationPools>
- <cidr>107.239.52.0/24</cidr>
- <enableDHCP>true</enableDHCP>
- <gatewayIp>107.239.52.1</gatewayIp>
- <ipVersion>4</ipVersion>
- <subnetId>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnetId>
- <subnetName>subnetName</subnetName>
- </subnets>
- <subnets>
- <allocationPools>
- <start/>
- <end/>
- </allocationPools>
- <cidr>107.239.52.0/24</cidr>
- <enableDHCP>true</enableDHCP>
- <gatewayIp>107.239.52.1</gatewayIp>
- <ipVersion>4</ipVersion>
- <subnetId>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnetId>
- <subnetName>subnetName</subnetName>
- </subnets>
- <skipAAI>true</skipAAI>
- <backout>true</backout>
- <failIfExists>false</failIfExists>
- <networkParams>
- <some_user_param1>someValue1</some_user_param1>
- </networkParams>
- <msoRequest>
- <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
- <serviceInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</serviceInstanceId>
- </msoRequest>
- <messageId>messageId_generated</messageId>
- <notificationUrl/>
-</createNetworkRequest>"""
-
-String createNetworkRequest_SRIOV =
-"""<createNetworkRequest>
- <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
- <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
- <networkId>6cb1ae5a-d2db-4eb6-97bf-d52a506a53d8</networkId>
- <networkName>MSO_TEST_1702_A_HnportalProviderNetwork.HNPortalPROVIDERNETWORK.SR_IOV_Provider2_1_net_17</networkName>
- <networkType>CONTRAIL_EXTERNAL</networkType>
- <modelCustomizationUuid>sn5256d1-5a33-55df-13ab-12abad84e222</modelCustomizationUuid>
- <networkTechnology>AIC_SR_IOV</networkTechnology>
- <providerVlanNetwork>
- <physicalNetworkName>Physnet21</physicalNetworkName>
- <vlans/>
- </providerVlanNetwork>
- <subnets>
- <allocationPools>
- <start>192.168.6.3</start>
- <end>192.168.6.62</end>
- </allocationPools>
- <cidr>192.168.6.0/26</cidr>
- <enableDHCP>true</enableDHCP>
- <gatewayIp>192.168.6.1</gatewayIp>
- <ipVersion>4</ipVersion>
- <subnetId>10437</subnetId>
- <subnetName>MSO_TEST_1702_A_HnportalProviderNetwork.HNPortalPROVIDERNETWORK.SR_IOV_Provider2_1_net_17_S0</subnetName>
- </subnets>
- <skipAAI>true</skipAAI>
- <backout>true</backout>
- <failIfExists>false</failIfExists>
- <msoRequest>
- <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
- <serviceInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</serviceInstanceId>
- </msoRequest>
- <messageId>messageId_generated</messageId>
- <notificationUrl/>
-</createNetworkRequest>"""
-
- String createNetworkRequest_noPhysicalName =
- """<createNetworkRequest>
- <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
- <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
- <networkId>49c86598-f766-46f8-84f8-8d1c1b10f9b4</networkId>
- <networkName>MNS-25180-L-01-dmz_direct_net_1</networkName>
- <networkType>CONTRAIL_EXTERNAL</networkType>
- <networkTechnology>CONTRAIL</networkTechnology>
- <providerVlanNetwork>
- <physicalNetworkName>networkName</physicalNetworkName>
- <vlans>414,415</vlans>
- </providerVlanNetwork>
- <contrailNetwork>
- <shared>true</shared>
- <external>false</external>
- <routeTargets>13979:105757</routeTargets>
- <routeTargets>13979:105757</routeTargets>
- <policyFqdns>GN_EVPN_Test</policyFqdns>
- </contrailNetwork>
- <subnets>
- <allocationPools>
- <start/>
- <end/>
- </allocationPools>
- <cidr>107.239.52.0/24</cidr>
- <enableDHCP>true</enableDHCP>
- <gatewayIp>107.239.52.1</gatewayIp>
- <ipVersion>4</ipVersion>
- <subnetId>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnetId>
- <subnetName>subnetName</subnetName>
- </subnets>
- <subnets>
- <allocationPools>
- <start/>
- <end/>
- </allocationPools>
- <cidr>107.239.52.0/24</cidr>
- <enableDHCP>true</enableDHCP>
- <gatewayIp>107.239.52.1</gatewayIp>
- <ipVersion>4</ipVersion>
- <subnetId>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnetId>
- <subnetName>subnetName</subnetName>
- </subnets>
- <skipAAI>true</skipAAI>
- <backout>true</backout>
- <failIfExists>false</failIfExists>
- <networkParams>
- <dhcp-enabled>true</dhcp-enabled>
- <serviceId>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</serviceId>
- <cidr-mask>true</cidr-mask>
- <backoutOnFailure>true</backoutOnFailure>
- <gateway-address>10.10.125.1</gateway-address>
- </networkParams>
- <msoRequest>
- <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
- <serviceInstanceId>null</serviceInstanceId>
- </msoRequest>
- <messageId>messageId_generated</messageId>
- <notificationUrl/>
-</createNetworkRequest>"""
-
- String createNetworkResponseREST =
- """<ns2:createNetworkResponse xmlns:ns2="http://org.openecomp.mso/network">
- <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
- <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
- <networkFqdn>default-domain:MSOTest:GN_EVPN_direct_net_0_ST1</networkFqdn>
- <networkStackId></networkStackId>
- <networkCreated>true</networkCreated>
- <subnetMap>
- <entry>
- <key>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</key>
- <value>bd8e87c6-f4e2-41b8-b0bc-9596aa00cd73</value>
- </entry>
- <entry>
- <key>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</key>
- <value>bd8e87c6-f4e2-41b8-b0bc-9596aa00cd73</value>
- </entry>
- </subnetMap>
- <rollback>
- <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
- <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
- <networkStackId></networkStackId>
- <networkType>CONTRAIL_EXTERNAL</networkType>
- <networkCreated>true</networkCreated>
- <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
- <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
- <msoRequest>
- <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId>
- <serviceInstanceId></serviceInstanceId>
- </msoRequest>
- </rollback>
- <messageId>messageId_generated</messageId>
-</ns2:createNetworkResponse>"""
-
- String createRollbackNetworkRequest =
- """<rollbackNetworkRequest>
- <networkRollback>
- <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
- <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
- <networkStackId/>
- <networkType>CONTRAIL_EXTERNAL</networkType>
- <networkCreated>true</networkCreated>
- <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
- <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
- <msoRequest>
- <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId>
- <serviceInstanceId/>
- </msoRequest>
- </networkRollback>
-</rollbackNetworkRequest>"""
-
- String createNetworkResponse =
- """<ns2:createNetworkResponse xmlns:ns2="http://org.openecomp.mso/network"
- xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
- <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
- <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
- <networkStackId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkStackId>
- <networkFqdn>default-domain:MSOTest:GN_EVPN_direct_net_0_ST1</networkFqdn>
- <subnetIdMap>
- <entry>
- <key>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</key>
- <value>bd8e87c6-f4e2-41b8-b0bc-9596aa00cd73</value>
- </entry>
- </subnetIdMap>
- <rollback>
- <cloudId>RDM2WAGPLCP</cloudId>
- <msoRequest>
- <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId>
- <serviceInstanceId/>
- </msoRequest>
- <networkCreated>true</networkCreated>
- <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
- <networkType>CONTRAIL_EXTERNAL</networkType>
- <networkUpdated>false</networkUpdated>
- <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
- <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
- </rollback>
-</ns2:createNetworkResponse>"""
-
- String updateContrailAAIPayloadRequest =
- """<l3-network xmlns="http://org.openecomp.aai.inventory/v9">
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>Contrail</network-technology>
- <neutron-network-id>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutron-network-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <resource-version>l3-version</resource-version>
- <orchestration-status>Created</orchestration-status>
- <contrail-network-fqdn>default-domain:MSOTest:GN_EVPN_direct_net_0_ST1</contrail-network-fqdn>
- <physical-network-name>networkName</physical-network-name>
- <is-provider-network>false</is-provider-network>
- <is-shared-network>true</is-shared-network>
- <is-external-network>false</is-external-network>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <neutron-subnet-id>bd8e87c6-f4e2-41b8-b0bc-9596aa00cd73</neutron-subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>Created</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <resource-version>1505857301954</resource-version>
- <subnet-name>subnetName</subnet-name>
- <ip-assignment-direction>true</ip-assignment-direction>
- <host-routes>
- <host-route>
- <host-route-id>string</host-route-id>
- <route-prefix>192.10.16.0/24</route-prefix>
- <next-hop>192.10.16.100/24</next-hop>
- <next-hop-type>ip-address</next-hop-type>
- <resource-version>1505857301954</resource-version>
- </host-route>
- <host-route>
- <host-route-id>string</host-route-id>
- <route-prefix>192.110.17.0/24</route-prefix>
- <next-hop>192.110.17.110/24</next-hop>
- <next-hop-type>ip-address</next-hop-type>
- <resource-version>1505857301954</resource-version>
- </host-route>
- </host-routes>
- </subnet>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <neutron-subnet-id>bd8e87c6-f4e2-41b8-b0bc-9596aa00cd73</neutron-subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>Created</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <resource-version>1505857301954</resource-version>
- <subnet-name>subnetName</subnet-name>
- <ip-assignment-direction>true</ip-assignment-direction>
- <host-routes>
- <host-route>
- <host-route-id>string</host-route-id>
- <route-prefix>192.10.16.0/24</route-prefix>
- <next-hop>192.10.16.100/24</next-hop>
- <next-hop-type>ip-address</next-hop-type>
- <resource-version>1505857301954</resource-version>
- </host-route>
- </host-routes>
- </subnet>
- </subnets>
- <segmentation-assignments>
- <segmentation-id>414</segmentation-id>
- <resource-version>4132176</resource-version>
- </segmentation-assignments>
- <segmentation-assignments>
- <segmentation-id>415</segmentation-id>
- <resource-version>4132176</resource-version>
- </segmentation-assignments>
- <ctag-assignments>
- <ctag-assignment>
- <vlan-id-inner>inner</vlan-id-inner>
- <resource-version>ctag-version</resource-version>
- <relationship-list>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/897deadc2b954a6bac6d3c197fb3525e/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>897deadc2b954a6bac6d3c197fb3525e</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>tenant.tenant-name</property-key>
- <property-value>MSOTest1</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/a290b841-f672-44dd-b9cd-6f8c20d7d8c8/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>a290b841-f672-44dd-b9cd-6f8c20d7d8c8</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vpn-binding.vpn-name</property-key>
- <property-value>oam_protected_net_6_MTN5_msotest2</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/24a4b507-853a-4a38-99aa-05fcc54be24d/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>24a4b507-853a-4a38-99aa-05fcc54be24d</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vpn-binding.vpn-name</property-key>
- <property-value>oam_protected_net_6_MTN5_msotest1</property-value>
- </related-to-property>
- </relationship>
- </relationship-list>
- </ctag-assignment>
- </ctag-assignments>
- <relationship-list>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>network-policy</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg</related-link>
- <relationship-data>
- <relationship-key>network-policy.network-policy-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0cg</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN1</related-link>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN2</related-link>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
-</l3-network>"""
-
-String updateContrailAAIPayloadRequest_segmentation =
-"""<l3-network xmlns="http://org.openecomp.aai.inventory/v9">
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>Contrail</network-technology>
- <neutron-network-id>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutron-network-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <resource-version>l3-version</resource-version>
- <orchestration-status>Created</orchestration-status>
- <contrail-network-fqdn>default-domain:MSOTest:GN_EVPN_direct_net_0_ST1</contrail-network-fqdn>
- <physical-network-name>networkName</physical-network-name>
- <is-provider-network>false</is-provider-network>
- <is-shared-network>true</is-shared-network>
- <is-external-network>false</is-external-network>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <neutron-subnet-id>bd8e87c6-f4e2-41b8-b0bc-9596aa00cd73</neutron-subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>Created</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <subnet-name>subnetName</subnet-name>
- </subnet>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <neutron-subnet-id>bd8e87c6-f4e2-41b8-b0bc-9596aa00cd73</neutron-subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>Created</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <subnet-name>subnetName</subnet-name>
- </subnet>
- </subnets>
- <segmentation-assignments>
- <segmentation-assignment>
- <segmentation-id>1</segmentation-id>
- <resource-version>1498507569188</resource-version>
- </segmentation-assignment>
- </segmentation-assignments>
- <ctag-assignments>
- <ctag-assignment>
- <vlan-id-inner>inner</vlan-id-inner>
- <resource-version>ctag-version</resource-version>
- <relationship-list>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/897deadc2b954a6bac6d3c197fb3525e/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>897deadc2b954a6bac6d3c197fb3525e</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>tenant.tenant-name</property-key>
- <property-value>MSOTest1</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/a290b841-f672-44dd-b9cd-6f8c20d7d8c8/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>a290b841-f672-44dd-b9cd-6f8c20d7d8c8</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vpn-binding.vpn-name</property-key>
- <property-value>oam_protected_net_6_MTN5_msotest2</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/24a4b507-853a-4a38-99aa-05fcc54be24d/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>24a4b507-853a-4a38-99aa-05fcc54be24d</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vpn-binding.vpn-name</property-key>
- <property-value>oam_protected_net_6_MTN5_msotest1</property-value>
- </related-to-property>
- </relationship>
- </relationship-list>
- </ctag-assignment>
- </ctag-assignments>
- <relationship-list>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>network-policy</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg</related-link>
- <relationship-data>
- <relationship-key>network-policy.network-policy-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0cg</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN1</related-link>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN2</related-link>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
-</l3-network>"""
-
- String updateContrailAAIResponse =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Content-Length" value="0"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:551-132672"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
-</rest:RESTResponse>"""
-
- String createNetworkErrorResponse =
- """<createNetworkError>
- <messageId>680bd458-5ec1-4a16-b77c-509022e53450</messageId><category>INTERNAL</category>
- <message>400 Bad Request: The server could not comply with the request since it is either malformed or otherwise incorrect., error.type=StackValidationFailed, error.message=Property error: : resources.network.properties: : Unknown Property network_ipam_refs_data</message>
- <rolledBack>true</rolledBack>
- </createNetworkError>"""
-
-
- String networkException500 =
- """<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:VersionMismatch</faultcode><faultstring>"http://org.openecomp.mso/network", the namespace on the "createNetworkContrail" element, is not a valid SOAP version.</faultstring></soap:Fault></soap:Body></soap:Envelope>"""
-
- String aaiResponse =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Sat,30 Jan 2016 20:09:24 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID"
- value="mtcnjv9aaas01.mtcnj.aic.cip.com-20160130-20:09:24:814-165843"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v3">
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name>HSL_direct_net_2</network-name>
- <network-type>CONTRAIL_BASIC</network-type>
- <network-role>HSL_direct</network-role>
- <network-technology>contrail</network-technology>
- <neutron-network-id>8bbd3edf-b835-4610-96a2-a5cafa029042</neutron-network-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <orchestration-status>active</orchestration-status>
- <heat-stack-id>HSL_direct_net_2/57594a56-1c92-4a38-9caa-641c1fa3d4b6</heat-stack-id>
- <subnets>
- <subnet>
- <subnet-id>ea5f2a2c-604f-47ff-a9c5-253ee4f0ef0a</subnet-id>
- <neutron-subnet-id>5a77fdc2-7789-4649-a1b9-6eaf1db1813a</neutron-subnet-id>
- <gateway-address>172.16.34.1</gateway-address>
- <network-start-address>172.16.34.0</network-start-address>
- <cidr-mask>28</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>active</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <relationship-list/>
- </subnet>
- </subnets>
- <relationship-list>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v3/cloud-infrastructure/tenants/tenant/e81d842d3e8b45c5a59f57cd76af3aaf/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>e81d842d3e8b45c5a59f57cd76af3aaf</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </l3-network>
- </rest:payload>
- </rest:RESTResponse>"""
-
- String assignSDNCRequest =
- """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:ns5="http://org.openecomp/mso/request/types/v1"
- xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
- <sdncadapter:RequestHeader>
- <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
- <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
- <sdncadapter:SvcAction>assign</sdncadapter:SvcAction>
- <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
- <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
- </sdncadapter:RequestHeader>
- <aetgt:SDNCRequestData>
- <request-information>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <request-action>NetworkActivateRequest</request-action>
- <source>VID</source>
- <notification-url/>
- <order-number/>
- <order-version/>
- </request-information>
- <service-information>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <service-type>MSO-dev-service-type</service-type>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- <subscriber-name>MSO_1610_dev</subscriber-name>
- </service-information>
- <network-request-information>
- <network-id>networkId</network-id>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <tenant>7dd5365547234ee8937416c65507d266</tenant>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- </network-request-information>
- </aetgt:SDNCRequestData>
-</aetgt:SDNCAdapterWorkflowRequest>"""
-
-String assignSDNCRequest_decodeUrlLink =
-"""<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:ns5="http://org.openecomp/mso/request/types/v1"
- xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
- <sdncadapter:RequestHeader>
- <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
- <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
- <sdncadapter:SvcAction>assign</sdncadapter:SvcAction>
- <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
- <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
- </sdncadapter:RequestHeader>
- <aetgt:SDNCRequestData>
- <request-information>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <request-action>NetworkActivateRequest</request-action>
- <source>VID</source>
- <notification-url/>
- <order-number/>
- <order-version/>
- </request-information>
- <service-information>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <service-type>VIRTUAL USP</service-type>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- <subscriber-name>MSO_1610_dev</subscriber-name>
- </service-information>
- <network-request-information>
- <network-id>networkId</network-id>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <tenant>7dd5365547234ee8937416c65507d266</tenant>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- </network-request-information>
- </aetgt:SDNCRequestData>
-</aetgt:SDNCAdapterWorkflowRequest>"""
-
-String assignRpcSDNCRequest =
- """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
- <sdncadapter:RequestHeader>
- <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
- <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
- <sdncadapter:SvcAction>assign</sdncadapter:SvcAction>
- <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
- <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
- <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
- </sdncadapter:RequestHeader>
- <aetgt:SDNCRequestData>
- <request-information>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <request-action>CreateNetworkInstance</request-action>
- <source>VID</source>
- <notification-url/>
- <order-number/>
- <order-version/>
- </request-information>
- <service-information>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <subscription-service-type>MSO-dev-service-type</subscription-service-type>
- <onap-model-information>
- <model-invariant-uuid>fcc85cb0-ad74-45d7-a5a1-17c8744fdb71</model-invariant-uuid>
- <model-uuid>36a3a8ea-49a6-4ac8-b06c-89a54544b9b6</model-uuid>
- <model-version>1.0</model-version>
- <model-name>HNGW Protected OAM</model-name>
- </onap-model-information>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- <global-customer-id>globalId_45678905678</global-customer-id>
- <subscriber-name>MSO_1610_dev</subscriber-name>
- </service-information>
- <network-information>
- <network-id>networkId</network-id>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <onap-model-information>
- <model-invariant-uuid>sn5256d1-5a33-55df-13ab-12abad84e764</model-invariant-uuid>
- <model-customization-uuid>sn5256d1-5a33-55df-13ab-12abad84e222</model-customization-uuid>
- <model-uuid>sn5256d1-5a33-55df-13ab-12abad84e111</model-uuid>
- <model-version>1</model-version>
- <model-name>CONTRAIL_EXTERNAL</model-name>
- </onap-model-information>
- </network-information>
- <network-request-input>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <tenant>7dd5365547234ee8937416c65507d266</tenant>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <aic-clli/>
- <network-input-parameters/>
- </network-request-input>
- </aetgt:SDNCRequestData>
-</aetgt:SDNCAdapterWorkflowRequest>"""
-
-String activateSDNCRequest =
-"""<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
- <sdncadapter:RequestHeader>
- <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
- <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
- <sdncadapter:SvcAction>activate</sdncadapter:SvcAction>
- <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
- <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
- <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
- </sdncadapter:RequestHeader>
- <aetgt:SDNCRequestData>
- <request-information>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <request-action>CreateNetworkInstance</request-action>
- <source>VID</source>
- <notification-url/>
- <order-number/>
- <order-version/>
- </request-information>
- <service-information>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <subscription-service-type>MSO-dev-service-type</subscription-service-type>
- <onap-model-information>
- <model-invariant-uuid>fcc85cb0-ad74-45d7-a5a1-17c8744fdb71</model-invariant-uuid>
- <model-uuid>36a3a8ea-49a6-4ac8-b06c-89a54544b9b6</model-uuid>
- <model-version>1.0</model-version>
- <model-name>HNGW Protected OAM</model-name>
- </onap-model-information>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- <global-customer-id>globalId_45678905678</global-customer-id>
- <subscriber-name>MSO_1610_dev</subscriber-name>
- </service-information>
- <network-information>
- <network-id>networkId</network-id>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <onap-model-information>
- <model-invariant-uuid>sn5256d1-5a33-55df-13ab-12abad84e764</model-invariant-uuid>
- <model-customization-uuid>sn5256d1-5a33-55df-13ab-12abad84e222</model-customization-uuid>
- <model-uuid>sn5256d1-5a33-55df-13ab-12abad84e111</model-uuid>
- <model-version>1</model-version>
- <model-name>CONTRAIL_EXTERNAL</model-name>
- </onap-model-information>
- </network-information>
- <network-request-input>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <tenant>7dd5365547234ee8937416c65507d266</tenant>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <aic-clli/>
- <network-input-parameters/>
- </network-request-input>
- </aetgt:SDNCRequestData>
-</aetgt:SDNCAdapterWorkflowRequest>"""
-
-String assignResponse =
-"""<sdncadapterworkflow:SDNCAdapterWorkflowResponse xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1" xmlns:tag0="http://org.openecomp/workflow/sdnc/adapter/schema/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <sdncadapterworkflow:response-data> <tag0:CallbackHeader> <tag0:RequestId>006927ca-f5a3-47fd-880c-dfcbcd81a093</tag0:RequestId> <tag0:ResponseCode>200</tag0:ResponseCode> <tag0:ResponseMessage>OK</tag0:ResponseMessage> </tag0:CallbackHeader> <tag0:RequestData xsi:type="xs:string"><output xmlns="com:att:sdnctl:vnf"><response-code>200</response-code><svc-request-id>006927ca-f5a3-47fd-880c-dfcbcd81a093</svc-request-id><ack-final-indicator>Y</ack-final-indicator><service-information><subscriber-name>notsurewecare</subscriber-name><service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id><service-instance-id>GN_EVPN_direct_net_0_ST_noGW</service-instance-id></service-information><network-information><network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id></network-information></output></tag0:RequestData> </sdncadapterworkflow:response-data> </sdncadapterworkflow:SDNCAdapterWorkflowResponse>"""
-
- String sdncRollbackRequest =
- """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:ns5="http://org.openecomp/mso/request/types/v1"
- xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
- <sdncadapter:RequestHeader>
- <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
- <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
- <sdncadapter:SvcAction>rollback</sdncadapter:SvcAction>
- <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
- <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
- </sdncadapter:RequestHeader>
- <aetgt:SDNCRequestData>
- <request-information>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <request-action>NetworkActivateRequest</request-action>
- <source>VID</source>
- <notification-url/>
- <order-number/>
- <order-version/>
- </request-information>
- <service-information>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <service-type>MSO-dev-service-type</service-type>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- <subscriber-name>MSO_1610_dev</subscriber-name>
- </service-information>
- <network-request-information>
- <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <tenant>7dd5365547234ee8937416c65507d266</tenant>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- </network-request-information>
- </aetgt:SDNCRequestData>
-</aetgt:SDNCAdapterWorkflowRequest>"""
-
-String sdncRpcRollbackRequest =
-"""<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
- <sdncadapter:RequestHeader>
- <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
- <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
- <sdncadapter:SvcAction>unassign</sdncadapter:SvcAction>
- <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
- <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
- <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
- </sdncadapter:RequestHeader>
- <aetgt:SDNCRequestData>
- <request-information>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <request-action>DeleteNetworkInstance</request-action>
- <source>VID</source>
- <notification-url/>
- <order-number/>
- <order-version/>
- </request-information>
- <service-information>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <subscription-service-type>MSO-dev-service-type</subscription-service-type>
- <onap-model-information>
- <model-invariant-uuid>fcc85cb0-ad74-45d7-a5a1-17c8744fdb71</model-invariant-uuid>
- <model-uuid>36a3a8ea-49a6-4ac8-b06c-89a54544b9b6</model-uuid>
- <model-version>1.0</model-version>
- <model-name>HNGW Protected OAM</model-name>
- </onap-model-information>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- <global-customer-id>globalId_45678905678</global-customer-id>
- <subscriber-name>MSO_1610_dev</subscriber-name>
- </service-information>
- <network-information>
- <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <onap-model-information>
- <model-invariant-uuid>sn5256d1-5a33-55df-13ab-12abad84e764</model-invariant-uuid>
- <model-customization-uuid>sn5256d1-5a33-55df-13ab-12abad84e222</model-customization-uuid>
- <model-uuid>sn5256d1-5a33-55df-13ab-12abad84e111</model-uuid>
- <model-version>1</model-version>
- <model-name>CONTRAIL_EXTERNAL</model-name>
- </onap-model-information>
- </network-information>
- <network-request-input>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <tenant>7dd5365547234ee8937416c65507d266</tenant>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <aic-clli/>
- <network-input-parameters/>
- </network-request-input>
- </aetgt:SDNCRequestData>
-</aetgt:SDNCAdapterWorkflowRequest>"""
-
-String sdncActivateRollbackRequest =
-"""<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
- <sdncadapter:RequestHeader>
- <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
- <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
- <sdncadapter:SvcAction>deactivate</sdncadapter:SvcAction>
- <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
- <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
- <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
- </sdncadapter:RequestHeader>
- <aetgt:SDNCRequestData>
- <request-information>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <request-action>DeleteNetworkInstance</request-action>
- <source>VID</source>
- <notification-url/>
- <order-number/>
- <order-version/>
- </request-information>
- <service-information>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <subscription-service-type>MSO-dev-service-type</subscription-service-type>
- <onap-model-information>
- <model-invariant-uuid>fcc85cb0-ad74-45d7-a5a1-17c8744fdb71</model-invariant-uuid>
- <model-uuid>36a3a8ea-49a6-4ac8-b06c-89a54544b9b6</model-uuid>
- <model-version>1.0</model-version>
- <model-name>HNGW Protected OAM</model-name>
- </onap-model-information>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- <global-customer-id>globalId_45678905678</global-customer-id>
- <subscriber-name>MSO_1610_dev</subscriber-name>
- </service-information>
- <network-information>
- <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <onap-model-information>
- <model-invariant-uuid>sn5256d1-5a33-55df-13ab-12abad84e764</model-invariant-uuid>
- <model-customization-uuid>sn5256d1-5a33-55df-13ab-12abad84e222</model-customization-uuid>
- <model-uuid>sn5256d1-5a33-55df-13ab-12abad84e111</model-uuid>
- <model-version>1</model-version>
- <model-name>CONTRAIL_EXTERNAL</model-name>
- </onap-model-information>
- </network-information>
- <network-request-input>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <tenant>7dd5365547234ee8937416c65507d266</tenant>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <aic-clli/>
- <network-input-parameters/>
- </network-request-input>
- </aetgt:SDNCRequestData>
-</aetgt:SDNCAdapterWorkflowRequest>"""
-
- String sdncAdapterWorkflowResponse =
- """<aetgt:SDNCAdapterWorkflowResponse xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1">
- <sdncadapterworkflow:response-data>
-<tag0:CallbackHeader xmlns:tag0="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
- <tag0:RequestId>745b1b50-e39e-4685-9cc8-c71f0bde8bf0</tag0:RequestId>
- <tag0:ResponseCode>200</tag0:ResponseCode>
- <tag0:ResponseMessage>OK</tag0:ResponseMessage>
-</tag0:CallbackHeader>
- <tag0:RequestData xmlns:tag0="http://org.openecomp/workflow/sdnc/adapter/schema/v1"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:type="xs:string"><output xmlns="com:att:sdnctl:vnf"><svc-request-id>00703dc8-71ff-442d-a4a8-3adc5beef6a9</svc-request-id><response-code>200</response-code><ack-final-indicator>Y</ack-final-indicator><network-information><network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id></network-information><service-information><service-type>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-type><service-instance-id>MNS-25180-L-01-dmz_direct_net_1</service-instance-id><subscriber-name>notsurewecare</subscriber-name></service-information></output></tag0:RequestData>
- </sdncadapterworkflow:response-data>
-</aetgt:SDNCAdapterWorkflowResponse>"""
-
-
- String sdncAdapterWorkflowResponse_Error =
- """<sdncadapterworkflow:SDNCAdapterWorkflowResponse xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:tag0="http://org.openecomp/workflow/sdnc/adapter/schema/v1"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="com:att:sdnctl:vnf">
- <sdncadapterworkflow:response-data>
- <tag0:RequestData xsi:type="xs:string">
- <output>
- <response-code>400</response-code>
- <response-message>Error writing to l3-netework</response-message>
- <ack-final-indicator>Y</ack-final-indicator>
- <svc-request-id>c79240d8-34b5-4853-af69-2021928dba00</svc-request-id>
- </output>
- </tag0:RequestData>
- </sdncadapterworkflow:response-data>
-</sdncadapterworkflow:SDNCAdapterWorkflowResponse>"""
-
- String expected_sdncAdapterWorkflowResponse_Error =
- """<sdncadapterworkflow:SDNCAdapterWorkflowResponse xmlns="com:att:sdnctl:vnf"
- xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:tag0="http://org.openecomp/workflow/sdnc/adapter/schema/v1"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <sdncadapterworkflow:response-data>
- <tag0:RequestData xsi:type="xs:string">
- <output>
- <response-code>400</response-code>
- <response-message>Error writing to l3-netework</response-message>
- <ack-final-indicator>Y</ack-final-indicator>
- <svc-request-id>c79240d8-34b5-4853-af69-2021928dba00</svc-request-id>
- </output>
- </tag0:RequestData>
- </sdncadapterworkflow:response-data>
-</sdncadapterworkflow:SDNCAdapterWorkflowResponse>"""
-
- String sdncAdapterWorkflowFormattedResponse =
- """<aetgt:SDNCAdapterWorkflowResponse xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns="com:att:sdnctl:vnf">
- <aetgt:response-data>
- <output>
- <svc-request-id>00703dc8-71ff-442d-a4a8-3adc5beef6a9</svc-request-id>
- <response-code>200</response-code>
- <ack-final-indicator>Y</ack-final-indicator>
- <network-information>
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- </network-information>
- <service-information>
- <service-type>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-type>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- <subscriber-name>notsurewecare</subscriber-name>
- </service-information>
- </output>
- </aetgt:response-data>
-</aetgt:SDNCAdapterWorkflowResponse>"""
-
-String sdncAdapterWorkflowAssignResponse =
-"""<sdncadapterworkflow:SDNCAdapterWorkflowResponse xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:tag0="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <sdncadapterworkflow:response-data>
- <tag0:CallbackHeader>
- <tag0:RequestId>79ec9006-3695-4fcc-93a8-be6f9e248beb</tag0:RequestId>
- <tag0:ResponseCode>200</tag0:ResponseCode>
- <tag0:ResponseMessage>OK</tag0:ResponseMessage>
- </tag0:CallbackHeader>
- <tag0:RequestData xsi:type="xs:string">
- <output xmlns="com:att:sdnctl:generic-resource">
- <response-message/>
- <svc-request-id>79ec9006-3695-4fcc-93a8-be6f9e248beb</svc-request-id>
- <service-response-information>
- <instance-id>f805ec2b-b4d8-473e-8325-67f110139e5d</instance-id>
- </service-response-information>
- <response-code>200</response-code>
- <network-response-information>
- <instance-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</instance-id>
- <object-path>restconf/config/GENERIC-RESOURCE-API:services/service/f805ec2b-b4d8-473e-8325-67f110139e5d/service-data/networks/network/f7e4db56-aab5-4065-8e65-cec1cd1de24f</object-path>
- </network-response-information>
- <ack-final-indicator>Y</ack-final-indicator>
- </output>
- </tag0:RequestData>
- </sdncadapterworkflow:response-data>
-</sdncadapterworkflow:SDNCAdapterWorkflowResponse>"""
-
- String rollbackNetworkRequest =
-"""<NetworkAdapter:rollbackNetwork xmlns:NetworkAdapter="http://org.openecomp.mso/network">
- <rollback>
- <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
- <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
- <networkStackId/>
- <networkType>CONTRAIL_EXTERNAL</networkType>
- <networkCreated>true</networkCreated>
- <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
- <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
- <msoRequest>
- <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId>
- <serviceInstanceId/>
- </msoRequest>
- </rollback>
-</NetworkAdapter:rollbackNetwork>"""
-
- String rollbackActivateSDNCRequest =
-"""<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:ns5="http://org.openecomp/mso/request/types/v1"
- xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
- <sdncadapter:RequestHeader>
- <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
- <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
- <sdncadapter:SvcAction>rollback</sdncadapter:SvcAction>
- <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
- <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
- </sdncadapter:RequestHeader>
- <aetgt:SDNCRequestData>
- <request-information>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <request-action>CreateNetworkInstance</request-action>
- <source>VID</source>
- <notification-url/>
- <order-number/>
- <order-version/>
- </request-information>
- <service-information>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <service-type>MSO-dev-service-type</service-type>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- <subscriber-name>MSO_1610_dev</subscriber-name>
- </service-information>
- <network-information>
- <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <onap-model-information>
- <model-invariant-uuid>invariant-uuid</model-invariant-uuid>
- <model-customization-uuid>customization-uuid</model-customization-uuid>
- <model-uuid>uuid</model-uuid>
- <model-version>version</model-version>
- <model-name>CONTRAIL_EXTERNAL</model-name>
- </onap-model-information>
- </network-information>
- <network-request-information>
- <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <tenant>7dd5365547234ee8937416c65507d266</tenant>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- </network-request-information>
- </aetgt:SDNCRequestData>
-</aetgt:SDNCAdapterWorkflowRequest>"""
-
- String rollbackSDNCRequest =
-"""<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:ns5="http://org.openecomp/mso/request/types/v1"
- xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
- <sdncadapter:RequestHeader>
- <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
- <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
- <sdncadapter:SvcAction>rollback</sdncadapter:SvcAction>
- <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
- <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
- </sdncadapter:RequestHeader>
- <aetgt:SDNCRequestData>
- <request-information>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <request-action>CreateNetworkInstance</request-action>
- <source>VID</source>
- <notification-url/>
- <order-number/>
- <order-version/>
- </request-information>
- <service-information>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <service-type>MSO-dev-service-type</service-type>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- <subscriber-name>MSO_1610_dev</subscriber-name>
- </service-information>
- <network-information>
- <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <onap-model-information>
- <model-invariant-uuid>invariant-uuid</model-invariant-uuid>
- <model-customization-uuid>customization-uuid</model-customization-uuid>
- <model-uuid>uuid</model-uuid>
- <model-version>version</model-version>
- <model-name>CONTRAIL_EXTERNAL</model-name>
- </onap-model-information>
- </network-information>
- <network-request-information>
- <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <tenant>7dd5365547234ee8937416c65507d266</tenant>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- </network-request-information>
- </aetgt:SDNCRequestData>
-</aetgt:SDNCAdapterWorkflowRequest>"""
-
-// - - - - - - - -
-
- @Before
- public void init()
- {
- MockitoAnnotations.initMocks(this)
-
- }
-
- public void initializeVariables (DelegateExecution mockExecution) {
-
- verify(mockExecution).setVariable(Prefix + "networkRequest", "")
- verify(mockExecution).setVariable(Prefix + "rollbackEnabled", null)
- verify(mockExecution).setVariable(Prefix + "networkInputs", "")
- //verify(mockExecution).setVariable(Prefix + "requestId", "")
- verify(mockExecution).setVariable(Prefix + "messageId", "")
- verify(mockExecution).setVariable(Prefix + "source", "")
- verify(mockExecution).setVariable("BasicAuthHeaderValuePO", "")
- verify(mockExecution).setVariable("BasicAuthHeaderValueSDNC", "")
- verify(mockExecution).setVariable(Prefix + "serviceInstanceId","")
- verify(mockExecution).setVariable("GENGS_type","")
- verify(mockExecution).setVariable(Prefix + "rsrc_endpoint", null)
- verify(mockExecution).setVariable(Prefix + "networkOutputs", "")
- verify(mockExecution).setVariable(Prefix + "networkId","")
- verify(mockExecution).setVariable(Prefix + "networkName","")
-
- // AAI query Name
- verify(mockExecution).setVariable(Prefix + "queryNameAAIRequest","")
- verify(mockExecution).setVariable(Prefix + "queryNameAAIResponse", "")
- verify(mockExecution).setVariable(Prefix + "aaiNameReturnCode", "")
- verify(mockExecution).setVariable(Prefix + "isAAIqueryNameGood", false)
-
- // AAI query Cloud Region
- verify(mockExecution).setVariable(Prefix + "queryCloudRegionRequest","")
- verify(mockExecution).setVariable(Prefix + "queryCloudRegionReturnCode","")
- verify(mockExecution).setVariable(Prefix + "queryCloudRegionResponse","")
- verify(mockExecution).setVariable(Prefix + "cloudRegionPo","")
- verify(mockExecution).setVariable(Prefix + "cloudRegionSdnc","")
- verify(mockExecution).setVariable(Prefix + "isCloudRegionGood", false)
-
- // AAI query Id
- verify(mockExecution).setVariable(Prefix + "queryIdAAIRequest","")
- verify(mockExecution).setVariable(Prefix + "queryIdAAIResponse", "")
- verify(mockExecution).setVariable(Prefix + "aaiIdReturnCode", "")
-
- // AAI query vpn binding
- verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIRequest","")
- verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIResponse", "")
- verify(mockExecution).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "")
- verify(mockExecution).setVariable(Prefix + "vpnBindings", null)
- verify(mockExecution).setVariable(Prefix + "vpnCount", 0)
- verify(mockExecution).setVariable(Prefix + "routeCollection", "")
-
- // AAI query network policy
- verify(mockExecution).setVariable(Prefix + "queryNetworkPolicyAAIRequest","")
- verify(mockExecution).setVariable(Prefix + "queryNetworkPolicyAAIResponse", "")
- verify(mockExecution).setVariable(Prefix + "aaiQqueryNetworkPolicyReturnCode", "")
- verify(mockExecution).setVariable(Prefix + "networkPolicyUriList", null)
- verify(mockExecution).setVariable(Prefix + "networkPolicyCount", 0)
- verify(mockExecution).setVariable(Prefix + "networkCollection", "")
-
- // AAI query route table reference
- verify(mockExecution).setVariable(Prefix + "queryNetworkTableRefAAIRequest","")
- verify(mockExecution).setVariable(Prefix + "queryNetworkTableRefAAIResponse", "")
- verify(mockExecution).setVariable(Prefix + "aaiQqueryNetworkTableRefReturnCode", "")
- verify(mockExecution).setVariable(Prefix + "networkTableRefUriList", null)
- verify(mockExecution).setVariable(Prefix + "networkTableRefCount", 0)
- verify(mockExecution).setVariable(Prefix + "tableRefCollection", "")
-
- // AAI requery Id
- verify(mockExecution).setVariable(Prefix + "requeryIdAAIRequest","")
- verify(mockExecution).setVariable(Prefix + "requeryIdAAIResponse", "")
- verify(mockExecution).setVariable(Prefix + "aaiRequeryIdReturnCode", "")
-
- // AAI update contrail
- verify(mockExecution).setVariable(Prefix + "updateContrailAAIUrlRequest","")
- verify(mockExecution).setVariable(Prefix + "updateContrailAAIPayloadRequest","")
- verify(mockExecution).setVariable(Prefix + "updateContrailAAIResponse", "")
- verify(mockExecution).setVariable(Prefix + "aaiUpdateContrailReturnCode", "")
-
- verify(mockExecution).setVariable(Prefix + "createNetworkRequest", "")
- verify(mockExecution).setVariable(Prefix + "createNetworkResponse", "")
- verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", "")
- //verify(mockExecution).setVariable(Prefix + "rollbackNetworkResponse", "")
- verify(mockExecution).setVariable(Prefix + "networkReturnCode", "")
- //verify(mockExecution).setVariable(Prefix + "rollbackNetworkReturnCode", "")
- verify(mockExecution).setVariable(Prefix + "isNetworkRollbackNeeded", false)
-
- verify(mockExecution).setVariable(Prefix + "assignSDNCRequest", "")
- verify(mockExecution).setVariable(Prefix + "assignSDNCResponse", "")
- verify(mockExecution).setVariable(Prefix + "rollbackSDNCRequest", "")
- //verify(mockExecution).setVariable(Prefix + "rollbackSDNCResponse", "")
- verify(mockExecution).setVariable(Prefix + "sdncReturnCode", "")
- //verify(mockExecution).setVariable(Prefix + "rollbackSDNCReturnCode", "")
- verify(mockExecution).setVariable(Prefix + "isSdncRollbackNeeded", false)
- verify(mockExecution).setVariable(Prefix + "sdncResponseSuccess", false)
-
- verify(mockExecution).setVariable(Prefix + "activateSDNCRequest", "")
- verify(mockExecution).setVariable(Prefix + "activateSDNCResponse", "")
- verify(mockExecution).setVariable(Prefix + "rollbackActivateSDNCRequest", "")
- //verify(mockExecution).setVariable(Prefix + "rollbackActivateSDNCResponse", "")
- verify(mockExecution).setVariable(Prefix + "sdncActivateReturnCode", "")
- //verify(mockExecution).setVariable(Prefix + "rollbackActivateSDNCReturnCode", "")
- verify(mockExecution).setVariable(Prefix + "isSdncActivateRollbackNeeded", false)
- verify(mockExecution).setVariable(Prefix + "sdncActivateResponseSuccess", false)
-
- verify(mockExecution).setVariable(Prefix + "orchestrationStatus", "")
- verify(mockExecution).setVariable(Prefix + "isVnfBindingPresent", false)
- verify(mockExecution).setVariable(Prefix + "Success", false)
-
- verify(mockExecution).setVariable(Prefix + "isException", false)
-
- }
-
- @Test
- //@Ignore
- public void preProcessRequest_vIPR_NetworkRequest() {
-
- println "************ preProcessRequest_Payload ************* "
-
- def networkModelInfo = """{"modelUuid": "sn5256d1-5a33-55df-13ab-12abad84e111",
- "modelName": "CONTRAIL_EXTERNAL",
- "modelType": "CONTRAIL_EXTERNAL",
- "modelVersion": "1",
- "modelCustomizationUuid": "sn5256d1-5a33-55df-13ab-12abad84e222",
- "modelInvariantUuid": "sn5256d1-5a33-55df-13ab-12abad84e764"
- }""".trim()
-
- def serviceModelInfo = """{"modelUuid": "36a3a8ea-49a6-4ac8-b06c-89a54544b9b6",
- "modelName": "HNGW Protected OAM",
- "modelType": "service",
- "modelVersion": "1.0",
- "modelInvariantUuid": "fcc85cb0-ad74-45d7-a5a1-17c8744fdb71"
- }""".trim()
-
-
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
-
- // Pre-defined value, testing Only
- when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- // Inputs:
- when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("disableRollback")).thenReturn("true")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable("networkId")).thenReturn("networkId") // optional
- when(mockExecution.getVariable("networkName")).thenReturn("MNS-25180-L-01-dmz_direct_net_1") // optional
- when(mockExecution.getVariable("productFamilyId")).thenReturn("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb")
- when(mockExecution.getVariable("networkModelInfo")).thenReturn("CONTRAIL_EXTERNAL")
- when(mockExecution.getVariable("lcpCloudRegionId")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable("tenantId")).thenReturn("7dd5365547234ee8937416c65507d266")
- when(mockExecution.getVariable("failIfExists")).thenReturn("false")
- when(mockExecution.getVariable("networkModelInfo")).thenReturn(networkModelInfo)
- when(mockExecution.getVariable("serviceModelInfo")).thenReturn(serviceModelInfo)
- when(mockExecution.getVariable("sdncVersion")).thenReturn("1702")
- when(mockExecution.getVariable("action")).thenReturn("CREATE")
- when(mockExecution.getVariable("subscriptionServiceType")).thenReturn("MSO-dev-service-type")
- when(mockExecution.getVariable("globalSubscriberId")).thenReturn("globalId_45678905678")
-
- when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
-
- when(mockExecution.getVariable("URN_mso_rollback")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_adapters_sdnc_endpoint")).thenReturn("http://localhost:8090/SDNCAdapter")
- when(mockExecution.getVariable("URN_mso_adapters_network_rest_endpoint")).thenReturn("http://localhost:8090/networks/NetworkAdapter")
- when(mockExecution.getVariable("URN_mso_adapters_sdnc_resource_endpoint")).thenReturn("http://localhost:8090/SDNCAdapterRpc")
-
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.preProcessRequest(mockExecution)
-
- verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix)
-
- //verify variable initialization
- initializeVariables(mockExecution)
-
- verify(mockExecution).setVariable("action", "CREATE")
- verify(mockExecution).setVariable(Prefix + "networkId","")
- verify(mockExecution).setVariable(Prefix + "networkRequest", expectedvIPRNetworkRequest)
- verify(mockExecution, atLeast(1)).setVariable(Prefix + "rollbackEnabled", false)
- verify(mockExecution).setVariable(Prefix + "networkInputs", expectedvIPRNetworkInputs)
- //verify(mockExecution).setVariable(Prefix + "requestId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- //verify(mockExecution).setVariable("mso-service-instance-id", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- verify(mockExecution).setVariable(Prefix + "messageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- verify(mockExecution).setVariable(Prefix + "source", "VID")
- verify(mockExecution).setVariable("BasicAuthHeaderValuePO", "Basic cGFzc3dvcmQ=")
- verify(mockExecution).setVariable("BasicAuthHeaderValueSDNC", "Basic cGFzc3dvcmQ=")
- verify(mockExecution).setVariable(Prefix + "serviceInstanceId","f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- verify(mockExecution, atLeast(1)).setVariable("GENGS_type", "service-instance")
- //verify(mockExecution, atLeast(1)).setVariable("mso-request-id", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- //verify(mockExecution, atLeast(1)).setVariable("msoRequestId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- //verify(mockExecution).setVariable("mso-service-instance-id","88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- verify(mockExecution).setVariable(Prefix + "networkId","")
- verify(mockExecution).setVariable(Prefix + "networkOutputs", networkvIPROutputs)
- verify(mockExecution).setVariable(Prefix + "networkName","")
-
- }
-
- @Test
- //@Ignore
- public void preProcessRequest_JSON_NetworkRequest() {
-
- println "************ preProcessRequest_Payload ************* "
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
-
- // Pre-defined value, testing Only
- when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- // Inputs:
- // when(mockExecution.getVariable("requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable("requestAction")).thenReturn("CREATE")
- when(mockExecution.getVariable("networkId")).thenReturn("networkId") // optional
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("bpmnRequest")).thenReturn(jsonIncomingRequest) // JSON format
- when(mockExecution.getVariable("sdncVersion")).thenReturn("1610") // 1610 default
- when(mockExecution.getVariable("disableRollback")).thenReturn(true)
-
- when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
-
- when(mockExecution.getVariable("URN_mso_rollback")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_adapters_sdnc_endpoint")).thenReturn("http://localhost:8090/SDNCAdapter")
- when(mockExecution.getVariable("URN_mso_adapters_network_rest_endpoint")).thenReturn("http://localhost:8090/networks/NetworkAdapter")
- when(mockExecution.getVariable("URN_mso_adapters_sdnc_resource_endpoint")).thenReturn("http://localhost:8090/SDNCAdapterRpc")
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.preProcessRequest(mockExecution)
-
- verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix)
-
- //verify variable initialization
- initializeVariables(mockExecution)
-
- verify(mockExecution).setVariable("action", "CREATE")
- verify(mockExecution).setVariable(Prefix + "networkRequest", expectedJSONNetworkRequest)
- verify(mockExecution).setVariable(Prefix + "rollbackEnabled", false)
- verify(mockExecution).setVariable(Prefix + "networkInputs", expectedJSONNetworkInputs)
- //verify(mockExecution).setVariable(Prefix + "requestId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- //verify(mockExecution).setVariable(Prefix + "messageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- verify(mockExecution).setVariable(Prefix + "source", "VID")
- verify(mockExecution).setVariable("BasicAuthHeaderValuePO", "Basic cGFzc3dvcmQ=")
- verify(mockExecution).setVariable("BasicAuthHeaderValueSDNC", "Basic cGFzc3dvcmQ=")
- verify(mockExecution).setVariable(Prefix + "serviceInstanceId","f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- verify(mockExecution, atLeast(1)).setVariable("GENGS_type", "service-instance")
- //verify(mockExecution, atLeast(1)).setVariable("msoRequestId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- //verify(mockExecution).setVariable("mso-service-instance-id","88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- verify(mockExecution).setVariable(Prefix + "networkId","")
- verify(mockExecution).setVariable(Prefix + "networkOutputs", networkJSONOutputs)
- verify(mockExecution).setVariable(Prefix + "networkName","")
-
-
- }
-
- @Test
- @Ignore // 1802 merge
- public void preProcessRequest_XML_NetworkRequest() {
-
- println "************ preProcessRequest_Payload ************* "
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
-
- // Pre-defined value, testing Only
- when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- // Inputs:
- // when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("bpmnRequest")).thenReturn(xmlIncomingRequest) // XML format
-
- when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
-
- when(mockExecution.getVariable("URN_mso_rollback")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_adapters_sdnc_endpoint")).thenReturn("http://localhost:8090/SDNCAdapter")
- when(mockExecution.getVariable("URN_mso_adapters_network_rest_endpoint")).thenReturn("http://localhost:8090/networks/NetworkAdapter")
- when(mockExecution.getVariable("URN_mso_adapters_sdnc_resource_endpoint")).thenReturn("http://localhost:8090/SDNCAdapterRpc")
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.preProcessRequest(mockExecution)
-
- verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix)
-
- //verify variable initialization
- initializeVariables(mockExecution)
-
- verify(mockExecution).setVariable(Prefix + "networkRequest", expectedXMLNetworkRequest)
- verify(mockExecution).setVariable("action", "CREATE")
- verify(mockExecution).setVariable(Prefix + "rollbackEnabled", true)
- verify(mockExecution).setVariable(Prefix + "networkInputs", expectedXMLNetworkInputs)
- //verify(mockExecution).setVariable(Prefix + "requestId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- verify(mockExecution).setVariable(Prefix + "messageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- verify(mockExecution).setVariable(Prefix + "source", "PORTAL")
- verify(mockExecution).setVariable("BasicAuthHeaderValuePO", "Basic cGFzc3dvcmQ=")
- verify(mockExecution).setVariable("BasicAuthHeaderValueSDNC", "Basic cGFzc3dvcmQ=")
- verify(mockExecution).setVariable(Prefix + "serviceInstanceId","MNS-25180-L-01-dmz_direct_net_1")
- verify(mockExecution, atLeast(1)).setVariable("GENGS_type", "service-instance")
- //verify(mockExecution).setVariable("mso-service-instance-id","88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- verify(mockExecution, atLeast(1)).setVariable(Prefix + "networkId","")
- verify(mockExecution).setVariable(Prefix + "networkOutputs", networkXMLOutputs)
- verify(mockExecution).setVariable(Prefix + "networkName","")
-
- }
-
-
-
- @Test
- //@Ignore
- public void prepareCreateNetworkRequest() {
-
- println "************ prepareNetworkRequest ************* "
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedvIPRNetworkRequest)
- when(mockExecution.getVariable(Prefix + "queryIdAAIResponse")).thenReturn(queryIdAIIResponse)
- when(mockExecution.getVariable(Prefix + "cloudRegionPo")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("messageId_generated")
- when(mockExecution.getVariable(Prefix + "source")).thenReturn("VID")
- //when(mockExecution.getVariable(Prefix + "queryVpnBindingAAIResponse")).thenReturn(queryVpnBindingAAIResponse)
- when(mockExecution.getVariable(Prefix + "routeCollection")).thenReturn("<routeTargets>13979:105757</routeTargets><routeTargets>13979:105757</routeTargets>")
- when(mockExecution.getVariable(Prefix + "networkCollection")).thenReturn("<policyFqdns>GN_EVPN_Test</policyFqdns>")
- when(mockExecution.getVariable(Prefix + "tableRefCollection")).thenReturn("<routeTableFqdns>refFQDN1</routeTableFqdns><routeTableFqdns>refFQDN2</routeTableFqdns>")
- when(mockExecution.getVariable(Prefix + "requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- //when(mockExecution.getVariable("URN_?????")).thenReturn("") // notificationUrl, //TODO - is this coming from URN? What variable/value to use?
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.prepareCreateNetworkRequest(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- // verify set prefix = Prefix + ""
- verify(mockExecution).setVariable("prefix", Prefix)
-
- verify(mockExecution).setVariable(Prefix + "createNetworkRequest", createNetworkRequest)
-
- }
-
-
- @Test
- //@Ignore
- public void prepareCreateNetworkRequest_Ipv4() {
-
- println "************ prepareNetworkRequest ************* "
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedvIPRNetworkRequest)
- when(mockExecution.getVariable(Prefix + "queryIdAAIResponse")).thenReturn(queryIdAIIResponse_Ipv4)
- when(mockExecution.getVariable(Prefix + "cloudRegionPo")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("messageId_generated")
- when(mockExecution.getVariable(Prefix + "source")).thenReturn("VID")
- //when(mockExecution.getVariable(Prefix + "queryVpnBindingAAIResponse")).thenReturn(queryVpnBindingAAIResponse)
- when(mockExecution.getVariable(Prefix + "routeCollection")).thenReturn("<routeTargets>13979:105757</routeTargets><routeTargets>13979:105757</routeTargets>")
- when(mockExecution.getVariable(Prefix + "networkCollection")).thenReturn("<policyFqdns>GN_EVPN_Test</policyFqdns>")
- when(mockExecution.getVariable(Prefix + "tableRefCollection")).thenReturn("<routeTableFqdns>refFQDN1</routeTableFqdns><routeTableFqdns>refFQDN2</routeTableFqdns>")
- when(mockExecution.getVariable(Prefix + "requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- //when(mockExecution.getVariable("URN_?????")).thenReturn("") // notificationUrl, //TODO - is this coming from URN? What variable/value to use?
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.prepareCreateNetworkRequest(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- // verify set prefix = Prefix + ""
- verify(mockExecution).setVariable("prefix", Prefix)
-
- verify(mockExecution).setVariable(Prefix + "createNetworkRequest", createNetworkRequest_Ipv4)
-
- }
-
- @Test
- //@Ignore
- public void prepareCreateNetworkRequest_AlaCarte() {
-
- println "************ prepareNetworkRequest ************* "
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedJSONNetworkRequest)
- when(mockExecution.getVariable(Prefix + "queryIdAAIResponse")).thenReturn(queryIdAIIResponse_AlaCarte)
- when(mockExecution.getVariable(Prefix + "cloudRegionPo")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("messageId_generated")
- when(mockExecution.getVariable(Prefix + "source")).thenReturn("VID")
- //when(mockExecution.getVariable(Prefix + "queryVpnBindingAAIResponse")).thenReturn(queryVpnBindingAAIResponse)
- when(mockExecution.getVariable(Prefix + "routeCollection")).thenReturn("<routeTargets>13979:105757</routeTargets><routeTargets>13979:105757</routeTargets>")
- when(mockExecution.getVariable(Prefix + "networkCollection")).thenReturn("<policyFqdns>GN_EVPN_Test</policyFqdns>")
- when(mockExecution.getVariable(Prefix + "tableRefCollection")).thenReturn("<routeTableFqdns>refFQDN1</routeTableFqdns><routeTableFqdns>refFQDN2</routeTableFqdns>")
- when(mockExecution.getVariable(Prefix + "requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- //when(mockExecution.getVariable("URN_?????")).thenReturn("") // notificationUrl, //TODO - is this coming from URN? What variable/value to use?
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.prepareCreateNetworkRequest(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- // verify set prefix = Prefix + ""
- verify(mockExecution).setVariable("prefix", Prefix)
-
- verify(mockExecution).setVariable(Prefix + "createNetworkRequest", createNetworkRequestAlaCarte)
-
- }
-
- @Test
- //@Ignore
- public void prepareCreateNetworkRequest_SRIOV() {
-
- println "************ prepareNetworkRequest ************* "
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedvIPRNetworkRequest)
- when(mockExecution.getVariable(Prefix + "queryIdAAIResponse")).thenReturn(queryIdAIIResponse_SRIOV)
- when(mockExecution.getVariable(Prefix + "cloudRegionPo")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("messageId_generated")
- when(mockExecution.getVariable(Prefix + "source")).thenReturn("VID")
- //when(mockExecution.getVariable(Prefix + "queryVpnBindingAAIResponse")).thenReturn(queryVpnBindingAAIResponse)
- when(mockExecution.getVariable(Prefix + "routeCollection")).thenReturn("<routeTargets>13979:105757</routeTargets><routeTargets>13979:105757</routeTargets>")
- when(mockExecution.getVariable(Prefix + "networkCollection")).thenReturn("<policyFqdns>GN_EVPN_Test</policyFqdns>")
- when(mockExecution.getVariable(Prefix + "tableRefCollection")).thenReturn("<routeTableFqdns>refFQDN1</routeTableFqdns><routeTableFqdns>refFQDN2</routeTableFqdns>")
- when(mockExecution.getVariable(Prefix + "requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- //when(mockExecution.getVariable("URN_?????")).thenReturn("") // notificationUrl, //TODO - is this coming from URN? What variable/value to use?
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.prepareCreateNetworkRequest(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- // verify set prefix = Prefix + ""
- verify(mockExecution).setVariable("prefix", Prefix)
-
- verify(mockExecution).setVariable(Prefix + "createNetworkRequest", createNetworkRequest_SRIOV)
-
- }
-
-
- @Test
- //@Ignore
- public void prepareSDNCRequest() {
-
- println "************ prepareSDNCRequest ************* "
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedvIPRNetworkRequest)
- when(mockExecution.getVariable(Prefix + "cloudRegionSdnc")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable(Prefix + "serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable(Prefix + "networkId")).thenReturn("networkId")
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("GENGSI_siResourceLink")).thenReturn("https://aai-int1.test.com:8443/aai/v8/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/6d4eb22a-82f1-4257-9f80-4176262cfe69/")
-
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.prepareSDNCRequest(mockExecution)
-
- // verify set prefix = Prefix + ""
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "assignSDNCRequest", assignSDNCRequest)
-
- }
-
- @Test
- //@Ignore
- public void prepareSDNCRequest_decodeUrlLink() {
-
- println "************ prepareSDNCRequest ************* "
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedvIPRNetworkRequest)
- when(mockExecution.getVariable(Prefix + "cloudRegionSdnc")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable(Prefix + "serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable(Prefix + "networkId")).thenReturn("networkId")
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("GENGSI_siResourceLink")).thenReturn("https://aai-int1.test.com:8443/aai/v8/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/VIRTUAL%20USP/service-instances/service-instance/6d4eb22a-82f1-4257-9f80-4176262cfe69/")
-
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.prepareSDNCRequest(mockExecution)
-
- // verify set prefix = Prefix + ""
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "assignSDNCRequest", assignSDNCRequest_decodeUrlLink)
-
- }
-
- @Test
- //@Ignore
- public void prepareRpcSDNCRequest() {
-
- println "************ prepareRpcSDNCRequest ************* "
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedvIPRNetworkRequest)
- when(mockExecution.getVariable(Prefix + "cloudRegionSdnc")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable(Prefix + "serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56") // test ONLY
- when(mockExecution.getVariable(Prefix + "networkId")).thenReturn("networkId")
- when(mockExecution.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("GENGSI_siResourceLink")).thenReturn("https://aai-int1.test.com:8443/aai/v8/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/6d4eb22a-82f1-4257-9f80-4176262cfe69/")
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.prepareRpcSDNCRequest(mockExecution)
-
- // verify set prefix = Prefix + ""
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "assignSDNCRequest", assignRpcSDNCRequest)
-
- }
-
- @Test
- //@Ignore
- public void prepareSDNCRollbackRequest() {
-
- println "************ prepareSDNCRollbackRequest ************* "
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedvIPRNetworkRequest)
- when(mockExecution.getVariable(Prefix + "cloudRegionSdnc")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable(Prefix + "serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable(Prefix + "assignSDNCResponse")).thenReturn(assignResponse)
- when(mockExecution.getVariable(Prefix + "networkId")).thenReturn("8abc633a-810b-4ca5-8b3a-09511d13a2ce")
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("GENGSI_siResourceLink")).thenReturn("https://aai-int1.test.com:8443/aai/v8/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/6d4eb22a-82f1-4257-9f80-4176262cfe69/")
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.prepareSDNCRollbackRequest(mockExecution)
-
- // verify set prefix = Prefix + ""
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "rollbackSDNCRequest", sdncRollbackRequest)
-
- }
-
- @Test
- //@Ignore
- public void prepareRpcSDNCActivateRequest() {
-
- println "************ prepareRpcSDNCActivateRequest ************* "
-
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedvIPRNetworkRequest)
- when(mockExecution.getVariable(Prefix + "cloudRegionSdnc")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable(Prefix + "serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable(Prefix + "networkId")).thenReturn("networkId")
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56") // test ONLY
- when(mockExecution.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("GENGSI_siResourceLink")).thenReturn("https://aai-int1.test.com:8443/aai/v8/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/6d4eb22a-82f1-4257-9f80-4176262cfe69/")
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.prepareRpcSDNCActivateRequest(mockExecution)
-
- // verify set prefix = Prefix + ""
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "activateSDNCRequest", activateSDNCRequest)
-
- }
-
-
- @Test
- //@Ignore
- public void prepareRpcSDNCRollbackRequest() {
-
- println "************ prepareRpcSDNCRollbackRequest ************* "
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedvIPRNetworkRequest)
- when(mockExecution.getVariable(Prefix + "cloudRegionSdnc")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable(Prefix + "serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable(Prefix + "assignSDNCResponse")).thenReturn(assignResponse)
- when(mockExecution.getVariable(Prefix + "networkId")).thenReturn("8abc633a-810b-4ca5-8b3a-09511d13a2ce")
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56") // test ONLY
- when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("GENGSI_siResourceLink")).thenReturn("https://aai-int1.test.com:8443/aai/v8/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/6d4eb22a-82f1-4257-9f80-4176262cfe69/")
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.prepareRpcSDNCRollbackRequest(mockExecution)
-
- // verify set prefix = Prefix + ""
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "rollbackSDNCRequest", sdncRpcRollbackRequest)
-
- }
-
- @Test
- //@Ignore
- public void prepareRpcSDNCActivateRollback() {
-
- println "************ prepareRpcSDNCActivateRollback ************* "
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedvIPRNetworkRequest)
- when(mockExecution.getVariable(Prefix + "cloudRegionSdnc")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable(Prefix + "serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable(Prefix + "activateSDNCResponse")).thenReturn(assignResponse)
- when(mockExecution.getVariable(Prefix + "networkId")).thenReturn("8abc633a-810b-4ca5-8b3a-09511d13a2ce")
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56") // test ONLY
- when(mockExecution.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("GENGSI_siResourceLink")).thenReturn("https://aai-int1.test.com:8443/aai/v8/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/6d4eb22a-82f1-4257-9f80-4176262cfe69/")
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.prepareRpcSDNCActivateRollback(mockExecution)
-
- // verify set prefix = Prefix + ""
- verify(mockExecution).setVariable("prefix", Prefix)
- //verify(mockExecution).setVariable("mso-request-id", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- //verify(mockExecution).setVariable(Prefix + "requestId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- //verify(mockExecution).setVariable("mso-service-instance-id", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- verify(mockExecution).setVariable(Prefix + "rollbackActivateSDNCRequest", sdncActivateRollbackRequest)
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkName_200() {
-
- println "************ callRESTQueryAAINetworkName ************* "
-
- WireMock.reset();
- MockGetNetworkByName("MNS-25180-L-01-dmz_direct_net_1", "CreateNetworkV2/createNetwork_queryName_AAIResponse_Success.xml");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(networkInputs)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- // old: when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_network_l3_network_uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
- when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_l3_network_uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.callRESTQueryAAINetworkName(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "queryNameAAIRequest", "http://localhost:8090/aai/v8/network/l3-networks/l3-network?network-name=MNS-25180-L-01-dmz_direct_net_1")
-
- verify(mockExecution).setVariable(Prefix + "aaiNameReturnCode", "200")
- verify(mockExecution).setVariable(Prefix + "orchestrationStatus", "PENDING-CREATE")
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkName_404() {
-
- println "************ callRESTQueryAAINetworkName ************* "
-
- WireMock.reset();
- MockGetNetworkByName_404("CreateNetworkV2/createNetwork_queryName_AAIResponse_Success.xml", "myOwn_Network");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(networkInputs_404)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- // old: when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_network_l3_network_uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
- when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_l3_network_uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.callRESTQueryAAINetworkName(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "queryNameAAIRequest", "http://localhost:8090/aai/v8/network/l3-networks/l3-network?network-name=myOwn_Network")
- verify(mockExecution).setVariable(Prefix + "aaiNameReturnCode", "404")
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkId_200() {
-
- println "************ callRESTQueryAAINetworkId ************* "
-
- WireMock.reset();
- MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml", "all");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "assignSDNCResponse")).thenReturn(sdncAdapterWorkflowAssignResponse)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- // old: when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_network_l3_network_uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
- when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_l3_network_uri")).thenReturn("/aai/v9/network/l3-networks/l3-network")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("sdncVersion")).thenReturn("1702")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.callRESTQueryAAINetworkId(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "queryIdAAIRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/49c86598-f766-46f8-84f8-8d1c1b10f9b4"+"?depth=all")
- verify(mockExecution).setVariable(Prefix + "aaiIdReturnCode", "200")
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAICloudRegion30_200() {
-
- println "************ callRESTQueryAAICloudRegion30_200 ************* "
-
- WireMock.reset();
- MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix)
- when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedvIPRNetworkRequest)
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- // old: when(mockExecution.getVariable("URN_mso_workflow_default_aai_cloud_infrastructure_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8")
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
- //
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "queryCloudRegionRequest", "http://localhost:8090/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/RDM2WAGPLCP")
- verify(mockExecution, atLeast(2)).setVariable(Prefix + "queryCloudRegionReturnCode", "200")
- verify(mockExecution).setVariable(Prefix + "isCloudRegionGood", true)
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAICloudRegion25_200() {
-
- println "************ callRESTQueryAAICloudRegion25_200 ************* "
-
- WireMock.reset();
- MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix)
- when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedvIPRNetworkRequest)
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- // old: when(mockExecution.getVariable("URN_mso_workflow_default_aai_cloud_infrastructure_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8")
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
- //
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "queryCloudRegionRequest", "http://localhost:8090/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/RDM2WAGPLCP")
- verify(mockExecution, atLeast(2)).setVariable(Prefix + "queryCloudRegionReturnCode", "200")
- verify(mockExecution).setVariable(Prefix + "isCloudRegionGood", true)
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAICloudRegion_NotFound() {
-
- println "************ callRESTQueryAAICloudRegionFake ************* "
-
- WireMock.reset();
- MockGetNetworkCloudRegion_404("MDTWNJ21")
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix)
- when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(vnfRequestFakeRegion)
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- //old: when(mockExecution.getVariable("URN_mso_workflow_default_aai_cloud_infrastructure_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8")
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
- //
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "queryCloudRegionRequest", "http://localhost:8090/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/MDTWNJ21")
- verify(mockExecution, atLeast(1)).setVariable(Prefix + "queryCloudRegionReturnCode", "404")
- verify(mockExecution).setVariable(Prefix + "cloudRegionPo", "MDTWNJ21")
- verify(mockExecution).setVariable(Prefix + "cloudRegionSdnc", "AAIAIC25")
- verify(mockExecution).setVariable(Prefix + "isCloudRegionGood", true)
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkVpnBinding_200() {
-
- println "************ callRESTQueryAAINetworkVpnBinding_200 ************* "
-
- WireMock.reset();
- MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
- MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "queryIdAAIResponse")).thenReturn(queryIdAIIResponse) // v6
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- // old: when(mockExecution.getVariable("URN_mso_workflow_default_aai_network_vpn-binding_uri")).thenReturn("")
- // old: when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_network_vpn-binding_uri")).thenReturn("")
- when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_vpn_binding_uri")).thenReturn("/aai/v8/network/vpn-bindings/vpn-binding")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "vpnCount", 2)
- verify(mockExecution).setVariable(Prefix + "vpnBindings", ['/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/', '/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/'])
- // the last vpnBinding value is saved.
- verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIRequest", "http://localhost:8090/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017?depth=all")
- verify(mockExecution, atLeast(2)).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200")
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkVpnBindingList_200() {
-
- println "************ callRESTQueryAAINetworkVpnBinding_200 ************* "
-
- WireMock.reset();
- MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBindingList_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
- MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBindingList_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "queryIdAAIResponse")).thenReturn(queryIdAIIResponse) // v6
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_vpn_binding_uri")).thenReturn("/aai/v8/network/vpn-bindings/vpn-binding")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "vpnCount", 2)
- verify(mockExecution).setVariable(Prefix + "vpnBindings", ['/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/', '/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/'])
- // the last vpnBinding value is saved.
- verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIRequest", "http://localhost:8090/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017?depth=all")
- verify(mockExecution, atLeast(2)).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200")
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkVpnBinding_TestScenario01_200() {
-
- println "************ callRESTQueryAAINetworkVpnBinding_200 ************* "
-
- WireMock.reset();
- MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "queryIdAAIResponse")).thenReturn(queryIdAIIResponseTestScenario01)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- // old: when(mockExecution.getVariable("URN_mso_workflow_default_aai_network_vpn-binding_uri")).thenReturn("")
- // old: when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_network_vpn-binding_uri")).thenReturn("")
- when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_vpn_binding_uri")).thenReturn("/aai/v8/network/vpn-bindings/vpn-binding")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "vpnCount", 1)
- verify(mockExecution).setVariable(Prefix + "vpnBindings", ['/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/'])
- // the last vpnBinding value is saved.
- verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIRequest", "http://localhost:8090/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017?depth=all")
- verify(mockExecution).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200")
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkVpnBinding_200_URN_Uri() {
-
- println "************ callRESTQueryAAINetworkVpnBinding_200 ************* "
-
- WireMock.reset();
- MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
- MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "queryIdAAIResponse")).thenReturn(queryIdAIIResponse)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- //when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_network_vpn_binding_uri")).thenReturn("/aai/v8/network/vpn-bindings/vpn-binding")
- //when(mockExecution.getVariable("URN_mso_workflow_default_aai_network_vpn_binding_uri")).thenReturn("/aai/v8/network/vpn-bindings/vpn-binding")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8")
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_vpn_binding_uri")).thenReturn("/aai/v8/network/vpn-bindings/vpn-binding")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "vpnCount", 2)
- verify(mockExecution).setVariable(Prefix + "vpnBindings", ['/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/', '/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/'])
- // the last vpnBinding value is saved.
- verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIRequest", "http://localhost:8090/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017?depth=all")
- verify(mockExecution, atLeast(2)).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200")
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkVpnBinding_NotPresent() {
-
- println "************ callRESTQueryAAINetworkVpnBinding_NotPresent ************* "
-
- WireMock.reset();
- MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
-
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
-
- when(mockExecution.getVariable(Prefix + "queryIdAAIResponse")).thenReturn(queryIdAIIResponseVpnNotPresent)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- //when(mockExecution.getVariable("URN_mso_workflow_default_aai_network_l3_network_uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8")
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_l3_network_uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200")
- verify(mockExecution).setVariable(Prefix + "vpnCount", 0)
- verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIResponse", aaiVpnResponseStub)
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkPolicy_200() {
-
- println "************ callRESTQueryAAINetworkPolicy_200 ************* "
-
- WireMock.reset();
- MockGetNetworkPolicy("CreateNetworkV2/createNetwork_queryNetworkPolicy_AAIResponse_Success.xml", "cee6d136-e378-4678-a024-2cd15f0ee0cg");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "queryIdAAIResponse")).thenReturn(queryIdAIIResponse)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- //when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_network_policy_uri")).thenReturn("")
- // old: when(mockExecution.getVariable("URN_mso_workflow_default_aai_network_policy_uri")).thenReturn("/aai/v8/network/network-policies/network-policy")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8")
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_network_policy_uri")).thenReturn("/aai/v8/network/network-policies/network-policy")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.callRESTQueryAAINetworkPolicy(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "networkPolicyCount", 1)
- verify(mockExecution).setVariable(Prefix + "networkPolicyUriList", ['/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg'])
- // the last vpnBinding value is saved.
- verify(mockExecution).setVariable(Prefix + "queryNetworkPolicyAAIRequest", "http://localhost:8090/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg?depth=all")
- verify(mockExecution).setVariable(Prefix + "aaiQqueryNetworkPolicyReturnCode", "200")
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkTableRef_200() {
-
- println "************ callRESTQueryAAINetworkTableRef_200 ************* "
-
- WireMock.reset();
- MockGetNetworkTableReference("CreateNetworkV2/createNetwork_queryNetworkTableRef1_AAIResponse_Success.xml", "refFQDN1");
- MockGetNetworkTableReference("CreateNetworkV2/createNetwork_queryNetworkTableRef2_AAIResponse_Success.xml", "refFQDN2");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "queryIdAAIResponse")).thenReturn(queryIdAIIResponse)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_network_table_reference_uri")).thenReturn("")
- // old: when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_network_table_reference_uri")).thenReturn("")
- when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_route_table_reference_uri")).thenReturn("/aai/v8/network/route-table-references/route-table-reference")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.callRESTQueryAAINetworkTableRef(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "networkTableRefCount", 2)
- verify(mockExecution).setVariable(Prefix + "networkTableRefUriList", ['/aai/v8/network/route-table-references/route-table-reference/refFQDN1','/aai/v8/network/route-table-references/route-table-reference/refFQDN2'])
- // the last vpnBinding value is saved.
- verify(mockExecution).setVariable(Prefix + "queryNetworkTableRefAAIRequest", "http://localhost:8090/aai/v8/network/route-table-references/route-table-reference/refFQDN1?depth=all")
- verify(mockExecution, atLeast(2)).setVariable(Prefix + "aaiQqueryNetworkTableRefReturnCode", "200")
-
- }
-
- @Test
- //@Ignore
- public void callRESTReQueryAAINetworkId_200() {
-
- println "************ callRESTReQueryAAINetworkId ************* "
-
- WireMock.reset();
- MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml", "all");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "networkId")).thenReturn("49c86598-f766-46f8-84f8-8d1c1b10f9b4")
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- //when(mockExecution.getVariable("URN_mso_workflow_default_aai_l3_network_version")).thenReturn("8")
- when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_l3_network_uri")).thenReturn("/aai/v9/network/l3-networks/l3-network")
- //old: when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_network_l3_network_uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("sdncVersion")).thenReturn("1702")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.callRESTReQueryAAINetworkId(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "requeryIdAAIRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/49c86598-f766-46f8-84f8-8d1c1b10f9b4"+"?depth=all")
- verify(mockExecution).setVariable(Prefix + "aaiRequeryIdReturnCode", "200")
-
- }
-
- @Test
- //@Ignore
- public void callRESTUpdateContrailAAINetworkREST_200() {
-
- println "************ callRESTUpdateContrailAAINetwork ************* "
-
- WireMock.reset();
- MockPutNetworkIdWithDepth("CreateNetworkV2/createNetwork_updateContrail_AAIResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "all");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "networkId")).thenReturn("49c86598-f766-46f8-84f8-8d1c1b10f9b4")
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse)
- when(mockExecution.getVariable(Prefix + "createNetworkResponse")).thenReturn(createNetworkResponseREST)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- // old: when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_network_l3_network_uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
- when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_l3_network_uri")).thenReturn("/aai/v9/network/l3-networks/l3-network")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("false")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.callRESTUpdateContrailAAINetwork(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "updateContrailAAIUrlRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/49c86598-f766-46f8-84f8-8d1c1b10f9b4"+"?depth=all")
- verify(mockExecution).setVariable(Prefix + "updateContrailAAIPayloadRequest", updateContrailAAIPayloadRequest)
- verify(mockExecution).setVariable(Prefix + "aaiUpdateContrailReturnCode", "200")
- //verify(mockExecution).setVariable(Prefix + "updateContrailAAIResponse", updateContrailAAIResponse)
- verify(mockExecution).setVariable(Prefix + "isPONR", true)
-
- }
-
- @Test
- //@Ignore
- public void callRESTUpdateContrailAAINetworkREST_200_segmentation() {
-
- println "************ callRESTUpdateContrailAAINetwork ************* "
-
- WireMock.reset();
- MockPutNetworkIdWithDepth("CreateNetworkV2/createNetwork_updateContrail_AAIResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "all");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "networkId")).thenReturn("49c86598-f766-46f8-84f8-8d1c1b10f9b4")
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse_segmentation)
- when(mockExecution.getVariable(Prefix + "createNetworkResponse")).thenReturn(createNetworkResponseREST)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- // old: when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_network_l3_network_uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
- when(mockExecution.getVariable("URN_mso_workflow_DoCreateNetworkInstance_aai_l3_network_uri")).thenReturn("/aai/v9/network/l3-networks/l3-network")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("false")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.callRESTUpdateContrailAAINetwork(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "updateContrailAAIUrlRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/49c86598-f766-46f8-84f8-8d1c1b10f9b4"+"?depth=all")
- verify(mockExecution).setVariable(Prefix + "updateContrailAAIPayloadRequest", updateContrailAAIPayloadRequest_segmentation)
- verify(mockExecution).setVariable(Prefix + "aaiUpdateContrailReturnCode", "200")
- //verify(mockExecution).setVariable(Prefix + "updateContrailAAIResponse", updateContrailAAIResponse)
- verify(mockExecution).setVariable(Prefix + "isPONR", true)
-
- }
-
-
-
- @Test
- //@Ignore
- public void validateCreateNetworkResponseREST() {
-
- println "************ validateNetworkResponse ************* "
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "createNetworkResponse")).thenReturn(createNetworkResponseREST)
- when(mockExecution.getVariable(Prefix + "networkReturnCode")).thenReturn('200')
-
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.validateCreateNetworkResponse(mockExecution)
-
- //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
- //debugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "createNetworkResponse", createNetworkResponseREST)
- verify(mockExecution).setVariable(Prefix + "isNetworkRollbackNeeded", true)
- verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", createRollbackNetworkRequest)
-
- }
-
- @Test
- //@Ignore
- public void validateCreateNetworkResponseREST_Error() {
-
- println "************ validateNetworkResponse ************* "
-
- WorkflowException workflowException = new WorkflowException("DoCreateNetworkInstance", 2500, "Received error from Network Adapter: JBWEB000065: HTTP Status 500.")
-
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "createNetworkResponse")).thenReturn(networkException500)
- when(mockExecution.getVariable(Prefix + "networkReturnCode")).thenReturn('500')
-
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- try {
- DoCreateNetworkInstance.validateCreateNetworkResponse(mockExecution)
- } catch (Exception ex) {
- println " Test End - Handle catch-throw BpmnError()! "
- }
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution, atLeast(1)).setVariable("WorkflowException", refEq(workflowException, any(WorkflowException.class)))
-
- }
-
- @Test
- //@Ignore
- public void validateSDNCResponse() {
-
- println "************ validateSDNCResponse ************* "
-
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "assignSDNCResponse")).thenReturn(sdncAdapterWorkflowResponse)
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
- when(mockExecution.getVariable("SDNCA_SuccessIndicator")).thenReturn(true)
- when(mockExecution.getVariable(Prefix + "sdncReturnCode")).thenReturn("200")
- when(mockExecution.getVariable(Prefix + "isResponseGood")).thenReturn(true)
-
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- try {
- DoCreateNetworkInstance.validateSDNCResponse(mockExecution)
- verify(mockExecution).setVariable(Prefix + "isSdncRollbackNeeded", true)
-
- } catch (Exception ex) {
- println " Graceful Exit - " + ex.getMessage()
- }
- //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
- //debugger.printInvocations(mockExecution)
-
- //verify(mockExecution).setVariable(Prefix + "isSdncRollbackNeeded", true)
-
- }
-
- @Test
- //@Ignore
- public void validateSDNCResponse_Error() {
-
- println "************ validateSDNCResponse ************* "
-
- WorkflowException workflowException = new WorkflowException("DoCreateNetworkInstance", 2500, "Received error from SNDC Adapter: HTTP Status 500.")
-
- //ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "assignSDNCResponse")).thenReturn(sdncAdapterWorkflowResponse_Error)
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
- when(mockExecution.getVariable("SDNCA_SuccessIndicator")).thenReturn(false)
- when(mockExecution.getVariable(Prefix + "sdncReturnCode")).thenReturn("200")
- when(mockExecution.getVariable("WorkflowException")).thenReturn(workflowException)
-
-
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- try {
- DoCreateNetworkInstance.validateSDNCResponse(mockExecution)
- } catch (Exception ex) {
- println " Graceful Exit! - " + ex.getMessage()
- }
- //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
- //debugger.printInvocations(mockExecution)
-
- // verify set prefix = Prefix + ""
- //verify(mockExecution).setVariable(Prefix + "sdncResponseSuccess", false)
-
- }
-
- @Test
- //@Ignore
- public void validateRpcSDNCActivateResponse() {
-
- println "************ validateRpcSDNCActivateResponse ************* "
-
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "activateSDNCResponse")).thenReturn(sdncAdapterWorkflowResponse)
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
- when(mockExecution.getVariable("SDNCA_SuccessIndicator")).thenReturn(true)
- when(mockExecution.getVariable(Prefix + "sdncActivateReturnCode")).thenReturn("200")
-
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- try {
- DoCreateNetworkInstance.validateRpcSDNCActivateResponse(mockExecution)
- verify(mockExecution).setVariable(Prefix + "isSdncActivateRollbackNeeded", true)
-
- } catch (Exception ex) {
- println " Graceful Exit - " + ex.getMessage()
- }
- //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
- //debugger.printInvocations(mockExecution)
-
- //verify(mockExecution).setVariable(Prefix + "isSdncRollbackNeeded", true)
-
- }
-
- @Test
- //@Ignore
- public void prepareRollbackData() {
-
- println "************ prepareRollbackData() ************* "
-
-
-
- WorkflowException workflowException = new WorkflowException("DoCreateNetworkInstance", 2500, "Received error from Network Adapter: JBWEB000065: HTTP Status 500.")
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn(rollbackSDNCRequest)
- when(mockExecution.getVariable(Prefix + "rollbackActivateSDNCRequest")).thenReturn(rollbackActivateSDNCRequest)
- when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn(rollbackNetworkRequest)
- when(mockExecution.getVariable("WorkflowException")).thenReturn(workflowException)
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.prepareRollbackData(mockExecution)
-
- verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix)
-
- }
-
- @Test
- @Ignore
- public void postProcessResponse() {
-
- println "************ postProcessResponse() ************* "
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "isException")).thenReturn(false)
- when(mockExecution.getVariable("sdncVersion")).thenReturn("1702")
- when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn(sdncRpcRollbackRequest)
- when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn(rollbackSDNCRequest)
- when(mockExecution.getVariable(Prefix + "rollbackActivateSDNCRequest")).thenReturn(sdncActivateRollbackRequest)
-
-
- // preProcessRequest(DelegateExecution execution)
- DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
- DoCreateNetworkInstance.postProcessResponse(mockExecution)
-
- verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "Success", true)
-
- }
-
- private ExecutionEntity setupMock() {
-
- ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class)
- when(mockProcessDefinition.getKey()).thenReturn("DoCreateNetworkInstance")
- RepositoryService mockRepositoryService = mock(RepositoryService.class)
- when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition)
- when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("DoCreateNetworkInstance")
- when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100")
- ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class)
- when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService)
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
-
- when(mockExecution.getId()).thenReturn("100")
- when(mockExecution.getProcessDefinitionId()).thenReturn("DoCreateNetworkInstance")
- when(mockExecution.getProcessInstanceId()).thenReturn("DoCreateNetworkInstance")
- when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices)
- when(mockExecution.getProcessEngineServices().getRepositoryService().getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(mockProcessDefinition)
-
- return mockExecution
- }
-}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeV2Test.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeV2Test.groovy deleted file mode 100644 index 2d58c7af69..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeV2Test.groovy +++ /dev/null @@ -1,93 +0,0 @@ -package org.openecomp.mso.bpmn.infrastructure.scripts - -import static org.junit.Assert.*; -import static org.mockito.Mockito.* - -import org.camunda.bpm.engine.delegate.DelegateExecution -import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity -import org.mockito.ArgumentCaptor -import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner -import org.openecomp.mso.bpmn.common.scripts.MsoGroovyTest -import org.openecomp.mso.bpmn.common.scripts.MsoUtils -import org.junit.Before -import org.junit.Ignore; -import org.junit.Test -import org.junit.runner.RunWith - - -@RunWith(MockitoJUnitRunner.class) -class DoCreateVfModuleVolumeV2Test extends MsoGroovyTest { - - def String volumeRollbackRequest = """ -<rollbackVolumeGroupRequest> - <volumeGroupRollback> - <volumeGroupId>171907d6-cdf0-4e08-953d-81ee104005a7</volumeGroupId> - <volumeGroupStackId>{{VOLUMEGROUPSTACKID}}</volumeGroupStackId> - <cloudSiteId>mtwnj1a</cloudSiteId> - <tenantId>c2141e3fcae940fcb4797ec9115e5a7a</tenantId> - <volumeGroupCreated>true</volumeGroupCreated> - <msoRequest> - <requestId>230fd6ac-2a39-4be4-9b1e-7b7e1cc039b5</requestId> - <serviceInstanceId>88c871d6-be09-4982-8490-96b1d243fb34</serviceInstanceId> - </msoRequest> - <messageId>9a5a91e8-3b79-463c-81c3-874a78f5b567</messageId> - </volumeGroupRollback> - <skipAAI>true</skipAAI> - <messageId>9a5a91e8-3b79-463c-81c3-874a78f5b567</messageId> - <notificationUrl>http://msobpel-app-e2e.ecomp.cci.att.com:8080/mso/WorkflowMessage/VNFAResponse/9a5a91e8-3b79-463c-81c3-874a78f5b567</notificationUrl> -</rollbackVolumeGroupRequest> - """ - - def String volumeRollbackRequestWithStackId = """ -<rollbackVolumeGroupRequest> - <volumeGroupRollback> - <volumeGroupId>171907d6-cdf0-4e08-953d-81ee104005a7</volumeGroupId> - <volumeGroupStackId>mdt22avrr_volume01/0f1aaae8-efe3-45ce-83e1-bfad01db58d8</volumeGroupStackId> - <cloudSiteId>mtwnj1a</cloudSiteId> - <tenantId>c2141e3fcae940fcb4797ec9115e5a7a</tenantId> - <volumeGroupCreated>true</volumeGroupCreated> - <msoRequest> - <requestId>230fd6ac-2a39-4be4-9b1e-7b7e1cc039b5</requestId> - <serviceInstanceId>88c871d6-be09-4982-8490-96b1d243fb34</serviceInstanceId> - </msoRequest> - <messageId>9a5a91e8-3b79-463c-81c3-874a78f5b567</messageId> - </volumeGroupRollback> - <skipAAI>true</skipAAI> - <messageId>9a5a91e8-3b79-463c-81c3-874a78f5b567</messageId> - <notificationUrl>http://msobpel-app-e2e.ecomp.cci.att.com:8080/mso/WorkflowMessage/VNFAResponse/9a5a91e8-3b79-463c-81c3-874a78f5b567</notificationUrl> -</rollbackVolumeGroupRequest> - """ - - - - @Before - public void init() - { - MockitoAnnotations.initMocks(this) - } - - @Test - @Ignore // 1802 merge - public void testBuildRollbackVolumeGroupRequestXml() { - DoCreateVfModuleVolumeV2 process = new DoCreateVfModuleVolumeV2() - String xml = process.buildRollbackVolumeGroupRequestXml( - "171907d6-cdf0-4e08-953d-81ee104005a7", // volumeGroupId - "mtwnj1a", // cloudSiteId - "c2141e3fcae940fcb4797ec9115e5a7a", // tenantId - "230fd6ac-2a39-4be4-9b1e-7b7e1cc039b5", // requestId - "88c871d6-be09-4982-8490-96b1d243fb34", // serviceInstanceId - "9a5a91e8-3b79-463c-81c3-874a78f5b567", // messageId - "http://msobpel-app-e2e.ecomp.cci.att.com:8080/mso/WorkflowMessage/VNFAResponse/9a5a91e8-3b79-463c-81c3-874a78f5b567") // notificationUrl - - assertEquals(volumeRollbackRequest.replaceAll("\\s", ""), xml.replaceAll("\\s", "")) - } - - - @Test - public void testUpdateRollbackVolumeGroupRequestXml() { - DoCreateVfModuleVolumeV2 process = new DoCreateVfModuleVolumeV2() - String updatedXml = process.updateRollbackVolumeGroupRequestXml(volumeRollbackRequest, "mdt22avrr_volume01/0f1aaae8-efe3-45ce-83e1-bfad01db58d8") - assertEquals(volumeRollbackRequestWithStackId.replaceAll("\\s", ""), updatedXml.replaceAll("\\s", "")) - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstanceTest.groovy deleted file mode 100644 index c301b65c41..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstanceTest.groovy +++ /dev/null @@ -1,148 +0,0 @@ -package org.openecomp.mso.bpmn.infrastructure.scripts - -import com.github.tomakehurst.wiremock.junit.WireMockRule -import org.camunda.bpm.engine.delegate.BpmnError -import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity -import org.junit.Before -import org.junit.BeforeClass -import org.junit.Ignore -import org.junit.Rule -import org.junit.Test -import org.mockito.MockitoAnnotations -import org.openecomp.mso.bpmn.mock.FileUtil -import org.openecomp.mso.bpmn.vcpe.scripts.GroovyTestBase - -import static org.assertj.core.api.Assertions.assertThatThrownBy -import static org.mockito.Matchers.anyString -import static org.mockito.Mockito.verify -import static org.mockito.Mockito.when -import static org.mockito.Mockito.eq - -class DoCustomDeleteE2EServiceInstanceTest extends GroovyTestBase { - - private static String request - - @Rule - public WireMockRule wireMockRule = new WireMockRule(GroovyTestBase.PORT) - - String Prefix = "CVRCS_" - String RbType = "DCRENI_" - - @BeforeClass - public static void setUpBeforeClass() { - request = FileUtil.readResourceFile("__files/InfrastructureFlows/DeleteCustomE2EService.json") - } - - @Before - public void init() - { - MockitoAnnotations.initMocks(this) - } - public DoCustomDeleteE2EServiceInstanceTest(){ - super("DoCustomDeleteE2EServiceInstance") - } - - @Test - public void preProcessRequestTest(){ - - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPreProcess(mex) - - DoCustomDeleteE2EServiceInstance instance = new DoCustomDeleteE2EServiceInstance() - instance.preProcessRequest(mex) - verify(mex).setVariable("sdncCallbackUrl", "/mso/sdncadapter/") - verify(mex).setVariable("siParamsXml", "") - } - - @Test - public void postProcessAAIGETSuccessTest(){ - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPreProcess(mex) - when(mex.getVariable("GENGS_SuccessIndicator")).thenReturn(true) - - String aaiGetResponse = FileUtil.readResourceFile("__files/GenericFlows/aaiGetResponse.xml") - when(mex.getVariable("GENGS_service")).thenReturn(aaiGetResponse) - DoCustomDeleteE2EServiceInstance instance = new DoCustomDeleteE2EServiceInstance() - instance.postProcessAAIGET(mex) - - verify(mex).setVariable(eq("serviceRelationShip"), anyString()) - } - - @Test - public void postProcessAAIGETFailureTest(){ - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPreProcess(mex) - when(mex.getVariable("GENGS_FoundIndicator")).thenReturn(false) - when(mex.getVariable("GENGS_SuccessIndicator")).thenReturn(false) - - DoCustomDeleteE2EServiceInstance instance = new DoCustomDeleteE2EServiceInstance() - assertThatThrownBy { instance.postProcessAAIGET(mex) } isInstanceOf BpmnError.class - } - - @Test - public void preInitResourcesOperStatusTest(){ - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPreProcess(mex) - when(mex.getVariable("serviceRelationShip")).thenReturn("[{\"resourceInstanceId\":\"3333\",\"resourceType\":\"overlay\"},{\"resourceInstanceId\":\"4444\",\"resourceType\":\"underlay\"},{\"resourceInstanceId\":\"1111\",\"resourceType\":\"vIMS\"},{\"resourceInstanceId\":\"222\",\"resourceType\":\"vEPC\"}]") - DoCustomDeleteE2EServiceInstance instance = new DoCustomDeleteE2EServiceInstance() - instance.preInitResourcesOperStatus(mex) - - verify(mex).setVariable(eq("CVFMI_initResOperStatusRequest"), anyString()) - } - - @Test - public void preResourceDeleteTest() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPreProcess(mex) - when(mex.getVariable("serviceRelationShip")).thenReturn("[{\"resourceInstanceId\":\"3333\",\"resourceType\":\"overlay\"},{\"resourceInstanceId\":\"4444\",\"resourceType\":\"underlay\"},{\"resourceInstanceId\":\"1111\",\"resourceType\":\"vIMS\"},{\"resourceInstanceId\":\"222\",\"resourceType\":\"vEPC\"}]") - DoCustomDeleteE2EServiceInstance instance = new DoCustomDeleteE2EServiceInstance() - instance.preResourceDelete(mex,"overlay") - verify(mex).setVariable("resourceType", "overlay") - } - - @Test - public void postProcessSDNCDeleteTest(){ - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPreProcess(mex) - when(mex.getVariable("SDNCA_SuccessIndicator")).thenReturn("true") - when(mex.getVariable("DDELSI_sdncResponseSuccess")).thenReturn("true") - when(mex.getVariable("prefix")).thenReturn("DDELSI_") - DoCustomDeleteE2EServiceInstance instance = new DoCustomDeleteE2EServiceInstance() - String response = FileUtil.readResourceFile("__files/GenericFlows/SDNCDeleteResponse.xml") - String method = "deleteE2E"; - instance.postProcessSDNCDelete(mex, response, method) - // following method doesn't do anything currently -> nothing to check - } - - @Test - public void postProcessAAIDELTest() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPreProcess(mex) - when(mex.getVariable("GENDS_SuccessIndicator")).thenReturn("true") - DoCustomDeleteE2EServiceInstance instance = new DoCustomDeleteE2EServiceInstance() - instance.postProcessAAIDEL(mex) - } - - private void initPreProcess(ExecutionEntity mex) { - when(mex.getVariable(GroovyTestBase.DBGFLAG)).thenReturn("true") - when(mex.getVariable("bpmnRequest")).thenReturn(request) - when(mex.getVariable("mso-request-id")).thenReturn("mri") - when(mex.getVariable("serviceType")).thenReturn("VoLTE") - when(mex.getVariable("serviceInstanceId")).thenReturn("e151059a-d924-4629-845f-264db19e50b4") - when(mex.getVariable("requestAction")).thenReturn("ra") - when(mex.getVariable("operationId")).thenReturn("59960003992") - when(mex.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("/mso/sdncadapter/") - when(mex.getVariable("GENGS_FoundIndicator")).thenReturn("true") - when(mex.getVariable("GENGS_siResourceLink")).thenReturn("/service-subscription/e2eserviceInstance/delete/service-instances/") - when(mex.getVariable("globalSubscriberId")).thenReturn("4993921112123") - when(mex.getVariable("GENGS_service")).thenReturn("test3434") - when(mex.getVariable("URN_mso_adapters_openecomp_db_endpoint")).thenReturn("http://localhost:8080/mso") - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollbackTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollbackTest.groovy deleted file mode 100644 index 345ca1bc2c..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollbackTest.groovy +++ /dev/null @@ -1,323 +0,0 @@ -package org.openecomp.mso.bpmn.infrastructure.scripts - -import static org.mockito.Mockito.* - -import org.camunda.bpm.engine.delegate.BpmnError -import org.camunda.bpm.engine.ProcessEngineServices -import org.camunda.bpm.engine.RepositoryService -import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity -import org.camunda.bpm.engine.impl.pvm.process.ProcessDefinitionImpl -import org.camunda.bpm.engine.repository.ProcessDefinition -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner -import org.mockito.internal.debugging.MockitoDebuggerImpl -import org.openecomp.mso.bpmn.common.scripts.MsoUtils -import org.openecomp.mso.bpmn.core.WorkflowException -import org.junit.Before -import org.junit.Rule; -import org.junit.Test -import org.junit.Ignore -import org.junit.runner.RunWith - -import static org.junit.Assert.*; - -import com.github.tomakehurst.wiremock.client.WireMock; -import com.github.tomakehurst.wiremock.junit.WireMockRule; - -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import org.apache.commons.lang3.* - - -@RunWith(MockitoJUnitRunner.class) -class DoDeleteNetworkInstanceRollbackTest { - - @Rule - public WireMockRule wireMockRule = new WireMockRule(8090); - - def utils = new MsoUtils() - String Prefix="DELNWKIR_" - - - String rollbackNetworkRequest = - """<NetworkAdapter:rollbackNetwork xmlns:NetworkAdapter="http://org.openecomp.mso/network"> - <rollback> - <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId> - <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId> - <networkStackId/> - <networkType>CONTRAIL_EXTERNAL</networkType> - <networkCreated>true</networkCreated> - <tenantId>7dd5365547234ee8937416c65507d266</tenantId> - <cloudSiteId>RDM2WAGPLCP</cloudSiteId> - <msoRequest> - <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId> - <serviceInstanceId/> - </msoRequest> - </rollback> -</NetworkAdapter:rollbackNetwork>""" - - String rollbackDeActivateSDNCRequest = - """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1" - xmlns:ns5="http://org.openecomp/mso/request/types/v1" - xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1"> - <sdncadapter:RequestHeader> - <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId> - <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId> - <sdncadapter:SvcAction>activate</sdncadapter:SvcAction> - <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation> - <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl> - <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction> - </sdncadapter:RequestHeader> - <aetgt:SDNCRequestData> - <request-information> - <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id> - <request-action>CreateNetworkInstance</request-action> - <source>VID</source> - <notification-url/> - <order-number/> - <order-version/> - </request-information> - <service-information> - <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id> - <service-type>MSO-dev-service-type</service-type> - <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id> - <subscriber-name>MSO_1610_dev</subscriber-name> - </service-information> - <network-information> - <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id> - <network-type>CONTRAIL_EXTERNAL</network-type> - <onap-model-information> - <model-invariant-uuid>invariant-uuid</model-invariant-uuid> - <model-customization-uuid>customization-uuid</model-customization-uuid> - <model-uuid>uuid</model-uuid> - <model-version>version</model-version> - <model-name>CONTRAIL_EXTERNAL</model-name> - </onap-model-information> - </network-information> - <network-request-information> - <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id> - <network-type>CONTRAIL_EXTERNAL</network-type> - <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name> - <tenant>7dd5365547234ee8937416c65507d266</tenant> - <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region> - </network-request-information> - </aetgt:SDNCRequestData> -</aetgt:SDNCAdapterWorkflowRequest>""" - - String rollbackSDNCRequest = - """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1" - xmlns:ns5="http://org.openecomp/mso/request/types/v1" - xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1"> - <sdncadapter:RequestHeader> - <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId> - <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId> - <sdncadapter:SvcAction>rollback</sdncadapter:SvcAction> - <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation> - <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl> - </sdncadapter:RequestHeader> - <aetgt:SDNCRequestData> - <request-information> - <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id> - <request-action>CreateNetworkInstance</request-action> - <source>VID</source> - <notification-url/> - <order-number/> - <order-version/> - </request-information> - <service-information> - <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id> - <service-type>MSO-dev-service-type</service-type> - <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id> - <subscriber-name>MSO_1610_dev</subscriber-name> - </service-information> - <network-information> - <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id> - <network-type>CONTRAIL_EXTERNAL</network-type> - <onap-model-information> - <model-invariant-uuid>invariant-uuid</model-invariant-uuid> - <model-customization-uuid>customization-uuid</model-customization-uuid> - <model-uuid>uuid</model-uuid> - <model-version>version</model-version> - <model-name>CONTRAIL_EXTERNAL</model-name> - </onap-model-information> - </network-information> - <network-request-information> - <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id> - <network-type>CONTRAIL_EXTERNAL</network-type> - <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name> - <tenant>7dd5365547234ee8937416c65507d266</tenant> - <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region> - </network-request-information> - </aetgt:SDNCRequestData> -</aetgt:SDNCAdapterWorkflowRequest>""" - -// - - - - - - - - - - - @Before - public void init() - { - MockitoAnnotations.initMocks(this) - - } - - public void initializeVariables (DelegateExecution mockExecution) { - - verify(mockExecution).setVariable(Prefix + "WorkflowException", null) - - verify(mockExecution).setVariable(Prefix + "rollbackDeactivateSDNCRequest", null) - verify(mockExecution).setVariable(Prefix + "rollbackDeactivateSDNCResponse", "") - verify(mockExecution).setVariable(Prefix + "rollbackDeactivateSDNCReturnCode", "") - - verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", null) - verify(mockExecution).setVariable(Prefix + "rollbackNetworkResponse", "") - verify(mockExecution).setVariable(Prefix + "rollbackNetworkReturnCode", "") - - verify(mockExecution).setVariable(Prefix + "Success", false) - verify(mockExecution).setVariable(Prefix + "fullRollback", false) - - } - - @Test - //@Ignore - public void preProcessRequest() { - - println "************ preProcessRequest ************* " - - WorkflowException workflowException = new WorkflowException("DoCreateNetworkInstance", 2500, "Received error from Network Adapter: JBWEB000065: HTTP Status 500.") - Map<String, String> rollbackData = new HashMap<String, String>(); - rollbackData.put("rollbackDeactivateSDNCRequest", rollbackDeActivateSDNCRequest) - rollbackData.put("rollbackNetworkRequest", rollbackNetworkRequest) - rollbackData.put("rollbackSDNCRequest", rollbackSDNCRequest) - - ExecutionEntity mockExecution = setupMock() - // Initialize prerequisite variables - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "") - when(mockExecution.getVariable("WorkflowException")).thenReturn(workflowException) - when(mockExecution.getVariable("rollbackData")).thenReturn(rollbackData) - when(mockExecution.getVariable("sdncVersion")).thenReturn("1702") - - when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B") - when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") - - when(mockExecution.getVariable("URN_mso_adapters_sdnc_endpoint")).thenReturn("http://localhost:8090/SDNCAdapter") - when(mockExecution.getVariable("URN_mso_adapters_network_rest_endpoint")).thenReturn("http://localhost:8090/networks/NetworkAdapter") - when(mockExecution.getVariable("URN_mso_adapters_sdnc_resource_endpoint")).thenReturn("http://localhost:8090/SDNCAdapterRpc") - - - // preProcessRequest(DelegateExecution execution) - DoDeleteNetworkInstanceRollback DoDeleteNetworkInstanceRollback = new DoDeleteNetworkInstanceRollback() - DoDeleteNetworkInstanceRollback.preProcessRequest(mockExecution) - - //verify variable initialization - initializeVariables(mockExecution) - - verify(mockExecution).getVariable("isDebugLogEnabled") - verify(mockExecution).setVariable("prefix", Prefix) - - } - - - @Test - //@Ignore - public void validateRollbackResponses_Good() { - - WorkflowException workflowException = new WorkflowException("DoDeleteNetworkInstanceRollback", 2500, "AAI Update Contrail Failed. Error 404.") - WorkflowException expectedWorkflowException = new WorkflowException("DoDeleteNetworkInstanceRollback", 2500, "AAI Update Contrail Failed. Error 404. + SNDC deactivate rollback completed. + PO Network rollback completed. + SNDC unassign rollback completed.") - - println "************ validateRollbackResponses_Good() ************* " - ExecutionEntity mockExecution = setupMock() - // Initialize prerequisite variables - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "") - - when(mockExecution.getVariable(Prefix + "rollbackDeactivateSDNCRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackDeactivateSDNCReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackDeactivateSDNCResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackNetworkReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackNetworkResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackSDNCReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackSDNCResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "WorkflowException")).thenReturn(workflowException) - when(mockExecution.getVariable(Prefix + "fullRollback")).thenReturn(false) - - DoDeleteNetworkInstanceRollback DoDeleteNetworkInstanceRollback = new DoDeleteNetworkInstanceRollback() - DoDeleteNetworkInstanceRollback.validateRollbackResponses(mockExecution) - - // verify set prefix = Prefix + "" - verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix) - verify(mockExecution, atLeast(1)).setVariable("rolledBack", true) - verify(mockExecution, atLeast(1)).setVariable("wasDeleted", true) - verify(mockExecution).setVariable("WorkflowException", refEq(expectedWorkflowException, any(WorkflowException.class))) - //verify(mockExecution).setVariable("WorkflowException", expectedWorkflowException) - } - - @Test - //@Ignore - public void validateRollbackResponses_FullRollback() { - - Map<String, String> rollbackData = new HashMap<String, String>(); - rollbackData.put("rollbackDeactivateSDNCRequest", rollbackDeActivateSDNCRequest) - rollbackData.put("rollbackNetworkRequest", rollbackNetworkRequest) - rollbackData.put("rollbackSDNCRequest", rollbackSDNCRequest) - - println "************ validateRollbackResponses_FullRollback() ************* " - ExecutionEntity mockExecution = setupMock() - // Initialize prerequisite variables - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "") - - when(mockExecution.getVariable(Prefix + "rollbackDeactivateSDNCRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackDeactivateSDNCReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackDeactivateSDNCResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackNetworkReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackNetworkResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackSDNCReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackSDNCResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "WorkflowException")).thenReturn(null) - when(mockExecution.getVariable(Prefix + "fullRollback")).thenReturn(true) - when(mockExecution.getVariable("rollbackData")).thenReturn(rollbackData) - - DoDeleteNetworkInstanceRollback DoDeleteNetworkInstanceRollback = new DoDeleteNetworkInstanceRollback() - DoDeleteNetworkInstanceRollback.validateRollbackResponses(mockExecution) - - // verify set prefix = Prefix + "" - verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix) - verify(mockExecution, atLeast(1)).setVariable("rollbackSuccessful", true) - verify(mockExecution, atLeast(1)).setVariable("rollbackError", false) - - } - - - private ExecutionEntity setupMock() { - - ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class) - when(mockProcessDefinition.getKey()).thenReturn("DoDeleteNetworkInstanceRollback") - RepositoryService mockRepositoryService = mock(RepositoryService.class) - when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition) - when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("DoDeleteNetworkInstanceRollback") - when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100") - ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class) - when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService) - - ExecutionEntity mockExecution = mock(ExecutionEntity.class) - // Initialize prerequisite variables - - when(mockExecution.getId()).thenReturn("100") - when(mockExecution.getProcessDefinitionId()).thenReturn("DoDeleteNetworkInstanceRollback") - when(mockExecution.getProcessInstanceId()).thenReturn("DoDeleteNetworkInstanceRollback") - when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices) - when(mockExecution.getProcessEngineServices().getRepositoryService().getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(mockProcessDefinition) - - return mockExecution - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceTest.groovy deleted file mode 100644 index d357444cfc..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceTest.groovy +++ /dev/null @@ -1,1929 +0,0 @@ -package org.openecomp.mso.bpmn.infrastructure.scripts
-
-import static org.mockito.Mockito.*
-
-import static org.openecomp.mso.bpmn.mock.StubResponseNetworkAdapter.MockNetworkAdapter;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkByIdWithDepth;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkCloudRegion;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkCloudRegion_404;
-import org.camunda.bpm.engine.ProcessEngineServices
-import org.camunda.bpm.engine.RepositoryService
-import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
-import org.camunda.bpm.engine.repository.ProcessDefinition
-import org.camunda.bpm.engine.delegate.DelegateExecution
-import org.junit.Before
-import org.junit.Ignore
-import org.junit.Rule
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.mockito.MockitoAnnotations
-import org.mockito.runners.MockitoJUnitRunner
-import org.openecomp.mso.bpmn.common.scripts.MsoUtils
-import org.openecomp.mso.bpmn.core.WorkflowException
-
-import com.github.tomakehurst.wiremock.client.WireMock
-import com.github.tomakehurst.wiremock.junit.WireMockRule
-import org.apache.commons.lang3.*
-
-
-@RunWith(MockitoJUnitRunner.class)
-class DoDeleteNetworkInstanceTest {
-
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(8090);
-
- def utils = new MsoUtils()
- String Prefix="DELNWKI_"
-
- String incomingJsonRequest =
- """{ "requestDetails": {
- "modelInfo": {
- "modelType": "network",
- "modelCustomizationId": "f21df226-8093-48c3-be7e-0408fcda0422",
- "modelName": "CONTRAIL_EXTERNAL",
- "modelVersion": "1.0"
- },
- "cloudConfiguration": {
- "lcpCloudRegionId": "RDM2WAGPLCP",
- "tenantId": "7dd5365547234ee8937416c65507d266"
- },
- "requestInfo": {
- "instanceName": "HSL_direct_net_2",
- "source": "VID",
- "callbackUrl": "",
- "suppressRollback": true,
- "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"
- },
- "relatedInstanceList": [
- {
- "relatedInstance": {
- "instanceId": "f70e927b-6087-4974-9ef8-c5e4d5847ca4",
- "modelInfo": {
- "modelType": "serviceT",
- "modelId": "modelI",
- "modelNameVersionId": "modelNameVersionI",
- "modelName": "modleNam",
- "modelVersion": "1"
- }
- }
- }
- ],
- "requestParameters": {
- "userParams": []
- }
- }"""
-
- String expectedDoDeleteNetworkInstanceRequest =
- """{ "requestDetails": {
- "modelInfo": {
- "modelType": "networkTyp",
- "modelId": "modelId",
- "modelNameVersionId": "modelNameVersionId",
- "modelName": "CONTRAIL_EXTERNAL",
- "modelVersion": "1"
- },
- "cloudConfiguration": {
- "lcpCloudRegionId": "RDM2WAGPLCP",
- "tenantId": "7dd5365547234ee8937416c65507d266"
- },
- "requestInfo": {
- "instanceName": "HSL_direct_net_2",
- "source": "VID",
- "callbackUrl": "",
- "suppressRollback": true,
- "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"
- },
- "relatedInstanceList": [
- {
- "relatedInstance": {
- "instanceId": "f70e927b-6087-4974-9ef8-c5e4d5847ca4",
- "modelInfo": {
- "modelType": "serviceT",
- "modelId": "modelI",
- "modelNameVersionId": "modelNameVersionI",
- "modelName": "modleNam",
- "modelVersion": "1"
- }
- }
- }
- ],
- "requestParameters": {
- "userParams": []
- }
- }"""
-
- // expectedVnfRequest
- String expectedNetworkRequest =
-"""<network-request xmlns="http://www.w3.org/2001/XMLSchema">
- <request-info>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <action>DELETE</action>
- <source>VID</source>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- </request-info>
- <network-inputs>
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name>HSL_direct_net_2</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <modelCustomizationId>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationId>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <backout-on-failure>false</backout-on-failure>
- <sdncVersion>1610</sdncVersion>
- </network-inputs>
- <network-params/>
-</network-request>"""
-
- String expectedVperNetworkRequest =
-"""<network-request xmlns="http://www.w3.org/2001/XMLSchema">
- <request-info>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <action>DELETE</action>
- <source>VID</source>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- </request-info>
- <network-inputs>
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <subscription-service-type>MSO-dev-service-type</subscription-service-type>
- <global-customer-id>globalId_45678905678</global-customer-id>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <backout-on-failure>false</backout-on-failure>
- <failIfExist>false</failIfExist>
- <networkModelInfo>
- <modelName>CONTRAIL_EXTERNAL</modelName>
- <modelUuid>sn5256d1-5a33-55df-13ab-12abad84e111</modelUuid>
- <modelInvariantUuid>sn5256d1-5a33-55df-13ab-12abad84e764</modelInvariantUuid>
- <modelVersion>1</modelVersion>
- <modelCustomizationUuid>sn5256d1-5a33-55df-13ab-12abad84e222</modelCustomizationUuid>
- </networkModelInfo>
- <serviceModelInfo>
- <modelName/>
- <modelUuid/>
- <modelInvariantUuid/>
- <modelVersion/>
- <modelCustomizationUuid/>
- </serviceModelInfo>
- <sdncVersion>1702</sdncVersion>
- </network-inputs>
- <network-params/>
-</network-request>"""
-
- String expected_networkInput =
- """<network-inputs xmlns="http://www.w3.org/2001/XMLSchema">
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name>HSL_direct_net_2</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <modelCustomizationId>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationId>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <backout-on-failure>false</backout-on-failure>
- <sdncVersion>1610</sdncVersion>
-</network-inputs>"""
-
- String expectedVper_networkInput =
-"""<network-inputs xmlns="http://www.w3.org/2001/XMLSchema">
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <subscription-service-type>MSO-dev-service-type</subscription-service-type>
- <global-customer-id>globalId_45678905678</global-customer-id>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <backout-on-failure>false</backout-on-failure>
- <failIfExist>false</failIfExist>
- <networkModelInfo>
- <modelName>CONTRAIL_EXTERNAL</modelName>
- <modelUuid>sn5256d1-5a33-55df-13ab-12abad84e111</modelUuid>
- <modelInvariantUuid>sn5256d1-5a33-55df-13ab-12abad84e764</modelInvariantUuid>
- <modelVersion>1</modelVersion>
- <modelCustomizationUuid>sn5256d1-5a33-55df-13ab-12abad84e222</modelCustomizationUuid>
- </networkModelInfo>
- <serviceModelInfo>
- <modelName/>
- <modelUuid/>
- <modelInvariantUuid/>
- <modelVersion/>
- <modelCustomizationUuid/>
- </serviceModelInfo>
- <sdncVersion>1702</sdncVersion>
-</network-inputs>"""
-
-// emptyRegionVnfRequest
-String emptyRegionVnfRequest =
-"""<network-request xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
- <request-info>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <action>DELETE</action>
- <source>PORTAL</source>
- </request-info>
- <network-inputs>
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name>HSL_direct_net_2</network-name>
- <network-type>CONTRAIL_BASIC</network-type>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <aic-cloud-region/>
- <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
- </network-inputs>
- <network-params>
- <param name="shared">0</param>
- </network-params>
-</network-request>"""
-
-String vnfRequestCloudRegionNotFound =
-"""<network-request xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
- <request-info>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <action>DELETE</action>
- <source>PORTAL</source>
- </request-info>
- <network-inputs>
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name>HSL_direct_net_2</network-name>
- <network-type>CONTRAIL_BASIC</network-type>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <aic-cloud-region>MDTWNJ21</aic-cloud-region>
- <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
- </network-inputs>
- <network-params>
- <param name="shared">0</param>
- </network-params>
-</network-request>"""
-
- String vnfPayload =
- """<rest:payload xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- contentType="text/xml">
- <network-request xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
- <request-info>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <action>DELETE</action>
- <source>PORTAL</source>
- </request-info>
- <network-inputs>
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name>HSL_direct_net_2</network-name>
- <network-type>CONTRAIL_BASIC</network-type>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
- </network-inputs>
- <network-params>
- <param name="shared">0</param>
- </network-params>
- </network-request>
-</rest:payload>"""
-
- String vnfPayload_MissingId =
-"""<rest:payload xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- contentType="text/xml">
- <network-request xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
- <request-info>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <action>DELETE</action>
- <source>PORTAL</source>
- </request-info>
- <network-inputs>
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name/>
- <network-type>CONTRAIL_BASIC</network-type>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
- </network-inputs>
- <network-params>
- <param name="shared">0</param>
- </network-params>
- </network-request>
-</rest:payload>"""
-
- String vnfRequestRESTPayload =
-"""<network-request xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
- <request-info>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <action>DELETE</action>
- <source>PORTAL</source>
- </request-info>
- <network-inputs>
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name>HSL_direct_net_2</network-name>
- <network-type>CONTRAIL_BASIC</network-type>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
- </network-inputs>
- <network-outputs>
- <network-id>id</network-id>
- <network-name>name</network-name>
- </network-outputs>
- <network-params>
- <param name="shared">0</param>
- </network-params>
- </network-request>"""
-
-
-String incomingRequestMissingCloudRegion =
-"""{ "requestDetails": {
- "modelInfo": {
- "modelType": "network",
- "modelCustomizationId": "f21df226-8093-48c3-be7e-0408fcda0422",
- "modelName": "CONTRAIL_EXTERNAL",
- "modelVersion": "1.0"
- },
- "cloudConfiguration": {
- "tenantId": "7dd5365547234ee8937416c65507d266"
- },
- "requestInfo": {
- "instanceName": "HSL_direct_net_2",
- "source": "VID",
- "callbackUrl": "",
- "suppressRollback": true,
- "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"
- },
- "relatedInstanceList": [
- {
- "relatedInstance": {
- "instanceId": "f70e927b-6087-4974-9ef8-c5e4d5847ca4",
- "modelInfo": {
- "modelType": "serviceT",
- "modelId": "modelI",
- "modelNameVersionId": "modelNameVersionI",
- "modelName": "modleNam",
- "modelVersion": "1"
- }
- }
- }
- ],
- "requestParameters": {
- "userParams": []
- }
- }"""
-
- String expectedNetworkRequestMissingId =
- """<network-request xmlns="http://www.w3.org/2001/XMLSchema">
- <request-info>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <action>DELETE</action>
- <source>VID</source>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- </request-info>
- <network-inputs>
- <network-id/>
- <network-name>HSL_direct_net_2</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <modelCustomizationId>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationId>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <backout-on-failure>false</backout-on-failure>
- <sdncVersion>1610</sdncVersion>
- </network-inputs>
- <network-params/>
-</network-request>"""
-
-String expectedNetworkRequestMissingCloudRegion =
-"""<network-request xmlns="http://www.w3.org/2001/XMLSchema">
- <request-info>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <action>DELETE</action>
- <source>VID</source>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- </request-info>
- <network-inputs>
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name>HSL_direct_net_2</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <modelCustomizationId>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationId>
- <aic-cloud-region>null</aic-cloud-region>
- <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <backout-on-failure>false</backout-on-failure>
- <sdncVersion>1610</sdncVersion>
- </network-inputs>
- <network-params/>
-</network-request>"""
-
- // vnfRESTRequest
- String vnfRESTRequest =
-"""<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- xmlns="http://www.w3.org/2001/XMLSchema"
- statusCode="200">
- <rest:payload contentType="text/xml">
- <network-request>
- <request-info>
- <action>DELETE</action>
- <source>VID</source>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- </request-info>
- <network-inputs>
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name>HSL_direct_net_2</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <backout-on-failure>true</backout-on-failure>
- </network-inputs>
- <network-params>
- <userParams/>
- </network-params>
- </network-request>
- </rest:payload>
-</rest:RESTResponse>"""
-
- String networkInputs =
- """<network-inputs xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name>HSL_direct_net_2</network-name>
- <network-type>CONTRAIL_BASIC</network-type>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
-</network-inputs>"""
-
-String networkInputsNoType =
-"""<network-inputs xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
- <network-id></network-id>
- <network-name></network-name>
- <network-type></network-type>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
-</network-inputs>"""
-
- String networkInputsMissingId =
- """<network-inputs xmlns="http://www.w3.org/2001/XMLSchema">
- <network-id/>
- <network-name>HSL_direct_net_2</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <modelCustomizationId>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationId>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <backout-on-failure>false</backout-on-failure>
- <sdncVersion>1610</sdncVersion>
-</network-inputs>"""
-
-String networkInputsMissingCloudRegion =
-"""<network-inputs xmlns="http://www.w3.org/2001/XMLSchema">
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name>HSL_direct_net_2</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <modelCustomizationId>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationId>
- <aic-cloud-region>null</aic-cloud-region>
- <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <backout-on-failure>false</backout-on-failure>
- <sdncVersion>1610</sdncVersion>
-</network-inputs>"""
-
- String MissingIdFault = "Invalid value or missing network-id element"
- String MissingRegionFault = "Invalid value or missing 'aic-cloud-region' element"
-
- String invalidWorkflowException = """<aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">
- <aetgt:ErrorMessage>Invalid value of network-id element</aetgt:ErrorMessage>
- <aetgt:ErrorCode>2500</aetgt:ErrorCode>
- </aetgt:WorkflowException>"""
-
-
- String queryAAIResponse =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Sat,30 Jan 2016 20:09:24 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID"
- value="mtcnjv9aaas01.mtcnj.aic.cip.com-20160130-20:09:24:814-165843"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v3">
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name>HSL_direct_net_2</network-name>
- <network-type>CONTRAIL_BASIC</network-type>
- <network-role>HSL_direct</network-role>
- <network-technology>contrail</network-technology>
- <neutron-network-id>8bbd3edf-b835-4610-96a2-a5cafa029042</neutron-network-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <orchestration-status>active</orchestration-status>
- <heat-stack-id>HSL_direct_net_2/57594a56-1c92-4a38-9caa-641c1fa3d4b6</heat-stack-id>
- <subnets>
- <subnet>
- <subnet-id>ea5f2a2c-604f-47ff-a9c5-253ee4f0ef0a</subnet-id>
- <neutron-subnet-id>5a77fdc2-7789-4649-a1b9-6eaf1db1813a</neutron-subnet-id>
- <gateway-address>172.16.34.1</gateway-address>
- <network-start-address>172.16.34.0</network-start-address>
- <cidr-mask>28</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>active</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <relationship-list/>
- </subnet>
- </subnets>
- <relationship-list>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v3/cloud-infrastructure/tenants/tenant/e81d842d3e8b45c5a59f57cd76af3aaf/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>e81d842d3e8b45c5a59f57cd76af3aaf</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </l3-network>
- </rest:payload>
-</rest:RESTResponse>"""
-
- String deleteNetworkRequest =
- """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
- <soapenv:Header/>
- <soapenv:Body>
- <NetworkAdapter:deleteNetwork xmlns:NetworkAdapter="http://org.openecomp.mso/network">
- <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
- <tenantId>e81d842d3e8b45c5a59f57cd76af3aaf</tenantId>
- <networkType>CONTRAIL_BASIC</networkType>
- <networkId>HSL_direct_net_2/57594a56-1c92-4a38-9caa-641c1fa3d4b6</networkId>
- <request>
- <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
- <serviceInstanceId>0</serviceInstanceId>
- </request>
- </NetworkAdapter:deleteNetwork>
- </soapenv:Body>
-</soapenv:Envelope>"""
-
-String deleteNetworkRESTRequest =
-"""<deleteNetworkRequest>
- <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
- <tenantId>e81d842d3e8b45c5a59f57cd76af3aaf</tenantId>
- <networkId>bdc5efe8-404a-409b-85f6-0dcc9eebae30</networkId>
- <networkStackId>HSL_direct_net_2/57594a56-1c92-4a38-9caa-641c1fa3d4b6</networkStackId>
- <networkType>CONTRAIL_BASIC</networkType>
- <modelCustomizationUuid>sn5256d1-5a33-55df-13ab-12abad84e222</modelCustomizationUuid>
- <skipAAI>true</skipAAI>
- <msoRequest>
- <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
- <serviceInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</serviceInstanceId>
- </msoRequest>
- <messageId>messageId_value</messageId>
- <notificationUrl/>
-</deleteNetworkRequest>"""
-
-String deleteNetworkRESTRequestAlaCarte =
-"""<deleteNetworkRequest>
- <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
- <tenantId>e81d842d3e8b45c5a59f57cd76af3aaf</tenantId>
- <networkId>bdc5efe8-404a-409b-85f6-0dcc9eebae30</networkId>
- <networkStackId>HSL_direct_net_2/57594a56-1c92-4a38-9caa-641c1fa3d4b6</networkStackId>
- <networkType>CONTRAIL_BASIC</networkType>
- <modelCustomizationUuid>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationUuid>
- <skipAAI>true</skipAAI>
- <msoRequest>
- <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
- <serviceInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</serviceInstanceId>
- </msoRequest>
- <messageId>messageId_value</messageId>
- <notificationUrl/>
-</deleteNetworkRequest>"""
-
- String deleteNetworkResponse_noRollback =
-"""<ns2:deleteNetworkResponse xmlns:ns2="http://org.openecomp.mso/network">
- <networkDeleted>true</networkDeleted>
-</ns2:deleteNetworkResponse>
-"""
-
- String deleteNetworkResponse =
- """<ns2:deleteNetworkResponse xmlns:ns2="http://org.openecomp.mso/network">
- <networkDeleted>true</networkDeleted>
- <rollback>
- <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
- <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
- <networkStackId></networkStackId>
- <networkType>CONTRAIL_EXTERNAL</networkType>
- <networkCreated>true</networkCreated>
- <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
- <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
- <msoRequest>
- <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId>
- <serviceInstanceId></serviceInstanceId>
- </msoRequest>
- </rollback>
- </ns2:deleteNetworkResponse>"""
-
- String deleteRollbackNetworkRequest =
- """<NetworkAdapter:rollbackNetwork xmlns:NetworkAdapter="http://org.openecomp.mso/network">
- <rollback>
- <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
- <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
- <networkStackId/>
- <networkType>CONTRAIL_EXTERNAL</networkType>
- <networkCreated>true</networkCreated>
- <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
- <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
- <msoRequest>
- <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId>
- <serviceInstanceId/>
- </msoRequest>
- </rollback>
-</NetworkAdapter:rollbackNetwork>"""
-
- String deleteNetworkResponseFalseCompletion =
- """<ns2:deleteNetworkResponse xmlns:ns2="http://org.openecomp.mso/network"
- xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
- <networkDeleted>false</networkDeleted>
- </ns2:deleteNetworkResponse>"""
-
- String deleteNetworkErrorResponse =
- """<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<deleteNetworkError>
-<messageId>680bd458-5ec1-4a16-b77c-509022e53450</messageId><category>INTERNAL</category>
-<message>400 Bad Request: The server could not comply with the request since it is either malformed or otherwise incorrect., error.type=StackValidationFailed, error.message=Property error: : resources.network.properties: : Unknown Property network_ipam_refs_data</message>
-<rolledBack>true</rolledBack>
-</deleteNetworkError>
-"""
-
- String deleteNetworkWorkflowException =
- """<aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">
- <aetgt:ErrorMessage>Received error from Network Adapter: 400 Bad Request: The server could not comply with the request since it is either malformed or otherwise incorrect., error.type=StackValidationFailed, error.message=Property error: : resources.network.properties: : Unknown Property network_ipam_refs_data</aetgt:ErrorMessage>
- <aetgt:ErrorCode>7020</aetgt:ErrorCode>
- </aetgt:WorkflowException>"""
-
-String aaiWorkflowException =
-"""<aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">
- <aetgt:ErrorMessage>Bpmn error encountered in DoDeleteNetworkInstance flow. Unexpected Response from AAI Adapter - org.apache.http.conn.HttpHostConnectException: Connect to localhost:8090 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect</aetgt:ErrorMessage>
- <aetgt:ErrorCode>2500</aetgt:ErrorCode>
- </aetgt:WorkflowException>"""
-
- String aaiResponse =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Sat,30 Jan 2016 20:09:24 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID"
- value="mtcnjv9aaas01.mtcnj.aic.cip.com-20160130-20:09:24:814-165843"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v8">
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name>HSL_direct_net_2</network-name>
- <network-type>CONTRAIL_BASIC</network-type>
- <network-role>HSL_direct</network-role>
- <network-technology>contrail</network-technology>
- <neutron-network-id>8bbd3edf-b835-4610-96a2-a5cafa029042</neutron-network-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <orchestration-status>active</orchestration-status>
- <heat-stack-id>HSL_direct_net_2/57594a56-1c92-4a38-9caa-641c1fa3d4b6</heat-stack-id>
- <subnets>
- <subnet>
- <subnet-id>ea5f2a2c-604f-47ff-a9c5-253ee4f0ef0a</subnet-id>
- <neutron-subnet-id>5a77fdc2-7789-4649-a1b9-6eaf1db1813a</neutron-subnet-id>
- <gateway-address>172.16.34.1</gateway-address>
- <network-start-address>172.16.34.0</network-start-address>
- <cidr-mask>28</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>active</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <relationship-list/>
- </subnet>
- </subnets>
- <relationship-list>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/e81d842d3e8b45c5a59f57cd76af3aaf/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>e81d842d3e8b45c5a59f57cd76af3aaf</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>cloud-region</related-to>
- <related-link>cloud-infrastructure/cloud-regions/cloud-region/att-aic/RDM2WAGPLCP/</related-link>
- <relationship-data>
- <relationship-key>cloud-region.cloud-owner</relationship-key>
- <relationship-value>att-aic</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-region-id</relationship-key>
- <relationship-value>RDM2WAGPLCP</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </l3-network>
- </rest:payload>
-</rest:RESTResponse>"""
-
-String aaiResponseWithRelationship =
-"""<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Sat,30 Jan 2016 20:09:24 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID"
- value="mtcnjv9aaas01.mtcnj.aic.cip.com-20160130-20:09:24:814-165843"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v8">
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name>HSL_direct_net_2</network-name>
- <network-type>CONTRAIL_BASIC</network-type>
- <network-role>HSL_direct</network-role>
- <network-technology>contrail</network-technology>
- <neutron-network-id>8bbd3edf-b835-4610-96a2-a5cafa029042</neutron-network-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <orchestration-status>active</orchestration-status>
- <heat-stack-id>HSL_direct_net_2/57594a56-1c92-4a38-9caa-641c1fa3d4b6</heat-stack-id>
- <subnets>
- <subnet>
- <subnet-id>ea5f2a2c-604f-47ff-a9c5-253ee4f0ef0a</subnet-id>
- <neutron-subnet-id>5a77fdc2-7789-4649-a1b9-6eaf1db1813a</neutron-subnet-id>
- <gateway-address>172.16.34.1</gateway-address>
- <network-start-address>172.16.34.0</network-start-address>
- <cidr-mask>28</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>active</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <relationship-list/>
- </subnet>
- </subnets>
- <relationship-list>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/e81d842d3e8b45c5a59f57cd76af3aaf/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>e81d842d3e8b45c5a59f57cd76af3aaf</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>vf-module</related-to>
- <related-link>https://aai-app-e2e.ecomp.cci.com:8443/aai/v8/network/generic-vnfs/generic-vnf/105df7e5-0b3b-49f7-a837-4864b62827c4/vf-modules/vf-module/d9217058-95a0-49ee-b9a9-949259e89349/</related-link>
- <relationship-data>
- <relationship-key>generic-vnf.vnf-id</relationship-key>
- <relationship-value>105df7e5-0b3b-49f7-a837-4864b62827c4</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>vf-module.vf-module-id</relationship-key>
- <relationship-value>d9217058-95a0-49ee-b9a9-949259e89349</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>generic-vnf</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/generic-vnfs/generic-vnf/45f822d9-73ca-4255-9844-7cef401bbf47/</related-link>
- <relationship-data>
- <relationship-key>generic-vnf.vnf-id</relationship-key>
- <relationship-value>45f822d9-73ca-4255-9844-7cef401bbf47</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>generic-vnf.vnf-name</property-key>
- <property-value>zrdm1scpx05</property-value>
- </related-to-property>
- </relationship>
- </relationship-list>
- </l3-network>
- </rest:payload>
-</rest:RESTResponse>"""
-
- String deleteSDNCRequest =
- """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:ns5="http://org.openecomp/mso/request/types/v1"
- xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
- <sdncadapter:RequestHeader>
- <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
- <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
- <sdncadapter:SvcAction>delete</sdncadapter:SvcAction>
- <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
- <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
- </sdncadapter:RequestHeader>
- <aetgt:SDNCRequestData>
- <request-information>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <request-action>DisconnectNetworkRequest</request-action>
- <source>VID</source>
- <notification-url/>
- <order-number/>
- <order-version/>
- </request-information>
- <service-information>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <service-type/>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- <subscriber-name/>
- </service-information>
- <network-request-information>
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-type>CONTRAIL_BASIC</network-type>
- <network-name>HSL_direct_net_2</network-name>
- <tenant>7dd5365547234ee8937416c65507d266</tenant>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- </network-request-information>
- </aetgt:SDNCRequestData>
-</aetgt:SDNCAdapterWorkflowRequest>"""
-
- String deleteRpcSDNCRequest =
- """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
- <sdncadapter:RequestHeader>
- <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
- <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
- <sdncadapter:SvcAction>unassign</sdncadapter:SvcAction>
- <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
- <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
- <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
- </sdncadapter:RequestHeader>
- <aetgt:SDNCRequestData>
- <request-information>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <request-action>DeleteNetworkInstance</request-action>
- <source>VID</source>
- <notification-url/>
- <order-number/>
- <order-version/>
- </request-information>
- <service-information>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <subscription-service-type>MSO-dev-service-type</subscription-service-type>
- <onap-model-information>
- <model-invariant-uuid>fcc85cb0-ad74-45d7-a5a1-17c8744fdb71</model-invariant-uuid>
- <model-uuid>36a3a8ea-49a6-4ac8-b06c-89a54544b9b6</model-uuid>
- <model-version>1.0</model-version>
- <model-name>HNGW Protected OAM</model-name>
- </onap-model-information>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- <global-customer-id>globalId_45678905678</global-customer-id>
- <subscriber-name/>
- </service-information>
- <network-information>
- <network-id>networkId</network-id>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <onap-model-information>
- <model-invariant-uuid>sn5256d1-5a33-55df-13ab-12abad84e764</model-invariant-uuid>
- <model-customization-uuid>sn5256d1-5a33-55df-13ab-12abad84e222</model-customization-uuid>
- <model-uuid>sn5256d1-5a33-55df-13ab-12abad84e111</model-uuid>
- <model-version>1</model-version>
- <model-name>CONTRAIL_EXTERNAL</model-name>
- </onap-model-information>
- </network-information>
- <network-request-input>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <tenant>7dd5365547234ee8937416c65507d266</tenant>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <aic-clli/>
- <network-input-parameters/>
- </network-request-input>
- </aetgt:SDNCRequestData>
-</aetgt:SDNCAdapterWorkflowRequest>"""
-
- String sdncAdapaterDeactivateRollback =
-"""<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
- <sdncadapter:RequestHeader>
- <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
- <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
- <sdncadapter:SvcAction>activate</sdncadapter:SvcAction>
- <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
- <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
- <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
- </sdncadapter:RequestHeader>
- <aetgt:SDNCRequestData>
- <request-information>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <request-action>CreateNetworkInstance</request-action>
- <source>VID</source>
- <notification-url/>
- <order-number/>
- <order-version/>
- </request-information>
- <service-information>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <subscription-service-type>MSO-dev-service-type</subscription-service-type>
- <onap-model-information>
- <model-invariant-uuid>fcc85cb0-ad74-45d7-a5a1-17c8744fdb71</model-invariant-uuid>
- <model-uuid>36a3a8ea-49a6-4ac8-b06c-89a54544b9b6</model-uuid>
- <model-version>1.0</model-version>
- <model-name>HNGW Protected OAM</model-name>
- </onap-model-information>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- <global-customer-id>globalId_45678905678</global-customer-id>
- <subscriber-name/>
- </service-information>
- <network-information>
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <onap-model-information>
- <model-invariant-uuid>sn5256d1-5a33-55df-13ab-12abad84e764</model-invariant-uuid>
- <model-customization-uuid>sn5256d1-5a33-55df-13ab-12abad84e222</model-customization-uuid>
- <model-uuid>sn5256d1-5a33-55df-13ab-12abad84e111</model-uuid>
- <model-version>1</model-version>
- <model-name>CONTRAIL_EXTERNAL</model-name>
- </onap-model-information>
- </network-information>
- <network-request-input>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <tenant>7dd5365547234ee8937416c65507d266</tenant>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <aic-clli/>
- <network-input-parameters/>
- </network-request-input>
- </aetgt:SDNCRequestData>
-</aetgt:SDNCAdapterWorkflowRequest>"""
- String sdncAdapterWorkflowResponse =
- """<aetgt:SDNCAdapterWorkflowResponse xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1">
- <sdncadapterworkflow:response-data>
-<tag0:CallbackHeader xmlns:tag0="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
- <tag0:RequestId>745b1b50-e39e-4685-9cc8-c71f0bde8bf0</tag0:RequestId>
- <tag0:ResponseCode>200</tag0:ResponseCode>
- <tag0:ResponseMessage>OK</tag0:ResponseMessage>
-</tag0:CallbackHeader>
- <tag0:RequestData xmlns:tag0="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1"><?xml version="1.0" encoding="UTF-8"?><output xmlns="com:att:sdnctl:vnf"><svc-request-id>19174929-3809-49ca-89eb-17f84a035389</svc-request-id><response-code>200</response-code><ack-final-indicator>Y</ack-final-indicator><network-information><network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id></network-information><service-information><service-type>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-type><service-instance-id>HSL_direct_net_2</service-instance-id><subscriber-name>notsurewecare</subscriber-name></service-information></output></tag0:RequestData>
- </sdncadapterworkflow:response-data>
- </aetgt:SDNCAdapterWorkflowResponse>"""
-
- String sdncAdapterWorkflowResponse_404 =
- """<aetgt:SDNCAdapterWorkflowResponse xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1">
- <sdncadapterworkflow:response-data><?xml version="1.0" encoding="UTF-8"?><output xmlns="com:att:sdnctl:vnf"><svc-request-id>00703dc8-71ff-442d-a4a8-3adc5beef6a9</svc-request-id><response-code>404</response-code><response-message>Service instance not found in config tree</response-message><ack-final-indicator>Y</ack-final-indicator><network-information><network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id></network-information><service-information><service-type>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-type><service-instance-id>MNS-25180-L-01-dmz_direct_net_1</service-instance-id><subscriber-name>notsurewecare</subscriber-name></service-information></output></sdncadapterworkflow:response-data>
-</aetgt:SDNCAdapterWorkflowResponse>"""
-
- String expected_sdncAdapterWorkflowFormattedResponse_404 =
-"""<aetgt:SDNCAdapterWorkflowResponse xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns="com:att:sdnctl:vnf">
- <aetgt:response-data>
- <output>
- <svc-request-id>00703dc8-71ff-442d-a4a8-3adc5beef6a9</svc-request-id>
- <response-code>404</response-code>
- <response-message>Service instance not found in config tree</response-message>
- <ack-final-indicator>Y</ack-final-indicator>
- <network-information>
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- </network-information>
- <service-information>
- <service-type>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-type>
- <service-instance-id>MNS-25180-L-01-dmz_direct_net_1</service-instance-id>
- <subscriber-name>notsurewecare</subscriber-name>
- </service-information>
- </output>
- </aetgt:response-data>
-</aetgt:SDNCAdapterWorkflowResponse>"""
-
- String sdncAdapterWorkflowFormattedResponse =
- """<aetgt:SDNCAdapterWorkflowResponse xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns="com:att:sdnctl:vnf">
- <aetgt:response-data>
- <output>
- <svc-request-id>19174929-3809-49ca-89eb-17f84a035389</svc-request-id>
- <response-code>200</response-code>
- <ack-final-indicator>Y</ack-final-indicator>
- <network-information>
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- </network-information>
- <service-information>
- <service-type>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-type>
- <service-instance-id>HSL_direct_net_2</service-instance-id>
- <subscriber-name>notsurewecare</subscriber-name>
- </service-information>
- </output>
- </aetgt:response-data>
-</aetgt:SDNCAdapterWorkflowResponse>"""
-
-String sdncAdapterWorkflowFormattedResponse_404 =
-"""<aetgt:SDNCAdapterWorkflowResponse xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns="com:att:sdnctl:vnf">
- <aetgt:response-data>
- <output>
- <svc-request-id>00703dc8-71ff-442d-a4a8-3adc5beef6a9</svc-request-id>
- <response-code>404</response-code>
- <response-message>Service instance not found in config tree</response-message>
- <ack-final-indicator>Y</ack-final-indicator>
- <network-information>
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- </network-information>
- <service-information>
- <service-type>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-type>
- <service-instance-id>MNS-25180-L-01-dmz_direct_net_1</service-instance-id>
- <subscriber-name>notsurewecare</subscriber-name>
- </service-information>
- </output>
- </aetgt:response-data>
-</aetgt:SDNCAdapterWorkflowResponse>"""
-
- String invalidRequest = "Invalid value of network-id element"
-
-
-
- String sndcWorkflowException =
- """<aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">
- <aetgt:ErrorMessage>Received error from SDN-C: No availability zone available</aetgt:ErrorMessage>
- <aetgt:ErrorCode>5300</aetgt:ErrorCode>
- <aetgt:SourceSystemErrorCode>200</aetgt:SourceSystemErrorCode>
-</aetgt:WorkflowException>"""
-
- String sndcWorkflowErrorResponse =
- """<aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">
- <aetgt:ErrorMessage>Received error from SDN-C: <aetgt:SDNCAdapterWorkflowResponse xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1">
- <sdncadapterworkflow:response-data><?xml version="1.0" encoding="UTF-8"?><output xmlns="com:att:sdnctl:vnf"><svc-request-id>00703dc8-71ff-442d-a4a8-3adc5beef6a9</svc-request-id><response-code>404</response-code><response-message>Service instance not found in config tree</response-message><ack-final-indicator>Y</ack-final-indicator><network-information><network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id></network-information><service-information><service-type>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-type><service-instance-id>MNS-25180-L-01-dmz_direct_net_1</service-instance-id><subscriber-name>notsurewecare</subscriber-name></service-information></output></sdncadapterworkflow:response-data>
-</aetgt:SDNCAdapterWorkflowResponse></aetgt:ErrorMessage>
- <aetgt:ErrorCode>5300</aetgt:ErrorCode>
- </aetgt:WorkflowException>"""
-
- String unexpectedErrorEncountered =
- """<aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">
- <aetgt:ErrorMessage>bpel error deleting network</aetgt:ErrorMessage>
- <aetgt:ErrorCode>5300</aetgt:ErrorCode>
- </aetgt:WorkflowException>"""
-
-
- // expectedVnfRequest
- String inputViprSDC_NetworkRequest =
- """<network-request xmlns="http://www.w3.org/2001/XMLSchema">
- <request-info>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <action>DELETE</action>
- <source>VID</source>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- </request-info>
- <network-inputs>
- <network-id>networkId</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <subscription-service-type>MSO-dev-service-type</subscription-service-type>
- <global-customer-id>globalId_45678905678</global-customer-id>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <backout-on-failure>false</backout-on-failure>
- <failIfExist>false</failIfExist>
- <networkModelInfo>
- <modelName>CONTRAIL_EXTERNAL</modelName>
- <modelUuid>sn5256d1-5a33-55df-13ab-12abad84e111</modelUuid>
- <modelInvariantUuid>sn5256d1-5a33-55df-13ab-12abad84e764</modelInvariantUuid>
- <modelVersion>1</modelVersion>
- <modelCustomizationUuid>sn5256d1-5a33-55df-13ab-12abad84e222</modelCustomizationUuid>
- <modelType>CONTRAIL_EXTERNAL</modelType>
- </networkModelInfo>
- <serviceModelInfo>
- <modelName>HNGW Protected OAM</modelName>
- <modelUuid>36a3a8ea-49a6-4ac8-b06c-89a54544b9b6</modelUuid>
- <modelInvariantUuid>fcc85cb0-ad74-45d7-a5a1-17c8744fdb71</modelInvariantUuid>
- <modelVersion>1.0</modelVersion>
- <modelCustomizationUuid/>
- <modelType>service</modelType>
- </serviceModelInfo>
- <sdncVersion>1702</sdncVersion>
- </network-inputs>
- <network-params/>
-</network-request>"""
-// - - - - - - - -
-
-
- @Before
- public void init()
- {
- MockitoAnnotations.initMocks(this)
- }
-
- @Test
- //@Ignore
- public void preProcessRequest_Json() {
-
- println "************ preProcessRequest_Payload ************* "
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("isBaseVfModule")).thenReturn(true)
- when(mockExecution.getVariable("recipeTimeout")).thenReturn(0)
- when(mockExecution.getVariable("requestAction")).thenReturn("DELETE")
- when(mockExecution.getVariable("networkId")).thenReturn("bdc5efe8-404a-409b-85f6-0dcc9eebae30")
- when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable("vnfId")).thenReturn("")
- when(mockExecution.getVariable("volumeGroupId")).thenReturn("")
- //when(mockExecution.getVariable("networkId")).thenReturn("")
- when(mockExecution.getVariable("serviceType")).thenReturn("MOG")
- when(mockExecution.getVariable("networkType")).thenReturn("modelName")
- when(mockExecution.getVariable("bpmnRequest")).thenReturn(incomingJsonRequest)
- when(mockExecution.getVariable("disableRollback")).thenReturn(true)
- when(mockExecution.getVariable("testMessageId")).thenReturn("7df689f9-7b93-430b-9b9e-28140d70cc7ad")
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("mso-service-instance-id")).thenReturn("FH/VLXM/003717//SW_INTERNET")
- when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_rollback")).thenReturn("true")
- when(mockExecution.getVariable("sdncVersion")).thenReturn("1610")
-
- DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
- DoDeleteNetworkInstance.preProcessRequest(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix)
-
- //verify variable initialization
- initializeVariables(mockExecution)
-
- verify(mockExecution).setVariable("action", "DELETE")
- verify(mockExecution).setVariable(Prefix + "networkRequest", expectedNetworkRequest)
-
- verify(mockExecution).setVariable(Prefix + "rollbackEnabled", false)
-
- verify(mockExecution).setVariable(Prefix + "networkInputs", expected_networkInput)
- verify(mockExecution).setVariable(Prefix + "messageId", "7df689f9-7b93-430b-9b9e-28140d70cc7ad")
- verify(mockExecution).setVariable(Prefix + "source", "VID")
-
- // Authentications
- verify(mockExecution).setVariable("BasicAuthHeaderValuePO", "Basic cGFzc3dvcmQ=")
- verify(mockExecution).setVariable("BasicAuthHeaderValueSDNC", "Basic cGFzc3dvcmQ=")
-
-
- }
-
- @Test
- //@Ignore
- public void preProcessRequest_vPER() {
-
- def networkModelInfo = """{"modelUuid": "sn5256d1-5a33-55df-13ab-12abad84e111",
- "modelName": "CONTRAIL_EXTERNAL",
- "modelType": "CONTRAIL_EXTERNAL",
- "modelVersion": "1",
- "modelCustomizationUuid": "sn5256d1-5a33-55df-13ab-12abad84e222",
- "modelInvariantUuid": "sn5256d1-5a33-55df-13ab-12abad84e764"
- }""".trim()
-
- println "************ preProcessRequest_Payload ************* "
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- // Inputs:
- when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("disableRollback")).thenReturn("true")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable("networkId")).thenReturn("bdc5efe8-404a-409b-85f6-0dcc9eebae30") // optional
- when(mockExecution.getVariable("networkName")).thenReturn("MNS-25180-L-01-dmz_direct_net_1") // optional
- when(mockExecution.getVariable("productFamilyId")).thenReturn("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb")
- when(mockExecution.getVariable("networkModelInfo")).thenReturn("CONTRAIL_EXTERNAL")
- when(mockExecution.getVariable("lcpCloudRegionId")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable("tenantId")).thenReturn("7dd5365547234ee8937416c65507d266")
- when(mockExecution.getVariable("failIfExists")).thenReturn("false")
- when(mockExecution.getVariable("networkModelInfo")).thenReturn(networkModelInfo)
- when(mockExecution.getVariable("sdncVersion")).thenReturn("1702")
- when(mockExecution.getVariable("action")).thenReturn("DELETE")
- when(mockExecution.getVariable("subscriptionServiceType")).thenReturn("MSO-dev-service-type")
- when(mockExecution.getVariable("globalSubscriberId")).thenReturn("globalId_45678905678")
- when(mockExecution.getVariable("testMessageId")).thenReturn("7df689f9-7b93-430b-9b9e-28140d70cc7ad")
-
- when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
-
- DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
- DoDeleteNetworkInstance.preProcessRequest(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix)
-
- //verify variable initialization
- initializeVariables(mockExecution)
-
- verify(mockExecution).setVariable("action", "DELETE")
- verify(mockExecution).setVariable(Prefix + "networkRequest", expectedVperNetworkRequest)
-
- verify(mockExecution).setVariable(Prefix + "rollbackEnabled", false)
-
- verify(mockExecution).setVariable(Prefix + "networkInputs", expectedVper_networkInput)
- verify(mockExecution).setVariable(Prefix + "messageId", "7df689f9-7b93-430b-9b9e-28140d70cc7ad")
- verify(mockExecution).setVariable(Prefix + "source", "VID")
-
- // Authentications
- verify(mockExecution).setVariable("BasicAuthHeaderValuePO", "Basic cGFzc3dvcmQ=")
- verify(mockExecution).setVariable("BasicAuthHeaderValueSDNC", "Basic cGFzc3dvcmQ=")
-
-
- }
-
- public void initializeVariables (DelegateExecution mockExecution) {
-
- verify(mockExecution).setVariable(Prefix + "networkRequest", "")
- verify(mockExecution).setVariable(Prefix + "isSilentSuccess", false)
- verify(mockExecution).setVariable(Prefix + "Success", false)
-
- verify(mockExecution).setVariable(Prefix + "requestId", "")
- verify(mockExecution).setVariable(Prefix + "source", "")
- verify(mockExecution).setVariable(Prefix + "lcpCloudRegion", "")
- verify(mockExecution).setVariable(Prefix + "networkInputs", "")
- verify(mockExecution).setVariable(Prefix + "tenantId", "")
-
- verify(mockExecution).setVariable(Prefix + "queryAAIRequest","")
- verify(mockExecution).setVariable(Prefix + "queryAAIResponse", "")
- verify(mockExecution).setVariable(Prefix + "aaiReturnCode", "")
- verify(mockExecution).setVariable(Prefix + "isAAIGood", false)
- verify(mockExecution).setVariable(Prefix + "isVfRelationshipExist", false)
-
- // AAI query Cloud Region
- verify(mockExecution).setVariable(Prefix + "queryCloudRegionRequest","")
- verify(mockExecution).setVariable(Prefix + "queryCloudRegionReturnCode","")
- verify(mockExecution).setVariable(Prefix + "queryCloudRegionResponse","")
- verify(mockExecution).setVariable(Prefix + "cloudRegionPo","")
- verify(mockExecution).setVariable(Prefix + "cloudRegionSdnc","")
-
- verify(mockExecution).setVariable(Prefix + "deleteNetworkRequest", "")
- verify(mockExecution).setVariable(Prefix + "deleteNetworkResponse", "")
- verify(mockExecution).setVariable(Prefix + "networkReturnCode", "")
- verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", "")
-
- verify(mockExecution).setVariable(Prefix + "deleteSDNCRequest", "")
- verify(mockExecution).setVariable(Prefix + "deleteSDNCResponse", "")
- verify(mockExecution).setVariable(Prefix + "sdncReturnCode", "")
- verify(mockExecution).setVariable(Prefix + "sdncResponseSuccess", false)
-
- verify(mockExecution).setVariable(Prefix + "deactivateSDNCRequest", "")
- verify(mockExecution).setVariable(Prefix + "deactivateSDNCResponse", "")
- verify(mockExecution).setVariable(Prefix + "deactivateSdncReturnCode", "")
- verify(mockExecution).setVariable(Prefix + "isSdncDeactivateRollbackNeeded", "")
-
- verify(mockExecution).setVariable(Prefix + "rollbackDeactivateSDNCRequest", "")
- verify(mockExecution).setVariable(Prefix + "isException", false)
-
- }
-
- @Test
- //@Ignore
- public void preProcessRequest_Json_MissingId() {
-
- println "************ preProcessRequest_MissingId() ************* "
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("isBaseVfModule")).thenReturn(true)
- when(mockExecution.getVariable("recipeTimeout")).thenReturn(0)
- when(mockExecution.getVariable("requestAction")).thenReturn("DELETE")
- //when(mockExecution.getVariable("networkId")).thenReturn("") // missing Id
- when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable("vnfId")).thenReturn("")
- when(mockExecution.getVariable("volumeGroupId")).thenReturn("")
- //when(mockExecution.getVariable("networkId")).thenReturn("")
- when(mockExecution.getVariable("serviceType")).thenReturn("MOG")
- when(mockExecution.getVariable("networkType")).thenReturn("modelName")
- when(mockExecution.getVariable("bpmnRequest")).thenReturn(incomingJsonRequest)
- when(mockExecution.getVariable("disableRollback")).thenReturn(true)
-
- when(mockExecution.getVariable("testMessageId")).thenReturn("7df689f9-7b93-430b-9b9e-28140d70cc7ad")
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("mso-service-instance-id")).thenReturn("FH/VLXM/003717//SW_INTERNET")
- when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_rollback")).thenReturn("true")
- when(mockExecution.getVariable("sdncVersion")).thenReturn("1610")
-
- // preProcessRequest(DelegateExecution execution)
- DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
- try {
- DoDeleteNetworkInstance.preProcessRequest(mockExecution)
- } catch (Exception ex) {
- println " Test End - Handle catch-throw BpmnError()! "
- }
-
- //verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix)
-
- //verify variable initialization
- initializeVariables(mockExecution)
-
- verify(mockExecution).setVariable("action", "DELETE")
- verify(mockExecution).setVariable(Prefix + "networkRequest", expectedNetworkRequestMissingId)
- verify(mockExecution).setVariable(Prefix + "rollbackEnabled", false)
-
- verify(mockExecution).setVariable(Prefix + "networkInputs", networkInputsMissingId)
- verify(mockExecution).setVariable(Prefix + "messageId", "7df689f9-7b93-430b-9b9e-28140d70cc7ad")
- verify(mockExecution).setVariable(Prefix + "source", "VID")
-
- }
-
- @Test
- //@Ignore
- public void preProcessRequest_Json_MissingCloudRegion() {
-
- def networkModelInfo = """{"modelVersionId": "sn5256d1-5a33-55df-13ab-12abad84e111",
- "modelName": "CONTRAIL_EXTERNAL",
- "modelType": "CONTRAIL_EXTERNAL",
- "modelVersion": "1",
- "modelCustomizationId": "sn5256d1-5a33-55df-13ab-12abad84e222",
- "modelInvariantId": "sn5256d1-5a33-55df-13ab-12abad84e764"
- }""".trim()
-
- println "************ preProcessRequest_MissingCloudRegion() ************* "
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("networkModelInfo")).thenReturn(networkModelInfo)
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("isBaseVfModule")).thenReturn(true)
- when(mockExecution.getVariable("recipeTimeout")).thenReturn(0)
- when(mockExecution.getVariable("requestAction")).thenReturn("DELETE")
- when(mockExecution.getVariable("networkId")).thenReturn("bdc5efe8-404a-409b-85f6-0dcc9eebae30")
- when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable("vnfId")).thenReturn("")
- when(mockExecution.getVariable("volumeGroupId")).thenReturn("")
- //when(mockExecution.getVariable("networkId")).thenReturn("")
- when(mockExecution.getVariable("serviceType")).thenReturn("MOG")
- when(mockExecution.getVariable("networkType")).thenReturn("modelName")
- when(mockExecution.getVariable("bpmnRequest")).thenReturn(incomingRequestMissingCloudRegion)
- when(mockExecution.getVariable("disableRollback")).thenReturn(true)
-
- when(mockExecution.getVariable("testMessageId")).thenReturn("7df689f9-7b93-430b-9b9e-28140d70cc7ad")
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("mso-service-instance-id")).thenReturn("FH/VLXM/003717//SW_INTERNET")
- when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_rollback")).thenReturn("true")
- when(mockExecution.getVariable("sdncVersion")).thenReturn("1610")
-
- // preProcessRequest(DelegateExecution execution)
- DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
- DoDeleteNetworkInstance.preProcessRequest(mockExecution)
-
- //verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix)
-
- //verify variable initialization
- initializeVariables(mockExecution)
-
- verify(mockExecution).setVariable("action", "DELETE")
- verify(mockExecution).setVariable(Prefix + "networkRequest", expectedNetworkRequestMissingCloudRegion)
- verify(mockExecution).setVariable(Prefix + "rollbackEnabled", false)
-
- verify(mockExecution).setVariable(Prefix + "networkInputs", networkInputsMissingCloudRegion)
- verify(mockExecution).setVariable(Prefix + "messageId", "7df689f9-7b93-430b-9b9e-28140d70cc7ad")
- verify(mockExecution).setVariable(Prefix + "lcpCloudRegion", null)
-
- verify(mockExecution).setVariable("BasicAuthHeaderValuePO","Basic cGFzc3dvcmQ=")
- verify(mockExecution).setVariable("BasicAuthHeaderValueSDNC", "Basic cGFzc3dvcmQ=")
-
- }
-
-
-
- @Test
- //@Ignore
- public void prepareNetworkRequest() {
-
- println "************ prepareNetworkRequest ************* "
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedVperNetworkRequest)
- when(mockExecution.getVariable(Prefix + "queryAAIResponse")).thenReturn(queryAAIResponse)
- when(mockExecution.getVariable(Prefix + "cloudRegionPo")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable(Prefix + "tenantId")).thenReturn("e81d842d3e8b45c5a59f57cd76af3aaf")
-
- when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable("URN_mso_adapters_network_rest_endpoint")).thenReturn("http://localhost:8090/networks/NetworkAdapter")
- when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("messageId_value")
- //when(mockExecution.getVariable("URN_?????")).thenReturn("") // notificationUrl, //TODO - is this coming from URN? What variable/value to use?
- when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
-
- DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
- DoDeleteNetworkInstance.prepareNetworkRequest(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable("URN_mso_adapters_network_rest_endpoint", "http://localhost:8090/networks/NetworkAdapter/bdc5efe8-404a-409b-85f6-0dcc9eebae30")
- //verify(mockExecution).setVariable(Prefix + "deleteNetworkRequest", deleteNetworkRequest)
- verify(mockExecution).setVariable(Prefix + "deleteNetworkRequest", deleteNetworkRESTRequest)
-
- }
-
- @Test
- //@Ignore
- public void prepareNetworkRequest_AlaCarte() {
-
- println "************ prepareNetworkRequest ************* "
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable(Prefix + "queryAAIResponse")).thenReturn(queryAAIResponse)
- when(mockExecution.getVariable(Prefix + "cloudRegionPo")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable(Prefix + "tenantId")).thenReturn("e81d842d3e8b45c5a59f57cd76af3aaf")
-
- when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable("URN_mso_adapters_network_rest_endpoint")).thenReturn("http://localhost:8090/networks/NetworkAdapter")
- when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("messageId_value")
- //when(mockExecution.getVariable("URN_?????")).thenReturn("") // notificationUrl, //TODO - is this coming from URN? What variable/value to use?
- when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
-
- DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
- DoDeleteNetworkInstance.prepareNetworkRequest(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable("URN_mso_adapters_network_rest_endpoint", "http://localhost:8090/networks/NetworkAdapter/bdc5efe8-404a-409b-85f6-0dcc9eebae30")
- //verify(mockExecution).setVariable(Prefix + "deleteNetworkRequest", deleteNetworkRequest)
- verify(mockExecution).setVariable("mso-request-id", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- verify(mockExecution).setVariable(Prefix + "deleteNetworkRequest", deleteNetworkRESTRequestAlaCarte)
-
- }
-
- @Test
- //@Ignore
- public void sendRequestToVnfAdapter() {
-
- println "************ sendRequestToVnfAdapter ************* "
-
- WireMock.reset();
- MockNetworkAdapter("bdc5efe8-404a-409b-85f6-0dcc9eebae30", 200, "deleteNetworkResponse_Success.xml");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "deleteNetworkRequest")).thenReturn(deleteNetworkRESTRequest)
- when(mockExecution.getVariable("URN_mso_adapters_network_rest_endpoint")).thenReturn("http://localhost:8090/networks/NetworkAdapter/bdc5efe8-404a-409b-85f6-0dcc9eebae30")
- when(mockExecution.getVariable("BasicAuthHeaderValuePO")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
-
- DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
- DoDeleteNetworkInstance.sendRequestToVnfAdapter(mockExecution)
-
- verify(mockExecution).setVariable(Prefix + "networkReturnCode", 200)
- //verify(mockExecution).setVariable(Prefix + "deleteNetworkResponse", deleteNetworkResponse_noRollback)
-
- }
-
-
- @Test
- //@Ignore
- public void prepareSDNCRequest() {
-
- println "************ prepareSDNCRequest ************* "
-
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable(Prefix + "cloudRegionSdnc")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable(Prefix + "queryAAIResponse")).thenReturn(aaiResponse)
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
-
- DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
- DoDeleteNetworkInstance.prepareSDNCRequest(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "deleteSDNCRequest", deleteSDNCRequest)
-
- }
-
- @Test
- //@Ignore
- public void prepareRpcSDNCRequest() {
-
- println "************ prepareRpcSDNCRequest ************* "
-
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(inputViprSDC_NetworkRequest)
- when(mockExecution.getVariable(Prefix + "cloudRegionSdnc")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56") // test ONLY
- when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
-
- DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
- DoDeleteNetworkInstance.prepareRpcSDNCRequest(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "deleteSDNCRequest", deleteRpcSDNCRequest)
-
- }
-
- @Test
- //@Ignore
- public void prepareRpcSDNCActivateRollback() {
-
- println "************ prepareRpcSDNCActivateRollback ************* "
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(inputViprSDC_NetworkRequest)
- when(mockExecution.getVariable(Prefix + "cloudRegionSdnc")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable(Prefix + "serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable(Prefix + "networkId")).thenReturn("8abc633a-810b-4ca5-8b3a-09511d13a2ce")
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56") // test ONLY
- when(mockExecution.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("GENGSI_siResourceLink")).thenReturn(null)
- when(mockExecution.getVariable(Prefix + "deactivateSDNCResponse")).thenReturn(sdncAdapterWorkflowFormattedResponse)
-
- // preProcessRequest(DelegateExecution execution)
- DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
- DoDeleteNetworkInstance.prepareRpcSDNCDeactivateRollback(mockExecution)
-
- // verify set prefix = Prefix + ""
- verify(mockExecution).setVariable("prefix", Prefix)
- //verify(mockExecution).setVariable("mso-request-id", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- //verify(mockExecution).setVariable(Prefix + "requestId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- //verify(mockExecution).setVariable("mso-service-instance-id", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- verify(mockExecution).setVariable(Prefix + "rollbackDeactivateSDNCRequest", sdncAdapaterDeactivateRollback)
-
- }
-
-
- @Test
- //@Ignore
- public void callRESTQueryAAI_200() {
-
- println "************ callRESTQueryAAI ************* "
-
- WireMock.reset();
- MockGetNetworkByIdWithDepth("bdc5efe8-404a-409b-85f6-0dcc9eebae30", "DeleteNetworkV2/deleteNetworkAAIResponse_Success.xml", "all");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_network_l3_network_uri")).thenReturn("")
- // old: when(mockExecution.getVariable("URN_mso_workflow_DoDeleteNetworkInstance_aai_network_l3_network_uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
- when(mockExecution.getVariable("URN_mso_workflow_DoDeleteNetworkInstance_aai_l3_network_uri")).thenReturn("/aai/v9/network/l3-networks/l3-network")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
- DoDeleteNetworkInstance.callRESTQueryAAI(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "queryAAIRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/bdc5efe8-404a-409b-85f6-0dcc9eebae30"+"?depth=all")
-
- verify(mockExecution).setVariable(Prefix + "aaiReturnCode", "200")
- //verify(mockExecution).setVariable(Prefix + "queryAAIResponse", aaiResponse)
- verify(mockExecution).setVariable(Prefix + "isAAIGood", true)
- verify(mockExecution).setVariable(Prefix + "isVfRelationshipExist", false)
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAI_withRelationship_200() {
-
- println "************ callRESTQueryAAI ************* "
-
- WireMock.reset();
- MockGetNetworkByIdWithDepth("bdc5efe8-404a-409b-85f6-0dcc9eebae30", "DeleteNetworkV2/deleteNetworkAAIResponse_withRelationship_Success.xml", "all");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_network_l3_network_uri")).thenReturn("")
- // old: when(mockExecution.getVariable("URN_mso_workflow_DoDeleteNetworkInstance_aai_network_l3_network_uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
- when(mockExecution.getVariable("URN_mso_workflow_DoDeleteNetworkInstance_aai_l3_network_uri")).thenReturn("/aai/v9/network/l3-networks/l3-network")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
- DoDeleteNetworkInstance.callRESTQueryAAI(mockExecution)
-
- verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "queryAAIRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/bdc5efe8-404a-409b-85f6-0dcc9eebae30"+"?depth=all")
-
- verify(mockExecution).setVariable(Prefix + "aaiReturnCode", "200")
- //verify(mockExecution).setVariable(Prefix + "queryAAIResponse", aaiResponseWithRelationship)
- verify(mockExecution).setVariable(Prefix + "isAAIGood", true)
- verify(mockExecution).setVariable(Prefix + "isVfRelationshipExist", true)
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAI_200_DefaultUri() {
-
- println "************ callRESTQueryAAI ************* "
-
- WireMock.reset();
- MockGetNetworkByIdWithDepth("bdc5efe8-404a-409b-85f6-0dcc9eebae30", "DeleteNetworkV2/deleteNetworkAAIResponse_Success.xml", "all");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- // old: when(mockExecution.getVariable("URN_mso_workflow_default_aai_network_l3_network_uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8")
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_l3_network_uri")).thenReturn("/aai/v9/network/l3-networks/l3-network")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
- DoDeleteNetworkInstance.callRESTQueryAAI(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "queryAAIRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/bdc5efe8-404a-409b-85f6-0dcc9eebae30"+ "?depth=all")
-
- verify(mockExecution).setVariable(Prefix + "aaiReturnCode", "200")
- //verify(mockExecution).setVariable(Prefix + "queryAAIResponse", aaiResponse)
- verify(mockExecution).setVariable(Prefix + "isAAIGood", true)
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAICloudRegion30_200() {
-
- println "************ callRESTQueryAAICloudRegion30_200 ************* "
-
- WireMock.reset();
- MockGetNetworkCloudRegion("DeleteNetworkV2/cloudRegion30_AAIResponse_Success.xml", "RDM2WAGPLCP");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix)
- when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable(Prefix + "lcpCloudRegion")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- // old: when(mockExecution.getVariable("URN_mso_workflow_default_aai_cloud_infrastructure_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8")
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
- DoDeleteNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
-
- verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "queryCloudRegionRequest", "http://localhost:8090/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/RDM2WAGPLCP")
- verify(mockExecution, atLeast(2)).setVariable(Prefix + "queryCloudRegionReturnCode", "200")
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAICloudRegion_NotFound() {
-
- println "************ callRESTQueryAAICloudRegion_NotFound ************* "
-
- WireMock.reset();
- MockGetNetworkCloudRegion_404("MDTWNJ21");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix)
- when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(vnfRequestCloudRegionNotFound)
- when(mockExecution.getVariable(Prefix + "lcpCloudRegion")).thenReturn("MDTWNJ21")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- // old: when(mockExecution.getVariable("URN_mso_workflow_default_aai_cloud_infrastructure_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8")
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
- DoDeleteNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
-
- verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "cloudRegionPo", "MDTWNJ21")
- verify(mockExecution).setVariable(Prefix + "cloudRegionSdnc", "AAIAIC25")
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAICloudRegion25_200() {
-
- println "************ callRESTQueryAAICloudRegion25_200 ************* "
-
- WireMock.reset();
- MockGetNetworkCloudRegion("DeleteNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix)
- when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable(Prefix + "lcpCloudRegion")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- // old: when(mockExecution.getVariable("URN_mso_workflow_default_aai_cloud_infrastructure_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8")
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
- //
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
- DoDeleteNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
-
- verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "queryCloudRegionRequest", "http://localhost:8090/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/RDM2WAGPLCP")
- verify(mockExecution, atLeast(2)).setVariable(Prefix + "queryCloudRegionReturnCode", "200")
-
- }
-
-
- @Test
- //@Ignore
- public void validateNetworkResponse() {
-
- println "************ validateNetworkResponse ************* "
-
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "deleteNetworkResponse")).thenReturn(deleteNetworkResponse)
- when(mockExecution.getVariable(Prefix + "networkReturnCode")).thenReturn('200')
-
- DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
- DoDeleteNetworkInstance.validateNetworkResponse(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- //verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", null)
-
- }
-
-
- @Test
- //@Ignore
- public void validateSDNCResponse_200() {
-
- println "************ validateSDNCResponse ************* "
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "sdncReturnCode")).thenReturn("200")
- when(mockExecution.getVariable("SDNCA_SuccessIndicator")).thenReturn(true)
-
- DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
- try {
- DoDeleteNetworkInstance.validateSDNCResponse(mockExecution, sdncAdapterWorkflowResponse)
- } catch (Exception ex) {
- println " Graceful Exit - " + ex.getMessage()
- }
-
- }
-
- @Test
- //@Ignore
- public void validateSDNCResponse_404() {
-
- println "************ validateSDNCResponse ************* "
-
- WorkflowException workflowException = new WorkflowException("DoCreateNetworkInstance", 2500, "Received error from SNDC Adapter: HTTP Status 404.")
-
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "sdncReturnCode")).thenReturn("404")
- when(mockExecution.getVariable("SDNCA_SuccessIndicator")).thenReturn(false)
- when(mockExecution.getVariable("WorkflowException")).thenReturn(workflowException)
-
- DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
- try {
- DoDeleteNetworkInstance.validateSDNCResponse(mockExecution)
- } catch (Exception ex) {
- println " Graceful Exit - " + ex.getMessage()
- }
-
- }
-
- @Test
- //@Ignore
- public void validateRpcSDNCDeactivateResponse() {
-
- println "************ validateRpcSDNCDeactivateResponse ************* "
-
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "deactivateSDNCResponse")).thenReturn(sdncAdapterWorkflowResponse)
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
- when(mockExecution.getVariable("SDNCA_SuccessIndicator")).thenReturn(true)
- when(mockExecution.getVariable(Prefix + "deactivateSDNCReturnCode")).thenReturn("200")
-
- DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
- try {
- DoDeleteNetworkInstance.validateRpcSDNCDeactivateResponse(mockExecution)
- verify(mockExecution).setVariable(Prefix + "isSdncDeactivateRollbackNeeded", true)
-
- } catch (Exception ex) {
- println " Graceful Exit - " + ex.getMessage()
- }
- //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
- //debugger.printInvocations(mockExecution)
-
- //verify(mockExecution).setVariable(Prefix + "isSdncRollbackNeeded", true)
-
- }
-
- @Test
- @Ignore
- public void postProcessResponse() {
-
- println "************ postProcessResponse ************* "
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "source")).thenReturn("PORTAL")
- when(mockExecution.getVariable(Prefix + "isException")).thenReturn(false)
-
- // postProcessResponse(DelegateExecution execution)
- DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
- DoDeleteNetworkInstance.postProcessResponse(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "Success", true)
-
- }
-
- @Test
- //@Ignore
- public void prepareRollbackData() {
-
- println "************ prepareRollbackData() ************* "
-
-
-
- WorkflowException workflowException = new WorkflowException("DoCreateNetworkInstance", 2500, "Received error from Network Adapter: JBWEB000065: HTTP Status 500.")
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn(deleteRollbackNetworkRequest)
- //when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn(null)
- //when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn("")
- when(mockExecution.getVariable(Prefix + "rollbackDeactivateSDNCRequest")).thenReturn(sdncAdapaterDeactivateRollback)
- when(mockExecution.getVariable("WorkflowException")).thenReturn(workflowException)
-
- // preProcessRequest(DelegateExecution execution)
- DoDeleteNetworkInstance DoDeleteNetworkInstance = new DoDeleteNetworkInstance()
- DoDeleteNetworkInstance.prepareRollbackData(mockExecution)
-
- verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix)
-
- }
-
-
- private ExecutionEntity setupMock() {
-
- ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class)
- when(mockProcessDefinition.getKey()).thenReturn("DoDeleteNetworkInstance")
- RepositoryService mockRepositoryService = mock(RepositoryService.class)
- when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition)
- when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("DoDeleteNetworkInstance")
- when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100")
- ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class)
- when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService)
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
-
- when(mockExecution.getId()).thenReturn("100")
- when(mockExecution.getProcessDefinitionId()).thenReturn("DoDeleteNetworkInstance")
- when(mockExecution.getProcessInstanceId()).thenReturn("DoDeleteNetworkInstance")
- when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices)
- when(mockExecution.getProcessEngineServices().getRepositoryService().getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(mockProcessDefinition)
-
- return mockExecution
-
- }
-
-}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoScaleE2EServiceInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoScaleE2EServiceInstanceTest.groovy deleted file mode 100644 index 2dc3157e57..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoScaleE2EServiceInstanceTest.groovy +++ /dev/null @@ -1,110 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2018 CMCC All rights reserved. * - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.bpmn.infrastructure.scripts - -import com.github.tomakehurst.wiremock.junit.WireMockRule -import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity -import org.junit.Before -import org.junit.BeforeClass -import org.junit.Rule -import org.junit.Test -import org.mockito.MockitoAnnotations -import org.openecomp.mso.bpmn.mock.FileUtil -import org.openecomp.mso.bpmn.vcpe.scripts.GroovyTestBase - -import static org.mockito.Mockito.verify -import static org.mockito.Mockito.when - -class DoScaleE2EServiceInstanceTest extends GroovyTestBase { - - private static String request - - @Rule - public WireMockRule wireMockRule = new WireMockRule(GroovyTestBase.PORT) - - String Prefix = "CVRCS_" - - @BeforeClass - public static void setUpBeforeClass() { - request = FileUtil.readResourceFile("__files/InfrastructureFlows/DoScaleE2EServiceInstance.json") - } - - @Before - public void init() - { - MockitoAnnotations.initMocks(this) - } - public DoScaleE2EServiceInstanceTest(){ - super("DoScaleE2EServiceInstance") - } - - @Test - public void preProcessRequestTest(){ - - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPreProcess(mex) - - DoScaleE2EServiceInstance instance = new DoScaleE2EServiceInstance() - instance.preProcessRequest(mex) - verify(mex).setVariable("resourceTemplateUUIDs", "ns111:ns333:") - } - - @Test - public void preInitResourcesOperStatusTest(){ - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPreProcess(mex) - DoScaleE2EServiceInstance instance = new DoScaleE2EServiceInstance() - instance.preInitResourcesOperStatus(mex) - - verify(mex).setVariable("serviceInstanceId","e151059a-d924-4629-845f-264db19e50b4") - verify(mex).setVariable("operationId", "59960003992") - verify(mex).setVariable("operationType", "SCALE") - verify(mex).setVariable("URN_mso_openecomp_adapters_db_endpoint","http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter") - - String payload = - """<soapenv:Envelope xmlns:ns="http://org.openecomp.mso/requestsdb" - xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> - <soapenv:Header/> - <soapenv:Body> - <ns:initResourceOperationStatus> - <serviceId>e151059a-d924-4629-845f-264db19e50b4</serviceId> - <operationId>59960003992</operationId> - <operationType>SCALE</operationType> - <resourceTemplateUUIDs>ns111:ns333:</resourceTemplateUUIDs> - </ns:initResourceOperationStatus> - </soapenv:Body> -</soapenv:Envelope>""" - verify(mex).setVariable("CVFMI_initResOperStatusRequest", payload) - } - - private void initPreProcess(ExecutionEntity mex) { - when(mex.getVariable(GroovyTestBase.DBGFLAG)).thenReturn("true") - when(mex.getVariable("bpmnRequest")).thenReturn(request) - when(mex.getVariable("msoRequestId")).thenReturn("mri") - when(mex.getVariable("serviceType")).thenReturn("VoLTE") - when(mex.getVariable("serviceInstanceId")).thenReturn("e151059a-d924-4629-845f-264db19e50b4") - when(mex.getVariable("serviceInstanceName")).thenReturn("ra") - when(mex.getVariable("operationId")).thenReturn("59960003992") - when(mex.getVariable("globalSubscriberId")).thenReturn("4993921112123") - when(mex.getVariable("resourceTemplateUUIDs")).thenReturn("ns111:ns333:") - } -}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollbackTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollbackTest.groovy deleted file mode 100644 index a4d57d265d..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollbackTest.groovy +++ /dev/null @@ -1,315 +0,0 @@ -package org.openecomp.mso.bpmn.infrastructure.scripts - -import static org.mockito.Mockito.* - -import org.camunda.bpm.engine.delegate.BpmnError -import org.camunda.bpm.engine.ProcessEngineServices -import org.camunda.bpm.engine.RepositoryService -import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity -import org.camunda.bpm.engine.impl.pvm.process.ProcessDefinitionImpl -import org.camunda.bpm.engine.repository.ProcessDefinition -import org.camunda.bpm.engine.delegate.DelegateExecution;
-import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner -import org.mockito.internal.debugging.MockitoDebuggerImpl -import org.openecomp.mso.bpmn.common.scripts.MsoUtils -import org.openecomp.mso.bpmn.core.WorkflowException -import org.junit.Before -import org.junit.Rule; -import org.junit.Test -import org.junit.Ignore -import org.junit.runner.RunWith - -import static org.junit.Assert.*; - -import com.github.tomakehurst.wiremock.client.WireMock; -import com.github.tomakehurst.wiremock.junit.WireMockRule; - -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; -import org.apache.commons.lang3.* - - -@RunWith(MockitoJUnitRunner.class) -class DoUpdateNetworkInstanceRollbackTest { - - @Rule - public WireMockRule wireMockRule = new WireMockRule(28090); - - def utils = new MsoUtils() - String Prefix="UPDNETIR_" - - - String rollbackNetworkRequest = - """<NetworkAdapter:rollbackNetwork xmlns:NetworkAdapter="http://org.openecomp.mso/network"> - <rollback> - <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId> - <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId> - <networkStackId/> - <networkType>CONTRAIL_EXTERNAL</networkType> - <networkCreated>true</networkCreated> - <tenantId>7dd5365547234ee8937416c65507d266</tenantId> - <cloudSiteId>RDM2WAGPLCP</cloudSiteId> - <msoRequest> - <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId> - <serviceInstanceId/> - </msoRequest> - </rollback> -</NetworkAdapter:rollbackNetwork>""" - - String rollbackActivateSDNCRequest = - """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1" - xmlns:ns5="http://org.openecomp/mso/request/types/v1" - xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1"> - <sdncadapter:RequestHeader> - <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId> - <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId> - <sdncadapter:SvcAction>rollback</sdncadapter:SvcAction> - <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation> - <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl> - <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction> - </sdncadapter:RequestHeader> - <aetgt:SDNCRequestData> - <request-information> - <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id> - <request-action>CreateNetworkInstance</request-action> - <source>VID</source> - <notification-url/> - <order-number/> - <order-version/> - </request-information> - <service-information> - <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id> - <service-type>MSO-dev-service-type</service-type> - <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id> - <subscriber-name>MSO_1610_dev</subscriber-name> - </service-information> - <network-information> - <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id> - <network-type>CONTRAIL_EXTERNAL</network-type> - <onap-model-information> - <model-invariant-uuid>invariant-uuid</model-invariant-uuid> - <model-customization-uuid>customization-uuid</model-customization-uuid> - <model-uuid>uuid</model-uuid> - <model-version>version</model-version> - <model-name>CONTRAIL_EXTERNAL</model-name> - </onap-model-information> - </network-information> - <network-request-information> - <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id> - <network-type>CONTRAIL_EXTERNAL</network-type> - <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name> - <tenant>7dd5365547234ee8937416c65507d266</tenant> - <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region> - </network-request-information> - </aetgt:SDNCRequestData> -</aetgt:SDNCAdapterWorkflowRequest>""" - - String rollbackSDNCRequest = - """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1" - xmlns:ns5="http://org.openecomp/mso/request/types/v1" - xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1"> - <sdncadapter:RequestHeader> - <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId> - <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId> - <sdncadapter:SvcAction>rollback</sdncadapter:SvcAction> - <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation> - <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl> - <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction> - </sdncadapter:RequestHeader> - <aetgt:SDNCRequestData> - <request-information> - <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id> - <request-action>CreateNetworkInstance</request-action> - <source>VID</source> - <notification-url/> - <order-number/> - <order-version/> - </request-information> - <service-information> - <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id> - <service-type>MSO-dev-service-type</service-type> - <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id> - <subscriber-name>MSO_1610_dev</subscriber-name> - </service-information> - <network-information> - <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id> - <network-type>CONTRAIL_EXTERNAL</network-type> - <onap-model-information> - <model-invariant-uuid>invariant-uuid</model-invariant-uuid> - <model-customization-uuid>customization-uuid</model-customization-uuid> - <model-uuid>uuid</model-uuid> - <model-version>version</model-version> - <model-name>CONTRAIL_EXTERNAL</model-name> - </onap-model-information> - </network-information> - <network-request-information> - <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id> - <network-type>CONTRAIL_EXTERNAL</network-type> - <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name> - <tenant>7dd5365547234ee8937416c65507d266</tenant> - <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region> - </network-request-information> - </aetgt:SDNCRequestData> -</aetgt:SDNCAdapterWorkflowRequest>""" - -// - - - - - - - - - - - @Before - public void init() - { - MockitoAnnotations.initMocks(this) - - } - - public void initializeVariables (DelegateExecution mockExecution) {
- - verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", null) - verify(mockExecution).setVariable(Prefix + "rollbackSDNCRequest", null) - verify(mockExecution).setVariable(Prefix + "WorkflowException", null) - - verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", "") - verify(mockExecution).setVariable(Prefix + "rollbackNetworkResponse", "") - verify(mockExecution).setVariable(Prefix + "rollbackNetworkReturnCode", "") - - verify(mockExecution).setVariable(Prefix + "rollbackSDNCRequest", "") - verify(mockExecution).setVariable(Prefix + "rollbackSDNCResponse", "") - verify(mockExecution).setVariable(Prefix + "rollbackSDNCReturnCode", "") - - verify(mockExecution).setVariable(Prefix + "Success", false) - verify(mockExecution).setVariable(Prefix + "fullRollback", false) - - - } - - @Test - //@Ignore - public void preProcessRequest() { - - println "************ preProcessRequest ************* " - - WorkflowException workflowException = new WorkflowException("DoUpdateNetworkInstanceRollback", 2500, "Received error from Network Adapter: JBWEB000065: HTTP Status 500.") - Map<String, String> rollbackData = new HashMap<String, String>(); - rollbackData.put("rollbackSDNCRequest", rollbackSDNCRequest) - rollbackData.put("rollbackNetworkRequest", rollbackNetworkRequest) - - ExecutionEntity mockExecution = setupMock() - // Initialize prerequisite variables - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "") - when(mockExecution.getVariable("WorkflowException")).thenReturn(workflowException) - when(mockExecution.getVariable("rollbackData")).thenReturn(rollbackData) - when(mockExecution.getVariable("sdncVersion")).thenReturn("1610") - when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B") - when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") - - when(mockExecution.getVariable("URN_mso_adapters_sdnc_endpoint")).thenReturn("http://localhost:28090/SDNCAdapter") - when(mockExecution.getVariable("URN_mso_adapters_network_rest_endpoint")).thenReturn("http://localhost:28090/networks/NetworkAdapter") - when(mockExecution.getVariable("URN_mso_adapters_sdnc_resource_endpoint")).thenReturn("http://localhost:28090/SDNCAdapterRpc") - - - // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstanceRollback DoUpdateNetworkInstanceRollback = new DoUpdateNetworkInstanceRollback() - DoUpdateNetworkInstanceRollback.preProcessRequest(mockExecution) - - verify(mockExecution).getVariable("isDebugLogEnabled") - verify(mockExecution).setVariable("prefix", Prefix) - - //verify variable initialization - initializeVariables(mockExecution) - - } - - - @Test - @Ignore - public void validateRollbackResponses_Good() { - - WorkflowException workflowException = new WorkflowException("DoUpdateNetworkInstanceRollback", 2500, "AAI Update Contrail Failed. Error 404.") - WorkflowException expectedWorkflowException = new WorkflowException("DoUpdateNetworkInstanceRollback", 2500, "AAI Update Contrail Failed. Error 404. + SNDC activate rollback completed. + PO Network rollback completed. + SNDC assign rollback completed.") - - println "************ validateRollbackResponses_Good() ************* " - ExecutionEntity mockExecution = setupMock() - // Initialize prerequisite variables - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "") - when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackNetworkReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackNetworkResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "rollbackSDNCReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackSDNCResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "WorkflowException")).thenReturn(workflowException) - when(mockExecution.getVariable(Prefix + "fullRollback")).thenReturn(false) - - DoUpdateNetworkInstanceRollback DoUpdateNetworkInstanceRollback = new DoUpdateNetworkInstanceRollback() - DoUpdateNetworkInstanceRollback.validateRollbackResponses(mockExecution) - - // verify set prefix = Prefix + "" - verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix) - verify(mockExecution, atLeast(1)).setVariable("rolledBack", true) - verify(mockExecution, atLeast(1)).setVariable("wasDeleted", true) - verify(mockExecution).setVariable("WorkflowException", refEq(expectedWorkflowException, any(WorkflowException.class))) - //verify(mockExecution).setVariable("WorkflowException", expectedWorkflowException) - } - - @Test - //@Ignore - public void validateRollbackResponses_FullRollback() { - - Map<String, String> rollbackData = new HashMap<String, String>(); - rollbackData.put("rollbackSDNCRequest", rollbackSDNCRequest) - rollbackData.put("rollbackNetworkRequest", rollbackNetworkRequest) - - println "************ validateRollbackResponses_FullRollback() ************* " - ExecutionEntity mockExecution = setupMock() - // Initialize prerequisite variables - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("prefix")).thenReturn(Prefix) - when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackNetworkReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackNetworkResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "rollbackSDNCReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackSDNCResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "WorkflowException")).thenReturn(null) - when(mockExecution.getVariable(Prefix + "fullRollback")).thenReturn(true) - when(mockExecution.getVariable("rollbackData")).thenReturn(rollbackData) - - DoUpdateNetworkInstanceRollback DoUpdateNetworkInstanceRollback = new DoUpdateNetworkInstanceRollback() - DoUpdateNetworkInstanceRollback.validateRollbackResponses(mockExecution) - - // verify set prefix = Prefix + "" - verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix) - verify(mockExecution, atLeast(1)).setVariable("rollbackSuccessful", true) - verify(mockExecution, atLeast(1)).setVariable("rollbackError", false) - - } - - - private ExecutionEntity setupMock() { - - ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class) - when(mockProcessDefinition.getKey()).thenReturn("DoUpdateNetworkInstanceRollback") - RepositoryService mockRepositoryService = mock(RepositoryService.class) - when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition) - when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("DoUpdateNetworkInstanceRollback") - when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100") - ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class) - when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService) - - ExecutionEntity mockExecution = mock(ExecutionEntity.class) - // Initialize prerequisite variables - - when(mockExecution.getId()).thenReturn("100") - when(mockExecution.getProcessDefinitionId()).thenReturn("DoUpdateNetworkInstanceRollback") - when(mockExecution.getProcessInstanceId()).thenReturn("DoUpdateNetworkInstanceRollback") - when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices) - when(mockExecution.getProcessEngineServices().getRepositoryService().getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(mockProcessDefinition) - - return mockExecution - } - -}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceTest.groovy deleted file mode 100644 index 8390ac3f6b..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceTest.groovy +++ /dev/null @@ -1,2743 +0,0 @@ -package org.openecomp.mso.bpmn.infrastructure.scripts
-
-import static org.mockito.Mockito.*
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkByIdWithDepth;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkCloudRegion;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkCloudRegion_404;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkVpnBinding;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkTableReference;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkPolicy;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutNetworkIdWithDepth;
-import org.camunda.bpm.engine.ProcessEngineServices
-import org.camunda.bpm.engine.RepositoryService
-import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
-import org.camunda.bpm.engine.repository.ProcessDefinition
-import org.camunda.bpm.engine.delegate.DelegateExecution
-import org.junit.Before
-import org.junit.Rule
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.mockito.MockitoAnnotations
-import org.mockito.runners.MockitoJUnitRunner
-import org.openecomp.mso.bpmn.common.scripts.MsoUtils
-import org.openecomp.mso.bpmn.core.WorkflowException
-
-import com.github.tomakehurst.wiremock.client.WireMock
-import com.github.tomakehurst.wiremock.junit.WireMockRule
-import org.apache.commons.lang3.*
-
-
-@RunWith(MockitoJUnitRunner.class)
-class DoUpdateNetworkInstanceTest {
-
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(8090);
-
- def utils = new MsoUtils()
- String Prefix="UPDNETI_"
-
- String jsonIncomingRequest =
- """{ "requestDetails": {
- "modelInfo": {
- "modelType": "network",
- "modelCustomizationId": "f21df226-8093-48c3-be7e-0408fcda0422",
- "modelName": "CONTRAIL_EXTERNAL",
- "modelVersion": "1.0"
- },
- "cloudConfiguration": {
- "lcpCloudRegionId": "RDM2WAGPLCP",
- "tenantId": "7dd5365547234ee8937416c65507d266"
- },
- "requestInfo": {
- "instanceName": "MNS-25180-L-01-dmz_direct_net_1",
- "source": "VID",
- "callbackUrl": "",
- "suppressRollback": true,
- "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"
- },
- "relatedInstanceList": [
- {
- "relatedInstance": {
- "instanceId": "f70e927b-6087-4974-9ef8-c5e4d5847ca4",
- "modelInfo": {
- "modelType": "serviceT",
- "modelId": "modelI",
- "modelNameVersionId": "modelNameVersionI",
- "modelName": "modleNam",
- "modelVersion": "1"
- }
- }
- }
- ],
- "requestParameters": {
- "userParams": [
- {
- "name": "someUserParam1",
- "value": "someValue1"
- }
- ]
- }
- }}"""
-
-
- String jsonIncomingRequest_MissingCloudRegion =
- """{ "requestDetails": {
- "modelInfo": {
- "modelType": "network",
- "modelCustomizationId": "f21df226-8093-48c3-be7e-0408fcda0422",
- "modelName": "CONTRAIL_EXTERNAL",
- "modelVersion": "1.0"
- },
- "cloudConfiguration": {
- "tenantId": "7dd5365547234ee8937416c65507d266"
- },
- "requestInfo": {
- "instanceName": "MNS-25180-L-01-dmz_direct_net_1",
- "source": "VID",
- "callbackUrl": "",
- "suppressRollback": true,
- "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"
- },
- "relatedInstanceList": [
- {
- "relatedInstance": {
- "instanceId": "f70e927b-6087-4974-9ef8-c5e4d5847ca4",
- "modelInfo": {
- "modelType": "serviceT",
- "modelId": "modelI",
- "modelNameVersionId": "modelNameVersionI",
- "modelName": "modleNam",
- "modelVersion": "1"
- }
- }
- }
- ],
- "requestParameters": {
- "userParams": []
- }
- }}"""
-
-
-
- String expectedNetworkRequestMissingNetworkId =
- """<network-request xmlns="http://www.w3.org/2001/XMLSchema">
- <request-info>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <action>UPDATE</action>
- <source>VID</source>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- </request-info>
- <network-inputs>
- <network-id/>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <modelCustomizationId>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationId>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <backout-on-failure>false</backout-on-failure>
- <sdncVersion>1610</sdncVersion>
- </network-inputs>
- <network-params>
- <param name="some_user_param1">someValue1</param>
- </network-params>
-</network-request>"""
-
-
-String expectedNetworkRequestMissingCloudRegion =
-"""<network-request xmlns="http://www.w3.org/2001/XMLSchema">
- <request-info>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <action>UPDATE</action>
- <source>VID</source>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- </request-info>
- <network-inputs>
- <network-id>networkId</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <modelCustomizationId>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationId>
- <aic-cloud-region>null</aic-cloud-region>
- <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <backout-on-failure>false</backout-on-failure>
- <sdncVersion>null</sdncVersion>
- </network-inputs>
- <network-params/>
-</network-request>"""
-
-String expectedNetworkInputMissingCloudRegion =
-"""<network-inputs xmlns="http://www.w3.org/2001/XMLSchema">
- <network-id>networkId</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <modelCustomizationId>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationId>
- <aic-cloud-region>null</aic-cloud-region>
- <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <backout-on-failure>false</backout-on-failure>
- <sdncVersion>null</sdncVersion>
-</network-inputs>"""
-
- String networkInputsMissingName =
- """<network-inputs xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
- <network-name/>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
- </network-inputs>"""
-
-String networkInputsMissingCloudRegion =
-"""<network-inputs xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
- <network-name>HSL_direct_net_2</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <aic-cloud-region/>
- <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
-</network-inputs>"""
-
- // expectedNetworkRequest
- String expectedNetworkRequest =
- """<network-request xmlns="http://www.w3.org/2001/XMLSchema">
- <request-info>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <action>UPDATE</action>
- <source>VID</source>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- </request-info>
- <network-inputs>
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <modelCustomizationId>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationId>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <backout-on-failure>false</backout-on-failure>
- <sdncVersion>1610</sdncVersion>
- </network-inputs>
- <network-params>
- <param name="some_user_param1">someValue1</param>
- </network-params>
-</network-request>"""
-
-String expectedNetworkInputs =
-"""<network-inputs xmlns="http://www.w3.org/2001/XMLSchema">
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <modelCustomizationId>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationId>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <backout-on-failure>false</backout-on-failure>
- <sdncVersion>1610</sdncVersion>
-</network-inputs>"""
-
-String expectedVperNetworkRequest =
-"""<network-request xmlns="http://www.w3.org/2001/XMLSchema">
- <request-info>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <action>UPDATE</action>
- <source>VID</source>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- </request-info>
- <network-inputs>
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <subscription-service-type>MSO-dev-service-type</subscription-service-type>
- <global-customer-id>globalId_45678905678</global-customer-id>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <backout-on-failure>false</backout-on-failure>
- <failIfExist>false</failIfExist>
- <networkModelInfo>
- <modelName>CONTRAIL_EXTERNAL</modelName>
- <modelUuid>sn5256d1-5a33-55df-13ab-12abad84e111</modelUuid>
- <modelInvariantUuid>sn5256d1-5a33-55df-13ab-12abad84e764</modelInvariantUuid>
- <modelVersion>1</modelVersion>
- <modelCustomizationUuid>sn5256d1-5a33-55df-13ab-12abad84e222</modelCustomizationUuid>
- </networkModelInfo>
- <serviceModelInfo>
- <modelName/>
- <modelUuid/>
- <modelInvariantUuid/>
- <modelVersion/>
- <modelCustomizationUuid/>
- </serviceModelInfo>
- <sdncVersion>1702</sdncVersion>
- </network-inputs>
- <network-params/>
-</network-request>"""
-
-String expectedVperNetworkInputs =
-"""<network-inputs xmlns="http://www.w3.org/2001/XMLSchema">
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <subscription-service-type>MSO-dev-service-type</subscription-service-type>
- <global-customer-id>globalId_45678905678</global-customer-id>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <backout-on-failure>false</backout-on-failure>
- <failIfExist>false</failIfExist>
- <networkModelInfo>
- <modelName>CONTRAIL_EXTERNAL</modelName>
- <modelUuid>sn5256d1-5a33-55df-13ab-12abad84e111</modelUuid>
- <modelInvariantUuid>sn5256d1-5a33-55df-13ab-12abad84e764</modelInvariantUuid>
- <modelVersion>1</modelVersion>
- <modelCustomizationUuid>sn5256d1-5a33-55df-13ab-12abad84e222</modelCustomizationUuid>
- </networkModelInfo>
- <serviceModelInfo>
- <modelName/>
- <modelUuid/>
- <modelInvariantUuid/>
- <modelVersion/>
- <modelCustomizationUuid/>
- </serviceModelInfo>
- <sdncVersion>1702</sdncVersion>
-</network-inputs>"""
-
-String expectedNetworkInputsMissingNetworkId =
-"""<network-inputs xmlns="http://www.w3.org/2001/XMLSchema">
- <network-id/>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <modelCustomizationId>f21df226-8093-48c3-be7e-0408fcda0422</modelCustomizationId>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>7dd5365547234ee8937416c65507d266</tenant-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <backout-on-failure>false</backout-on-failure>
- <sdncVersion>1610</sdncVersion>
-</network-inputs>"""
-
-
- String NetworkRequest_noPhysicalName =
- """<vnfreq:network-request xmlns:vnfreq="http://org.openecomp/mso/infra/vnf-request/v1">
- <vnfreq:request-info>
- <vnfreq:request-id>1ef47428-cade-45bd-a103-0751e8b2deb0</vnfreq:request-id>
- <vnfreq:action>UPDATE</vnfreq:action>
- <vnfreq:source>PORTAL</vnfreq:source>
- </vnfreq:request-info>
- <vnfreq:network-inputs>
- <vnfreq:network-name>MNS-25180-L-01-dmz_direct_net_1</vnfreq:network-name>
- <vnfreq:network-type>CONTRAIL_EXTERNAL</vnfreq:network-type>
- <vnfreq:modelCustomizationId></vnfreq:modelCustomizationId>
- <vnfreq:service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</vnfreq:service-id>
- <vnfreq:aic-cloud-region>RDM2WAGPLCP</vnfreq:aic-cloud-region>
- <vnfreq:tenant-id>7dd5365547234ee8937416c65507d266</vnfreq:tenant-id>
- <vnfreq:vlans>3008</vnfreq:vlans>
- </vnfreq:network-inputs>
- <vnfreq:network-params>
- <network-params>
- <param name="dhcp-enabled">true</param>
- <param name="serviceId">a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</param>
- <param name="cidr-mask">true</param>
- <param name="backoutOnFailure">true</param>
- <param name="gateway-address">10.10.125.1</param>
- </network-params>
- </vnfreq:network-params>
-</vnfreq:network-request>"""
-
- String vnfRequestFakeRegion =
- """<vnfreq:network-request xmlns:vnfreq="http://org.openecomp/mso/infra/vnf-request/v1">
- <vnfreq:request-info>
- <vnfreq:request-id>1ef47428-cade-45bd-a103-0751e8b2deb0</vnfreq:request-id>
- <vnfreq:action>UPDATE</vnfreq:action>
- <vnfreq:source>PORTAL</vnfreq:source>
- </vnfreq:request-info>
- <vnfreq:network-inputs>
- <vnfreq:network-name>MNS-25180-L-01-dmz_direct_net_1</vnfreq:network-name>
- <vnfreq:network-type>CONTRAIL_EXTERNAL</vnfreq:network-type>
- <vnfreq:service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</vnfreq:service-id>
- <vnfreq:aic-cloud-region>MDTWNJ21</vnfreq:aic-cloud-region>
- <vnfreq:tenant-id>7dd5365547234ee8937416c65507d266</vnfreq:tenant-id>
- </vnfreq:network-inputs>
- <vnfreq:network-params>
- <param name="shared">1</param>
- <param name="external">0</param>
- </vnfreq:network-params>
-</vnfreq:network-request>"""
-
- // expectedNetworkRequest
- String expectedNetworkRequest_Outputs =
- """<vnfreq:network-request xmlns:vnfreq="http://org.openecomp/mso/infra/vnf-request/v1">
- <vnfreq:request-info>
- <vnfreq:request-id>1ef47428-cade-45bd-a103-0751e8b2deb0</vnfreq:request-id>
- <vnfreq:action>UPDATE</vnfreq:action>
- <vnfreq:source>PORTAL</vnfreq:source>
- </vnfreq:request-info>
- <vnfreq:network-inputs>
- <vnfreq:network-name>MNS-25180-L-01-dmz_direct_net_1</vnfreq:network-name>
- <vnfreq:network-type>CONTRAIL_EXTERNAL</vnfreq:network-type>
- <vnfreq:service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</vnfreq:service-id>
- <vnfreq:aic-cloud-region>RDM2WAGPLCP</vnfreq:aic-cloud-region>
- <vnfreq:tenant-id>7dd5365547234ee8937416c65507d266</vnfreq:tenant-id>
- </vnfreq:network-inputs>
- <vnfreq:network-outputs>
- <vnfreq:network-name>MNS-25180-L-01-dmz_direct_net_1</vnfreq:network-name>
- <vnfreq:network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</vnfreq:network-id>
- </vnfreq:network-outputs>
- <vnfreq:network-params>
- <param name="shared">1</param>
- <param name="external">0</param>
- </vnfreq:network-params>
-</vnfreq:network-request>"""
-
-
- String networkInputs =
- """<network-inputs xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
-</network-inputs>"""
-
- String networkOutputs =
- """<network-outputs>
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- </network-outputs>"""
-
- String queryAAIResponse =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v3">
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name>HSL_direct_net_2</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>contrail</network-technology>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <orchestration-status>pending-delete</orchestration-status>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-delete</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <relationship-list/>
- </subnet>
- </subnets>
- <relationship-list>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </l3-network>
- </rest:payload>
-</rest:RESTResponse>"""
-
- String queryIdAIIResponse =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v6">
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>contrail</network-technology>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <resource-version>l3-version</resource-version>
- <orchestration-status>pending-delete</orchestration-status>
- <heat-stack-id>ST_2Bindings_6006/55288ef0-595c-47d3-819e-cf93aaac6326</heat-stack-id>
- <physical-network-name>networkName</physical-network-name>
- <is-provider-network>false</is-provider-network>
- <is-shared-network>true</is-shared-network>
- <is-external-network>false</is-external-network>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-update</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <subnet-name>subnetName</subnet-name>
- <ip-assignment-direction>true</ip-assignment-direction>
- <host-routes>
- <host-route>
- <host-route-id>400d286b-7e44-4514-b9b3-f70f7360ff32</host-route-id>
- <route-prefix>172.20.1.0/24</route-prefix>
- <next-hop>10.102.200.1</next-hop>
- <next-hop-type>ip-address</next-hop-type>
- <resource-version>1505857300987</resource-version>
- </host-route>
- <host-route>
- <host-route-id>6f038013-8b15-4eb8-914b-507489fbc8ee</host-route-id>
- <route-prefix>10.102.0.0/16</route-prefix>
- <next-hop>10.102.200.1</next-hop>
- <next-hop-type>ip-address</next-hop-type>
- <resource-version>1505857301151</resource-version>
- </host-route>
- <host-route>
- <host-route-id>8811c5f8-f1ed-4fa0-a505-e1be60396e28</host-route-id>
- <route-prefix>192.168.2.0/25</route-prefix>
- <next-hop>10.102.200.1</next-hop>
- <resource-version>1505857301954</resource-version>
- </host-route>
- </host-routes>
- <relationship-list/>
- </subnet>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-delete</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <subnet-name>subnetName</subnet-name>
- <ip-assignment-direction>true</ip-assignment-direction>
- <host-routes>
- <host-route>
- <host-route-id>400d286b-7e44-4514-b9b3-f70f7360ff32</host-route-id>
- <route-prefix>172.20.1.0/24</route-prefix>
- <next-hop>10.102.200.1</next-hop>
- <resource-version>1505857300987</resource-version>
- </host-route>
- </host-routes>
- <relationship-list/>
- </subnet>
- </subnets>
- <segmentation-assignments>
- <segmentation-id>414</segmentation-id>
- <resource-version>4132176</resource-version>
- </segmentation-assignments>
- <segmentation-assignments>
- <segmentation-id>415</segmentation-id>
- <resource-version>4132176</resource-version>
- </segmentation-assignments>
- <ctag-assignments>
- <ctag-assignment>
- <vlan-id-inner>inner</vlan-id-inner>
- <resource-version>ctag-version</resource-version>
- <relationship-list>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/897deadc2b954a6bac6d3c197fb3525e/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>897deadc2b954a6bac6d3c197fb3525e</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>tenant.tenant-name</property-key>
- <property-value>MSOTest1</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/a290b841-f672-44dd-b9cd-6f8c20d7d8c8/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>a290b841-f672-44dd-b9cd-6f8c20d7d8c8</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vpn-binding.vpn-name</property-key>
- <property-value>oam_protected_net_6_MTN5_msotest2</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/24a4b507-853a-4a38-99aa-05fcc54be24d/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>24a4b507-853a-4a38-99aa-05fcc54be24d</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vpn-binding.vpn-name</property-key>
- <property-value>oam_protected_net_6_MTN5_msotest1</property-value>
- </related-to-property>
- </relationship>
- </relationship-list>
- </ctag-assignment>
- </ctag-assignments>
- <relationship-list>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>network-policy</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg</related-link>
- <relationship-data>
- <relationship-key>network-policy.network-policy-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0cg</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN1</related-link>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN2</related-link>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </l3-network>
- </rest:payload>
-</rest:RESTResponse>"""
-
- String queryIdAIIResponseTestScenario01 =
- """<?xml version="1.0" encoding="UTF-8"?>
-<l3-network xmlns="http://org.openecomp.aai.inventory/v7">
- <network-id>4da55fe4-7a9e-478c-a434-8a98d62265ab</network-id>
- <network-name>GN_EVPN_direct_net_0_ST1</network-name>
- <network-type>CONTRAIL30_BASIC</network-type>
- <network-role>GN_EVPN_direct</network-role>
- <network-technology>contrail</network-technology>
- <is-bound-to-vpn>false</is-bound-to-vpn>
- <service-id>9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <resource-version>1465398611</resource-version>
- <orchestration-status>pending-delete</orchestration-status>
- <physical-network-name>networkName</physical-network-name>
- <is-provider-network>false</is-provider-network>
- <is-shared-network>true</is-shared-network>
- <is-external-network>false</is-external-network>
- <subnets>
- <subnet>
- <subnet-id>cb1a7b47-5428-44c9-89c2-8b17541c3228</subnet-id>
- <gateway-address>108.239.40.1</gateway-address>
- <network-start-address>108.239.40.0</network-start-address>
- <cidr-mask>28</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-delete</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <dhcp-start>108.239.40.0</dhcp-start>
- <dhcp-end>108.239.40.0</dhcp-end>
- <resource-version>1465398611</resource-version>
- <subnet-name>subnetName</subnet-name>
- <relationship-list />
- </subnet>
- <subnet>
- <subnet-id>e2cc7c14-90f0-4205-840d-b4e07f04e621</subnet-id>
- <gateway-address>2606:ae00:2e01:604::1</gateway-address>
- <network-start-address>2606:ae00:2e01:604::</network-start-address>
- <cidr-mask>64</cidr-mask>
- <ip-version>6</ip-version>
- <orchestration-status>pending-delete</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <dhcp-start>2606:ae00:2e01:604::</dhcp-start>
- <dhcp-end>2606:ae00:2e01:604::</dhcp-end>
- <resource-version>1465398611</resource-version>
- <subnet-name>subnetName</subnet-name>
- <relationship-list />
- </subnet>
- </subnets>
- <ctag-assignments />
- <segmentation-assignments>
- <segmentation-id>416</segmentation-id>
- <resource-version>4132176</resource-version>
- </segmentation-assignments>
- <relationship-list>
- <relationship>
- <related-to>cloud-region</related-to>
- <related-link>https://mtanjv9aaas03.aic.cip.com:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/
- </related-link>
- <relationship-data>
- <relationship-key>cloud-region.cloud-region-id</relationship-key>
- <relationship-value>AAIAIC25</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-owner</relationship-key>
- <relationship-value>att-aic</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>cloud-region.owner-defined-type</property-key>
- <property-value></property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://mtanjv9aaas03.aic.cip.com:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/tenants/tenant/4ae1d3446a4c48b2bec44b6cfba06d68/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>4ae1d3446a4c48b2bec44b6cfba06d68
- </relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-owner</relationship-key>
- <relationship-value>att-aic</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-region-id</relationship-key>
- <relationship-value>AAIAIC25</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>tenant.tenant-name</property-key>
- <property-value>Ruchira Contrail 3.0 test</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://mtanjv9aaas03.aic.cip.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>9a7b327d9-287aa00-82c4b0-100001</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vpn-binding.vpn-name</property-key>
- <property-value>GN_EVPN_direct_net_0_ST1</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
-</l3-network>"""
-
- String queryIdAIIResponseVpnNotPresent =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v6">
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>contrail</network-technology>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <orchestration-status>pending-delete</orchestration-status>
- <physical-network-name>networkName</physical-network-name>
- <is-provider-network>false</is-provider-network>
- <is-shared-network>true</is-shared-network>
- <is-external-network>false</is-external-network>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-delete</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <subnet-name>subnetName</subnet-name>
- <relationship-list/>
- </subnet>
- </subnets>
- <relationship-list/>
- </l3-network>
- </rest:payload>
-</rest:RESTResponse>"""
-
- String queryNameAIIResponse =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v6">
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>contrail</network-technology>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <orchestration-status>pending-delete</orchestration-status>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-delete</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <relationship-list/>
- </subnet>
- </subnets>
- <relationship-list>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </l3-network>
- </rest:payload>
- </rest:RESTResponse>"""
-
- String queryNameAIIResponseVpnNotPresent =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v6>
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>contrail</network-technology>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <orchestration-status>pending-delete</orchestration-status>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-delete</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <relationship-list/>
- </subnet>
- </subnets>
- </l3-network>
- </rest:payload>
- </rest:RESTResponse>"""
-
- String aaiVpnResponseStub =
- """<rest:payload xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- xmlns="http://org.openecomp.aai.inventory/v8"
- contentType="text/xml">
- <vpn-binding>
- <global-route-target/>
- </vpn-binding>
-</rest:payload>"""
-
- String queryVpnBindingAAIResponse =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Mon,14 Mar 2016 20:53:33 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID"
- value="mtcnjv9aaas01.mtcnj.aic.cip.com-20160314-20:53:33:487-134392"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <vpn-binding xmlns="http://org.openecomp.aai.inventory/v6">
- <vpn-id>9a7b327d9-287aa00-82c4b0-105757</vpn-id>
- <vpn-name>GN_EVPN_Test</vpn-name>
- <global-route-target>13979:105757</global-route-target>
- <relationship-list>
- <relationship>
- <related-to>l3-network</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/689ec39e-c5fc-4462-8db2-4f760763ad28/</related-link>
- <relationship-data>
- <relationship-key>l3-network.network-id</relationship-key>
- <relationship-value>689ec39e-c5fc-4462-8db2-4f760763ad28</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>l3-network</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/1a49396b-19b3-40a4-8792-aa2fbd0f0704/</related-link>
- <relationship-data>
- <relationship-key>l3-network.network-id</relationship-key>
- <relationship-value>1a49396b-19b3-40a4-8792-aa2fbd0f0704</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>l3-network</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/774f3329-3c83-4771-86c7-9e6207cd50fd/</related-link>
- <relationship-data>
- <relationship-key>l3-network.network-id</relationship-key>
- <relationship-value>774f3329-3c83-4771-86c7-9e6207cd50fd</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </vpn-binding>
- </rest:payload>
-</rest:RESTResponse>"""
-
-
- String updateNetworkRequest =
- """<updateNetworkRequest>
- <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
- <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
- <networkId>49c86598-f766-46f8-84f8-8d1c1b10f9b4</networkId>
- <networkStackId>ST_2Bindings_6006/55288ef0-595c-47d3-819e-cf93aaac6326</networkStackId>
- <networkName>MNS-25180-L-01-dmz_direct_net_1</networkName>
- <networkType>CONTRAIL_EXTERNAL</networkType>
- <modelCustomizationUuid>sn5256d1-5a33-55df-13ab-12abad84e222</modelCustomizationUuid>
- <networkTypeVersion/>
- <networkTechnology>CONTRAIL</networkTechnology>
- <providerVlanNetwork>
- <physicalNetworkName>networkName</physicalNetworkName>
- <vlans>414,415</vlans>
- </providerVlanNetwork>
- <contrailNetwork>
- <shared>true</shared>
- <external>false</external>
- <routeTargets>13979:105757</routeTargets>
- <routeTargets>13979:105757</routeTargets>
- <policyFqdns>GN_EVPN_Test</policyFqdns>
- <routeTableFqdns>refFQDN1</routeTableFqdns>
- <routeTableFqdns>refFQDN2</routeTableFqdns>
- </contrailNetwork>
- <subnets>
- <allocationPools>
- <start/>
- <end/>
- </allocationPools>
- <cidr>107.239.52.0/24</cidr>
- <enableDHCP>true</enableDHCP>
- <gatewayIp>107.239.52.1</gatewayIp>
- <ipVersion>4</ipVersion>
- <subnetId>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnetId>
- <subnetName>subnetName</subnetName>
- <addrFromStart>true</addrFromStart>
- <hostRoutes>
- <prefix>172.20.1.0/24</prefix>
- <nextHop>10.102.200.1</nextHop>
- </hostRoutes>
- <hostRoutes>
- <prefix>10.102.0.0/16</prefix>
- <nextHop>10.102.200.1</nextHop>
- </hostRoutes>
- <hostRoutes>
- <prefix>192.168.2.0/25</prefix>
- <nextHop>10.102.200.1</nextHop>
- </hostRoutes>
- </subnets>
- <skipAAI>true</skipAAI>
- <backout>true</backout>
- <failIfExists>false</failIfExists>
- <msoRequest>
- <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
- <serviceInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</serviceInstanceId>
- </msoRequest>
- <messageId>messageId_generated</messageId>
- <notificationUrl/>
-</updateNetworkRequest>"""
-
-String updateNetworkRequest_noPhysicalName =
-"""<updateNetworkRequest>
- <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
- <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
- <networkId>49c86598-f766-46f8-84f8-8d1c1b10f9b4</networkId>
- <networkStackId>ST_2Bindings_6006/55288ef0-595c-47d3-819e-cf93aaac6326</networkStackId>
- <networkName>MNS-25180-L-01-dmz_direct_net_1</networkName>
- <networkType>CONTRAIL_EXTERNAL</networkType>
- <modelCustomizationUuid/>
- <networkTypeVersion/>
- <networkTechnology>CONTRAIL</networkTechnology>
- <providerVlanNetwork>
- <physicalNetworkName>networkName</physicalNetworkName>
- <vlans>414,415</vlans>
- </providerVlanNetwork>
- <contrailNetwork>
- <shared>true</shared>
- <external>false</external>
- <routeTargets>13979:105757</routeTargets>
- <routeTargets>13979:105757</routeTargets>
- <policyFqdns>GN_EVPN_Test</policyFqdns>
- </contrailNetwork>
- <subnets>
- <allocationPools>
- <start/>
- <end/>
- </allocationPools>
- <cidr>107.239.52.0/24</cidr>
- <enableDHCP>true</enableDHCP>
- <gatewayIp>107.239.52.1</gatewayIp>
- <ipVersion>4</ipVersion>
- <subnetId>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnetId>
- <subnetName>subnetName</subnetName>
- <addrFromStart>true</addrFromStart>
- <hostRoutes>
- <prefix>172.20.1.0/24</prefix>
- <nextHop>10.102.200.1</nextHop>
- </hostRoutes>
- <hostRoutes>
- <prefix>10.102.0.0/16</prefix>
- <nextHop>10.102.200.1</nextHop>
- </hostRoutes>
- <hostRoutes>
- <prefix>192.168.2.0/25</prefix>
- <nextHop>10.102.200.1</nextHop>
- </hostRoutes>
- </subnets>
- <skipAAI>true</skipAAI>
- <backout>true</backout>
- <failIfExists>false</failIfExists>
- <networkParams>
- <dhcp-enabled>true</dhcp-enabled>
- <serviceId>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</serviceId>
- <cidr-mask>true</cidr-mask>
- <backoutOnFailure>true</backoutOnFailure>
- <gateway-address>10.10.125.1</gateway-address>
- </networkParams>
- <msoRequest>
- <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
- <serviceInstanceId>null</serviceInstanceId>
- </msoRequest>
- <messageId>messageId_generated</messageId>
- <notificationUrl/>
-</updateNetworkRequest>"""
-
- String updateNetworkResponseREST =
- """<ns2:updateNetworkContrailResponse xmlns:ns2="http://org.openecomp.mso/network">
- <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
- <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
- <networkFqdn>default-domain:MSOTest:GN_EVPN_direct_net_0_ST1</networkFqdn>
- <networkStackId></networkStackId>
- <subnetMap>
- <entry>
- <key>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</key>
- <value>bd8e87c6-f4e2-41b8-b0bc-9596aa00cd73</value>
- </entry>
- <entry>
- <key>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</key>
- <value>bd8e87c6-f4e2-41b8-b0bc-9596aa00cd73</value>
- </entry>
- </subnetMap>
- <rollback>
- <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
- <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
- <networkStackId></networkStackId>
- <networkType>CONTRAIL_EXTERNAL</networkType>
- <networkUpdated>true</networkUpdated>
- <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
- <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
- <msoRequest>
- <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId>
- <serviceInstanceId></serviceInstanceId>
- </msoRequest>
- </rollback>
- <messageId>messageId_generated</messageId>
-</ns2:updateNetworkContrailResponse>"""
-
- String updateRollbackNetworkRequest =
- """<rollbackNetworkRequest>
- <networkRollback>
- <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
- <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
- <networkStackId/>
- <networkType>CONTRAIL_EXTERNAL</networkType>
- <networkUpdated>true</networkUpdated>
- <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
- <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
- <msoRequest>
- <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId>
- <serviceInstanceId/>
- </msoRequest>
- </networkRollback>
-</rollbackNetworkRequest>"""
-
- String updateNetworkResponse =
- """<ns2:updateNetworkContrailResponse xmlns:ns2="http://org.openecomp.mso/network"
- xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
- <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
- <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
- <networkStackId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkStackId>
- <networkFqdn>default-domain:MSOTest:GN_EVPN_direct_net_0_ST1</networkFqdn>
- <subnetIdMap>
- <entry>
- <key>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</key>
- <value>bd8e87c6-f4e2-41b8-b0bc-9596aa00cd73</value>
- </entry>
- </subnetIdMap>
- <rollback>
- <cloudId>RDM2WAGPLCP</cloudId>
- <msoRequest>
- <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId>
- <serviceInstanceId/>
- </msoRequest>
- <networkUpdated>true</networkUpdated>
- <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
- <networkType>CONTRAIL_EXTERNAL</networkType>
- <networkUpdated>false</networkUpdated>
- <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
- <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
- </rollback>
-</ns2:updateNetworkContrailResponse>"""
-
- String updateContrailAAIPayloadRequest =
- """<l3-network xmlns="http://org.openecomp.aai.inventory/v9">
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>contrail</network-technology>
- <neutron-network-id>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutron-network-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <resource-version>l3-version</resource-version>
- <orchestration-status>Active</orchestration-status>
- <heat-stack-id>ST_2Bindings_6006/55288ef0-595c-47d3-819e-cf93aaac6326</heat-stack-id>
- <contrail-network-fqdn>default-domain:MSOTest:GN_EVPN_direct_net_0_ST1</contrail-network-fqdn>
- <physical-network-name>networkName</physical-network-name>
- <is-provider-network>false</is-provider-network>
- <is-shared-network>true</is-shared-network>
- <is-external-network>false</is-external-network>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <neutron-subnet-id>bd8e87c6-f4e2-41b8-b0bc-9596aa00cd73</neutron-subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>Active</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <resource-version>1505857300987</resource-version>
- <subnet-name>subnetName</subnet-name>
- <ip-assignment-direction>true</ip-assignment-direction>
- <host-routes>
- <host-route>
- <host-route-id>400d286b-7e44-4514-b9b3-f70f7360ff32</host-route-id>
- <route-prefix>172.20.1.0/24</route-prefix>
- <next-hop>10.102.200.1</next-hop>
- <next-hop-type>ip-address</next-hop-type>
- <resource-version>1505857300987</resource-version>
- </host-route>
- <host-route>
- <host-route-id>6f038013-8b15-4eb8-914b-507489fbc8ee</host-route-id>
- <route-prefix>10.102.0.0/16</route-prefix>
- <next-hop>10.102.200.1</next-hop>
- <next-hop-type>ip-address</next-hop-type>
- <resource-version>1505857301151</resource-version>
- </host-route>
- <host-route>
- <host-route-id>8811c5f8-f1ed-4fa0-a505-e1be60396e28</host-route-id>
- <route-prefix>192.168.2.0/25</route-prefix>
- <next-hop>10.102.200.1</next-hop>
- <next-hop-type/>
- <resource-version>1505857301954</resource-version>
- </host-route>
- </host-routes>
- </subnet>
- </subnets>
- <segmentation-assignments>
- <segmentation-id>414</segmentation-id>
- <resource-version>4132176</resource-version>
- </segmentation-assignments>
- <segmentation-assignments>
- <segmentation-id>415</segmentation-id>
- <resource-version>4132176</resource-version>
- </segmentation-assignments>
- <ctag-assignments>
- <ctag-assignment>
- <vlan-id-inner>inner</vlan-id-inner>
- <resource-version>ctag-version</resource-version>
- <relationship-list>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/897deadc2b954a6bac6d3c197fb3525e/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>897deadc2b954a6bac6d3c197fb3525e</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>tenant.tenant-name</property-key>
- <property-value>MSOTest1</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/a290b841-f672-44dd-b9cd-6f8c20d7d8c8/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>a290b841-f672-44dd-b9cd-6f8c20d7d8c8</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vpn-binding.vpn-name</property-key>
- <property-value>oam_protected_net_6_MTN5_msotest2</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/24a4b507-853a-4a38-99aa-05fcc54be24d/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>24a4b507-853a-4a38-99aa-05fcc54be24d</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vpn-binding.vpn-name</property-key>
- <property-value>oam_protected_net_6_MTN5_msotest1</property-value>
- </related-to-property>
- </relationship>
- </relationship-list>
- </ctag-assignment>
- </ctag-assignments>
- <relationship-list>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>network-policy</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg</related-link>
- <relationship-data>
- <relationship-key>network-policy.network-policy-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0cg</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN1</related-link>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN2</related-link>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
-</l3-network>"""
-
-
- String updateContrailAAIResponse =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Content-Length" value="0"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:551-132672"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
-</rest:RESTResponse>"""
-
- String updateNetworkErrorResponse =
- """<updateNetworkError>
- <messageId>680bd458-5ec1-4a16-b77c-509022e53450</messageId><category>INTERNAL</category>
- <message>400 Bad Request: The server could not comply with the request since it is either malformed or otherwise incorrect., error.type=StackValidationFailed, error.message=Property error: : resources.network.properties: : Unknown Property network_ipam_refs_data</message>
- <rolledBack>true</rolledBack>
- </updateNetworkError>"""
-
-
- String networkException500 =
- """<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:VersionMismatch</faultcode><faultstring>"http://org.openecomp.mso/network", the namespace on the "updateNetworkContrail" element, is not a valid SOAP version.</faultstring></soap:Fault></soap:Body></soap:Envelope>"""
-
- String aaiResponse =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Sat,30 Jan 2016 20:09:24 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID"
- value="mtcnjv9aaas01.mtcnj.aic.cip.com-20160130-20:09:24:814-165843"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v3">
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name>HSL_direct_net_2</network-name>
- <network-type>CONTRAIL_BASIC</network-type>
- <network-role>HSL_direct</network-role>
- <network-technology>contrail</network-technology>
- <neutron-network-id>8bbd3edf-b835-4610-96a2-a5cafa029042</neutron-network-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <orchestration-status>active</orchestration-status>
- <heat-stack-id>HSL_direct_net_2/57594a56-1c92-4a38-9caa-641c1fa3d4b6</heat-stack-id>
- <subnets>
- <subnet>
- <subnet-id>ea5f2a2c-604f-47ff-a9c5-253ee4f0ef0a</subnet-id>
- <neutron-subnet-id>5a77fdc2-7789-4649-a1b9-6eaf1db1813a</neutron-subnet-id>
- <gateway-address>172.16.34.1</gateway-address>
- <network-start-address>172.16.34.0</network-start-address>
- <cidr-mask>28</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>active</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <relationship-list/>
- </subnet>
- </subnets>
- <relationship-list>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v3/cloud-infrastructure/tenants/tenant/e81d842d3e8b45c5a59f57cd76af3aaf/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>e81d842d3e8b45c5a59f57cd76af3aaf</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </l3-network>
- </rest:payload>
- </rest:RESTResponse>"""
-
- String changeAssignSDNCRequest =
- """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:ns5="http://org.openecomp/mso/request/types/v1"
- xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
- <sdncadapter:RequestHeader>
- <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
- <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
- <sdncadapter:SvcAction>changeassign</sdncadapter:SvcAction>
- <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
- <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
- </sdncadapter:RequestHeader>
- <aetgt:SDNCRequestData>
- <request-information>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <request-action>NetworkActivateRequest</request-action>
- <source>VID</source>
- <notification-url/>
- <order-number/>
- <order-version/>
- </request-information>
- <service-information>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <service-type>MSO-dev-service-type</service-type>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- <subscriber-name>MSO_1610_dev</subscriber-name>
- </service-information>
- <network-request-information>
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <tenant>7dd5365547234ee8937416c65507d266</tenant>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- </network-request-information>
- </aetgt:SDNCRequestData>
-</aetgt:SDNCAdapterWorkflowRequest>"""
-
-String assignResponse =
-"""<sdncadapterworkflow:SDNCAdapterWorkflowResponse xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1" xmlns:tag0="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <sdncadapterworkflow:response-data> <tag0:CallbackHeader> <tag0:RequestId>006927ca-f5a3-47fd-880c-dfcbcd81a093</tag0:RequestId> <tag0:ResponseCode>200</tag0:ResponseCode> <tag0:ResponseMessage>OK</tag0:ResponseMessage> </tag0:CallbackHeader> <tag0:RequestData xsi:type="xs:string"><output xmlns="com:att:sdnctl:vnf"><response-code>200</response-code><svc-request-id>006927ca-f5a3-47fd-880c-dfcbcd81a093</svc-request-id><ack-final-indicator>Y</ack-final-indicator><service-information><subscriber-name>notsurewecare</subscriber-name><service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id><service-instance-id>GN_EVPN_direct_net_0_ST_noGW</service-instance-id></service-information><network-information><network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id></network-information></output></tag0:RequestData> </sdncadapterworkflow:response-data> </sdncadapterworkflow:SDNCAdapterWorkflowResponse>"""
-
- String sdncRollbackRequest =
- """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:ns5="http://org.openecomp/mso/request/types/v1"
- xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
- <sdncadapter:RequestHeader>
- <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
- <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
- <sdncadapter:SvcAction>rollback</sdncadapter:SvcAction>
- <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
- <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
- </sdncadapter:RequestHeader>
- <aetgt:SDNCRequestData>
- <request-information>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <request-action>NetworkActivateRequest</request-action>
- <source>VID</source>
- <notification-url/>
- <order-number/>
- <order-version/>
- </request-information>
- <service-information>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <service-type>MSO-dev-service-type</service-type>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- <subscriber-name>MSO_1610_dev</subscriber-name>
- </service-information>
- <network-request-information>
- <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <tenant>7dd5365547234ee8937416c65507d266</tenant>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- </network-request-information>
- </aetgt:SDNCRequestData>
-</aetgt:SDNCAdapterWorkflowRequest>"""
-
- String sdncAdapterWorkflowResponse =
- """<aetgt:SDNCAdapterWorkflowResponse xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1">
- <sdncadapterworkflow:response-data>
-<tag0:CallbackHeader xmlns:tag0="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
- <tag0:RequestId>745b1b50-e39e-4685-9cc8-c71f0bde8bf0</tag0:RequestId>
- <tag0:ResponseCode>200</tag0:ResponseCode>
- <tag0:ResponseMessage>OK</tag0:ResponseMessage>
-</tag0:CallbackHeader>
- <tag0:RequestData xmlns:tag0="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:type="xs:string"><output xmlns="com:att:sdnctl:vnf"><svc-request-id>00703dc8-71ff-442d-a4a8-3adc5beef6a9</svc-request-id><response-code>200</response-code><ack-final-indicator>Y</ack-final-indicator><network-information><network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id></network-information><service-information><service-type>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-type><service-instance-id>MNS-25180-L-01-dmz_direct_net_1</service-instance-id><subscriber-name>notsurewecare</subscriber-name></service-information></output></tag0:RequestData>
- </sdncadapterworkflow:response-data>
-</aetgt:SDNCAdapterWorkflowResponse>"""
-
-
- String sdncAdapterWorkflowResponse_Error =
- """<sdncadapterworkflow:SDNCAdapterWorkflowResponse xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:tag0="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="com:att:sdnctl:vnf">
- <sdncadapterworkflow:response-data>
- <tag0:RequestData xsi:type="xs:string">
- <output>
- <response-code>400</response-code>
- <response-message>Error writing to l3-netework</response-message>
- <ack-final-indicator>Y</ack-final-indicator>
- <svc-request-id>c79240d8-34b5-4853-af69-2021928dba00</svc-request-id>
- </output>
- </tag0:RequestData>
- </sdncadapterworkflow:response-data>
-</sdncadapterworkflow:SDNCAdapterWorkflowResponse>"""
-
- String expected_sdncAdapterWorkflowResponse_Error =
- """<sdncadapterworkflow:SDNCAdapterWorkflowResponse xmlns="com:att:sdnctl:vnf"
- xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:tag0="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <sdncadapterworkflow:response-data>
- <tag0:RequestData xsi:type="xs:string">
- <output>
- <response-code>400</response-code>
- <response-message>Error writing to l3-netework</response-message>
- <ack-final-indicator>Y</ack-final-indicator>
- <svc-request-id>c79240d8-34b5-4853-af69-2021928dba00</svc-request-id>
- </output>
- </tag0:RequestData>
- </sdncadapterworkflow:response-data>
-</sdncadapterworkflow:SDNCAdapterWorkflowResponse>"""
-
- String sdncAdapterWorkflowFormattedResponse =
- """<aetgt:SDNCAdapterWorkflowResponse xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns="com:att:sdnctl:vnf">
- <aetgt:response-data>
- <output>
- <svc-request-id>00703dc8-71ff-442d-a4a8-3adc5beef6a9</svc-request-id>
- <response-code>200</response-code>
- <ack-final-indicator>Y</ack-final-indicator>
- <network-information>
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- </network-information>
- <service-information>
- <service-type>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-type>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- <subscriber-name>notsurewecare</subscriber-name>
- </service-information>
- </output>
- </aetgt:response-data>
-</aetgt:SDNCAdapterWorkflowResponse>"""
-
-String rollbackSDNCRequest =
-"""<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:ns5="http://org.openecomp/mso/request/types/v1"
- xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1">
- <sdncadapter:RequestHeader>
- <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId>
- <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId>
- <sdncadapter:SvcAction>rollback</sdncadapter:SvcAction>
- <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
- <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
- </sdncadapter:RequestHeader>
- <aetgt:SDNCRequestData>
- <request-information>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <request-action>CreateNetworkInstance</request-action>
- <source>VID</source>
- <notification-url/>
- <order-number/>
- <order-version/>
- </request-information>
- <service-information>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <service-type>MSO-dev-service-type</service-type>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- <subscriber-name>MSO_1610_dev</subscriber-name>
- </service-information>
- <network-information>
- <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <onap-model-information>
- <model-invariant-uuid>invariant-uuid</model-invariant-uuid>
- <model-customization-uuid>customization-uuid</model-customization-uuid>
- <model-uuid>uuid</model-uuid>
- <model-version>version</model-version>
- <model-name>CONTRAIL_EXTERNAL</model-name>
- </onap-model-information>
- </network-information>
- <network-request-information>
- <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <tenant>7dd5365547234ee8937416c65507d266</tenant>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- </network-request-information>
- </aetgt:SDNCRequestData>
-</aetgt:SDNCAdapterWorkflowRequest>"""
-
-String rollbackNetworkRequest =
-"""<NetworkAdapter:rollbackNetwork xmlns:NetworkAdapter="http://org.openecomp.mso/network">
- <rollback>
- <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
- <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
- <networkStackId/>
- <networkType>CONTRAIL_EXTERNAL</networkType>
- <networkCreated>true</networkCreated>
- <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
- <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
- <msoRequest>
- <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId>
- <serviceInstanceId/>
- </msoRequest>
- </rollback>
-</NetworkAdapter:rollbackNetwork>"""
-
-// - - - - - - - -
-
-
- @Before
- public void init()
- {
- MockitoAnnotations.initMocks(this)
-
- }
-
- public void initializeVariables (DelegateExecution mockExecution) {
-
- verify(mockExecution).setVariable(Prefix + "messageId", "")
- verify(mockExecution).setVariable("BasicAuthHeaderValuePO", "")
- verify(mockExecution).setVariable("BasicAuthHeaderValueSDNC", "")
- verify(mockExecution).setVariable(Prefix + "networkRequest", "")
- verify(mockExecution).setVariable(Prefix + "networkInputs", "")
- verify(mockExecution).setVariable(Prefix + "networkOutputs", "")
- verify(mockExecution).setVariable(Prefix + "requestId", "")
- verify(mockExecution).setVariable(Prefix + "source", "")
- verify(mockExecution).setVariable(Prefix + "networkId", "")
-
- verify(mockExecution).setVariable(Prefix + "isPONR", false)
-
- // AAI query Cloud Region
- verify(mockExecution).setVariable(Prefix + "queryCloudRegionRequest","")
- verify(mockExecution).setVariable(Prefix + "queryCloudRegionReturnCode","")
- verify(mockExecution).setVariable(Prefix + "queryCloudRegionResponse","")
- verify(mockExecution).setVariable(Prefix + "cloudRegionPo","")
- verify(mockExecution).setVariable(Prefix + "cloudRegionSdnc","")
- verify(mockExecution).setVariable(Prefix + "isCloudRegionGood", false)
-
- // AAI query Id
- verify(mockExecution).setVariable(Prefix + "queryIdAAIRequest","")
- verify(mockExecution).setVariable(Prefix + "queryIdAAIResponse", "")
- verify(mockExecution).setVariable(Prefix + "aaiIdReturnCode", "")
-
- // AAI query vpn binding
- verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIRequest","")
- verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIResponse", "")
- verify(mockExecution).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "")
- verify(mockExecution).setVariable(Prefix + "vpnBindings", null)
- verify(mockExecution).setVariable(Prefix + "vpnCount", 0)
- verify(mockExecution).setVariable(Prefix + "routeCollection", "")
-
- // AAI query network policy
- verify(mockExecution).setVariable(Prefix + "queryNetworkPolicyAAIRequest","")
- verify(mockExecution).setVariable(Prefix + "queryNetworkPolicyAAIResponse", "")
- verify(mockExecution).setVariable(Prefix + "aaiQqueryNetworkPolicyReturnCode", "")
- verify(mockExecution).setVariable(Prefix + "networkPolicyUriList", null)
- verify(mockExecution).setVariable(Prefix + "networkPolicyCount", 0)
- verify(mockExecution).setVariable(Prefix + "networkCollection", "")
-
- // AAI query route table reference
- verify(mockExecution).setVariable(Prefix + "queryNetworkTableRefAAIRequest","")
- verify(mockExecution).setVariable(Prefix + "queryNetworkTableRefAAIResponse", "")
- verify(mockExecution).setVariable(Prefix + "aaiQqueryNetworkTableRefReturnCode", "")
- verify(mockExecution).setVariable(Prefix + "networkTableRefUriList", null)
- verify(mockExecution).setVariable(Prefix + "networkTableRefCount", 0)
- verify(mockExecution).setVariable(Prefix + "tableRefCollection", "")
-
-
- // AAI requery Id
- verify(mockExecution).setVariable(Prefix + "requeryIdAAIRequest","")
- verify(mockExecution).setVariable(Prefix + "requeryIdAAIResponse", "")
- verify(mockExecution).setVariable(Prefix + "aaiRequeryIdReturnCode", "")
-
- // AAI update contrail
- verify(mockExecution).setVariable(Prefix + "updateContrailAAIUrlRequest","")
- verify(mockExecution).setVariable(Prefix + "updateContrailAAIPayloadRequest","")
- verify(mockExecution).setVariable(Prefix + "updateContrailAAIResponse", "")
- verify(mockExecution).setVariable(Prefix + "aaiUpdateContrailReturnCode", "")
-
- verify(mockExecution).setVariable(Prefix + "updateNetworkRequest", "")
- verify(mockExecution).setVariable(Prefix + "updateNetworkResponse", "")
- verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", "")
- //verify(mockExecution).setVariable(Prefix + "rollbackNetworkResponse", "")
- verify(mockExecution).setVariable(Prefix + "networkReturnCode", "")
- //verify(mockExecution).setVariable(Prefix + "rollbackNetworkReturnCode", "")
- verify(mockExecution).setVariable(Prefix + "isNetworkRollbackNeeded", false)
-
- verify(mockExecution).setVariable(Prefix + "changeAssignSDNCRequest", "")
- verify(mockExecution).setVariable(Prefix + "changeAssignSDNCResponse", "")
- verify(mockExecution).setVariable(Prefix + "rollbackSDNCRequest", "")
- //verify(mockExecution).setVariable(Prefix + "rollbackSDNCResponse", "")
- verify(mockExecution).setVariable(Prefix + "sdncReturnCode", "")
- //verify(mockExecution).setVariable(Prefix + "rollbackSDNCReturnCode", "")
- verify(mockExecution).setVariable(Prefix + "isSdncRollbackNeeded", false)
- verify(mockExecution).setVariable(Prefix + "sdncResponseSuccess", false)
-
- verify(mockExecution).setVariable(Prefix + "isVnfBindingPresent", false)
- verify(mockExecution).setVariable(Prefix + "Success", false)
- verify(mockExecution).setVariable(Prefix + "serviceInstanceId", "")
-
- verify(mockExecution).setVariable(Prefix + "isException", false)
-
- }
-
- @Test
- //@Ignore
- public void preProcessRequest_NetworkRequest() {
-
- println "************ preProcessRequest_Payload ************* "
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("isBaseVfModule")).thenReturn(true)
- when(mockExecution.getVariable("recipeTimeout")).thenReturn(0)
- when(mockExecution.getVariable("requestAction")).thenReturn("UPDATE")
- when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable("vnfId")).thenReturn("")
- when(mockExecution.getVariable("volumeGroupId")).thenReturn("")
- when(mockExecution.getVariable("networkId")).thenReturn("49c86598-f766-46f8-84f8-8d1c1b10f9b4")
- when(mockExecution.getVariable("serviceType")).thenReturn("MOG")
- when(mockExecution.getVariable("networkType")).thenReturn("modelName")
- when(mockExecution.getVariable("bpmnRequest")).thenReturn(jsonIncomingRequest)
- when(mockExecution.getVariable("sdncVersion")).thenReturn("1610")
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_rollback")).thenReturn("true")
- when(mockExecution.getVariable("disableRollback")).thenReturn("true")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.preProcessRequest(mockExecution)
-
- verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix + "")
-
- //verify variable initialization
- initializeVariables(mockExecution)
-
- // Authentications
- verify(mockExecution).setVariable("action", "UPDATE")
- verify(mockExecution).setVariable(Prefix + "networkRequest", expectedNetworkRequest)
- verify(mockExecution).setVariable(Prefix + "rollbackEnabled", false)
- verify(mockExecution).setVariable(Prefix + "networkInputs", expectedNetworkInputs)
- verify(mockExecution).setVariable("BasicAuthHeaderValuePO", "Basic cGFzc3dvcmQ=")
- verify(mockExecution).setVariable("BasicAuthHeaderValueSDNC", "Basic cGFzc3dvcmQ=")
- verify(mockExecution).setVariable(Prefix + "networkOutputs", "")
-
- }
-
- @Test
- //@Ignore
- public void preProcessRequest_vPERNetworkRequest() {
-
- def networkModelInfo = """{"modelUuid": "sn5256d1-5a33-55df-13ab-12abad84e111",
- "modelName": "CONTRAIL_EXTERNAL",
- "modelType": "CONTRAIL_EXTERNAL",
- "modelVersion": "1",
- "modelCustomizationUuid": "sn5256d1-5a33-55df-13ab-12abad84e222",
- "modelInvariantUuid": "sn5256d1-5a33-55df-13ab-12abad84e764"
- }""".trim()
-
- println "************ preProcessRequest_Payload ************* "
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("disableRollback")).thenReturn("true")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable("networkId")).thenReturn("49c86598-f766-46f8-84f8-8d1c1b10f9b4") // optional
- when(mockExecution.getVariable("networkName")).thenReturn("MNS-25180-L-01-dmz_direct_net_1") // optional
- when(mockExecution.getVariable("productFamilyId")).thenReturn("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb")
- when(mockExecution.getVariable("networkModelInfo")).thenReturn("CONTRAIL_EXTERNAL")
- when(mockExecution.getVariable("lcpCloudRegionId")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable("tenantId")).thenReturn("7dd5365547234ee8937416c65507d266")
- when(mockExecution.getVariable("failIfExists")).thenReturn("false")
- when(mockExecution.getVariable("networkModelInfo")).thenReturn(networkModelInfo)
- when(mockExecution.getVariable("sdncVersion")).thenReturn("1702")
- when(mockExecution.getVariable("action")).thenReturn("UPDATE")
- when(mockExecution.getVariable("subscriptionServiceType")).thenReturn("MSO-dev-service-type")
- when(mockExecution.getVariable("globalSubscriberId")).thenReturn("globalId_45678905678")
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
-
- when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
-
- when(mockExecution.getVariable("URN_mso_rollback")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_adapters_sdnc_endpoint")).thenReturn("http://localhost:8090/SDNCAdapter")
- when(mockExecution.getVariable("URN_mso_adapters_network_rest_endpoint")).thenReturn("http://localhost:8090/networks/NetworkAdapter")
- when(mockExecution.getVariable("URN_mso_adapters_sdnc_resource_endpoint")).thenReturn("http://localhost:8090/SDNCAdapterRpc")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.preProcessRequest(mockExecution)
-
- verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix + "")
-
- //verify variable initialization
- initializeVariables(mockExecution)
-
- // Authentications
- verify(mockExecution).setVariable("action", "UPDATE")
- verify(mockExecution).setVariable(Prefix + "networkRequest", expectedVperNetworkRequest)
- verify(mockExecution).setVariable(Prefix + "rollbackEnabled", false)
- verify(mockExecution).setVariable(Prefix + "networkInputs", expectedVperNetworkInputs)
- verify(mockExecution).setVariable("BasicAuthHeaderValuePO", "Basic cGFzc3dvcmQ=")
- verify(mockExecution).setVariable("BasicAuthHeaderValueSDNC", "Basic cGFzc3dvcmQ=")
- verify(mockExecution).setVariable(Prefix + "networkOutputs", "")
-
- }
-
- @Test
- //@Ignore
- public void preProcessRequest_MissingNetworkId() {
-
- println "************ preProcessRequest_MissingName() ************* "
-
- WorkflowException missingNameWorkflowException = new WorkflowException("DoUpdateNetworkInstance", 2500, "Variable 'network-id' value/element is missing.")
-
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("isBaseVfModule")).thenReturn(true)
- when(mockExecution.getVariable("recipeTimeout")).thenReturn(0)
- when(mockExecution.getVariable("requestAction")).thenReturn("UPDATE")
- when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable("vnfId")).thenReturn("")
- when(mockExecution.getVariable("volumeGroupId")).thenReturn("")
- //when(mockExecution.getVariable("networkId")).thenReturn("49c86598-f766-46f8-84f8-8d1c1b10f9b4")
- when(mockExecution.getVariable("serviceType")).thenReturn("MOG")
- when(mockExecution.getVariable("networkType")).thenReturn("modelName")
- when(mockExecution.getVariable("bpmnRequest")).thenReturn(jsonIncomingRequest)
- when(mockExecution.getVariable("sdncVersion")).thenReturn("1610")
-
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_rollback")).thenReturn("true")
- when(mockExecution.getVariable("disableRollback")).thenReturn("true")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- try {
- DoUpdateNetworkInstance.preProcessRequest(mockExecution)
- } catch (Exception ex) {
- println " Test End - Handle catch-throw BpmnError()! "
- }
-
- verify(mockExecution, atLeast(1)).getVariable("isDebugLogEnabled")
- verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix + "")
-
- //verify variable initialization
- initializeVariables(mockExecution)
-
- verify(mockExecution).setVariable("action", "UPDATE")
- verify(mockExecution).setVariable(Prefix + "networkRequest", expectedNetworkRequestMissingNetworkId)
- verify(mockExecution).setVariable(Prefix + "rollbackEnabled", false)
- verify(mockExecution).setVariable(Prefix + "networkInputs", expectedNetworkInputsMissingNetworkId)
- verify(mockExecution).setVariable(Prefix + "messageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- verify(mockExecution).setVariable(Prefix + "source", "VID")
- verify(mockExecution).setVariable(Prefix + "networkOutputs", "")
-
- verify(mockExecution).setVariable(eq("WorkflowException"), refEq(missingNameWorkflowException))
-
- }
-
- @Test
- //@Ignore
- public void preProcessRequest_MissingCloudRegion() {
-
- println "************ preProcessRequest_MissingCloudRegion() ************* "
-
- WorkflowException missingCloudRegionWorkflowException = new WorkflowException("DoUpdateNetworkInstance", 2500, "requestDetails has missing 'aic-cloud-region' value/element.")
-
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("isBaseVfModule")).thenReturn(true)
- when(mockExecution.getVariable("recipeTimeout")).thenReturn(0)
- when(mockExecution.getVariable("requestAction")).thenReturn("UPDATE")
- when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable("vnfId")).thenReturn("")
- when(mockExecution.getVariable("volumeGroupId")).thenReturn("")
- when(mockExecution.getVariable("networkId")).thenReturn("networkId")
- when(mockExecution.getVariable("serviceType")).thenReturn("MOG")
- when(mockExecution.getVariable("networkType")).thenReturn("modelName")
-
- when(mockExecution.getVariable("bpmnRequest")).thenReturn(jsonIncomingRequest_MissingCloudRegion)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_rollback")).thenReturn("true")
- when(mockExecution.getVariable("disableRollback")).thenReturn("true")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- try {
- DoUpdateNetworkInstance.preProcessRequest(mockExecution)
- } catch (Exception ex) {
- println " Test End - Handle catch-throw BpmnError()! "
- }
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution, atLeast(1)).getVariable("isDebugLogEnabled")
- verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix + "")
-
- //verify variable initialization
- initializeVariables(mockExecution)
-
- verify(mockExecution).setVariable("action", "UPDATE")
- verify(mockExecution).setVariable(Prefix + "networkRequest", expectedNetworkRequestMissingCloudRegion)
- verify(mockExecution).setVariable(Prefix + "rollbackEnabled", false)
- verify(mockExecution).setVariable(Prefix + "networkInputs", expectedNetworkInputMissingCloudRegion)
- verify(mockExecution).setVariable(Prefix + "messageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- verify(mockExecution).setVariable(Prefix + "source", "VID")
-
- verify(mockExecution).setVariable(eq("WorkflowException"), refEq(missingCloudRegionWorkflowException))
-
- }
-
- @Test
- //@Ignore
- public void prepareUpdateNetworkRequest() {
-
- println "************ prepareNetworkRequest ************* "
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedVperNetworkRequest)
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse)
- when(mockExecution.getVariable(Prefix + "cloudRegionPo")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("messageId_generated")
- when(mockExecution.getVariable(Prefix + "source")).thenReturn("VID")
- //when(mockExecution.getVariable(Prefix + "queryVpnBindingAAIResponse")).thenReturn(queryVpnBindingAAIResponse)
- when(mockExecution.getVariable(Prefix + "routeCollection")).thenReturn("<routeTargets>13979:105757</routeTargets><routeTargets>13979:105757</routeTargets>")
- when(mockExecution.getVariable(Prefix + "networkCollection")).thenReturn("<policyFqdns>GN_EVPN_Test</policyFqdns>")
- when(mockExecution.getVariable(Prefix + "tableRefCollection")).thenReturn("<routeTableFqdns>refFQDN1</routeTableFqdns><routeTableFqdns>refFQDN2</routeTableFqdns>")
- when(mockExecution.getVariable(Prefix + "requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- //when(mockExecution.getVariable("URN_?????")).thenReturn("") // notificationUrl, //TODO - is this coming from URN? What variable/value to use?
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.prepareUpdateNetworkRequest(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- // verify set prefix = Prefix + ""
- verify(mockExecution).setVariable("prefix", Prefix + "")
-
- verify(mockExecution).setVariable(Prefix + "updateNetworkRequest", updateNetworkRequest)
-
- }
-
-
- @Test
- //@Ignore
- public void prepareUpdateNetworkRequest_NoPhysicalname() {
-
- println "************ prepareNetworkRequest ************* "
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(NetworkRequest_noPhysicalName)
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse)
- when(mockExecution.getVariable(Prefix + "cloudRegionPo")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("messageId_generated")
- when(mockExecution.getVariable(Prefix + "source")).thenReturn("VID")
- //when(mockExecution.getVariable(Prefix + "queryVpnBindingAAIResponse")).thenReturn(queryVpnBindingAAIResponse)
- when(mockExecution.getVariable(Prefix + "routeCollection")).thenReturn("<routeTargets>13979:105757</routeTargets><routeTargets>13979:105757</routeTargets>")
- when(mockExecution.getVariable(Prefix + "networkCollection")).thenReturn("<policyFqdns>GN_EVPN_Test</policyFqdns>")
- when(mockExecution.getVariable(Prefix + "tableRefCollection")).thenReturn("")
- when(mockExecution.getVariable(Prefix + "requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- //when(mockExecution.getVariable("URN_?????")).thenReturn("") // notificationUrl, //TODO - is this coming from URN? What variable/value to use?
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.prepareUpdateNetworkRequest(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- // verify set prefix = Prefix + ""
- verify(mockExecution).setVariable("prefix", Prefix + "")
-
- verify(mockExecution).setVariable(Prefix + "updateNetworkRequest", updateNetworkRequest_noPhysicalName)
-
- }
-
- @Test
- //@Ignore
- public void prepareSDNCRequest() {
-
- println "************ prepareSDNCRequest ************* "
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable(Prefix + "cloudRegionSdnc")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable(Prefix + "serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("GENGSI_siResourceLink")).thenReturn("https://aai-int1.test.com:8443/aai/v8/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/6d4eb22a-82f1-4257-9f80-4176262cfe69/")
-
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.prepareSDNCRequest(mockExecution)
-
- // verify set prefix = Prefix + ""
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "changeAssignSDNCRequest", changeAssignSDNCRequest)
-
- }
-
- @Test
- //@Ignore
- public void prepareSDNCRollbackRequest() {
-
- println "************ prepareSDNCRollbackRequest ************* "
-
-
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable(Prefix + "cloudRegionSdnc")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable(Prefix + "serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable(Prefix + "changeAssignSDNCResponse")).thenReturn(assignResponse)
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("GENGSI_siResourceLink")).thenReturn("https://aai-int1.test.com:8443/aai/v8/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/6d4eb22a-82f1-4257-9f80-4176262cfe69/")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.prepareSDNCRollbackRequest(mockExecution)
-
- // verify set prefix = Prefix + ""
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "rollbackSDNCRequest", sdncRollbackRequest)
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkId_200() {
-
- println "************ callRESTQueryAAINetworkId ************* "
-
- WireMock.reset();
- MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "UpdateNetworkV2/updateNetwork_queryNetworkId_AAIResponse_Success.xml", "all");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("URN_mso_workflow_DoUpdateNetworkInstance_aai_l3_network_uri")).thenReturn("/aai/v9/network/l3-networks/l3-network")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAINetworkId(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "queryIdAAIRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/49c86598-f766-46f8-84f8-8d1c1b10f9b4"+"?depth=all")
- verify(mockExecution).setVariable(Prefix + "aaiIdReturnCode", "200")
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAICloudRegion30_200() {
-
- println "************ callRESTQueryAAICloudRegion30_200 ************* "
-
- WireMock.reset();
- MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion30_AAIResponse_Success.xml", "RDM2WAGPLCP");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
- when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8")
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "queryCloudRegionRequest", "http://localhost:8090/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/RDM2WAGPLCP")
- verify(mockExecution, atLeast(2)).setVariable(Prefix + "queryCloudRegionReturnCode", "200")
- verify(mockExecution).setVariable(Prefix + "isCloudRegionGood", true)
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAICloudRegion25_200() {
-
- println "************ callRESTQueryAAICloudRegion25_200 ************* "
-
- WireMock.reset();
- MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
- when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8")
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "queryCloudRegionRequest", "http://localhost:8090/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/RDM2WAGPLCP")
- verify(mockExecution, atLeast(2)).setVariable(Prefix + "queryCloudRegionReturnCode", "200")
- verify(mockExecution).setVariable(Prefix + "isCloudRegionGood", true)
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAICloudRegion_NotFound() {
-
- println "************ callRESTQueryAAICloudRegionFake ************* "
-
- WireMock.reset();
- MockGetNetworkCloudRegion_404("MDTWNJ21");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
- when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(vnfRequestFakeRegion)
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8")
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_cloud_region_uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "queryCloudRegionRequest", "http://localhost:8090/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/MDTWNJ21")
- verify(mockExecution, atLeast(1)).setVariable(Prefix + "queryCloudRegionReturnCode", "404")
- verify(mockExecution).setVariable(Prefix + "cloudRegionPo", "MDTWNJ21")
- verify(mockExecution).setVariable(Prefix + "cloudRegionSdnc", "AAIAIC25")
- verify(mockExecution).setVariable(Prefix + "isCloudRegionGood", true)
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkVpnBinding_200() {
-
- println "************ callRESTQueryAAINetworkVpnBinding_200 ************* "
-
- WireMock.reset();
- MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
- MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse) // v6
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8")
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_vpn_binding_uri")).thenReturn("/aai/v8/network/vpn-bindings/vpn-binding")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "vpnCount", 2)
- verify(mockExecution).setVariable(Prefix + "vpnBindings", ['/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/', '/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/'])
- // the last vpnBinding value is saved.
- verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIRequest", "http://localhost:8090/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017?depth=all")
- verify(mockExecution, atLeast(2)).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200")
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkVpnBindingList_200() {
-
- println "************ callRESTQueryAAINetworkVpnBinding_200 ************* "
-
- WireMock.reset();
- MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBindingList_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
- MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBindingList_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse) // v6
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8")
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_vpn_binding_uri")).thenReturn("/aai/v8/network/vpn-bindings/vpn-binding")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "vpnCount", 2)
- verify(mockExecution).setVariable(Prefix + "vpnBindings", ['/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/', '/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/'])
- // the last vpnBinding value is saved.
- verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIRequest", "http://localhost:8090/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017?depth=all")
- verify(mockExecution, atLeast(2)).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200")
-
- }
-
-
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkVpnBinding_TestScenario01_200() {
-
- println "************ callRESTQueryAAINetworkVpnBinding_200 ************* "
-
- WireMock.reset();
- MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponseTestScenario01)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8")
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_vpn_binding_uri")).thenReturn("/aai/v8/network/vpn-bindings/vpn-binding")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "vpnCount", 1)
- verify(mockExecution).setVariable(Prefix + "vpnBindings", ['/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/'])
- // the last vpnBinding value is saved.
- verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIRequest", "http://localhost:8090/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017?depth=all")
- verify(mockExecution).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200")
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkVpnBinding_200_URN_Uri() {
-
- println "************ callRESTQueryAAINetworkVpnBinding_200 ************* "
-
- WireMock.reset();
- MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
- MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8")
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_vpn_binding_uri")).thenReturn("/aai/v8/network/vpn-bindings/vpn-binding")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "vpnCount", 2)
- verify(mockExecution).setVariable(Prefix + "vpnBindings", ['/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/', '/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/'])
- // the last vpnBinding value is saved.
- verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIRequest", "http://localhost:8090/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017?depth=all")
- verify(mockExecution, atLeast(2)).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200")
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkVpnBinding_NotPresent() {
-
- println "************ callRESTQueryAAINetworkVpnBinding_NotPresent ************* "
-
- WireMock.reset();
- MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
-
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
-
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponseVpnNotPresent)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8")
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_l3_network_uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200")
- verify(mockExecution).setVariable(Prefix + "vpnCount", 0)
- verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIResponse", aaiVpnResponseStub)
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkTableRef_200() {
-
- println "************ callRESTQueryAAINetworkTableRef_200 ************* "
-
- WireMock.reset();
- MockGetNetworkTableReference("UpdateNetworkV2/updateNetwork_queryNetworkTableRef1_AAIResponse_Success.xml", "refFQDN1");
- MockGetNetworkTableReference("UpdateNetworkV2/updateNetwork_queryNetworkTableRef2_AAIResponse_Success.xml", "refFQDN2");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_network_table_reference_uri")).thenReturn("")
- when(mockExecution.getVariable("URN_mso_workflow_DoUpdateNetworkInstance_aai_route_table_reference_uri")).thenReturn("/aai/v8/network/route-table-references/route-table-reference")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAINetworkTableRef(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "networkTableRefCount", 2)
- verify(mockExecution).setVariable(Prefix + "networkTableRefUriList", ['/aai/v8/network/route-table-references/route-table-reference/refFQDN1','/aai/v8/network/route-table-references/route-table-reference/refFQDN2'])
- // the last vpnBinding value is saved.
- verify(mockExecution).setVariable(Prefix + "queryNetworkTableRefAAIRequest", "http://localhost:8090/aai/v8/network/route-table-references/route-table-reference/refFQDN1?depth=all")
- verify(mockExecution, atLeast(2)).setVariable(Prefix + "aaiQqueryNetworkTableRefReturnCode", "200")
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkPolicy_200() {
-
- println "************ callRESTQueryAAINetworkPolicy_200 ************* "
-
- WireMock.reset();
- MockGetNetworkPolicy("UpdateNetworkV2/updateNetwork_queryNetworkPolicy_AAIResponse_Success.xml", "cee6d136-e378-4678-a024-2cd15f0ee0cg");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("8")
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_network_policy_uri")).thenReturn("/aai/v8/network/network-policies/network-policy")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAINetworkPolicy(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "networkPolicyCount", 1)
- verify(mockExecution).setVariable(Prefix + "networkPolicyUriList", ['/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg'])
- // the last vpnBinding value is saved.
- verify(mockExecution).setVariable(Prefix + "queryNetworkPolicyAAIRequest", "http://localhost:8090/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg?depth=all")
- verify(mockExecution).setVariable(Prefix + "aaiQqueryNetworkPolicyReturnCode", "200")
-
- }
-
-
- @Test
- //@Ignore
- public void callRESTReQueryAAINetworkId_200() {
-
- println "************ callRESTReQueryAAINetworkId ************* "
-
- WireMock.reset();
- MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "UpdateNetworkV2/updateNetwork_queryNetworkId_AAIResponse_Success.xml", "all");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable(Prefix + "changeAssignSDNCResponse")).thenReturn(sdncAdapterWorkflowFormattedResponse)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("URN_mso_workflow_DoUpdateNetworkInstance_aai_l3_network_uri")).thenReturn("/aai/v9/network/l3-networks/l3-network")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTReQueryAAINetworkId(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "requeryIdAAIRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/49c86598-f766-46f8-84f8-8d1c1b10f9b4"+"?depth=all")
- verify(mockExecution).setVariable(Prefix + "aaiRequeryIdReturnCode", "200")
-
- }
-
-
- @Test
- //@Ignore
- public void callRESTUpdateContrailAAINetworkREST_200() {
-
- println "************ callRESTUpdateContrailAAINetwork ************* "
-
- WireMock.reset();
- MockPutNetworkIdWithDepth("UpdateNetworkV2/updateNetwork_updateContrail_AAIResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "all");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable(Prefix + "changeAssignSDNCResponse")).thenReturn(sdncAdapterWorkflowFormattedResponse)
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse)
- when(mockExecution.getVariable(Prefix + "updateNetworkResponse")).thenReturn(updateNetworkResponseREST)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("URN_mso_workflow_DoUpdateNetworkInstance_aai_l3_network_uri")).thenReturn("/aai/v9/network/l3-networks/l3-network")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTUpdateContrailAAINetwork(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "updateContrailAAIUrlRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/49c86598-f766-46f8-84f8-8d1c1b10f9b4"+"?depth=all")
- verify(mockExecution).setVariable(Prefix + "updateContrailAAIPayloadRequest", updateContrailAAIPayloadRequest)
- verify(mockExecution).setVariable(Prefix + "aaiUpdateContrailReturnCode", "200")
- //verify(mockExecution).setVariable(Prefix + "updateContrailAAIResponse", updateContrailAAIResponse)
- verify(mockExecution).setVariable(Prefix + "isPONR", true)
-
- }
-
-
-
- @Test
- //@Ignore
- public void validateUpdateNetworkResponseREST() {
-
- println "************ validateNetworkResponse ************* "
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "updateNetworkResponse")).thenReturn(updateNetworkResponseREST)
- when(mockExecution.getVariable(Prefix + "networkReturnCode")).thenReturn('200')
-
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.validateUpdateNetworkResponse(mockExecution)
-
- //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
- //debugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "updateNetworkResponse", updateNetworkResponseREST)
- verify(mockExecution).setVariable(Prefix + "isNetworkRollbackNeeded", true)
- verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", updateRollbackNetworkRequest)
-
- }
-
- @Test
- //@Ignore
- public void validateUpdateNetworkResponseREST_Error() {
-
- println "************ validateNetworkResponse ************* "
-
- WorkflowException workflowException = new WorkflowException("DoUpdateNetworkInstance", 2500, "Received error from Network Adapter: JBWEB000065: HTTP Status 500.")
-
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "updateNetworkResponse")).thenReturn(networkException500)
- when(mockExecution.getVariable(Prefix + "networkReturnCode")).thenReturn('500')
-
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- try {
- DoUpdateNetworkInstance.validateUpdateNetworkResponse(mockExecution)
- } catch (Exception ex) {
- println " Test End - Handle catch-throw BpmnError()! "
- }
-
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution, atLeast(1)).setVariable("WorkflowException", refEq(workflowException, any(WorkflowException.class)))
-
- }
-
- @Test
- //@Ignore
- public void validateSDNCResponse() {
-
- println "************ validateSDNCResponse ************* "
-
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "changeAssignSDNCResponse")).thenReturn(sdncAdapterWorkflowResponse)
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
- when(mockExecution.getVariable("SDNCA_SuccessIndicator")).thenReturn(true)
- when(mockExecution.getVariable(Prefix + "sdncReturnCode")).thenReturn("200")
- when(mockExecution.getVariable(Prefix + "isResponseGood")).thenReturn(true)
-
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- try {
- DoUpdateNetworkInstance.validateSDNCResponse(mockExecution)
- verify(mockExecution).setVariable(Prefix + "isSdncRollbackNeeded", true)
- verify(mockExecution).setVariable(Prefix + "rollbackSDNCRequest", "")
-
- } catch (Exception ex) {
- println " Graceful Exit - " + ex.getMessage()
- }
- //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
- //debugger.printInvocations(mockExecution)
-
- //verify(mockExecution).setVariable(Prefix + "isSdncRollbackNeeded", true)
-
- }
-
- @Test
- //@Ignore
- public void validateSDNCResponse_Error() {
-
- println "************ validateSDNCResponse ************* "
- //ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "changeAssignSDNCResponse")).thenReturn(sdncAdapterWorkflowResponse_Error)
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
- when(mockExecution.getVariable("SDNCA_SuccessIndicator")).thenReturn(false)
- when(mockExecution.getVariable(Prefix + "sdncReturnCode")).thenReturn("200")
- when(mockExecution.getVariable(Prefix + "isResponseGood")).thenReturn(true)
-
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- try {
- DoUpdateNetworkInstance.validateSDNCResponse(mockExecution)
- } catch (Exception ex) {
- println " Graceful Exit! - " + ex.getMessage()
- }
- //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
- //debugger.printInvocations(mockExecution)
-
- // verify set prefix = Prefix + ""
- //verify(mockExecution).setVariable(Prefix + "sdncResponseSuccess", false)
-
- }
-
- @Test
- //@Ignore
- public void prepareRollbackData() {
-
- println "************ prepareRollbackData() ************* "
-
-
-
- WorkflowException workflowException = new WorkflowException("DoUpdateNetworkInstance", 2500, "Received error from Network Adapter: JBWEB000065: HTTP Status 500.")
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn(rollbackSDNCRequest)
- when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn(rollbackNetworkRequest)
- when(mockExecution.getVariable("WorkflowException")).thenReturn(workflowException)
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.prepareRollbackData(mockExecution)
-
- verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix)
-
- }
-
- @Test
- //@Ignore
- public void postProcessResponse() {
-
- println "************ postProcessResponse() ************* "
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "isException")).thenReturn(false)
- when(mockExecution.getVariable("sdncVersion")).thenReturn("1610")
- when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn(rollbackSDNCRequest)
- when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn(rollbackSDNCRequest)
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable("mso-request-id")).thenReturn("requestId")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.postProcessResponse(mockExecution)
-
- verify(mockExecution, atLeast(3)).getVariable("isDebugLogEnabled")
- verify(mockExecution, atLeast(3)).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "Success", true)
-
- }
-
- private ExecutionEntity setupMock() {
-
- ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class)
- when(mockProcessDefinition.getKey()).thenReturn("DoUpdateNetworkInstance")
- RepositoryService mockRepositoryService = mock(RepositoryService.class)
- when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition)
- when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("DoUpdateNetworkInstance")
- when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100")
- ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class)
- when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService)
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
-
- when(mockExecution.getId()).thenReturn("100")
- when(mockExecution.getProcessDefinitionId()).thenReturn("DoUpdateNetworkInstance")
- when(mockExecution.getProcessInstanceId()).thenReturn("DoUpdateNetworkInstance")
- when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices)
- when(mockExecution.getProcessEngineServices().getRepositoryService().getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(mockProcessDefinition)
-
- return mockExecution
- }
-
-
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/ScaleCustomE2EServiceInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/ScaleCustomE2EServiceInstanceTest.groovy deleted file mode 100644 index 063f4b571b..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/ScaleCustomE2EServiceInstanceTest.groovy +++ /dev/null @@ -1,175 +0,0 @@ -package org.openecomp.mso.bpmn.infrastructure.scripts - -import static org.mockito.Mockito.* - -import org.apache.commons.lang3.* -import org.camunda.bpm.engine.ProcessEngineServices -import org.camunda.bpm.engine.RepositoryService -import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity -import org.camunda.bpm.engine.repository.ProcessDefinition -import org.camunda.bpm.engine.runtime.Execution -import org.junit.Before -import org.junit.Rule -import org.junit.Test -import org.junit.runner.RunWith -import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner -import org.openecomp.mso.bpmn.common.scripts.MsoUtils -import org.openecomp.mso.bpmn.core.WorkflowException -import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil - - -import com.github.tomakehurst.wiremock.junit.WireMockRule - -@RunWith(MockitoJUnitRunner.class) -class SacleCustomE2EServiceInstanceTest{ - @Rule - public WireMockRule wireMockRule = new WireMockRule(8090); - - String Prefix="CRESI_" - ExceptionUtil exceptionUtil = new ExceptionUtil() - String globalSubscriberId="test_custormer" - String requestDescription = "request description for test" - def utils = new MsoUtils() - - String jsonIncomingRequest = """{"service":{ - "serviceType":"example-service-type", - "globalSubscriberId":"test_custormer", - "resources":[ - { - "resourceInstanceId":"ns111", - "scaleType":"SCALE_NS", - "scaleNsData":{ - "scaleNsByStepsData":{ - "numberOfSteps":"4", - "aspectId":"TIC_EDGE_HW", - "scalingDirection":"UP" - } - } - }, - { - "resourceInstanceId":"ns333", - "scaleType":"SCALE_NS", - "scaleNsData":{ - "scaleNsByStepsData":{ - "numberOfSteps":"4", - "aspectId":"TIC_EDGE_HW", - "scalingDirection":"UP" - } - } - }], - "serviceInstanceName":"XXXX" - }, - "operationId":"0a5b1651-c56e-4263-8c26-c8f8a6ef72d8" - }""" - - String xmlMsoCompletionRequest = """<aetgt:MsoCompletionRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1" - xmlns:ns="http://org.openecomp/mso/request/types/v1" - xmlns:w1aaan0="http://org.openecomp/mso/infra/vnf-request/v1"> - <w1aaan0:request-info> - <w1aaan0:request-id>56c881ad-6c9d-4b79-aacc-401e5640b47f</w1aaan0:request-id> - <w1aaan0:action>SCALE</w1aaan0:action> - <w1aaan0:source>null</w1aaan0:source> - </w1aaan0:request-info> - <status-message>Service Instance was scaled successfully.</status-message> - <serviceInstanceId>56c881ad-6c9d-4b79-aacc-401e5640b47f</serviceInstanceId> - <mso-bpel-name>ScaleGenericALaCarteServiceInstance</mso-bpel-name> -</aetgt:MsoCompletionRequest>""" - - String requestInfo = """<request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1"> - <request-id>56c881ad-6c9d-4b79-aacc-401e5640b47f</request-id> - <action>SCALE</action> - <source>null</source> - </request-info>""" - - String payload ="""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" - xmlns:ns="http://org.openecomp.mso/requestsdb"> - <soapenv:Header/> - <soapenv:Body> - <ns:updateServiceOperationStatus xmlns:ns="http://org.openecomp.mso/requestsdb"> - <serviceId>56c881ad-6c9d-4b79-aacc-401e5640b47f</serviceId> - <operationId>0a5b1651-c56e-4263-8c26-c8f8a6ef72d8</operationId> - <operationType>SCALE</operationType> - <userId></userId> - <result>processing</result> - <operationContent>Prepare service scaling</operationContent> - <progress>0</progress> - <reason></reason> - </ns:updateServiceOperationStatus> - </soapenv:Body> - </soapenv:Envelope>""" - - @Before - public void init() - { - MockitoAnnotations.initMocks(this) - } - - @Test - public void preProcessRequestTest() { - println "************ preProcessRequest_Payload ************* " - ExecutionEntity mockExecution = mock(ExecutionEntity.class) - - // Initialize prerequisite variables - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("bpmnRequest")).thenReturn(jsonIncomingRequest) - - when(mockExecution.getVariable("mso-request-id")).thenReturn("56c881ad-6c9d-4b79-aacc-401e5640b47f") - when(mockExecution.getVariable("serviceInstanceId")).thenReturn("56c881ad-6c9d-4b79-aacc-401e5640b47f") - - ScaleCustomE2EServiceInstance scaleCustomE2EServiceInstance = new ScaleCustomE2EServiceInstance() - scaleCustomE2EServiceInstance.preProcessRequest(mockExecution) - - verify(mockExecution).setVariable("globalSubscriberId", globalSubscriberId) - verify(mockExecution).setVariable("prefix", Prefix) - verify(mockExecution).setVariable("requestDescription", requestDescription) - } - - @Test - public void sendSyncResponseTest() { - println "************ sendSyncResponse ************* " - ExecutionEntity mockExecution = mock(ExecutionEntity.class) - - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("operationId")).thenReturn("3338b250-e995-4782-8936-081b66ba4dbf") - when(mockExecution.getVariable("serviceInstanceId")).thenReturn("56c881ad-6c9d-4b79-aacc-401e5640b47f") - - ScaleCustomE2EServiceInstance scaleCustomE2EServiceInstance = new ScaleCustomE2EServiceInstance() - scaleCustomE2EServiceInstance.sendSyncResponse(mockExecution) - - verify(mockExecution).setVariable("sentSyncResponse", true) - } - - @Test - public void prepareCompletionRequestTest() { - println "************ prepareCompletionRequest ************* " - ExecutionEntity mockExecution = mock(ExecutionEntity.class) - - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("msoRequestId")).thenReturn("56c881ad-6c9d-4b79-aacc-401e5640b47f") - when(mockExecution.getVariable("serviceInstanceId")).thenReturn("56c881ad-6c9d-4b79-aacc-401e5640b47f") - - ScaleCustomE2EServiceInstance scaleCustomE2EServiceInstance = new ScaleCustomE2EServiceInstance() - scaleCustomE2EServiceInstance.prepareCompletionRequest(mockExecution) - - verify(mockExecution).setVariable("CompleteMsoProcessRequest", xmlMsoCompletionRequest) - - } - - @Test - public void prepareInitServiceOperationStatusTest() { - println "************ prepareInitServiceOperationStatus ************* " - ExecutionEntity mockExecution = mock(ExecutionEntity.class) - - when(mockExecution.getVariable("serviceInstanceId")).thenReturn("56c881ad-6c9d-4b79-aacc-401e5640b47f") - //when(mockExecution.getVariable("serviceInstanceName")).thenReturn("XXXX") - when(mockExecution.getVariable("operationId")).thenReturn("0a5b1651-c56e-4263-8c26-c8f8a6ef72d8") - - ScaleCustomE2EServiceInstance scaleCustomE2EServiceInstance = new ScaleCustomE2EServiceInstance() - scaleCustomE2EServiceInstance.prepareInitServiceOperationStatus(mockExecution) - - payload = utils.formatXml(payload) - verify(mockExecution).setVariable("CVFMI_updateServiceOperStatusRequest", payload) - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/UpdateNetworkInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/UpdateNetworkInstanceTest.groovy deleted file mode 100644 index 4c77a04701..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/UpdateNetworkInstanceTest.groovy +++ /dev/null @@ -1,368 +0,0 @@ -package org.openecomp.mso.bpmn.infrastructure.scripts
-
-import static org.mockito.Mockito.*
-
-import org.camunda.bpm.engine.ProcessEngineServices
-import org.camunda.bpm.engine.RepositoryService
-import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
-import org.camunda.bpm.engine.repository.ProcessDefinition
-import org.camunda.bpm.engine.delegate.DelegateExecution
-import org.junit.Before
-import org.junit.Ignore
-import org.junit.Rule
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.mockito.MockitoAnnotations
-import org.mockito.runners.MockitoJUnitRunner
-import org.openecomp.mso.bpmn.common.scripts.MsoUtils
-import org.openecomp.mso.bpmn.core.WorkflowException
-
-import com.github.tomakehurst.wiremock.junit.WireMockRule
-import org.apache.commons.lang3.*
-
-
-@RunWith(MockitoJUnitRunner.class)
-class UpdateNetworkInstanceTest {
-
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(8090);
-
- String Prefix="UPDNI_"
- def utils = new MsoUtils()
-
- String createDBRequestError =
-"""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
- <soapenv:Header/>
- <soapenv:Body>
- <ns:updateInfraRequest xmlns:ns="http://org.openecomp.mso/requestsdb">
- <requestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</requestId>
- <lastModifiedBy>BPMN</lastModifiedBy>
- <statusMessage>Received error from SDN-C: No availability zone available</statusMessage>
- <responseBody></responseBody>
- <requestStatus>FAILED</requestStatus>
- <vnfOutputs><network-id></network-id><network-name></network-names></vnfOutputs>
- </ns:updateInfraRequest>
- </soapenv:Body>
- </soapenv:Envelope>"""
-
- String falloutHandlerRequest =
- """<aetgt:FalloutHandlerRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:ns="http://org.openecomp/mso/request/types/v1"
- xmlns:wfsch="http://org.openecomp/mso/workflow/schema/v1">
- <request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
- <request-id>b69c9054-da09-4a2c-adf5-51042b62bfac</request-id>
- <action>UPDATE</action>
- <source>VID</source>
- </request-info>
- <aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">
- <aetgt:ErrorMessage>Received error from SDN-C: No availability zone available.</aetgt:ErrorMessage>
- <aetgt:ErrorCode>5300</aetgt:ErrorCode>
- </aetgt:WorkflowException>
- </aetgt:FalloutHandlerRequest>"""
-
- String completeMsoProcessRequest =
- """<aetgt:MsoCompletionRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:ns="http://org.openecomp/mso/request/types/v1"
- xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
- <request-info>
- <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>
- <action>UPDATE</action>
- <source>VID</source>
- </request-info>
- <aetgt:status-message>Network has been updated successfully.</aetgt:status-message>
- <aetgt:mso-bpel-name>BPMN Network action: UPDATE</aetgt:mso-bpel-name>
-</aetgt:MsoCompletionRequest>"""
-
-
-String jsonIncomingRequest =
-"""{ "requestDetails": {
- "modelInfo": {
- "modelType": "networkTyp",
- "modelId": "modelId",
- "modelNameVersionId": "modelNameVersionId",
- "modelName": "CONTRAIL_EXTERNAL",
- "modelVersion": "1"
- },
- "cloudConfiguration": {
- "lcpCloudRegionId": "RDM2WAGPLCP",
- "tenantId": "7dd5365547234ee8937416c65507d266"
- },
- "requestInfo": {
- "instanceName": "MNS-25180-L-01-dmz_direct_net_1",
- "source": "VID",
- "callbackUrl": "",
- "suppressRollback": true,
- "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"
- },
- "relatedInstanceList": [
- {
- "relatedInstance": {
- "instanceId": "f70e927b-6087-4974-9ef8-c5e4d5847ca4",
- "modelInfo": {
- "modelType": "serviceT",
- "modelId": "modelI",
- "modelNameVersionId": "modelNameVersionI",
- "modelName": "modleNam",
- "modelVersion": "1"
- }
- }
- }
- ],
- "requestParameters": {
- "userParams": [
- {
- "name": "someUserParam1",
- "value": "someValue1"
- }
- ]
- }
- }}"""
-
- @Before
- public void init()
- {
- MockitoAnnotations.initMocks(this)
-
- }
-
- public void initializeVariables(DelegateExecution mockExecution) {
-
- verify(mockExecution).setVariable(Prefix + "source", "")
- verify(mockExecution).setVariable(Prefix + "Success", false)
-
- verify(mockExecution).setVariable(Prefix + "CompleteMsoProcessRequest", "")
- verify(mockExecution).setVariable(Prefix + "FalloutHandlerRequest", "")
-
- }
-
- @Test
- //@Ignore
- public void preProcessRequest() {
-
- println "************ preProcessRequest() ************* "
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("bpmnRequest")).thenReturn(jsonIncomingRequest)
-
- when(mockExecution.getVariable("URN_mso_adapters_db_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
-
- // preProcessRequest(DelegateExecution execution)
- UpdateNetworkInstance UpdateNetworkInstance = new UpdateNetworkInstance()
- UpdateNetworkInstance.preProcessRequest(mockExecution)
-
- verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix)
-
- initializeVariables(mockExecution)
- //verify(mockExecution).setVariable(Prefix + "Success", false)
-
- }
-
-
- @Test
- //@Ignore
- public void getNetworkModelInfo() {
-
- println "************ getNetworkModelInfo() ************* "
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
-
- // preProcessRequest(DelegateExecution execution)
- UpdateNetworkInstance UpdateNetworkInstance = new UpdateNetworkInstance()
- UpdateNetworkInstance.getNetworkModelInfo(mockExecution)
-
- verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix)
-
- }
-
- @Test
- //@Ignore
- public void sendSyncResponse() {
-
- println "************ sendSyncResponse ************* "
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("isAsyncProcess")).thenReturn(true)
- when(mockExecution.getVariable("mso-request-id")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
-
- // preProcessRequest(DelegateExecution execution)
- UpdateNetworkInstance UpdateNetworkInstance = new UpdateNetworkInstance()
- UpdateNetworkInstance.sendSyncResponse(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable("UpdateNetworkInstanceResponseCode", "202")
-
- }
-
- @Test
- //@Ignore
- public void sendSyncError() {
-
- println "************ sendSyncError ************* "
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("isAsyncProcess")).thenReturn(true)
- when(mockExecution.getVariable("mso-request-id")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
-
- UpdateNetworkInstance UpdateNetworkInstance = new UpdateNetworkInstance()
- UpdateNetworkInstance.sendSyncError(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable("UpdateNetworkInstanceResponseCode", "500")
-
- }
-
- @Test
- //@Ignore
- public void prepareDBRequestError() {
-
- println "************ prepareDBRequestError ************* "
-
- WorkflowException sndcWorkflowException = new WorkflowException("UpdateNetworkInstance", 500, "Received error from SDN-C: No availability zone available")
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable("WorkflowException")).thenReturn(sndcWorkflowException)
- //when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable(Prefix + "requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("networkId")).thenReturn("")
- when(mockExecution.getVariable("networkName")).thenReturn("")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
-
- when(mockExecution.getVariable("URN_mso_adapters_db_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
-
- // preProcessRequest(DelegateExecution execution)
- UpdateNetworkInstance UpdateNetworkInstance = new UpdateNetworkInstance()
- UpdateNetworkInstance.prepareDBRequestError(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "createDBRequest", createDBRequestError)
-
- }
-
-
- @Test
- //@Ignore
- public void prepareCompletion() {
-
- println "************ postProcessResponse ************* "
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable(Prefix + "dbReturnCode")).thenReturn("200")
-
- // postProcessResponse(DelegateExecution execution)
- UpdateNetworkInstance UpdateNetworkInstance = new UpdateNetworkInstance()
- UpdateNetworkInstance.prepareCompletion(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "Success", true)
- verify(mockExecution).setVariable(Prefix + "CompleteMsoProcessRequest", completeMsoProcessRequest)
-
- }
-
- @Test
- //@Ignore
- public void buildErrorResponse() {
-
- println "************ buildErrorResponse ************* "
-
-
- WorkflowException sndcWorkflowException = new WorkflowException("UpdateNetworkInstance", 5300, "Received error from SDN-C: No availability zone available.")
-
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso-request-id")).thenReturn("b69c9054-da09-4a2c-adf5-51042b62bfac")
- //when(mockExecution.getVariable("WorkflowException")).thenReturn(sndcWorkflowException)
- when(mockExecution.getVariable("WorkflowException")).thenReturn(sndcWorkflowException)
-
- // buildErrorResponse(DelegateExecution execution)
- UpdateNetworkInstance UpdateNetworkInstance = new UpdateNetworkInstance()
- UpdateNetworkInstance.buildErrorResponse(mockExecution)
-
- verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix)
- verify(mockExecution).setVariable(Prefix + "FalloutHandlerRequest", falloutHandlerRequest)
-
- //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
- //debugger.printInvocations(mockExecution)
-
- }
-
- @Test
- //@Ignore
- public void postProcessResponse() {
-
- println "************ postProcessResponse() ************* "
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("CMSO_ResponseCode")).thenReturn("200")
-
- // postProcessResponse(DelegateExecution execution)
- UpdateNetworkInstance UpdateNetworkInstance = new UpdateNetworkInstance()
- UpdateNetworkInstance.postProcessResponse(mockExecution)
-
- //verify(mockExecution).getVariable("isDebugLogEnabled")
- //verify(mockExecution).setVariable("prefix", Prefix)
-
- verify(mockExecution).setVariable(Prefix + "Success", true)
-
- }
-
- @Test
- //@Ignore
- public void processRollbackData() {
-
- println "************ callDBCatalog() ************* "
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
-
- // preProcessRequest(DelegateExecution execution)
- UpdateNetworkInstance UpdateNetworkInstance = new UpdateNetworkInstance()
- UpdateNetworkInstance.processRollbackData(mockExecution)
-
- verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix)
-
- }
-
- private ExecutionEntity setupMock() {
-
- ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class)
- when(mockProcessDefinition.getKey()).thenReturn("UpdateNetworkInstance")
- RepositoryService mockRepositoryService = mock(RepositoryService.class)
- when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition)
- when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("UpdateNetworkInstance")
- when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100")
- ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class)
- when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService)
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
-
- when(mockExecution.getId()).thenReturn("100")
- when(mockExecution.getProcessDefinitionId()).thenReturn("UpdateNetworkInstance")
- when(mockExecution.getProcessInstanceId()).thenReturn("UpdateNetworkInstance")
- when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices)
- when(mockExecution.getProcessEngineServices().getRepositoryService().getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(mockProcessDefinition)
-
- return mockExecution
- }
-
-}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1Test.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1Test.groovy deleted file mode 100644 index 9459cd4a7d..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1Test.groovy +++ /dev/null @@ -1,93 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.bpmn.infrastructure.scripts;
-
-import static org.junit.Assert.*
-import static org.mockito.Mockito.*
-
-import org.junit.Before
-import org.junit.Ignore
-import org.junit.Rule
-import org.junit.runner.RunWith
-import org.mockito.MockitoAnnotations
-import org.mockito.runners.MockitoJUnitRunner
-
-import com.github.tomakehurst.wiremock.junit.WireMockRule
-
-@RunWith(MockitoJUnitRunner.class)
-@Ignore // No Junits exists in this class to run
-class UpdateVfModuleVolumeInfraV1Test {
-
- String xml = """
- <relationship-list>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v7/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mdt1/tenants/tenant/fba1bd1e195a404cacb9ce17a9b2b421/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>fba1bd1e195a404cacb9ce17a9b2b421</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-owner</relationship-key>
- <relationship-value>att-aic</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-region-id</relationship-key>
- <relationship-value>mdt1</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>tenant.tenant-name</property-key>
- <property-value>ECOMP_MDT1</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vf-module</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v7/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mdt1/tenants/tenant/fba1bd1e195a404cacb9ce17a9b2b421/</related-link>
- <relationship-data>
- <relationship-key>vf-module.vf-module-ids</relationship-key>
- <relationship-value>fba1bd1e195a404cacb9ce17a9b2b421</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-owner</relationship-key>
- <relationship-value>att-aic</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-region-id</relationship-key>
- <relationship-value>mdt1</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vf-module.vf-module-name</property-key>
- <property-value>ECOMP_MDT1</property-value>
- </related-to-property>
- </relationship>
- </relationship-list>
-"""
-
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090);
-
- @Before
- public void init()
- {
- MockitoAnnotations.initMocks(this)
-
- }
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustServiceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustServiceTest.groovy deleted file mode 100644 index a8401d7a02..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustServiceTest.groovy +++ /dev/null @@ -1,1269 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.bpmn.vcpe.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.junit.Before -import org.junit.BeforeClass -import org.junit.Rule -import org.junit.Test -import org.junit.Ignore -import org.mockito.MockitoAnnotations -import org.camunda.bpm.engine.delegate.BpmnError -import org.openecomp.mso.bpmn.core.WorkflowException -import org.openecomp.mso.bpmn.core.domain.HomingSolution -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.domain.ServiceDecomposition -import org.openecomp.mso.bpmn.core.domain.VnfResource -import org.openecomp.mso.bpmn.core.domain.AllottedResource -import org.openecomp.mso.bpmn.core.domain.ModelInfo -import org.openecomp.mso.bpmn.core.domain.HomingSolution -import org.openecomp.mso.bpmn.core.RollbackData -import org.openecomp.mso.bpmn.vcpe.scripts.MapGetter -import org.openecomp.mso.bpmn.vcpe.scripts.MapSetter - -import com.github.tomakehurst.wiremock.junit.WireMockRule - -class CreateVcpeResCustServiceTest extends GroovyTestBase { - - private static String request - - @Rule - public WireMockRule wireMockRule = new WireMockRule(PORT) - - String Prefix = "CVRCS_" - String RbType = "DCRENI_" - - @BeforeClass - public static void setUpBeforeClass() { - request = FileUtil.readResourceFile("__files/VCPE/CreateVcpeResCustService/request.json") - } - - @Before - public void init() - { - MockitoAnnotations.initMocks(this) - } - - public CreateVcpeResCustServiceTest() { - super("CreateVcpeResCustService") - } - - - // ***** preProcessRequest ***** - - @Test - @Ignore // 1802 merge - public void preProcessRequest() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPreProcess(mex) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.preProcessRequest(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("prefix", Prefix) - verify(mex).setVariable("aaiDistDelay", "aaidelay") - verify(mex).setVariable("createVcpeServiceRequest", request) - verify(mex).setVariable("msoRequestId", "mri") - assertEquals("sii", map.get("serviceInstanceId")) - verify(mex).setVariable("requestAction", "ra") - verify(mex).setVariable("source", "VID") - verify(mex).setVariable("globalSubscriberId", CUST) - verify(mex).setVariable("globalCustomerId", CUST) - verify(mex).setVariable("subscriptionServiceType", SVC) - verify(mex).setVariable("disableRollback", "false") - verify(mex).setVariable("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb") - assertTrue(map.containsKey("subscriberInfo")) - - verify(mex).setVariable("brgWanMacAddress", "brgmac") - verify(mex).setVariable("customerLocation", ["customerLatitude":"32.897480", "customerLongitude":"-97.040443", "customerName":"some_company"]) - verify(mex).setVariable("homingService", "sniro") - assertTrue(map.containsKey("serviceInputParams")) - assertTrue(map.containsKey(Prefix+"requestInfo")) - - def reqinfo = map.get(Prefix+"requestInfo") - assertTrue(reqinfo.indexOf("<request-id>mri</") >= 0) - assertTrue(reqinfo.indexOf("<source>VID</") >= 0) - } - - @Test - // @Ignore - public void preProcessRequest_MissingAaiDistDelay() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPreProcess(mex) - - when(mex.getVariable("URN_mso_workflow_aai_distribution_delay")).thenReturn(null) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - - assertTrue(doBpmnError( { _ -> CreateVcpeResCustService.preProcessRequest(mex) })) - } - - @Test - @Ignore // 1802 merge - public void preProcessRequest_EmptyParts() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPreProcess(mex) - - def req = request - .replace('"source"', '"sourceXXX"') - .replace('"BRG_WAN_MAC_Address"', '"BRG_WAN_MAC_AddressXXX"') - .replace('"Customer_Location"', '"Customer_LocationXXX"') - - when(mex.getVariable("bpmnRequest")).thenReturn(req) - when(mex.getVariable("serviceInstanceId")).thenReturn(null) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.preProcessRequest(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("prefix", Prefix) - verify(mex).setVariable("createVcpeServiceRequest", req) - verify(mex).setVariable("msoRequestId", "mri") - assertNotNull(map.get("serviceInstanceId")) - assertFalse(map.get("serviceInstanceId").isEmpty()) - verify(mex).setVariable("requestAction", "ra") - verify(mex).setVariable("source", "VID") - verify(mex).setVariable("globalSubscriberId", CUST) - verify(mex).setVariable("globalCustomerId", CUST) - verify(mex).setVariable("subscriptionServiceType", SVC) - verify(mex).setVariable("disableRollback", "false") - verify(mex).setVariable("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb") - assertTrue(map.containsKey("subscriberInfo")) - - assertEquals("", map.get("brgWanMacAddress")) - assertEquals("", map.get("customerLocation")) - assertEquals("oof", map.get("homingService")) - assertTrue(map.containsKey("serviceInputParams")) - assertTrue(map.containsKey(Prefix+"requestInfo")) - - def reqinfo = map.get(Prefix+"requestInfo") - println reqinfo - assertTrue(reqinfo.indexOf("<request-id>mri</") >= 0) - assertTrue(reqinfo.indexOf("<source>VID</") >= 0) - } - - @Test - // @Ignore - public void preProcessRequest_MissingSubscriberId() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPreProcess(mex) - - def req = request - .replace('"globalSubscriberId"', '"globalSubscriberIdXXX"') - - when(mex.getVariable("bpmnRequest")).thenReturn(req) - when(mex.getVariable("serviceInstanceId")).thenReturn(null) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - - assertTrue(doBpmnError( { _ -> CreateVcpeResCustService.preProcessRequest(mex) })) - } - - @Test - // @Ignore - public void preProcessRequest_BpmnError() { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - when(mex.getVariable("bpmnRequest")).thenThrow(new BpmnError("expected exception")) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - - assertTrue(doBpmnError( { _ -> CreateVcpeResCustService.preProcessRequest(mex) })) - } - - @Test - // @Ignore - public void preProcessRequest_Ex() { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - when(mex.getVariable("bpmnRequest")).thenThrow(new RuntimeException("expected exception")) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - - assertTrue(doBpmnError( { _ -> CreateVcpeResCustService.preProcessRequest(mex) })) - } - - // ***** sendSyncResponse ***** - - @Test - // @Ignore - public void sendSyncResponse() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initSendSyncResponse(mex) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.sendSyncResponse(mex) - - verify(mex, times(2)).getVariable(DBGFLAG) - - verify(mex).setVariable(processName+"WorkflowResponseSent", "true") - - assertEquals("202", map.get(processName+"ResponseCode")) - assertEquals("Success", map.get(processName+"Status")) - - def resp = map.get(processName+"Response") - - assertTrue(resp.indexOf('"instanceId":"sii"') >= 0) - assertTrue(resp.indexOf('"requestId":"mri"') >= 0) - } - - @Test - // @Ignore - public void sendSyncResponse_Ex() { - ExecutionEntity mex = setupMock() - initSendSyncResponse(mex) - - when(mex.getVariable("serviceInstanceId")).thenThrow(new RuntimeException("expected exception")) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - - assertTrue(doBpmnError( { _ -> CreateVcpeResCustService.sendSyncResponse(mex) })) - } - - - // ***** prepareDecomposeService ***** - - @Test - // @Ignore - public void prepareDecomposeService() { - ExecutionEntity mex = setupMock() - initPrepareDecomposeService(mex) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.prepareDecomposeService(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("serviceModelInfo", "mi") - } - - @Test - // @Ignore - public void prepareDecomposeService_Ex() { - ExecutionEntity mex = setupMock() - initPrepareDecomposeService(mex) - - when(mex.getVariable("createVcpeServiceRequest")).thenThrow(new RuntimeException("expected exception")) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - - assertTrue(doBpmnError( { _ -> CreateVcpeResCustService.prepareDecomposeService(mex) })) - } - - - // ***** prepareCreateServiceInstance ***** - - @Test - // @Ignore - public void prepareCreateServiceInstance() { - ExecutionEntity mex = setupMock() - initPrepareCreateServiceInstance(mex) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.prepareCreateServiceInstance(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("serviceInstanceName", "VCPE1") - verify(mex).setVariable("serviceDecompositionString", "mydecomp") - } - - @Test - // @Ignore - public void prepareCreateServiceInstance_Ex() { - ExecutionEntity mex = setupMock() - initPrepareCreateServiceInstance(mex) - - when(mex.getVariable("createVcpeServiceRequest")).thenThrow(new RuntimeException("expected exception")) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - - assertTrue(doBpmnError( { _ -> CreateVcpeResCustService.prepareCreateServiceInstance(mex) })) - } - - - // ***** postProcessServiceInstanceCreate ***** - - @Test - // @Ignore - public void postProcessServiceInstanceCreate() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPostProcessServiceInstanceCreate(mex) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.postProcessServiceInstanceCreate(mex) - - verify(mex).getVariable(DBGFLAG) - - def reqinfo = map.get(Prefix+"setUpdateDbInstancePayload") - - assertTrue(reqinfo.indexOf("<requestId>mri</") >= 0) - assertTrue(reqinfo.indexOf("<serviceInstanceId>sii</") >= 0) - assertTrue(reqinfo.indexOf("<serviceInstanceName>sin</") >= 0) - } - - @Test - // @Ignore - public void postProcessServiceInstanceCreate_BpmnError() { - ExecutionEntity mex = setupMock() - initPostProcessServiceInstanceCreate(mex) - - doThrow(new BpmnError("expected exception")).when(mex).setVariable(endsWith("setUpdateDbInstancePayload"), any()) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - - assertTrue(doBpmnError( { _ -> CreateVcpeResCustService.postProcessServiceInstanceCreate(mex) })) - } - - @Test - // @Ignore - public void postProcessServiceInstanceCreate_Ex() { - ExecutionEntity mex = setupMock() - initPostProcessServiceInstanceCreate(mex) - - doThrow(new RuntimeException("expected exception")).when(mex).setVariable(endsWith("setUpdateDbInstancePayload"), any()) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - - assertTrue(doBpmnError( { _ -> CreateVcpeResCustService.postProcessServiceInstanceCreate(mex) })) - } - - - // ***** processDecomposition ***** - - @Test - // @Ignore - public void processDecomposition() { - ExecutionEntity mex = setupMock() - def svcdecomp = initProcessDecomposition(mex) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.processDecomposition(mex) - - verify(mex).getVariable(DBGFLAG) - - verify(mex).setVariable("vnfList", svcdecomp.getServiceVnfs()) - verify(mex).setVariable("vnfListString", '[myvnf]') - verify(mex).setVariable(Prefix+"VNFsCount", 1) - - verify(mex).setVariable("vnfModelInfo", "mymodel") - verify(mex).setVariable("vnfModelInfoString", "mymodel") - } - - @Test - // @Ignore - public void processDecomposition_EmptyNet_EmptyVnf() { - ExecutionEntity mex = setupMock() - def svcdecomp = initProcessDecomposition(mex) - - when(svcdecomp.getServiceVnfs()).thenReturn(new LinkedList<VnfResource>()) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.processDecomposition(mex) - - verify(mex).getVariable(DBGFLAG) - - verify(mex).setVariable("vnfList", svcdecomp.getServiceVnfs()) - verify(mex).setVariable("vnfListString", '[]') - verify(mex).setVariable(Prefix+"VNFsCount", 0) - - verify(mex).setVariable("vnfModelInfo", "") - verify(mex).setVariable("vnfModelInfoString", "") - } - - @Test - // @Ignore - public void processDecomposition_Ex() { - ExecutionEntity mex = setupMock() - def svcdecomp = initProcessDecomposition(mex) - - when(svcdecomp.getServiceVnfs()).thenThrow(new RuntimeException("expected exception")) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - - assertTrue(doBpmnError( { _ -> CreateVcpeResCustService.processDecomposition(mex) })) - } - - - // ***** filterVnfs ***** - - @Test - // @Ignore - public void filterVnfs() { - ExecutionEntity mex = setupMock() - def svcdecomp = initFilterVnfs(mex) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.processDecomposition(mex) - - verify(mex).setVariable("vnfListString", '[myvnf3, myvnf5]') - } - - @Test - // @Ignore - public void filterVnfs_Null() { - ExecutionEntity mex = setupMock() - def svcdecomp = initFilterVnfs(mex) - - when(svcdecomp.getServiceVnfs()).thenReturn(null) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.processDecomposition(mex) - - // nothing more to check, as long as it didn't throw an exception - } - - - // ***** prepareCreateAllottedResourceTXC ***** - - @Test - // @Ignore - public void prepareCreateAllottedResourceTXC() { - ExecutionEntity mex = setupMock() - initPrepareCreateAllottedResourceTXC(mex) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.prepareCreateAllottedResourceTXC(mex) - - verify(mex).getVariable(DBGFLAG) - - verify(mex).setVariable("createTXCAR", true) - verify(mex).setVariable("allottedResourceModelInfoTXC", "modelB") - verify(mex).setVariable("allottedResourceRoleTXC", "TXCr") - verify(mex).setVariable("allottedResourceTypeTXC", "Tunnel XConn") - verify(mex).setVariable("parentServiceInstanceIdTXC", "homeB") - } - - @Test - // @Ignore - public void prepareCreateAllottedResourceTXC_NullArList() { - ExecutionEntity mex = setupMock() - def svcdecomp = initPrepareCreateAllottedResourceTXC(mex) - - when(svcdecomp.getServiceAllottedResources()).thenReturn(null) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.prepareCreateAllottedResourceTXC(mex) - - verify(mex).getVariable(DBGFLAG) - - verify(mex, never()).setVariable("createTXCAR", true) - verify(mex, never()).setVariable("allottedResourceModelInfoTXC", "modelB") - verify(mex, never()).setVariable("allottedResourceRoleTXC", "TXCr") - verify(mex, never()).setVariable("allottedResourceTypeTXC", "Tunnel XConn") - verify(mex, never()).setVariable("parentServiceInstanceIdTXC", "homeB") - } - - @Test - // @Ignore - public void prepareCreateAllottedResourceTXC_Ex() { - ExecutionEntity mex = setupMock() - initPrepareCreateAllottedResourceTXC(mex) - - when(mex.getVariable("createVcpeServiceRequest")).thenThrow(new RuntimeException("expected exception")) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - - assertTrue(doBpmnError( { _ -> CreateVcpeResCustService.prepareCreateAllottedResourceTXC(mex) })) - } - - - // ***** prepareCreateAllottedResourceBRG ***** - - @Test - // @Ignore - public void prepareCreateAllottedResourceBRG() { - ExecutionEntity mex = setupMock() - initPrepareCreateAllottedResourceBRG(mex) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.prepareCreateAllottedResourceBRG(mex) - - verify(mex).getVariable(DBGFLAG) - - verify(mex).setVariable("createBRGAR", true) - verify(mex).setVariable("allottedResourceModelInfoBRG", "modelB") - verify(mex).setVariable("allottedResourceRoleBRG", "BRGr") - verify(mex).setVariable("allottedResourceTypeBRG", "BRG") - verify(mex).setVariable("parentServiceInstanceIdBRG", "homeB") - } - - @Test - // @Ignore - public void prepareCreateAllottedResourceBRG_NullArList() { - ExecutionEntity mex = setupMock() - def svcdecomp = initPrepareCreateAllottedResourceBRG(mex) - - when(svcdecomp.getServiceAllottedResources()).thenReturn(null) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.prepareCreateAllottedResourceBRG(mex) - - verify(mex).getVariable(DBGFLAG) - - verify(mex, never()).setVariable("createBRGAR", true) - verify(mex, never()).setVariable("allottedResourceModelInfoBRG", "modelB") - verify(mex, never()).setVariable("allottedResourceRoleBRG", "BRGr") - verify(mex, never()).setVariable("allottedResourceTypeBRG", "BRG") - verify(mex, never()).setVariable("parentServiceInstanceIdBRG", "homeB") - } - - @Test - // @Ignore - public void prepareCreateAllottedResourceBRG_Ex() { - ExecutionEntity mex = setupMock() - initPrepareCreateAllottedResourceBRG(mex) - - when(mex.getVariable("createVcpeServiceRequest")).thenThrow(new RuntimeException("expected exception")) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - - assertTrue(doBpmnError( { _ -> CreateVcpeResCustService.prepareCreateAllottedResourceBRG(mex) })) - } - - - // ***** prepareVnfAndModulesCreate ***** - - @Test - // @Ignore - public void prepareVnfAndModulesCreate() { - ExecutionEntity mex = setupMock() - initPrepareVnfAndModulesCreate(mex) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.prepareVnfAndModulesCreate(mex) - - verify(mex).getVariable(DBGFLAG) - - verify(mex).setVariable("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb") - verify(mex).setVariable("lcpCloudRegionId", "mdt1") - verify(mex).setVariable("tenantId", "8b1df54faa3b49078e3416e21370a3ba") - } - - @Test - // @Ignore - public void prepareVnfAndModulesCreate_EmptyList() { - ExecutionEntity mex = setupMock() - initPrepareVnfAndModulesCreate(mex) - - when(mex.getVariable("vnfList")).thenReturn(new LinkedList<VnfResource>()) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.prepareVnfAndModulesCreate(mex) - - verify(mex).getVariable(DBGFLAG) - - verify(mex).setVariable("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb") - verify(mex).setVariable("lcpCloudRegionId", "mdt1") - verify(mex).setVariable("tenantId", "8b1df54faa3b49078e3416e21370a3ba") - } - - @Test - // @Ignore - public void prepareVnfAndModulesCreate_NullList() { - ExecutionEntity mex = setupMock() - initPrepareVnfAndModulesCreate(mex) - - when(mex.getVariable("vnfList")).thenReturn(null) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.prepareVnfAndModulesCreate(mex) - - verify(mex).getVariable(DBGFLAG) - - verify(mex).setVariable("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb") - verify(mex).setVariable("lcpCloudRegionId", "mdt1") - verify(mex).setVariable("tenantId", "8b1df54faa3b49078e3416e21370a3ba") - } - - @Test - // @Ignore - public void prepareVnfAndModulesCreate_Ex() { - ExecutionEntity mex = setupMock() - initPrepareVnfAndModulesCreate(mex) - - when(mex.getVariable("vnfList")).thenThrow(new RuntimeException("expected exception")) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - - assertTrue(doBpmnError( { _ -> CreateVcpeResCustService.prepareVnfAndModulesCreate(mex) })) - } - - - // ***** validateVnfCreate ***** - - @Test - // @Ignore - public void validateVnfCreate() { - ExecutionEntity mex = setupMock() - initValidateVnfCreate(mex) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.validateVnfCreate(mex) - - verify(mex).getVariable(DBGFLAG) - - verify(mex).setVariable(Prefix+"VnfsCreatedCount", 3) - } - - @Test - // @Ignore - public void validateVnfCreate_Ex() { - ExecutionEntity mex = setupMock() - initValidateVnfCreate(mex) - - when(mex.getVariable(Prefix+"VnfsCreatedCount")).thenThrow(new RuntimeException("expected exception")) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - - assertTrue(doBpmnError( { _ -> CreateVcpeResCustService.validateVnfCreate(mex) })) - } - - - // ***** postProcessResponse ***** - - @Test - // @Ignore - public void postProcessResponse() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPostProcessResponse(mex) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.postProcessResponse(mex) - - verify(mex).getVariable(DBGFLAG) - - verify(mex).setVariable(Prefix+"Success", true) - - def reqinfo = map.get(Prefix+"CompleteMsoProcessRequest") - - assertTrue(reqinfo.indexOf("request-id>mri</") >= 0) - assertTrue(reqinfo.indexOf("source>mysrc</") >= 0) - assertTrue(reqinfo.indexOf("serviceInstanceId>sii</") >= 0) - } - - @Test - // @Ignore - public void postProcessResponse_BpmnError() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPostProcessResponse(mex) - - when(mex.getVariable("source")).thenThrow(new BpmnError("expected exception")) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - - assertTrue(doBpmnError( { _ -> CreateVcpeResCustService.postProcessResponse(mex) })) - } - - @Test - // @Ignore - public void postProcessResponse_Ex() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPostProcessResponse(mex) - - when(mex.getVariable("source")).thenThrow(new RuntimeException("expected exception")) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - - assertTrue(doBpmnError( { _ -> CreateVcpeResCustService.postProcessResponse(mex) })) - } - - - // ***** preProcessRollback ***** - - @Test - // @Ignore - public void preProcessRollback() { - ExecutionEntity mex = setupMock() - def wfe = initPreProcessRollback(mex) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.preProcessRollback(mex) - - verify(mex).getVariable(DBGFLAG) - - verify(mex).setVariable("prevWorkflowException", wfe) - } - - @Test - // @Ignore - public void preProcessRollback_NullWfe() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - def wfe = initPreProcessRollback(mex) - - when(mex.getVariable("WorkflowException")).thenReturn(null) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.preProcessRollback(mex) - - verify(mex).getVariable(DBGFLAG) - - assertFalse(map.containsKey("prevWorkflowException")) - } - - @Test - // @Ignore - public void preProcessRollback_BpmnError() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - def wfe = initPreProcessRollback(mex) - - when(mex.getVariable("WorkflowException")).thenThrow(new BpmnError("expected exception")) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.preProcessRollback(mex) - - verify(mex).getVariable(DBGFLAG) - - assertFalse(map.containsKey("prevWorkflowException")) - } - - @Test - // @Ignore - public void preProcessRollback_Ex() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - def wfe = initPreProcessRollback(mex) - - when(mex.getVariable("WorkflowException")).thenThrow(new RuntimeException("expected exception")) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.preProcessRollback(mex) - - verify(mex).getVariable(DBGFLAG) - - assertFalse(map.containsKey("prevWorkflowException")) - } - - - // ***** postProcessRollback ***** - - @Test - // @Ignore - public void postProcessRollback() { - ExecutionEntity mex = setupMock() - def wfe = initPostProcessRollback(mex) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.postProcessRollback(mex) - - verify(mex).getVariable(DBGFLAG) - - verify(mex).setVariable("WorkflowException", wfe) - } - - @Test - // @Ignore - public void postProcessRollback_NullWfe() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - def wfe = initPostProcessRollback(mex) - - when(mex.getVariable("prevWorkflowException")).thenReturn(null) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.postProcessRollback(mex) - - verify(mex).getVariable(DBGFLAG) - - assertFalse(map.containsKey("WorkflowException")) - } - - @Test - // @Ignore - public void postProcessRollback_BpmnError() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - def wfe = initPostProcessRollback(mex) - - when(mex.getVariable("prevWorkflowException")).thenThrow(new BpmnError("expected exception")) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - assertTrue(doBpmnError( { _ -> CreateVcpeResCustService.postProcessRollback(mex) })) - } - - @Test - // @Ignore - public void postProcessRollback_Ex() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - def wfe = initPostProcessRollback(mex) - - when(mex.getVariable("prevWorkflowException")).thenThrow(new RuntimeException("expected exception")) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.postProcessRollback(mex) - - verify(mex).getVariable(DBGFLAG) - - assertFalse(map.containsKey("WorkflowException")) - } - - - // ***** prepareFalloutRequest ***** - - @Test - // @Ignore - public void prepareFalloutRequest() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPrepareFalloutRequest(mex) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.prepareFalloutRequest(mex) - - verify(mex, times(2)).getVariable(DBGFLAG) - - def fo = map.get(Prefix+"falloutRequest") - - assertTrue(fo.indexOf("<hello>world</") >= 0) - assertTrue(fo.indexOf("ErrorMessage>mymsg</") >= 0) - assertTrue(fo.indexOf("ErrorCode>999</") >= 0) - } - - @Test - // @Ignore - public void prepareFalloutRequest_Ex() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPrepareFalloutRequest(mex) - - when(mex.getVariable("WorkflowException")).thenThrow(new RuntimeException("expected exception")) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - - assertTrue(doBpmnError( { _ -> CreateVcpeResCustService.prepareFalloutRequest(mex) })) - } - - // ***** sendSyncError ***** - - @Test - // @Ignore - public void sendSyncError() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initSendSyncError(mex) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.sendSyncError(mex) - - verify(mex, times(2)).getVariable(DBGFLAG) - - verify(mex).setVariable(processName+"WorkflowResponseSent", "true") - - assertEquals("500", map.get(processName+"ResponseCode")) - assertEquals("Fail", map.get(processName+"Status")) - - def resp = map.get(processName+"Response") - - assertTrue(resp.indexOf("ErrorMessage>mymsg</") >= 0) - - verify(mex).setVariable("WorkflowResponse", resp) - } - - @Test - // @Ignore - public void sendSyncError_NotWfe() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initSendSyncError(mex) - - when(mex.getVariable("WorkflowException")).thenReturn("not a WFE") - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.sendSyncError(mex) - - verify(mex, times(2)).getVariable(DBGFLAG) - - verify(mex).setVariable(processName+"WorkflowResponseSent", "true") - - assertEquals("500", map.get(processName+"ResponseCode")) - assertEquals("Fail", map.get(processName+"Status")) - - def resp = map.get(processName+"Response") - - assertTrue(resp.indexOf("ErrorMessage>Sending Sync Error.</") >= 0) - - verify(mex).setVariable("WorkflowResponse", resp) - } - - @Test - // @Ignore - public void sendSyncError_NullWfe() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initSendSyncError(mex) - - when(mex.getVariable("WorkflowException")).thenReturn(null) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - CreateVcpeResCustService.sendSyncError(mex) - - verify(mex, times(2)).getVariable(DBGFLAG) - - verify(mex).setVariable(processName+"WorkflowResponseSent", "true") - - assertEquals("500", map.get(processName+"ResponseCode")) - assertEquals("Fail", map.get(processName+"Status")) - - def resp = map.get(processName+"Response") - - assertTrue(resp.indexOf("ErrorMessage>Sending Sync Error.</") >= 0) - - verify(mex).setVariable("WorkflowResponse", resp) - } - - @Test - // @Ignore - public void sendSyncError_Ex() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initSendSyncError(mex) - - when(mex.getVariable("WorkflowException")).thenThrow(new RuntimeException("expected exception")) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - - CreateVcpeResCustService.sendSyncError(mex) - - assertFalse(map.containsKey(processName+"ResponseCode")) - } - - - // ***** processJavaException ***** - - @Test - // @Ignore - public void processJavaException() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initProcessJavaException(mex) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - - assertTrue(doBpmnError( { _ -> CreateVcpeResCustService.processJavaException(mex) })) - - verify(mex, times(2)).getVariable(DBGFLAG) - - verify(mex).setVariable("prefix", Prefix) - - def wfe = map.get("WorkflowException") - - assertEquals("Caught a Java Lang Exception", wfe.getErrorMessage()) - } - - @Test - // @Ignore - public void processJavaException_BpmnError() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initProcessJavaException(mex) - - when(mex.getVariables()).thenThrow(new BpmnError("expected exception")) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - - assertTrue(doBpmnError( { _ -> CreateVcpeResCustService.processJavaException(mex) })) - - assertFalse(map.containsKey("WorkflowException")) - } - - @Test - // @Ignore - public void processJavaException_Ex() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initProcessJavaException(mex) - - when(mex.getVariables()).thenThrow(new RuntimeException("expected exception")) - - CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService() - - assertTrue(doBpmnError( { _ -> CreateVcpeResCustService.processJavaException(mex) })) - - def wfe = map.get("WorkflowException") - - assertEquals("Exception in processJavaException method", wfe.getErrorMessage()) - } - - - private void initPreProcess(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("bpmnRequest")).thenReturn(request) - when(mex.getVariable("URN_mso_workflow_aai_distribution_delay")).thenReturn("aaidelay") - when(mex.getVariable("mso-request-id")).thenReturn("mri") - when(mex.getVariable("serviceInstanceId")).thenReturn("sii") - when(mex.getVariable("requestAction")).thenReturn("ra") - } - - private initSendSyncResponse(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("mso-request-id")).thenReturn("mri") - when(mex.getVariable("serviceInstanceId")).thenReturn("sii") - } - - private void initPrepareDecomposeService(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("createVcpeServiceRequest")).thenReturn('{"requestDetails":{"modelInfo":"mi"}}') - } - - private void initPrepareCreateServiceInstance(ExecutionEntity mex) { - ServiceDecomposition svcdecomp = mock(ServiceDecomposition.class) - - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("createVcpeServiceRequest")).thenReturn(request) - when(mex.getVariable("serviceDecomposition")).thenReturn(svcdecomp) - - when(svcdecomp.toJsonStringNoRootName()).thenReturn("mydecomp") - } - - private void initPostProcessServiceInstanceCreate(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("mso-request-id")).thenReturn("mri") - when(mex.getVariable("serviceInstanceId")).thenReturn("sii") - when(mex.getVariable("serviceInstanceName")).thenReturn("sin") - } - - private ServiceDecomposition initProcessDecomposition(ExecutionEntity mex) { - List<VnfResource> vnflst = new LinkedList<>() - vnflst.add(makeVnf("", "")) - vnflst.add(makeVnf("2", "BRG")) - vnflst.add(makeVnf("3", "BRG")) - - ServiceDecomposition svcdecomp = mock(ServiceDecomposition.class) - when(svcdecomp.getServiceVnfs()).thenReturn(vnflst) - - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("serviceDecomposition")).thenReturn(svcdecomp) - when(mex.getVariable("serviceInstanceId")).thenReturn("sii") - when(mex.getVariable("serviceInstanceName")).thenReturn("sin") - - return svcdecomp - } - - private ServiceDecomposition initFilterVnfs(ExecutionEntity mex) { - List<VnfResource> vnflst = new LinkedList<>() - vnflst.add(makeVnf("", "BRG")) - vnflst.add(makeVnf("2", "Tunnel XConn")) - vnflst.add(makeVnf("3", "")) - vnflst.add(makeVnf("4", "BRG")) - vnflst.add(makeVnf("5", "other")) - - ServiceDecomposition svcdecomp = mock(ServiceDecomposition.class) - when(svcdecomp.getServiceVnfs()).thenReturn(vnflst) - - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("serviceDecomposition")).thenReturn(svcdecomp) - when(mex.getVariable("serviceInstanceId")).thenReturn("sii") - when(mex.getVariable("serviceInstanceName")).thenReturn("sin") - - return svcdecomp - } - - private initAwaitAaiDistribution(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - } - - private ServiceDecomposition initPrepareCreateAllottedResourceTXC(ExecutionEntity mex) { - ServiceDecomposition svcdecomp = mock(ServiceDecomposition.class) - List<AllottedResource> arlst = new LinkedList<>() - - arlst.add(makeArBRG("A")) - arlst.add(makeArTXC("B")) - arlst.add(makeArBRG("C")) - - when(svcdecomp.getServiceAllottedResources()).thenReturn(arlst) - - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("createVcpeServiceRequest")).thenReturn(request) - when(mex.getVariable("serviceDecomposition")).thenReturn(svcdecomp) - when(mex.getVariable("allottedResourceId")).thenReturn(ARID) - - return svcdecomp - } - - private ServiceDecomposition initPrepareCreateAllottedResourceBRG(ExecutionEntity mex) { - ServiceDecomposition svcdecomp = mock(ServiceDecomposition.class) - List<AllottedResource> arlst = new LinkedList<>() - - arlst.add(makeArTXC("A")) - arlst.add(makeArBRG("B")) - arlst.add(makeArTXC("C")) - - when(svcdecomp.getServiceAllottedResources()).thenReturn(arlst) - - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("createVcpeServiceRequest")).thenReturn(request) - when(mex.getVariable("serviceDecomposition")).thenReturn(svcdecomp) - when(mex.getVariable("allottedResourceId")).thenReturn(ARID) - - return svcdecomp - } - - private AllottedResource makeArTXC(String id) { - AllottedResource ar = mock(AllottedResource.class) - ModelInfo mod = mock(ModelInfo.class) - HomingSolution home = mock(HomingSolution.class) - - when(ar.toJsonStringNoRootName()).thenReturn("json"+id) - when(ar.getAllottedResourceType()).thenReturn("Tunnel XConn") - when(ar.getModelInfo()).thenReturn(mod) - when(ar.getAllottedResourceRole()).thenReturn("TXCr") - when(ar.getHomingSolution()).thenReturn(home) - - when(mod.toJsonStringNoRootName()).thenReturn("model"+id) - - when(home.getServiceInstanceId()).thenReturn("home"+id) - - return ar - } - - private AllottedResource makeArBRG(String id) { - AllottedResource ar = mock(AllottedResource.class) - ModelInfo mod = mock(ModelInfo.class) - HomingSolution home = mock(HomingSolution.class) - - when(ar.toJsonStringNoRootName()).thenReturn("json"+id) - when(ar.getAllottedResourceType()).thenReturn("BRG") - when(ar.getModelInfo()).thenReturn(mod) - when(ar.getAllottedResourceRole()).thenReturn("BRGr") - when(ar.getHomingSolution()).thenReturn(home) - - when(mod.toJsonStringNoRootName()).thenReturn("model"+id) - - when(home.getServiceInstanceId()).thenReturn("home"+id) - - return ar - } - - private initPrepareVnfAndModulesCreate(ExecutionEntity mex) { - - List<VnfResource> vnflst = new LinkedList<>() - - vnflst.add(makeVnf("A", "BRG")) - vnflst.add(makeVnf("B", "")) - vnflst.add(makeVnf("C", "")) - vnflst.add(makeVnf("D", "Tunnel XConn")) - - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("createVcpeServiceRequest")).thenReturn(request) - when(mex.getVariable("vnfList")).thenReturn(vnflst) - when(mex.getVariable(Prefix+"VnfsCreatedCount")).thenReturn(2) - when(mex.getVariable("vnfModelInfo")).thenReturn("nomodel") - when(mex.getVariable("sdncVersion")).thenReturn("myvers") - } - - private VnfResource makeVnf(String id, String role) { - ModelInfo mod = mock(ModelInfo.class) - VnfResource vnf = mock(VnfResource.class) - - when(mod.toString()).thenReturn('{"modelInfo":"mymodel'+id+'"}') - - when(vnf.toString()).thenReturn("myvnf"+id) - when(vnf.getModelInfo()).thenReturn(mod) - when(vnf.getNfRole()).thenReturn(role) - - return vnf - } - - private initValidateVnfCreate(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable(Prefix+"VnfsCreatedCount")).thenReturn(2) - } - - private initPostProcessResponse(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("source")).thenReturn("mysrc") - when(mex.getVariable("mso-request-id")).thenReturn("mri") - when(mex.getVariable("serviceInstanceId")).thenReturn("sii") - } - - private WorkflowException initPreProcessRollback(ExecutionEntity mex) { - WorkflowException wfe = mock(WorkflowException.class) - - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("WorkflowException")).thenReturn(wfe) - - return wfe - } - - private WorkflowException initPostProcessRollback(ExecutionEntity mex) { - WorkflowException wfe = mock(WorkflowException.class) - - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("prevWorkflowException")).thenReturn(wfe) - - return wfe - } - - private initPrepareFalloutRequest(ExecutionEntity mex) { - WorkflowException wfe = mock(WorkflowException.class) - - when(wfe.getErrorMessage()).thenReturn("mymsg") - when(wfe.getErrorCode()).thenReturn(999) - - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("WorkflowException")).thenReturn(wfe) - when(mex.getVariable(Prefix+"requestInfo")).thenReturn("<hello>world</hello>") - - return wfe - } - - private initSendSyncError(ExecutionEntity mex) { - WorkflowException wfe = mock(WorkflowException.class) - - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("mso-request-id")).thenReturn("mri") - when(mex.getVariable("WorkflowException")).thenReturn(wfe) - - when(wfe.getErrorMessage()).thenReturn("mymsg") - } - - private initProcessJavaException(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustServiceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustServiceTest.groovy deleted file mode 100644 index b904a3f2d9..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustServiceTest.groovy +++ /dev/null @@ -1,773 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.bpmn.vcpe.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.junit.Before -import org.junit.BeforeClass -import org.junit.Rule -import org.junit.Test -import org.junit.Ignore -import org.mockito.MockitoAnnotations -import org.camunda.bpm.engine.delegate.BpmnError -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.domain.ServiceDecomposition -import org.openecomp.mso.bpmn.core.domain.VnfResource -import org.openecomp.mso.bpmn.core.domain.AllottedResource -import org.openecomp.mso.bpmn.core.domain.ModelInfo - -import org.openecomp.mso.bpmn.core.RollbackData -import org.openecomp.mso.bpmn.vcpe.scripts.MapGetter -import org.openecomp.mso.bpmn.vcpe.scripts.MapSetter - -import com.github.tomakehurst.wiremock.junit.WireMockRule - -class DeleteVcpeResCustServiceTest extends GroovyTestBase { - - private static String request - - @Rule - public WireMockRule wireMockRule = new WireMockRule(PORT) - - String Prefix = "DVRCS_" - String RbType = "DCRENI_" - - @BeforeClass - public static void setUpBeforeClass() { - request = FileUtil.readResourceFile("__files/VCPE/DeleteVcpeResCustService/request.json") - } - - @Before - public void init() - { - MockitoAnnotations.initMocks(this) - } - - public DeleteVcpeResCustServiceTest() { - super("DeleteVcpeResCustService") - } - - - // ***** preProcessRequest ***** - - @Test -// @Ignore - public void preProcessRequest() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPreProcess(mex) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - DeleteVcpeResCustService.preProcessRequest(mex) - - verify(mex).getVariable(DBGFLAG) - - assertEquals(Prefix, map.get("prefix")) - assertEquals(request, map.get("DeleteVcpeResCustServiceRequest")) - assertEquals("mri", map.get("msoRequestId")) - assertEquals("ra", map.get("requestAction")) - assertEquals("VID", map.get("source")) - assertEquals(CUST, map.get("globalSubscriberId")) - assertEquals(CUST, map.get("globalCustomerId")) - assertEquals("false", map.get("disableRollback")) - assertEquals("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", map.get("productFamilyId")) - assertEquals(SVC, map.get("subscriptionServiceType")) - - assertEquals("mdt1", map.get("lcpCloudRegionId")) - assertEquals("8b1df54faa3b49078e3416e21370a3ba", map.get("tenantId")) - assertEquals("1707", map.get("sdncVersion")) - assertEquals("service-instance", map.get("GENGS_type")) - assertEquals("""{"tenantId":"8b1df54faa3b49078e3416e21370a3ba","lcpCloudRegionId":"mdt1"}""", map.get("cloudConfiguration")) - assertTrue(map.containsKey(Prefix+"requestInfo")) - - def reqinfo = map.get(Prefix+"requestInfo") - assertTrue(reqinfo.indexOf("<request-id>mri</") >= 0) - assertTrue(reqinfo.indexOf("<source>VID</") >= 0) - } - - @Test -// @Ignore - public void preProcessRequest_EmptyParts() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPreProcess(mex) - - def req = request - .replace('"source"', '"sourceXXX"') - - when(mex.getVariable("bpmnRequest")).thenReturn(req) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - DeleteVcpeResCustService.preProcessRequest(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("prefix", Prefix) - verify(mex).setVariable("DeleteVcpeResCustServiceRequest", req) - verify(mex).setVariable("msoRequestId", "mri") - verify(mex).setVariable("requestAction", "ra") - verify(mex).setVariable("source", "VID") - verify(mex).setVariable("globalSubscriberId", CUST) - verify(mex).setVariable("globalCustomerId", CUST) - verify(mex).setVariable("disableRollback", "false") - verify(mex).setVariable("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb") - verify(mex).setVariable("subscriptionServiceType", SVC) - - verify(mex).setVariable("lcpCloudRegionId", "mdt1") - verify(mex).setVariable("tenantId", "8b1df54faa3b49078e3416e21370a3ba") - assertEquals("""{"tenantId":"8b1df54faa3b49078e3416e21370a3ba","lcpCloudRegionId":"mdt1"}""", map.get("cloudConfiguration")) - verify(mex).setVariable("sdncVersion", "1707") - verify(mex).setVariable("GENGS_type", "service-instance") - assertTrue(map.containsKey(Prefix+"requestInfo")) - - def reqinfo = map.get(Prefix+"requestInfo") - println reqinfo - assertTrue(reqinfo.indexOf("<request-id>mri</") >= 0) - assertTrue(reqinfo.indexOf("<source>VID</") >= 0) - } - - @Test -// @Ignore - public void preProcessRequest_MissingServiceInstanceId() { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - when(mex.getVariable("serviceInstanceId")).thenReturn(null) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - - assertTrue(doBpmnError( { _ -> DeleteVcpeResCustService.preProcessRequest(mex) })) - } - - @Test -// @Ignore - public void preProcessRequest_BpmnError() { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - when(mex.getVariable("bpmnRequest")).thenThrow(new BpmnError("expected exception")) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - - assertTrue(doBpmnError( { _ -> DeleteVcpeResCustService.preProcessRequest(mex) })) - } - - @Test -// @Ignore - public void preProcessRequest_Ex() { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - when(mex.getVariable("bpmnRequest")).thenThrow(new RuntimeException("expected exception")) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - - assertTrue(doBpmnError( { _ -> DeleteVcpeResCustService.preProcessRequest(mex) })) - } - - private void initPreProcess(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("bpmnRequest")).thenReturn(request) - when(mex.getVariable("mso-request-id")).thenReturn("mri") - when(mex.getVariable("serviceInstanceId")).thenReturn("sii") - when(mex.getVariable("requestAction")).thenReturn("ra") - } - - // ***** sendSyncResponse ***** - - @Test -// @Ignore - public void sendSyncResponse() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initSendSyncResponse(mex) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - DeleteVcpeResCustService.sendSyncResponse(mex) - - verify(mex, times(2)).getVariable(DBGFLAG) - - verify(mex).setVariable(processName+"WorkflowResponseSent", "true") - - assertEquals("202", map.get(processName+"ResponseCode")) - assertEquals("Success", map.get(processName+"Status")) - - def resp = map.get(processName+"Response") - - assertTrue(resp.indexOf('"instanceId":"sii"') >= 0) - assertTrue(resp.indexOf('"requestId":"mri"') >= 0) - } - - @Test -// @Ignore - public void sendSyncResponse_Ex() { - ExecutionEntity mex = setupMock() - initSendSyncResponse(mex) - - when(mex.getVariable("serviceInstanceId")).thenThrow(new RuntimeException("expected exception")) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - - assertTrue(doBpmnError( { _ -> DeleteVcpeResCustService.sendSyncResponse(mex) })) - } - - private initSendSyncResponse(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("mso-request-id")).thenReturn("mri") - when(mex.getVariable("serviceInstanceId")).thenReturn("sii") - } - - // ***** prepareServiceDelete ***** - - @Test -// @Ignore - public void prepareServiceDelete() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPrepareServiceDelete(mex) - - myMockGetAr("/aai/v11/anytxc", 200, "arGetTXCById.xml"); - myMockGetAr("/aai/v11/anybrg", 200, "arGetBRGById.xml"); - myMockGetAr("/aai/v11/other", 200, "arGetOtherById.xml"); - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - DeleteVcpeResCustService.prepareServiceDelete(mex) - - verify(mex).setVariable(Prefix+"TunnelXConn", true) - assertEquals("ar-txcA", map.get("TXC_allottedResourceId")) - - verify(mex).setVariable(Prefix+"BRG", true) - assertEquals("ar-brgB", map.get("BRG_allottedResourceId")) - - verify(mex).setVariable(Prefix+"vnfsCount", 2) - assertNotNull(map.get(Prefix+"relatedVnfIdList")) - assertEquals("[vnfX, vnfY]", map.get(Prefix+"relatedVnfIdList").toString()) - - verify(mex, never()).setVariable(processName+"WorkflowResponseSent", "true") - } - - @Test -// @Ignore - public void prepareServiceDelete_NotFound() { - ExecutionEntity mex = setupMock() - initPrepareServiceDelete(mex) - - when(mex.getVariable("GENGS_FoundIndicator")).thenReturn(false) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - - assertTrue(doBpmnError({ _ -> DeleteVcpeResCustService.prepareServiceDelete(mex) })) - - verify(mex, never()).setVariable(processName+"WorkflowResponseSent", "true") - } - - @Test -// @Ignore - public void prepareServiceDelete_Empty() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPrepareServiceDelete(mex) - - when(mex.getVariable("GENGS_service")).thenReturn("<empty></empty>") - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - DeleteVcpeResCustService.prepareServiceDelete(mex) - - verify(mex).getVariable(DBGFLAG) - - verify(mex).setVariable(Prefix+"TunnelXConn", false) - assertNull(map.get("TXC_allottedResourceId")) - - verify(mex).setVariable(Prefix+"BRG", false) - assertNull(map.get("BRG_allottedResourceId")) - - assertEquals(0, map.get(Prefix+"vnfsCount")) - assertFalse(map.containsKey(Prefix+"relatedVnfIdList")) - - verify(mex, never()).setVariable(processName+"WorkflowResponseSent", "true") - } - - @Test -// @Ignore - public void prepareServiceDelete_BpmnError() { - ExecutionEntity mex = setupMock() - initPrepareServiceDelete(mex) - - when(mex.getVariable("GENGS_FoundIndicator")).thenThrow(new BpmnError("expected exception")) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - - assertTrue(doBpmnError({ _ -> DeleteVcpeResCustService.prepareServiceDelete(mex) })) - - verify(mex, never()).setVariable(processName+"WorkflowResponseSent", "true") - } - - @Test -// @Ignore - public void prepareServiceDelete_Ex() { - ExecutionEntity mex = setupMock() - initPrepareServiceDelete(mex) - - when(mex.getVariable("GENGS_FoundIndicator")).thenThrow(new RuntimeException("expected exception")) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - - assertTrue(doBpmnError({ _ -> DeleteVcpeResCustService.prepareServiceDelete(mex) })) - - verify(mex).setVariable(processName+"WorkflowResponseSent", "true") - } - - private initPrepareServiceDelete(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("serviceInstanceId")).thenReturn("sii") - when(mex.getVariable("GENGS_FoundIndicator")).thenReturn(true) - when(mex.getVariable("mso-request-id")).thenReturn("mri") - when(mex.getVariable("DeleteVcpeResCustServiceRequest")).thenReturn(request) - when(mex.getVariable("URN_aai_endpoint")).thenReturn(aaiUriPfx) - when(mex.getVariable("GENGS_service")).thenReturn(FileUtil.readResourceFile("__files/VCPE/DeleteVcpeResCustService/serviceToDelete.xml")) - } - - // ***** getAaiAr ***** - - @Test -// @Ignore - public void getAaiAr() { - myMockGetAr("/myurl/ar1", 200, "arGetBRGById.xml"); - - ExecutionEntity mex = setupMock() - initGetAaiAr(mex) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - def (type, id) = DeleteVcpeResCustService.getAaiAr(mex, "/myurl/ar1") - - assertEquals("BRG", type) - assertEquals("ar-brgB", id) - } - - @Test -// @Ignore - public void getAaiAr_401() { - myMockGetAr("/myurl/ar1", 401, "arGetBRGById.xml"); - - ExecutionEntity mex = setupMock() - initGetAaiAr(mex) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - def (type, id) = DeleteVcpeResCustService.getAaiAr(mex, "/myurl/ar1") - - assertEquals(null, type) - assertEquals(null, id) - } - - @Test -// @Ignore - public void getAaiAr_EmptyResponse() { - myMockGetAr("/myurl/ar1", 200, "empty.txt"); - - ExecutionEntity mex = setupMock() - initGetAaiAr(mex) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - def (type, id) = DeleteVcpeResCustService.getAaiAr(mex, "/myurl/ar1") - - assertEquals(null, type) - assertEquals(null, id) - } - - private void initGetAaiAr(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("URN_aai_endpoint")).thenReturn(aaiUriPfx) - } - - // ***** prepareVnfAndModulesDelete ***** - - @Test -// @Ignore - public void prepareVnfAndModulesDelete() { - ExecutionEntity mex = setupMock() - initPrepareVnfAndModulesDelete(mex) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - DeleteVcpeResCustService.prepareVnfAndModulesDelete(mex) - - verify(mex).getVariable(DBGFLAG) - - verify(mex).setVariable("vnfId", "vnfB") - } - - @Test -// @Ignore - public void prepareVnfAndModulesDelete_Empty() { - ExecutionEntity mex = setupMock() - initPrepareVnfAndModulesDelete(mex) - - when(mex.getVariable(Prefix+"relatedVnfIdList")).thenReturn(new LinkedList()) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - DeleteVcpeResCustService.prepareVnfAndModulesDelete(mex) - - verify(mex).getVariable(DBGFLAG) - - verify(mex).setVariable("vnfId", "") - } - - @Test -// @Ignore - public void prepareVnfAndModulesDelete_Ex() { - ExecutionEntity mex = setupMock() - initPrepareVnfAndModulesDelete(mex) - - when(mex.getVariable(Prefix+"relatedVnfIdList")).thenThrow(new RuntimeException("expected exception")) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - - assertTrue(doBpmnError({ _ -> DeleteVcpeResCustService.prepareVnfAndModulesDelete(mex) })) - } - - private initPrepareVnfAndModulesDelete(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable(Prefix+"relatedVnfIdList")).thenReturn(Arrays.asList("vnfA", "vnfB", "vnfC")) - when(mex.getVariable(Prefix+"vnfsDeletedCount")).thenReturn(1) - } - - // ***** validateVnfDelete ***** - - @Test -// @Ignore - public void validateVnfDelete() { - ExecutionEntity mex = setupMock() - initValidateVnfDelete(mex) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - DeleteVcpeResCustService.validateVnfDelete(mex) - - verify(mex).getVariable(DBGFLAG) - - verify(mex).setVariable(Prefix+"vnfsDeletedCount", 3) - } - - @Test -// @Ignore - public void validateVnfDelete_Ex() { - ExecutionEntity mex = setupMock() - initValidateVnfDelete(mex) - - when(mex.getVariable(Prefix+"vnfsDeletedCount")).thenThrow(new RuntimeException("expected exception")) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - - assertTrue(doBpmnError({ _ -> DeleteVcpeResCustService.validateVnfDelete(mex) })) - } - - private initValidateVnfDelete(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable(Prefix+"vnfsDeletedCount")).thenReturn(2) - } - - // ***** postProcessResponse ***** - - @Test -// @Ignore - public void postProcessResponse() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPostProcessResponse(mex) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - DeleteVcpeResCustService.postProcessResponse(mex) - - verify(mex).getVariable(DBGFLAG) - - assertEquals(true, map.get(Prefix+"Success")) - - def req = map.get(Prefix+"CompleteMsoProcessRequest") - - assertTrue(req.indexOf("<request-id>mri</") >= 0) - assertTrue(req.indexOf("<source>mysrc</") >= 0) - } - - @Test -// @Ignore - public void postProcessResponse_BpmnError() { - ExecutionEntity mex = setupMock() - initPostProcessResponse(mex) - - when(mex.getVariable("source")).thenThrow(new BpmnError("expected exception")) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - - assertTrue(doBpmnError( { _ -> DeleteVcpeResCustService.postProcessResponse(mex) })) - } - - @Test -// @Ignore - public void postProcessResponse_Ex() { - ExecutionEntity mex = setupMock() - initPostProcessResponse(mex) - - when(mex.getVariable("source")).thenThrow(new RuntimeException("expected exception")) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - - assertTrue(doBpmnError( { _ -> DeleteVcpeResCustService.postProcessResponse(mex) })) - } - - private initPostProcessResponse(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("source")).thenReturn("mysrc") - when(mex.getVariable("msoRequestId")).thenReturn("mri") - } - - - // ***** prepareFalloutRequest ***** - - @Test -// @Ignore - public void prepareFalloutRequest() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPrepareFalloutRequest(mex) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - DeleteVcpeResCustService.prepareFalloutRequest(mex) - - verify(mex, times(2)).getVariable(DBGFLAG) - - def fo = map.get(Prefix+"falloutRequest") - - assertTrue(fo.indexOf("<hello>world</") >= 0) - assertTrue(fo.indexOf("ErrorMessage>mymsg</") >= 0) - assertTrue(fo.indexOf("ErrorCode>999</") >= 0) - } - - @Test -// @Ignore - public void prepareFalloutRequest_Ex() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPrepareFalloutRequest(mex) - - when(mex.getVariable("WorkflowException")).thenThrow(new RuntimeException("expected exception")) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - - assertTrue(doBpmnError( { _ -> DeleteVcpeResCustService.prepareFalloutRequest(mex) })) - } - - private initPrepareFalloutRequest(ExecutionEntity mex) { - WorkflowException wfe = mock(WorkflowException.class) - - when(wfe.getErrorMessage()).thenReturn("mymsg") - when(wfe.getErrorCode()).thenReturn(999) - - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("WorkflowException")).thenReturn(wfe) - when(mex.getVariable(Prefix+"requestInfo")).thenReturn("<hello>world</hello>") - - return wfe - } - - // ***** sendSyncError ***** - - @Test -// @Ignore - public void sendSyncError() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initSendSyncError(mex) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - DeleteVcpeResCustService.sendSyncError(mex) - - verify(mex, times(2)).getVariable(DBGFLAG) - - verify(mex).setVariable(processName+"WorkflowResponseSent", "true") - - assertEquals("500", map.get(processName+"ResponseCode")) - assertEquals("Fail", map.get(processName+"Status")) - - def resp = map.get(processName+"Response") - - assertTrue(resp.indexOf("ErrorMessage>mymsg</") >= 0) - - verify(mex).setVariable("WorkflowResponse", resp) - } - - @Test -// @Ignore - public void sendSyncError_NotWfe() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initSendSyncError(mex) - - when(mex.getVariable("WorkflowException")).thenReturn("not a WFE") - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - DeleteVcpeResCustService.sendSyncError(mex) - - verify(mex, times(2)).getVariable(DBGFLAG) - - verify(mex).setVariable(processName+"WorkflowResponseSent", "true") - - assertEquals("500", map.get(processName+"ResponseCode")) - assertEquals("Fail", map.get(processName+"Status")) - - def resp = map.get(processName+"Response") - - assertTrue(resp.indexOf("ErrorMessage>Sending Sync Error.</") >= 0) - - verify(mex).setVariable("WorkflowResponse", resp) - } - - @Test -// @Ignore - public void sendSyncError_NullWfe() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initSendSyncError(mex) - - when(mex.getVariable("WorkflowException")).thenReturn(null) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - DeleteVcpeResCustService.sendSyncError(mex) - - verify(mex, times(2)).getVariable(DBGFLAG) - - verify(mex).setVariable(processName+"WorkflowResponseSent", "true") - - assertEquals("500", map.get(processName+"ResponseCode")) - assertEquals("Fail", map.get(processName+"Status")) - - def resp = map.get(processName+"Response") - - assertTrue(resp.indexOf("ErrorMessage>Sending Sync Error.</") >= 0) - - verify(mex).setVariable("WorkflowResponse", resp) - } - - @Test -// @Ignore - public void sendSyncError_Ex() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initSendSyncError(mex) - - when(mex.getVariable("WorkflowException")).thenThrow(new RuntimeException("expected exception")) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - - DeleteVcpeResCustService.sendSyncError(mex) - - assertFalse(map.containsKey(processName+"ResponseCode")) - } - - private initSendSyncError(ExecutionEntity mex) { - WorkflowException wfe = mock(WorkflowException.class) - - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("mso-request-id")).thenReturn("mri") - when(mex.getVariable("WorkflowException")).thenReturn(wfe) - - when(wfe.getErrorMessage()).thenReturn("mymsg") - } - - - // ***** processJavaException ***** - - @Test -// @Ignore - public void processJavaException() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initProcessJavaException(mex) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - - assertTrue(doBpmnError( { _ -> DeleteVcpeResCustService.processJavaException(mex) })) - - verify(mex, times(2)).getVariable(DBGFLAG) - - verify(mex).setVariable("prefix", Prefix) - - def wfe = map.get("WorkflowException") - - assertEquals("Caught a Java Lang Exception", wfe.getErrorMessage()) - } - - @Test -// @Ignore - public void processJavaException_BpmnError() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initProcessJavaException(mex) - - when(mex.getVariables()).thenThrow(new BpmnError("expected exception")) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - - assertTrue(doBpmnError( { _ -> DeleteVcpeResCustService.processJavaException(mex) })) - - assertFalse(map.containsKey("WorkflowException")) - } - - @Test -// @Ignore - public void processJavaException_Ex() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initProcessJavaException(mex) - - when(mex.getVariables()).thenThrow(new RuntimeException("expected exception")) - - DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() - - assertTrue(doBpmnError( { _ -> DeleteVcpeResCustService.processJavaException(mex) })) - - def wfe = map.get("WorkflowException") - - assertEquals("Exception in processJavaException method", wfe.getErrorMessage()) - } - - private initProcessJavaException(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - } - - private void myMockGetAr(String url, int status, String fileResp) { - stubFor(get(urlMatching(url)) - .willReturn(aResponse() - .withStatus(status) - .withHeader("Content-Type", "text/xml") - .withBodyFile("VCPE/DeleteVcpeResCustService/" + fileResp))); - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollbackTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollbackTest.groovy deleted file mode 100644 index 71c0f8b511..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollbackTest.groovy +++ /dev/null @@ -1,652 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.bpmn.vcpe.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.junit.Before -import org.junit.BeforeClass -import org.junit.Rule -import org.junit.Test -import org.junit.Ignore -import org.mockito.MockitoAnnotations -import org.camunda.bpm.engine.delegate.BpmnError -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.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.MockDeleteAllottedResource -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource - -import org.openecomp.mso.bpmn.core.RollbackData - -import com.github.tomakehurst.wiremock.junit.WireMockRule - -class DoCreateAllottedResourceBRGRollbackTest extends GroovyTestBase { - - @Rule - public WireMockRule wireMockRule = new WireMockRule(PORT) - - String Prefix = "DCARBRGRB_" - String RbType = "DCARBRG_" - - @BeforeClass - public static void setUpBeforeClass() { - // nothing for now - } - - @Before - public void init() - { - MockitoAnnotations.initMocks(this) - } - - public DoCreateAllottedResourceBRGRollbackTest() { - super("DoCreateAllottedResourceBRGRollback") - } - - - // ***** preProcessRequest ***** - - @Test -// @Ignore - public void preProcessRequest() { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - DoCreateAllottedResourceBRGRollback.preProcessRequest(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("prefix", Prefix) - verify(mex).setVariable("serviceInstanceId", "sii") - verify(mex).setVariable("parentServiceInstanceId", "psii") - verify(mex).setVariable("allottedResourceId", "myid") - verify(mex).setVariable("rollbackAAI", true) - verify(mex).setVariable("aaiARPath", "mypath") - verify(mex).setVariable("rollbackSDNC", true) - verify(mex).setVariable("deactivateSdnc", "myactivate") - verify(mex).setVariable("deleteSdnc", "mycreate") - verify(mex).setVariable("unassignSdnc", "true") - verify(mex).setVariable("sdncDeactivateRequest", "activatereq") - verify(mex).setVariable("sdncDeleteRequest", "createreq") - verify(mex).setVariable("sdncUnassignRequest", "assignreq") - - verify(mex, never()).setVariable("skipRollback", true) - } - - @Test -// @Ignore - public void preProcessRequest_RollbackDisabled() { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - when(mex.getVariable("disableRollback")).thenReturn("true") - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - DoCreateAllottedResourceBRGRollback.preProcessRequest(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("prefix", Prefix) - verify(mex).setVariable("serviceInstanceId", "sii") - verify(mex).setVariable("parentServiceInstanceId", "psii") - verify(mex).setVariable("allottedResourceId", "myid") - verify(mex).setVariable("rollbackAAI", true) - verify(mex).setVariable("aaiARPath", "mypath") - verify(mex).setVariable("rollbackSDNC", true) - verify(mex).setVariable("deactivateSdnc", "myactivate") - verify(mex).setVariable("deleteSdnc", "mycreate") - verify(mex).setVariable("unassignSdnc", "true") - verify(mex).setVariable("sdncDeactivateRequest", "activatereq") - verify(mex).setVariable("sdncDeleteRequest", "createreq") - verify(mex).setVariable("sdncUnassignRequest", "assignreq") - - verify(mex).setVariable("skipRollback", true) - } - - @Test -// @Ignore - public void preProcessRequest_NoAAI() { - ExecutionEntity mex = setupMock() - def data = initPreProcess(mex) - - when(mex.getVariable("rollbackAAI")).thenReturn(false) - data.put(RbType, "rollbackAAI", "false") - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - DoCreateAllottedResourceBRGRollback.preProcessRequest(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("prefix", Prefix) - verify(mex).setVariable("serviceInstanceId", "sii") - verify(mex).setVariable("parentServiceInstanceId", "psii") - verify(mex).setVariable("allottedResourceId", "myid") - verify(mex, never()).setVariable("rollbackAAI", true) - verify(mex, never()).setVariable("aaiARPath", "mypath") - verify(mex).setVariable("rollbackSDNC", true) - verify(mex).setVariable("deactivateSdnc", "myactivate") - verify(mex).setVariable("deleteSdnc", "mycreate") - verify(mex).setVariable("unassignSdnc", "true") - verify(mex).setVariable("sdncDeactivateRequest", "activatereq") - verify(mex).setVariable("sdncDeleteRequest", "createreq") - verify(mex).setVariable("sdncUnassignRequest", "assignreq") - - verify(mex, never()).setVariable("skipRollback", true) - } - - @Test -// @Ignore - public void preProcessRequest_NoAssign() { - ExecutionEntity mex = setupMock() - def data = initPreProcess(mex) - - when(mex.getVariable("rollbackSDNC")).thenReturn(false) - data.put(RbType, "rollbackSDNCassign", "false") - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - DoCreateAllottedResourceBRGRollback.preProcessRequest(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("prefix", Prefix) - verify(mex).setVariable("serviceInstanceId", "sii") - verify(mex).setVariable("parentServiceInstanceId", "psii") - verify(mex).setVariable("allottedResourceId", "myid") - verify(mex).setVariable("rollbackAAI", true) - verify(mex).setVariable("aaiARPath", "mypath") - verify(mex, never()).setVariable("rollbackSDNC", true) - verify(mex, never()).setVariable("deactivateSdnc", "myactivate") - verify(mex, never()).setVariable("deleteSdnc", "mycreate") - verify(mex, never()).setVariable("unassignSdnc", "true") - verify(mex, never()).setVariable("sdncDeactivateRequest", "activatereq") - verify(mex, never()).setVariable("sdncDeleteRequest", "createreq") - verify(mex, never()).setVariable("sdncUnassignRequest", "assignreq") - - verify(mex, never()).setVariable("skipRollback", true) - } - - @Test -// @Ignore - public void preProcessRequest_NoAAI_NoAssign() { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - when(mex.getVariable("rollbackAAI")).thenReturn(false) - when(mex.getVariable("rollbackSDNC")).thenReturn(false) - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - DoCreateAllottedResourceBRGRollback.preProcessRequest(mex) - - verify(mex).setVariable("skipRollback", true) - } - - @Test -// @Ignore - public void preProcessRequest_NoRbStructure() { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - when(mex.getVariable("rollbackData")).thenReturn(new RollbackData()) - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - DoCreateAllottedResourceBRGRollback.preProcessRequest(mex) - - verify(mex).setVariable("skipRollback", true) - } - - @Test -// @Ignore - public void preProcessRequest_NullRb() { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - when(mex.getVariable("rollbackData")).thenReturn(null) - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - DoCreateAllottedResourceBRGRollback.preProcessRequest(mex) - - verify(mex).setVariable("skipRollback", true) - } - - @Test -// @Ignore - public void preProcessRequest_BpmnError() { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - when(mex.getVariable("rollbackData")).thenThrow(new BpmnError("expected exception")) - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - - assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.preProcessRequest(mex) })) - } - - @Test -// @Ignore - public void preProcessRequest_Ex() { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - when(mex.getVariable("rollbackData")).thenThrow(new RuntimeException("expected exception")) - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - - assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.preProcessRequest(mex) })) - } - - @Test -// @Ignore - public void updateAaiAROrchStatus() { - ExecutionEntity mex = setupMock() - initUpdateAaiAROrchStatus(mex) - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml") - MockPatchAllottedResource(CUST, SVC, INST, ARID) - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - DoCreateAllottedResourceBRGRollback.updateAaiAROrchStatus(mex, "success") - } - - @Test -// @Ignore - public void updateAaiAROrchStatus_EmptyResponse() { - ExecutionEntity mex = setupMock() - initUpdateAaiAROrchStatus(mex) - - wireMockRule - .stubFor(get(urlMatching("/aai/v[0-9]+/.*")) - .willReturn(aResponse() - .withStatus(200))) - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - - assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.updateAaiAROrchStatus(mex, "success") })) - } - - @Test -// @Ignore - public void updateAaiAROrchStatus_NoArPath() { - ExecutionEntity mex = setupMock() - initUpdateAaiAROrchStatus(mex) - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml") - MockPatchAllottedResource(CUST, SVC, INST, ARID) - - when(mex.getVariable("aaiARPath")).thenReturn(null) - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - - assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.updateAaiAROrchStatus(mex, "success") })) - } - - - // ***** validateSDNCResp ***** - - @Test -// @Ignore - public void validateSDNCResp() { - ExecutionEntity mex = setupMock() - initValidateSDNCResp(mex) - def resp = initValidateSDNCResp_Resp() - - when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(true) - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - - DoCreateAllottedResourceBRGRollback.validateSDNCResp(mex, resp, "create") - - verify(mex).getVariable("WorkflowException") - verify(mex).getVariable("SDNCA_SuccessIndicator") - } - - @Test -// @Ignore - public void validateSDNCResp_Unsuccessful() { - ExecutionEntity mex = setupMock() - initValidateSDNCResp(mex) - def resp = initValidateSDNCResp_Resp() - - when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(false) - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - - assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.validateSDNCResp(mex, resp, "create") })) - } - - @Test -// @Ignore - public void validateSDNCResp_BpmnError404() { - ExecutionEntity mex = setupMock() - initValidateSDNCResp(mex) - def resp = initValidateSDNCResp_Resp() - when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(true) - - when(mex.getVariable("WorkflowException")).thenThrow(new BpmnError("404", "expected exception")) - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - - DoCreateAllottedResourceBRGRollback.validateSDNCResp(mex, resp, "create") - } - - @Test -// @Ignore - public void validateSDNCResp_BpmnError() { - ExecutionEntity mex = setupMock() - initValidateSDNCResp(mex) - def resp = initValidateSDNCResp_Resp() - when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(true) - - when(mex.getVariable("WorkflowException")).thenThrow(new BpmnError("expected exception")) - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - - assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.validateSDNCResp(mex, resp, "create") })) - } - - @Test -// @Ignore - public void validateSDNCResp_Ex() { - ExecutionEntity mex = setupMock() - initValidateSDNCResp(mex) - def resp = initValidateSDNCResp_Resp() - when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(true) - - when(mex.getVariable("WorkflowException")).thenThrow(new RuntimeException("expected exception")) - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - - assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.validateSDNCResp(mex, resp, "create") })) - } - - @Test -// @Ignore - public void deleteAaiAR() { - ExecutionEntity mex = setupMock() - initDeleteAaiAR(mex) - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml") - MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS) - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - DoCreateAllottedResourceBRGRollback.deleteAaiAR(mex) - } - - @Test -// @Ignore - public void deleteAaiAR_NoArPath() { - ExecutionEntity mex = setupMock() - initDeleteAaiAR(mex) - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml") - MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS) - - when(mex.getVariable("aaiARPath")).thenReturn("") - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - - assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.deleteAaiAR(mex) })) - } - - @Test -// @Ignore - public void deleteAaiAR_BpmnError() { - ExecutionEntity mex = setupMock() - initDeleteAaiAR(mex) - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml") - MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS) - - when(mex.getVariable("aaiARPath")).thenThrow(new BpmnError("expected exception")) - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - - assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.deleteAaiAR(mex) })) - } - - @Test -// @Ignore - public void deleteAaiAR_Ex() { - ExecutionEntity mex = setupMock() - initDeleteAaiAR(mex) - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml") - MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS) - - when(mex.getVariable("aaiARPath")).thenThrow(new RuntimeException("expected exception")) - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - - assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.deleteAaiAR(mex) })) - } - - @Test -// @Ignore - public void postProcessRequest() { - ExecutionEntity mex = setupMock() - initPostProcessRequest(mex) - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - DoCreateAllottedResourceBRGRollback.postProcessRequest(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("rollbackData", null) - verify(mex).setVariable("rolledBack", true) - } - - @Test -// @Ignore - public void postProcessRequest_RolledBack() { - ExecutionEntity mex = setupMock() - initPostProcessRequest(mex) - - when(mex.getVariable("skipRollback")).thenReturn(true) - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - DoCreateAllottedResourceBRGRollback.postProcessRequest(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("rollbackData", null) - verify(mex, never()).setVariable("rolledBack", true) - } - - @Test -// @Ignore - public void postProcessRequest_BpmnError() { - ExecutionEntity mex = setupMock() - initPostProcessRequest(mex) - - when(mex.getVariable("skipRollback")).thenThrow(new BpmnError("expected exception")) - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - DoCreateAllottedResourceBRGRollback.postProcessRequest(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("rollbackData", null) - verify(mex, never()).setVariable("rolledBack", true) - } - - @Test -// @Ignore - public void postProcessRequest_Ex() { - ExecutionEntity mex = setupMock() - initPostProcessRequest(mex) - - when(mex.getVariable("skipRollback")).thenThrow(new RuntimeException("expected exception")) - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - DoCreateAllottedResourceBRGRollback.postProcessRequest(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("rollbackData", null) - verify(mex, never()).setVariable("rolledBack", true) - } - - @Test -// @Ignore - public void processRollbackException() { - ExecutionEntity mex = setupMock() - initProcessRollbackException(mex) - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - DoCreateAllottedResourceBRGRollback.processRollbackException(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("rollbackData", null) - verify(mex).setVariable("rolledBack", false) - verify(mex).setVariable("rollbackError", "Caught exception in AllottedResource Create Rollback") - verify(mex).setVariable("WorkflowException", null) - } - - @Test -// @Ignore - public void processRollbackException_BpmnError() { - ExecutionEntity mex = setupMock() - initProcessRollbackException(mex) - - doThrow(new BpmnError("expected exception")).when(mex).setVariable("rollbackData", null) - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - DoCreateAllottedResourceBRGRollback.processRollbackException(mex) - } - - @Test -// @Ignore - public void processRollbackException_Ex() { - ExecutionEntity mex = setupMock() - initProcessRollbackException(mex) - - doThrow(new RuntimeException("expected exception")).when(mex).setVariable("rollbackData", null) - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - DoCreateAllottedResourceBRGRollback.processRollbackException(mex) - } - - @Test -// @Ignore - public void processRollbackJavaException() { - ExecutionEntity mex = setupMock() - initProcessRollbackException(mex) - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - DoCreateAllottedResourceBRGRollback.processRollbackJavaException(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("rollbackData", null) - verify(mex).setVariable("rolledBack", false) - verify(mex).setVariable("rollbackError", "Caught Java exception in AllottedResource Create Rollback") - verify(mex, never()).setVariable("WorkflowException", null) - } - - @Test -// @Ignore - public void processRollbackJavaException_BpmnError() { - ExecutionEntity mex = setupMock() - initProcessRollbackException(mex) - - doThrow(new BpmnError("expected exception")).when(mex).setVariable("rollbackData", null) - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - DoCreateAllottedResourceBRGRollback.processRollbackJavaException(mex) - } - - @Test -// @Ignore - public void processRollbackJavaException_Ex() { - ExecutionEntity mex = setupMock() - initProcessRollbackException(mex) - - doThrow(new RuntimeException("expected exception")).when(mex).setVariable("rollbackData", null) - - DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback() - DoCreateAllottedResourceBRGRollback.processRollbackJavaException(mex) - } - - private RollbackData initPreProcess(ExecutionEntity mex) { - def data = new RollbackData() - - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("rollbackData")).thenReturn(data) - when(mex.getVariable("rollbackAAI")).thenReturn(true) - when(mex.getVariable("rollbackSDNC")).thenReturn(true) - when(mex.getVariable("disableRollback")).thenReturn("false") - - data.put("SERVICEINSTANCE", "allottedResourceId", "myid") - - data.put(RbType, "serviceInstanceId", "sii") - data.put(RbType, "parentServiceInstanceId", "psii") - - data.put(RbType, "rollbackAAI", "true") - data.put(RbType, "aaiARPath", "mypath") - - data.put(RbType, "rollbackSDNCassign", "true") - data.put(RbType, "rollbackSDNCactivate", "myactivate") - data.put(RbType, "rollbackSDNCcreate", "mycreate") - data.put(RbType, "sdncActivateRollbackReq", "activatereq") - data.put(RbType, "sdncCreateRollbackReq", "createreq") - data.put(RbType, "sdncAssignRollbackReq", "assignreq") - - return data - } - - private initUpdateAaiAROrchStatus(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("aaiARPath")).thenReturn(aaiUriPfx + "/aai/v9/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID) - when(mex.getVariable("URN_aai_endpoint")).thenReturn(aaiUriPfx) - } - - private initValidateSDNCResp(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("prefix")).thenReturn(Prefix) - when(mex.getVariable("SDNCA_SuccessIndicator")).thenReturn(true) - } - - private String initValidateSDNCResp_Resp() { - return "<response-data><response-code>200</response-code></response-data>" - } - - private initDeleteAaiAR(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("aaiARResourceVersion")).thenReturn(VERS) - when(mex.getVariable("aaiARPath")).thenReturn(aaiUriPfx + "/aai/v9/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID) - when(mex.getVariable("URN_aai_endpoint")).thenReturn(aaiUriPfx) - } - - private initPostProcessRequest(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("skipRollback")).thenReturn(false) - } - - private initProcessRollbackException(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - } - - private initProcessRollbackJavaException(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - } - -} 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 deleted file mode 100644 index c8afb228a9..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy +++ /dev/null @@ -1,996 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.bpmn.vcpe.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.junit.Before -import org.junit.BeforeClass -import org.junit.Rule -import org.junit.Test -import org.junit.Ignore -import org.mockito.MockitoAnnotations -import org.camunda.bpm.engine.delegate.BpmnError -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.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 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.MockPutAllottedResource_500 - -import org.openecomp.mso.bpmn.core.RollbackData -import org.openecomp.mso.bpmn.vcpe.scripts.MapSetter - -import com.github.tomakehurst.wiremock.junit.WireMockRule - -class DoCreateAllottedResourceBRGTest extends GroovyTestBase { - - @Rule - public WireMockRule wireMockRule = new WireMockRule(PORT) - - String Prefix = "DCARBRG_" - - @BeforeClass - public static void setUpBeforeClass() { - // nothing for now - } - - @Before - public void init() - { - MockitoAnnotations.initMocks(this) - } - - public DoCreateAllottedResourceBRGTest() { - super("DoCreateAllottedResourceBRG") - } - - - // ***** preProcessRequest ***** - - @Test -// @Ignore - public void preProcessRequest() { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG() - DoCreateAllottedResourceBRG.preProcessRequest(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("prefix", Prefix) - - assertTrue(checkMissingPreProcessRequest("URN_mso_workflow_sdncadapter_callback")) - assertTrue(checkMissingPreProcessRequest("URN_mso_workflow_sdnc_replication_delay")) - 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() { - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRG/getArBrg.xml") - - ExecutionEntity mex = setupMock() - initGetAaiAR(mex) - - DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG() - DoCreateAllottedResourceBRG.getAaiAR(mex) - - verify(mex).setVariable("foundActiveAR", true) - } - - @Test -// @Ignore - public void getAaiAR_Duplicate() { - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRG/getArBrg.xml") - - ExecutionEntity mex = setupMock() - initGetAaiAR(mex) - - // fail if duplicate - when(mex.getVariable("failExists")).thenReturn("true") - - DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG() - - assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRG.getAaiAR(mex) })) - } - - @Test -// @Ignore - public void getAaiAR_NotActive() { - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRG/getArBrg.xml") - - ExecutionEntity mex = setupMock() - initGetAaiAR(mex) - - // not active - when(mex.getVariable("aaiAROrchStatus")).thenReturn("not-active") - - DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG() - - assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRG.getAaiAR(mex) })) - } - - @Test -// @Ignore - public void getAaiAR_NoStatus() { - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRG/getArBrg.xml") - - ExecutionEntity mex = setupMock() - initGetAaiAR(mex) - - 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() - def map = setupMap(mex) - initCreateAaiAr(mex) - - MockPutAllottedResource(CUST, SVC, INST, ARID) - - DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG() - DoCreateAllottedResourceBRG.createAaiAR(mex) - - def data = map.get("rollbackData") - assertNotNull(data) - assertTrue(data instanceof RollbackData) - - assertEquals("45", data.get(Prefix, "disableRollback")) - assertEquals("true", data.get(Prefix, "rollbackAAI")) - assertEquals(ARID, data.get(Prefix, "allottedResourceId")) - assertEquals("sii", data.get(Prefix, "serviceInstanceId")) - assertEquals("psii", data.get(Prefix, "parentServiceInstanceId")) - assertEquals(mex.getVariable("PSI_resourceLink")+"/allotted-resources/allotted-resource/"+ARID, data.get(Prefix, "aaiARPath")) - } - - @Test -// @Ignore - public void createAaiAR_NoArid_NoModelUuids() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initCreateAaiAr(mex) - - // no allottedResourceId - will be generated - - when(mex.getVariable("allottedResourceId")).thenReturn(null) - - wireMockRule - .stubFor(put(urlMatching("/aai/.*/allotted-resource/.*")) - .willReturn(aResponse() - .withStatus(200))) - - DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG() - DoCreateAllottedResourceBRG.createAaiAR(mex) - - def arid = map.get("allottedResourceId") - assertNotNull(arid) - assertFalse(arid.isEmpty()) - - def data = map.get("rollbackData") - 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) - - MockPutAllottedResource(CUST, SVC, INST, ARID) - - DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG() - - assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceBRG.createAaiAR(mex) })) - } - - @Test -// @Ignore - public void createAaiAR_HttpFailed() { - ExecutionEntity mex = setupMock() - initCreateAaiAr(mex) - - MockPutAllottedResource_500(CUST, SVC, INST, ARID) - - 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")) - - MockPutAllottedResource(CUST, SVC, INST, ARID) - - 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")) - - MockPutAllottedResource(CUST, SVC, INST, ARID) - - 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>sii</") >= 0) - assertTrue(result.indexOf("<parent-service-instance-id>psii</") >= 0) - assertTrue(result.indexOf("<subscription-service-type>sst</") >= 0) - assertTrue(result.indexOf("<global-customer-id>gci</") >= 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>sii</") >= 0) - assertTrue(result.indexOf("<parent-service-instance-id>psii</") >= 0) - assertTrue(result.indexOf("<subscription-service-type>sst</") >= 0) - assertTrue(result.indexOf("<global-customer-id>gci</") >= 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 map = setupMap(mex) - def data = initPreProcessSDNC(mex) - - DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG() - DoCreateAllottedResourceBRG.preProcessSDNCAssign(mex) - - def req = map.get("sdncAssignRequest") - assertNotNull(req) - - assertEquals(data, map.get("rollbackData")) - - 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 map = setupMap(mex) - def data = initPreProcessSDNC(mex) - - DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG() - DoCreateAllottedResourceBRG.preProcessSDNCCreate(mex) - - def req = map.get("sdncCreateRequest") - assertNotNull(req) - - assertEquals(data, map.get("rollbackData")) - - 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 map = setupMap(mex) - def data = initPreProcessSDNC(mex) - - DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG() - DoCreateAllottedResourceBRG.preProcessSDNCActivate(mex) - - def req = map.get("sdncActivateRequest") - assertNotNull(req) - - assertEquals(data, map.get("rollbackData")) - - 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 map = setupMap(mex) - 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") - - assertEquals(data, map.get("rollbackData")) - - 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() - def map = setupMap(mex) - initPreProcessSDNCGet(mex) - - DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG() - DoCreateAllottedResourceBRG.preProcessSDNCGet(mex) - - String req = map.get("sdncGetRequest") - - 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() - def map = setupMap(mex) - initPreProcessSDNCGet(mex) - - when(mex.getVariable("foundActiveAR")).thenReturn(false) - - DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG() - DoCreateAllottedResourceBRG.preProcessSDNCGet(mex) - - String req = map.get("sdncGetRequest") - - 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() { - MockPatchAllottedResource(CUST, SVC, INST, ARID) - - 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(DBGFLAG)).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(DBGFLAG)).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(DBGFLAG)).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(DBGFLAG)).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(DBGFLAG)).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(DBGFLAG)).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(DBGFLAG)).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(DBGFLAG)).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(DBGFLAG)).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(DBGFLAG)).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(DBGFLAG)).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(DBGFLAG)).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 void initPreProcess(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("sdncurn") - when(mex.getVariable("URN_mso_workflow_sdnc_replication_delay")).thenReturn("sdncdelay") - 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 void initGetAaiAR(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("allottedResourceType")).thenReturn("BRGt") - when(mex.getVariable("allottedResourceRole")).thenReturn("BRGr") - when(mex.getVariable("CSI_service")).thenReturn(FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceBRG/getAR.xml")) - when(mex.getVariable("URN_aai_endpoint")).thenReturn(aaiUriPfx) - when(mex.getVariable("aaiAROrchStatus")).thenReturn("Active") - } - - 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(DBGFLAG)).thenReturn("true") - when(mex.getVariable("allottedResourceId")).thenReturn(ARID) - 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/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST) - 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(DBGFLAG)).thenReturn("true") - when(mex.getVariable("allottedResourceId")).thenReturn("ari") - when(mex.getVariable("serviceInstanceId")).thenReturn("sii") - when(mex.getVariable("parentServiceInstanceId")).thenReturn("psii") - when(mex.getVariable("subscriptionServiceType")).thenReturn("sst") - when(mex.getVariable("globalCustomerId")).thenReturn("gci") - 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(DBGFLAG)).thenReturn("true") - when(mex.getVariable("rollbackData")).thenReturn(data) - - return data - } - - private initPreProcessSDNCGet(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).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><object-path>assignlink</object-path></response-data>") - when(mex.getVariable("serviceInstanceId")).thenReturn("sii") - when(mex.getVariable("sdncCallbackUrl")).thenReturn("myurl") - } - - private RollbackData initValidateSDNCResp(ExecutionEntity mex) { - def data = new RollbackData() - - when(mex.getVariable(DBGFLAG)).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><response-code>200</response-code></response-data>" - } - - private initUpdateAaiAROrchStatus(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("aaiARPath")).thenReturn(aaiUriPfx + "/aai/v9/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID) - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollbackTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollbackTest.groovy deleted file mode 100644 index 9b4283bb82..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollbackTest.groovy +++ /dev/null @@ -1,652 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.bpmn.vcpe.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.junit.Before -import org.junit.BeforeClass -import org.junit.Rule -import org.junit.Test -import org.junit.Ignore -import org.mockito.MockitoAnnotations -import org.camunda.bpm.engine.delegate.BpmnError -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.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.MockDeleteAllottedResource -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource - -import org.openecomp.mso.bpmn.core.RollbackData - -import com.github.tomakehurst.wiremock.junit.WireMockRule - -class DoCreateAllottedResourceTXCRollbackTest extends GroovyTestBase { - - @Rule - public WireMockRule wireMockRule = new WireMockRule(PORT) - - String Prefix = "DCARTXCRB_" - String RbType = "DCARTXC_" - - @BeforeClass - public static void setUpBeforeClass() { - // nothing for now - } - - @Before - public void init() - { - MockitoAnnotations.initMocks(this) - } - - public DoCreateAllottedResourceTXCRollbackTest() { - super("DoCreateAllottedResourceTXCRollback") - } - - - // ***** preProcessRequest ***** - - @Test -// @Ignore - public void preProcessRequest() { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - DoCreateAllottedResourceTXCRollback.preProcessRequest(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("prefix", Prefix) - verify(mex).setVariable("serviceInstanceId", "sii") - verify(mex).setVariable("parentServiceInstanceId", "psii") - verify(mex).setVariable("allottedResourceId", "myid") - verify(mex).setVariable("rollbackAAI", true) - verify(mex).setVariable("aaiARPath", "mypath") - verify(mex).setVariable("rollbackSDNC", true) - verify(mex).setVariable("deactivateSdnc", "myactivate") - verify(mex).setVariable("deleteSdnc", "mycreate") - verify(mex).setVariable("unassignSdnc", "true") - verify(mex).setVariable("sdncDeactivateRequest", "activatereq") - verify(mex).setVariable("sdncDeleteRequest", "createreq") - verify(mex).setVariable("sdncUnassignRequest", "assignreq") - - verify(mex, never()).setVariable("skipRollback", true) - } - - @Test -// @Ignore - public void preProcessRequest_RollbackDisabled() { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - when(mex.getVariable("disableRollback")).thenReturn("true") - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - DoCreateAllottedResourceTXCRollback.preProcessRequest(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("prefix", Prefix) - verify(mex).setVariable("serviceInstanceId", "sii") - verify(mex).setVariable("parentServiceInstanceId", "psii") - verify(mex).setVariable("allottedResourceId", "myid") - verify(mex).setVariable("rollbackAAI", true) - verify(mex).setVariable("aaiARPath", "mypath") - verify(mex).setVariable("rollbackSDNC", true) - verify(mex).setVariable("deactivateSdnc", "myactivate") - verify(mex).setVariable("deleteSdnc", "mycreate") - verify(mex).setVariable("unassignSdnc", "true") - verify(mex).setVariable("sdncDeactivateRequest", "activatereq") - verify(mex).setVariable("sdncDeleteRequest", "createreq") - verify(mex).setVariable("sdncUnassignRequest", "assignreq") - - verify(mex).setVariable("skipRollback", true) - } - - @Test -// @Ignore - public void preProcessRequest_NoAAI() { - ExecutionEntity mex = setupMock() - def data = initPreProcess(mex) - - when(mex.getVariable("rollbackAAI")).thenReturn(false) - data.put(RbType, "rollbackAAI", "false") - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - DoCreateAllottedResourceTXCRollback.preProcessRequest(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("prefix", Prefix) - verify(mex).setVariable("serviceInstanceId", "sii") - verify(mex).setVariable("parentServiceInstanceId", "psii") - verify(mex).setVariable("allottedResourceId", "myid") - verify(mex, never()).setVariable("rollbackAAI", true) - verify(mex, never()).setVariable("aaiARPath", "mypath") - verify(mex).setVariable("rollbackSDNC", true) - verify(mex).setVariable("deactivateSdnc", "myactivate") - verify(mex).setVariable("deleteSdnc", "mycreate") - verify(mex).setVariable("unassignSdnc", "true") - verify(mex).setVariable("sdncDeactivateRequest", "activatereq") - verify(mex).setVariable("sdncDeleteRequest", "createreq") - verify(mex).setVariable("sdncUnassignRequest", "assignreq") - - verify(mex, never()).setVariable("skipRollback", true) - } - - @Test -// @Ignore - public void preProcessRequest_NoAssign() { - ExecutionEntity mex = setupMock() - def data = initPreProcess(mex) - - when(mex.getVariable("rollbackSDNC")).thenReturn(false) - data.put(RbType, "rollbackSDNCassign", "false") - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - DoCreateAllottedResourceTXCRollback.preProcessRequest(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("prefix", Prefix) - verify(mex).setVariable("serviceInstanceId", "sii") - verify(mex).setVariable("parentServiceInstanceId", "psii") - verify(mex).setVariable("allottedResourceId", "myid") - verify(mex).setVariable("rollbackAAI", true) - verify(mex).setVariable("aaiARPath", "mypath") - verify(mex, never()).setVariable("rollbackSDNC", true) - verify(mex, never()).setVariable("deactivateSdnc", "myactivate") - verify(mex, never()).setVariable("deleteSdnc", "mycreate") - verify(mex, never()).setVariable("unassignSdnc", "true") - verify(mex, never()).setVariable("sdncDeactivateRequest", "activatereq") - verify(mex, never()).setVariable("sdncDeleteRequest", "createreq") - verify(mex, never()).setVariable("sdncUnassignRequest", "assignreq") - - verify(mex, never()).setVariable("skipRollback", true) - } - - @Test -// @Ignore - public void preProcessRequest_NoAAI_NoAssign() { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - when(mex.getVariable("rollbackAAI")).thenReturn(false) - when(mex.getVariable("rollbackSDNC")).thenReturn(false) - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - DoCreateAllottedResourceTXCRollback.preProcessRequest(mex) - - verify(mex).setVariable("skipRollback", true) - } - - @Test -// @Ignore - public void preProcessRequest_NoRbStructure() { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - when(mex.getVariable("rollbackData")).thenReturn(new RollbackData()) - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - DoCreateAllottedResourceTXCRollback.preProcessRequest(mex) - - verify(mex).setVariable("skipRollback", true) - } - - @Test -// @Ignore - public void preProcessRequest_NullRb() { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - when(mex.getVariable("rollbackData")).thenReturn(null) - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - DoCreateAllottedResourceTXCRollback.preProcessRequest(mex) - - verify(mex).setVariable("skipRollback", true) - } - - @Test -// @Ignore - public void preProcessRequest_BpmnError() { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - when(mex.getVariable("rollbackData")).thenThrow(new BpmnError("expected exception")) - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - - assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceTXCRollback.preProcessRequest(mex) })) - } - - @Test -// @Ignore - public void preProcessRequest_Ex() { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - when(mex.getVariable("rollbackData")).thenThrow(new RuntimeException("expected exception")) - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - - assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceTXCRollback.preProcessRequest(mex) })) - } - - @Test -// @Ignore - public void updateAaiAROrchStatus() { - ExecutionEntity mex = setupMock() - initUpdateAaiAROrchStatus(mex) - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml") - MockPatchAllottedResource(CUST, SVC, INST, ARID) - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - DoCreateAllottedResourceTXCRollback.updateAaiAROrchStatus(mex, "success") - } - - @Test -// @Ignore - public void updateAaiAROrchStatus_EmptyResponse() { - ExecutionEntity mex = setupMock() - initUpdateAaiAROrchStatus(mex) - - wireMockRule - .stubFor(get(urlMatching("/aai/v[0-9]+/.*")) - .willReturn(aResponse() - .withStatus(200))) - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - - assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceTXCRollback.updateAaiAROrchStatus(mex, "success") })) - } - - @Test -// @Ignore - public void updateAaiAROrchStatus_NoArPath() { - ExecutionEntity mex = setupMock() - initUpdateAaiAROrchStatus(mex) - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml") - MockPatchAllottedResource(CUST, SVC, INST, ARID) - - when(mex.getVariable("aaiARPath")).thenReturn(null) - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - - assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceTXCRollback.updateAaiAROrchStatus(mex, "success") })) - } - - - // ***** validateSDNCResp ***** - - @Test -// @Ignore - public void validateSDNCResp() { - ExecutionEntity mex = setupMock() - initValidateSDNCResp(mex) - def resp = initValidateSDNCResp_Resp() - - when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(true) - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - - DoCreateAllottedResourceTXCRollback.validateSDNCResp(mex, resp, "create") - - verify(mex).getVariable("WorkflowException") - verify(mex).getVariable("SDNCA_SuccessIndicator") - } - - @Test -// @Ignore - public void validateSDNCResp_Unsuccessful() { - ExecutionEntity mex = setupMock() - initValidateSDNCResp(mex) - def resp = initValidateSDNCResp_Resp() - - when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(false) - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - - assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceTXCRollback.validateSDNCResp(mex, resp, "create") })) - } - - @Test -// @Ignore - public void validateSDNCResp_BpmnError404() { - ExecutionEntity mex = setupMock() - initValidateSDNCResp(mex) - def resp = initValidateSDNCResp_Resp() - when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(true) - - when(mex.getVariable("WorkflowException")).thenThrow(new BpmnError("404", "expected exception")) - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - - DoCreateAllottedResourceTXCRollback.validateSDNCResp(mex, resp, "create") - } - - @Test -// @Ignore - public void validateSDNCResp_BpmnError() { - ExecutionEntity mex = setupMock() - initValidateSDNCResp(mex) - def resp = initValidateSDNCResp_Resp() - when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(true) - - when(mex.getVariable("WorkflowException")).thenThrow(new BpmnError("expected exception")) - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - - assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceTXCRollback.validateSDNCResp(mex, resp, "create") })) - } - - @Test -// @Ignore - public void validateSDNCResp_Ex() { - ExecutionEntity mex = setupMock() - initValidateSDNCResp(mex) - def resp = initValidateSDNCResp_Resp() - when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(true) - - when(mex.getVariable("WorkflowException")).thenThrow(new RuntimeException("expected exception")) - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - - assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceTXCRollback.validateSDNCResp(mex, resp, "create") })) - } - - @Test -// @Ignore - public void deleteAaiAR() { - ExecutionEntity mex = setupMock() - initDeleteAaiAR(mex) - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml") - MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS) - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - DoCreateAllottedResourceTXCRollback.deleteAaiAR(mex) - } - - @Test -// @Ignore - public void deleteAaiAR_NoArPath() { - ExecutionEntity mex = setupMock() - initDeleteAaiAR(mex) - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml") - MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS) - - when(mex.getVariable("aaiARPath")).thenReturn("") - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - - assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceTXCRollback.deleteAaiAR(mex) })) - } - - @Test -// @Ignore - public void deleteAaiAR_BpmnError() { - ExecutionEntity mex = setupMock() - initDeleteAaiAR(mex) - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml") - MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS) - - when(mex.getVariable("aaiARPath")).thenThrow(new BpmnError("expected exception")) - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - - assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceTXCRollback.deleteAaiAR(mex) })) - } - - @Test -// @Ignore - public void deleteAaiAR_Ex() { - ExecutionEntity mex = setupMock() - initDeleteAaiAR(mex) - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml") - MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS) - - when(mex.getVariable("aaiARPath")).thenThrow(new RuntimeException("expected exception")) - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - - assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceTXCRollback.deleteAaiAR(mex) })) - } - - @Test -// @Ignore - public void postProcessRequest() { - ExecutionEntity mex = setupMock() - initPostProcessRequest(mex) - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - DoCreateAllottedResourceTXCRollback.postProcessRequest(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("rollbackData", null) - verify(mex).setVariable("rolledBack", true) - } - - @Test -// @Ignore - public void postProcessRequest_RolledBack() { - ExecutionEntity mex = setupMock() - initPostProcessRequest(mex) - - when(mex.getVariable("skipRollback")).thenReturn(true) - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - DoCreateAllottedResourceTXCRollback.postProcessRequest(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("rollbackData", null) - verify(mex, never()).setVariable("rolledBack", true) - } - - @Test -// @Ignore - public void postProcessRequest_BpmnError() { - ExecutionEntity mex = setupMock() - initPostProcessRequest(mex) - - when(mex.getVariable("skipRollback")).thenThrow(new BpmnError("expected exception")) - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - DoCreateAllottedResourceTXCRollback.postProcessRequest(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("rollbackData", null) - verify(mex, never()).setVariable("rolledBack", true) - } - - @Test -// @Ignore - public void postProcessRequest_Ex() { - ExecutionEntity mex = setupMock() - initPostProcessRequest(mex) - - when(mex.getVariable("skipRollback")).thenThrow(new RuntimeException("expected exception")) - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - DoCreateAllottedResourceTXCRollback.postProcessRequest(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("rollbackData", null) - verify(mex, never()).setVariable("rolledBack", true) - } - - @Test -// @Ignore - public void processRollbackException() { - ExecutionEntity mex = setupMock() - initProcessRollbackException(mex) - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - DoCreateAllottedResourceTXCRollback.processRollbackException(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("rollbackData", null) - verify(mex).setVariable("rolledBack", false) - verify(mex).setVariable("rollbackError", "Caught exception in AllottedResource Create Rollback") - verify(mex).setVariable("WorkflowException", null) - } - - @Test -// @Ignore - public void processRollbackException_BpmnError() { - ExecutionEntity mex = setupMock() - initProcessRollbackException(mex) - - doThrow(new BpmnError("expected exception")).when(mex).setVariable("rollbackData", null) - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - DoCreateAllottedResourceTXCRollback.processRollbackException(mex) - } - - @Test -// @Ignore - public void processRollbackException_Ex() { - ExecutionEntity mex = setupMock() - initProcessRollbackException(mex) - - doThrow(new RuntimeException("expected exception")).when(mex).setVariable("rollbackData", null) - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - DoCreateAllottedResourceTXCRollback.processRollbackException(mex) - } - - @Test -// @Ignore - public void processRollbackJavaException() { - ExecutionEntity mex = setupMock() - initProcessRollbackException(mex) - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - DoCreateAllottedResourceTXCRollback.processRollbackJavaException(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("rollbackData", null) - verify(mex).setVariable("rolledBack", false) - verify(mex).setVariable("rollbackError", "Caught Java exception in AllottedResource Create Rollback") - verify(mex, never()).setVariable("WorkflowException", null) - } - - @Test -// @Ignore - public void processRollbackJavaException_BpmnError() { - ExecutionEntity mex = setupMock() - initProcessRollbackException(mex) - - doThrow(new BpmnError("expected exception")).when(mex).setVariable("rollbackData", null) - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - DoCreateAllottedResourceTXCRollback.processRollbackJavaException(mex) - } - - @Test -// @Ignore - public void processRollbackJavaException_Ex() { - ExecutionEntity mex = setupMock() - initProcessRollbackException(mex) - - doThrow(new RuntimeException("expected exception")).when(mex).setVariable("rollbackData", null) - - DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback() - DoCreateAllottedResourceTXCRollback.processRollbackJavaException(mex) - } - - private RollbackData initPreProcess(ExecutionEntity mex) { - def data = new RollbackData() - - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("rollbackData")).thenReturn(data) - when(mex.getVariable("rollbackAAI")).thenReturn(true) - when(mex.getVariable("rollbackSDNC")).thenReturn(true) - when(mex.getVariable("disableRollback")).thenReturn("false") - - data.put("SERVICEINSTANCE", "allottedResourceId", "myid") - - data.put(RbType, "serviceInstanceId", "sii") - data.put(RbType, "parentServiceInstanceId", "psii") - - data.put(RbType, "rollbackAAI", "true") - data.put(RbType, "aaiARPath", "mypath") - - data.put(RbType, "rollbackSDNCassign", "true") - data.put(RbType, "rollbackSDNCactivate", "myactivate") - data.put(RbType, "rollbackSDNCcreate", "mycreate") - data.put(RbType, "sdncActivateRollbackReq", "activatereq") - data.put(RbType, "sdncCreateRollbackReq", "createreq") - data.put(RbType, "sdncAssignRollbackReq", "assignreq") - - return data - } - - private initUpdateAaiAROrchStatus(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("aaiARPath")).thenReturn(aaiUriPfx + "/aai/v9/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID) - when(mex.getVariable("URN_aai_endpoint")).thenReturn(aaiUriPfx) - } - - private initValidateSDNCResp(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("prefix")).thenReturn(Prefix) - when(mex.getVariable("SDNCA_SuccessIndicator")).thenReturn(true) - } - - private String initValidateSDNCResp_Resp() { - return "<response-data><response-code>200</response-code></response-data>" - } - - private initDeleteAaiAR(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("aaiARResourceVersion")).thenReturn(VERS) - when(mex.getVariable("aaiARPath")).thenReturn(aaiUriPfx + "/aai/v9/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID) - when(mex.getVariable("URN_aai_endpoint")).thenReturn(aaiUriPfx) - } - - private initPostProcessRequest(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("skipRollback")).thenReturn(false) - } - - private initProcessRollbackException(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - } - - private initProcessRollbackJavaException(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCTest.groovy deleted file mode 100644 index e1fc143576..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCTest.groovy +++ /dev/null @@ -1,950 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.bpmn.vcpe.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.junit.Before -import org.junit.BeforeClass -import org.junit.Rule -import org.junit.Test -import org.junit.Ignore -import org.mockito.MockitoAnnotations -import org.camunda.bpm.engine.delegate.BpmnError -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.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 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.MockPutAllottedResource_500 - -import java.util.Map - -import org.openecomp.mso.bpmn.core.RollbackData -import org.openecomp.mso.bpmn.vcpe.scripts.MapSetter - -import com.github.tomakehurst.wiremock.junit.WireMockRule - -class DoCreateAllottedResourceTXCTest extends GroovyTestBase { - - @Rule - public WireMockRule wireMockRule = new WireMockRule(PORT) - - String Prefix = "DCARTXC_" - - @BeforeClass - public static void setUpBeforeClass() { - // nothing for now - } - - @Before - public void init() - { - MockitoAnnotations.initMocks(this) - } - - public DoCreateAllottedResourceTXCTest() { - super("DoCreateAllottedResourceTXC") - } - - - // ***** preProcessRequest ***** - - @Test - // @Ignore - public void preProcessRequest() { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - DoCreateAllottedResourceTXC.preProcessRequest(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("prefix", Prefix) - - assertTrue(checkMissingPreProcessRequest("URN_mso_workflow_sdncadapter_callback")) - assertTrue(checkMissingPreProcessRequest("URN_mso_workflow_sdnc_replication_delay")) - assertTrue(checkMissingPreProcessRequest("serviceInstanceId")) - assertTrue(checkMissingPreProcessRequest("parentServiceInstanceId")) - assertTrue(checkMissingPreProcessRequest("allottedResourceModelInfo")) - assertTrue(checkMissingPreProcessRequest("brgWanMacAddress")) - assertTrue(checkMissingPreProcessRequest("allottedResourceRole")) - assertTrue(checkMissingPreProcessRequest("allottedResourceType")) - } - - - // ***** getAaiAR ***** - - @Test - // @Ignore - public void getAaiAR() { - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc.xml") - - ExecutionEntity mex = setupMock() - initGetAaiAR(mex) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - DoCreateAllottedResourceTXC.getAaiAR(mex) - - verify(mex).setVariable("foundActiveAR", true) - } - - @Test - // @Ignore - public void getAaiAR_Duplicate() { - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc.xml") - - ExecutionEntity mex = setupMock() - initGetAaiAR(mex) - - // fail if duplicate - when(mex.getVariable("failExists")).thenReturn("true") - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - - assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceTXC.getAaiAR(mex) })) - } - - @Test - // @Ignore - public void getAaiAR_NotActive() { - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc.xml") - - ExecutionEntity mex = setupMock() - initGetAaiAR(mex) - - // not active - when(mex.getVariable("aaiAROrchStatus")).thenReturn("not-active") - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - - assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceTXC.getAaiAR(mex) })) - } - - @Test - // @Ignore - public void getAaiAR_NoStatus() { - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc.xml") - - ExecutionEntity mex = setupMock() - initGetAaiAR(mex) - - when(mex.getVariable("aaiAROrchStatus")).thenReturn(null) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - DoCreateAllottedResourceTXC.getAaiAR(mex) - - verify(mex, never()).setVariable("foundActiveAR", true) - } - - - // ***** createAaiAR ***** - - @Test - // @Ignore - public void createAaiAR() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initCreateAaiAr(mex) - - MockPutAllottedResource(CUST, SVC, INST, ARID) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - DoCreateAllottedResourceTXC.createAaiAR(mex) - - def data = map.get("rollbackData") - assertNotNull(data) - assertTrue(data instanceof RollbackData) - - assertEquals("45", data.get(Prefix, "disableRollback")) - assertEquals("true", data.get(Prefix, "rollbackAAI")) - assertEquals(ARID, data.get(Prefix, "allottedResourceId")) - assertEquals("sii", data.get(Prefix, "serviceInstanceId")) - assertEquals("psii", data.get(Prefix, "parentServiceInstanceId")) - assertEquals(mex.getVariable("PSI_resourceLink")+"/allotted-resources/allotted-resource/"+ARID, data.get(Prefix, "aaiARPath")) - } - - @Test - // @Ignore - public void createAaiAR_NoArid_NoModelUuids() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initCreateAaiAr(mex) - - // no allottedResourceId - will be generated - - when(mex.getVariable("allottedResourceId")).thenReturn(null) - - wireMockRule - .stubFor(put(urlMatching("/aai/.*/allotted-resource/.*")) - .willReturn(aResponse() - .withStatus(200))) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - DoCreateAllottedResourceTXC.createAaiAR(mex) - - def arid = map.get("allottedResourceId") - assertNotNull(arid) - assertFalse(arid.isEmpty()) - - def data = map.get("rollbackData") - 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) - - MockPutAllottedResource(CUST, SVC, INST, ARID) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - - assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceTXC.createAaiAR(mex) })) - } - - @Test - // @Ignore - public void createAaiAR_HttpFailed() { - ExecutionEntity mex = setupMock() - initCreateAaiAr(mex) - - MockPutAllottedResource_500(CUST, SVC, INST, ARID) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - - assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceTXC.createAaiAR(mex) })) - } - - @Test - // @Ignore - public void createAaiAR_BpmnError() { - ExecutionEntity mex = setupMock() - initCreateAaiAr(mex) - - when(mex.getVariable("URN_aai_endpoint")).thenThrow(new BpmnError("expected exception")) - - MockPutAllottedResource(CUST, SVC, INST, ARID) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - - assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceTXC.createAaiAR(mex) })) - } - - @Test - // @Ignore - public void createAaiAR_Ex() { - ExecutionEntity mex = setupMock() - initCreateAaiAr(mex) - - when(mex.getVariable("URN_aai_endpoint")).thenThrow(new RuntimeException("expected exception")) - - MockPutAllottedResource(CUST, SVC, INST, ARID) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - - assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceTXC.createAaiAR(mex) })) - } - - - // ***** buildSDNCRequest ***** - - @Test - // @Ignore - public void buildSDNCRequest() { - ExecutionEntity mex = setupMock() - initBuildSDNCRequest(mex) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - - String result = DoCreateAllottedResourceTXC.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>sii</") >= 0) - assertTrue(result.indexOf("<parent-service-instance-id>psii</") >= 0) - assertTrue(result.indexOf("<subscription-service-type>sst</") >= 0) - assertTrue(result.indexOf("<global-customer-id>gci</") >= 0) - assertTrue(result.indexOf("<sdncadapter:CallbackUrl>scu</") >= 0) - assertTrue(result.indexOf("<request-id>mri</") >= 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")) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - - assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceTXC.buildSDNCRequest(mex, "myact", "myreq") })) - } - - - // ***** preProcessSDNCAssign ***** - - @Test - // @Ignore - public void preProcessSDNCAssign() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - def data = initPreProcessSDNC(mex) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - DoCreateAllottedResourceTXC.preProcessSDNCAssign(mex) - - def req = map.get("sdncAssignRequest") - assertNotNull(req) - - assertEquals(data, map.get("rollbackData")) - - def rbreq = data.get(Prefix, "sdncAssignRollbackReq") - - assertTrue(req.indexOf("<sdncadapter:SvcAction>assign</") >= 0) - assertTrue(req.indexOf("<request-action>CreateTunnelXConnInstance</") >= 0) - assertTrue(req.indexOf("<sdncadapter:RequestId>") >= 0) - - assertTrue(rbreq.indexOf("<sdncadapter:SvcAction>unassign</") >= 0) - assertTrue(rbreq.indexOf("<request-action>DeleteTunnelXConnInstance</") >= 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")) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - - assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceTXC.preProcessSDNCAssign(mex) })) - } - - @Test - // @Ignore - public void preProcessSDNCAssign_Ex() { - ExecutionEntity mex = setupMock() - initPreProcessSDNC(mex) - - when(mex.getVariable("rollbackData")).thenThrow(new RuntimeException("expected exception")) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - - assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceTXC.preProcessSDNCAssign(mex) })) - } - - - // ***** preProcessSDNCCreate ***** - - @Test - // @Ignore - public void preProcessSDNCCreate() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - def data = initPreProcessSDNC(mex) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - DoCreateAllottedResourceTXC.preProcessSDNCCreate(mex) - - def req = map.get("sdncCreateRequest") - assertNotNull(req) - - assertEquals(data, map.get("rollbackData")) - - def rbreq = data.get(Prefix, "sdncCreateRollbackReq") - - assertTrue(req.indexOf("<sdncadapter:SvcAction>create</") >= 0) - assertTrue(req.indexOf("<request-action>CreateTunnelXConnInstance</") >= 0) - assertTrue(req.indexOf("<sdncadapter:RequestId>") >= 0) - - assertTrue(rbreq.indexOf("<sdncadapter:SvcAction>delete</") >= 0) - assertTrue(rbreq.indexOf("<request-action>DeleteTunnelXConnInstance</") >= 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")) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - - assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceTXC.preProcessSDNCCreate(mex) })) - } - - @Test - // @Ignore - public void preProcessSDNCCreate_Ex() { - ExecutionEntity mex = setupMock() - initPreProcessSDNC(mex) - - when(mex.getVariable("rollbackData")).thenThrow(new RuntimeException("expected exception")) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - - assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceTXC.preProcessSDNCCreate(mex) })) - } - - - // ***** preProcessSDNCActivate ***** - - @Test - // @Ignore - public void preProcessSDNCActivate() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - def data = initPreProcessSDNC(mex) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - DoCreateAllottedResourceTXC.preProcessSDNCActivate(mex) - - def req = map.get("sdncActivateRequest") - assertNotNull(req) - - assertEquals(data, map.get("rollbackData")) - - def rbreq = data.get(Prefix, "sdncActivateRollbackReq") - - assertTrue(req.indexOf("<sdncadapter:SvcAction>activate</") >= 0) - assertTrue(req.indexOf("<request-action>CreateTunnelXConnInstance</") >= 0) - assertTrue(req.indexOf("<sdncadapter:RequestId>") >= 0) - - assertTrue(rbreq.indexOf("<sdncadapter:SvcAction>deactivate</") >= 0) - assertTrue(rbreq.indexOf("<request-action>DeleteTunnelXConnInstance</") >= 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")) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - - assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceTXC.preProcessSDNCActivate(mex) })) - } - - @Test - // @Ignore - public void preProcessSDNCActivate_Ex() { - ExecutionEntity mex = setupMock() - initPreProcessSDNC(mex) - - when(mex.getVariable("rollbackData")).thenThrow(new RuntimeException("expected exception")) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - - assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceTXC.preProcessSDNCActivate(mex) })) - } - - - // ***** validateSDNCResp ***** - - @Test - // @Ignore - public void validateSDNCResp() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - def data = initValidateSDNCResp(mex) - def resp = initValidateSDNCResp_Resp() - - when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(true) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - - DoCreateAllottedResourceTXC.validateSDNCResp(mex, resp, "create") - - verify(mex).getVariable("WorkflowException") - verify(mex).getVariable("SDNCA_SuccessIndicator") - verify(mex).getVariable("rollbackData") - - assertEquals(data, map.get("rollbackData")) - - 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) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - - DoCreateAllottedResourceTXC.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) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - - assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceTXC.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")) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - - assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceTXC.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")) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - - assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceTXC.validateSDNCResp(mex, resp, "create") })) - } - - - // ***** preProcessSDNCGet ***** - - @Test - // @Ignore - public void preProcessSDNCGet_FoundAR() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPreProcessSDNCGet(mex) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - DoCreateAllottedResourceTXC.preProcessSDNCGet(mex) - - String req = map.get("sdncGetRequest") - - 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() - def map = setupMap(mex) - initPreProcessSDNCGet(mex) - - when(mex.getVariable("foundActiveAR")).thenReturn(false) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - DoCreateAllottedResourceTXC.preProcessSDNCGet(mex) - - String req = map.get("sdncGetRequest") - - 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")) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - - assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceTXC.preProcessSDNCGet(mex) })) - } - - - // ***** updateAaiAROrchStatus ***** - - @Test - // @Ignore - public void updateAaiAROrchStatus() { - MockPatchAllottedResource(CUST, SVC, INST, ARID) - - ExecutionEntity mex = setupMock() - initUpdateAaiAROrchStatus(mex) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - DoCreateAllottedResourceTXC.updateAaiAROrchStatus(mex, "success") - } - - - // ***** generateOutputs ***** - - @Test - // @Ignore - public void generateOutputs() { - ExecutionEntity mex = setupMock() - def txctop = FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceTXC/SDNCTopologyQueryCallback.xml") - - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("enhancedCallbackRequestData")).thenReturn(txctop) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - DoCreateAllottedResourceTXC.generateOutputs(mex) - - verify(mex).setVariable("allotedResourceName", "namefromrequest") - verify(mex).setVariable("vni", "my-vni") - verify(mex).setVariable("vgmuxBearerIP", "my-bearer-ip") - verify(mex).setVariable("vgmuxLanIP", "my-lan-ip") - - } - - @Test - // @Ignore - public void generateOutputs_BadXml() { - ExecutionEntity mex = setupMock() - - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("enhancedCallbackRequestData")).thenReturn("invalid xml") - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - DoCreateAllottedResourceTXC.generateOutputs(mex) - - verify(mex, never()).setVariable(anyString(), anyString()) - - } - - @Test - // @Ignore - public void generateOutputs_BpmnError() { - ExecutionEntity mex = setupMock() - - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("enhancedCallbackRequestData")).thenThrow(new BpmnError("expected exception")) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - - DoCreateAllottedResourceTXC.generateOutputs(mex) - verify(mex, never()).setVariable(anyString(), anyString()) - - } - - @Test - // @Ignore - public void generateOutputs_Ex() { - ExecutionEntity mex = setupMock() - - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("enhancedCallbackRequestData")).thenThrow(new RuntimeException("expected exception")) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - - DoCreateAllottedResourceTXC.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(DBGFLAG)).thenReturn("true") - when(mex.getVariable("WorkflowException")).thenReturn(wfe) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - DoCreateAllottedResourceTXC.preProcessRollback(mex) - - verify(mex).setVariable("prevWorkflowException", wfe) - - } - - @Test - // @Ignore - public void preProcessRollback_NotWFE() { - ExecutionEntity mex = setupMock() - - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("WorkflowException")).thenReturn("I'm not a WFE") - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - DoCreateAllottedResourceTXC.preProcessRollback(mex) - -// verify(mex, never()).setVariable("prevWorkflowException", any()) - - } - - @Test - // @Ignore - public void preProcessRollback_BpmnError() { - ExecutionEntity mex = setupMock() - - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("WorkflowException")).thenThrow(new BpmnError("expected exception")) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - - DoCreateAllottedResourceTXC.preProcessRollback(mex) - - } - - @Test - // @Ignore - public void preProcessRollback_Ex() { - ExecutionEntity mex = setupMock() - - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("WorkflowException")).thenThrow(new RuntimeException("expected exception")) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - - DoCreateAllottedResourceTXC.preProcessRollback(mex) - - } - - - // ***** postProcessRollback ***** - - @Test - // @Ignore - public void postProcessRollback() { - ExecutionEntity mex = setupMock() - WorkflowException wfe = mock(WorkflowException.class) - - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("prevWorkflowException")).thenReturn(wfe) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - DoCreateAllottedResourceTXC.postProcessRollback(mex) - - verify(mex).setVariable("WorkflowException", wfe) - verify(mex).setVariable("rollbackData", null) - - } - - @Test - // @Ignore - public void postProcessRollback_NotWFE() { - ExecutionEntity mex = setupMock() - - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("prevWorkflowException")).thenReturn("I'm not a WFE") - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - DoCreateAllottedResourceTXC.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(DBGFLAG)).thenReturn("true") - when(mex.getVariable("prevWorkflowException")).thenThrow(new BpmnError("expected exception")) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - - assertTrue(doBpmnError({ _ -> DoCreateAllottedResourceTXC.postProcessRollback(mex) })) - verify(mex, never()).setVariable("rollbackData", null) - - } - - @Test - // @Ignore - public void postProcessRollback_Ex() { - ExecutionEntity mex = setupMock() - - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("prevWorkflowException")).thenThrow(new RuntimeException("expected exception")) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - - DoCreateAllottedResourceTXC.postProcessRollback(mex) - verify(mex, never()).setVariable("rollbackData", null) - - } - - private boolean checkMissingPreProcessRequest(String fieldnm) { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC() - - when(mex.getVariable(fieldnm)).thenReturn("") - - return doBpmnError( { _ -> DoCreateAllottedResourceTXC.preProcessRequest(mex) }) - } - - private void initPreProcess(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("sdncurn") - when(mex.getVariable("URN_mso_workflow_sdnc_replication_delay")).thenReturn("sdncdelay") - when(mex.getVariable("serviceInstanceId")).thenReturn("sii") - when(mex.getVariable("parentServiceInstanceId")).thenReturn("psii") - when(mex.getVariable("allottedResourceModelInfo")).thenReturn("armi") - when(mex.getVariable("brgWanMacAddress")).thenReturn("bwma") - when(mex.getVariable("allottedResourceRole")).thenReturn("arr") - when(mex.getVariable("allottedResourceType")).thenReturn("art") - } - - private void initGetAaiAR(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("allottedResourceType")).thenReturn("TXCt") - when(mex.getVariable("allottedResourceRole")).thenReturn("TXCr") - when(mex.getVariable("CSI_service")).thenReturn(FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceTXC/getAR.xml")) - when(mex.getVariable("URN_aai_endpoint")).thenReturn(aaiUriPfx) - when(mex.getVariable("aaiAROrchStatus")).thenReturn("Active") - } - - 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(DBGFLAG)).thenReturn("true") - when(mex.getVariable("allottedResourceId")).thenReturn(ARID) - 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/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST) - when(mex.getVariable("allottedResourceType")).thenReturn("TXCt") - when(mex.getVariable("allottedResourceRole")).thenReturn("TXCr") - 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(DBGFLAG)).thenReturn("true") - when(mex.getVariable("allottedResourceId")).thenReturn("ari") - when(mex.getVariable("serviceInstanceId")).thenReturn("sii") - when(mex.getVariable("parentServiceInstanceId")).thenReturn("psii") - when(mex.getVariable("subscriptionServiceType")).thenReturn("sst") - when(mex.getVariable("globalCustomerId")).thenReturn("gci") - when(mex.getVariable("sdncCallbackUrl")).thenReturn("scu") - when(mex.getVariable("msoRequestId")).thenReturn("mri") - } - - private RollbackData initPreProcessSDNC(ExecutionEntity mex) { - def data = new RollbackData() - - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("rollbackData")).thenReturn(data) - - return data - } - - private initPreProcessSDNCGet(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).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><object-path>assignlink</object-path></response-data>") - when(mex.getVariable("serviceInstanceId")).thenReturn("sii") - when(mex.getVariable("sdncCallbackUrl")).thenReturn("myurl") - } - - private RollbackData initValidateSDNCResp(ExecutionEntity mex) { - def data = new RollbackData() - - when(mex.getVariable(DBGFLAG)).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><response-code>200</response-code></response-data>" - } - - private initUpdateAaiAROrchStatus(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("aaiARPath")).thenReturn(aaiUriPfx + "/aai/v9/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID) - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRGTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRGTest.groovy deleted file mode 100644 index 14c382eb39..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRGTest.groovy +++ /dev/null @@ -1,603 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.bpmn.vcpe.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.junit.Before -import org.junit.BeforeClass -import org.junit.Rule -import org.junit.Test -import org.junit.Ignore -import org.mockito.MockitoAnnotations -import org.camunda.bpm.engine.delegate.BpmnError -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.delete -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.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 java.util.Map - -import org.openecomp.mso.bpmn.core.RollbackData -import org.openecomp.mso.bpmn.vcpe.scripts.MapSetter - -import com.github.tomakehurst.wiremock.junit.WireMockRule - -class DoDeleteAllottedResourceBRGTest extends GroovyTestBase { - - @Rule - public WireMockRule wireMockRule = new WireMockRule(PORT) - - String Prefix = "DDARBRG_" - - @BeforeClass - public static void setUpBeforeClass() { - // nothing for now - } - - @Before - public void init() - { - MockitoAnnotations.initMocks(this) - } - - public DoDeleteAllottedResourceBRGTest() { - super("DoDeleteAllottedResourceBRG") - } - - - // ***** preProcessRequest ***** - - @Test -// @Ignore - public void preProcessRequest() { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - DoDeleteAllottedResourceBRG.preProcessRequest(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("prefix", Prefix) - verify(mex).setVariable("sdncCallbackUrl", "sdncurn") - - assertTrue(checkMissingPreProcessRequest("URN_mso_workflow_sdncadapter_callback")) - assertTrue(checkMissingPreProcessRequest("serviceInstanceId")) - assertTrue(checkMissingPreProcessRequest("allottedResourceId")) - } - - @Test -// @Ignore - public void preProcessRequest_BpmnError() { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - when(mex.getVariable("serviceInstanceId")).thenThrow(new BpmnError("expected exception")) - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - - assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceBRG.preProcessRequest(mex) })) - } - - @Test -// @Ignore - public void preProcessRequest_Ex() { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - when(mex.getVariable("serviceInstanceId")).thenThrow(new RuntimeException("expected exception")) - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - - assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceBRG.preProcessRequest(mex) })) - } - - - // ***** getAaiAR ***** - - @Test -// @Ignore - public void getAaiAR() { - MockQueryAllottedResourceById(ARID, "GenericFlows/getARUrlById.xml") - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml") - - ExecutionEntity mex = setupMock() - initGetAaiAR(mex) - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - DoDeleteAllottedResourceBRG.getAaiAR(mex) - - verify(mex).setVariable("parentServiceInstanceId", INST) - } - - @Test -// @Ignore - public void getAaiAR_EmptyResponse() { - - // note: empty result-link - wireMockRule - .stubFor(get(urlMatching("/aai/.*/search/.*")) - .willReturn(aResponse() - .withStatus(200) - .withHeader("Content-Type", "text/xml") - .withBody("<result-data></result-data>"))) - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml") - - ExecutionEntity mex = setupMock() - initGetAaiAR(mex) - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - - assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceBRG.getAaiAR(mex) })) - } - - - // ***** updateAaiAROrchStatus ***** - - @Test -// @Ignore - public void updateAaiAROrchStatus() { - ExecutionEntity mex = setupMock() - initUpdateAaiAROrchStatus(mex) - - MockPatchAllottedResource(CUST, SVC, INST, ARID) - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - DoDeleteAllottedResourceBRG.updateAaiAROrchStatus(mex, "success") - } - - - // ***** buildSDNCRequest ***** - - @Test -// @Ignore - public void buildSDNCRequest() { - ExecutionEntity mex = setupMock() - initBuildSDNCRequest(mex) - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - - String result = DoDeleteAllottedResourceBRG.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>sii</") >= 0) - assertTrue(result.indexOf("<parent-service-instance-id>psii</") >= 0) - assertTrue(result.indexOf("<subscription-service-type>sst</") >= 0) - assertTrue(result.indexOf("<global-customer-id>gci</") >= 0) - assertTrue(result.indexOf("<sdncadapter:CallbackUrl>scu</") >= 0) - assertTrue(result.indexOf("<request-id>mri</") >= 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")) - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - - assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceBRG.buildSDNCRequest(mex, "myact", "myreq") })) - } - - - // ***** preProcessSDNCUnassign ***** - - @Test -// @Ignore - public void preProcessSDNCUnassign() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPreProcessSDNC(mex) - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - DoDeleteAllottedResourceBRG.preProcessSDNCUnassign(mex) - - def req = map.get("sdncUnassignRequest") - - assertTrue(req.indexOf("<sdncadapter:SvcAction>unassign</") >= 0) - assertTrue(req.indexOf("<request-action>DeleteBRGInstance</") >= 0) - assertTrue(req.indexOf("<sdncadapter:RequestId>") >= 0) - } - - @Test -// @Ignore - public void preProcessSDNCUnassign_BpmnError() { - ExecutionEntity mex = setupMock() - initPreProcessSDNC(mex) - - when(mex.getVariable("allottedResourceId")).thenThrow(new BpmnError("expected exception")) - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - - assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceBRG.preProcessSDNCUnassign(mex) })) - } - - @Test -// @Ignore - public void preProcessSDNCUnassign_Ex() { - ExecutionEntity mex = setupMock() - initPreProcessSDNC(mex) - - when(mex.getVariable("allottedResourceId")).thenThrow(new RuntimeException("expected exception")) - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - - assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceBRG.preProcessSDNCUnassign(mex) })) - } - - - // ***** preProcessSDNCDelete ***** - - @Test -// @Ignore - public void preProcessSDNCDelete() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPreProcessSDNC(mex) - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - DoDeleteAllottedResourceBRG.preProcessSDNCDelete(mex) - - def req = map.get("sdncDeleteRequest") - - assertTrue(req.indexOf("<sdncadapter:SvcAction>delete</") >= 0) - assertTrue(req.indexOf("<request-action>DeleteBRGInstance</") >= 0) - assertTrue(req.indexOf("<sdncadapter:RequestId>") >= 0) - } - - @Test -// @Ignore - public void preProcessSDNCDelete_BpmnError() { - ExecutionEntity mex = setupMock() - initPreProcessSDNC(mex) - - when(mex.getVariable("allottedResourceId")).thenThrow(new BpmnError("expected exception")) - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - - assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceBRG.preProcessSDNCDelete(mex) })) - } - - @Test -// @Ignore - public void preProcessSDNCDelete_Ex() { - ExecutionEntity mex = setupMock() - initPreProcessSDNC(mex) - - when(mex.getVariable("allottedResourceId")).thenThrow(new RuntimeException("expected exception")) - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - - assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceBRG.preProcessSDNCDelete(mex) })) - } - - - // ***** preProcessSDNCDeactivate ***** - - @Test -// @Ignore - public void preProcessSDNCDeactivate() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPreProcessSDNC(mex) - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - DoDeleteAllottedResourceBRG.preProcessSDNCDeactivate(mex) - - def req = map.get("sdncDeactivateRequest") - - assertTrue(req.indexOf("<sdncadapter:SvcAction>deactivate</") >= 0) - assertTrue(req.indexOf("<request-action>DeleteBRGInstance</") >= 0) - assertTrue(req.indexOf("<sdncadapter:RequestId>") >= 0) - } - - @Test -// @Ignore - public void preProcessSDNCDeactivate_BpmnError() { - ExecutionEntity mex = setupMock() - initPreProcessSDNC(mex) - - when(mex.getVariable("allottedResourceId")).thenThrow(new BpmnError("expected exception")) - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - - assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceBRG.preProcessSDNCDeactivate(mex) })) - } - - @Test -// @Ignore - public void preProcessSDNCDeactivate_Ex() { - ExecutionEntity mex = setupMock() - initPreProcessSDNC(mex) - - when(mex.getVariable("allottedResourceId")).thenThrow(new RuntimeException("expected exception")) - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - - assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceBRG.preProcessSDNCDeactivate(mex) })) - } - - - // ***** validateSDNCResp ***** - - @Test -// @Ignore - public void validateSDNCResp() { - ExecutionEntity mex = setupMock() - def data = initValidateSDNCResp(mex) - def resp = initValidateSDNCResp_Resp(200) - - when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(true) - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - - DoDeleteAllottedResourceBRG.validateSDNCResp(mex, resp, "create") - - verify(mex).getVariable("WorkflowException") - verify(mex).getVariable("SDNCA_SuccessIndicator") - verify(mex).getVariable(Prefix+"sdncResponseSuccess") - - verify(mex, never()).getVariable(Prefix + "sdncRequestDataResponseCode") - verify(mex, never()).setVariable("wasDeleted", false) - } - - @Test -// @Ignore - public void validateSDNCResp_Fail404_Deactivate_FailNotFound() { - ExecutionEntity mex = setupMock() - def data = initValidateSDNCResp(mex) - - def resp = initValidateSDNCResp_Resp(404) - when(mex.getVariable(Prefix+"sdncRequestDataResponseCode")).thenReturn("404") - when(mex.getVariable("failNotFound")).thenReturn("true") - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - - assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceBRG.validateSDNCResp(mex, resp, "deactivate")})) - } - - @Test -// @Ignore - public void validateSDNCResp_Fail404_Deactivate() { - ExecutionEntity mex = setupMock() - def data = initValidateSDNCResp(mex) - - def resp = initValidateSDNCResp_Resp(404) - when(mex.getVariable(Prefix+"sdncRequestDataResponseCode")).thenReturn("404") - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - - DoDeleteAllottedResourceBRG.validateSDNCResp(mex, resp, "deactivate") - - verify(mex).setVariable("ARNotFoundInSDNC", true) - verify(mex).setVariable("wasDeleted", false) - } - - @Test -// @Ignore - public void validateSDNCResp_Fail404() { - ExecutionEntity mex = setupMock() - def data = initValidateSDNCResp(mex) - - def resp = initValidateSDNCResp_Resp(404) - when(mex.getVariable(Prefix+"sdncRequestDataResponseCode")).thenReturn("404") - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - - assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceBRG.validateSDNCResp(mex, resp, "create")})) - } - - @Test -// @Ignore - public void validateSDNCResp_Deactivate() { - ExecutionEntity mex = setupMock() - def data = initValidateSDNCResp(mex) - def resp = initValidateSDNCResp_Resp(200) - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - - assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceBRG.validateSDNCResp(mex, resp, "deactivate")})) - } - - @Test -// @Ignore - public void validateSDNCResp_BpmnError() { - ExecutionEntity mex = setupMock() - initValidateSDNCResp(mex) - def resp = initValidateSDNCResp_Resp(200) - - when(mex.getVariable("WorkflowException")).thenThrow(new BpmnError("expected exception")) - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - - assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceBRG.validateSDNCResp(mex, resp, "create") })) - } - - @Test -// @Ignore - public void validateSDNCResp_Ex() { - ExecutionEntity mex = setupMock() - initValidateSDNCResp(mex) - def resp = initValidateSDNCResp_Resp(200) - - when(mex.getVariable("WorkflowException")).thenThrow(new RuntimeException("expected exception")) - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - - assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceBRG.validateSDNCResp(mex, resp, "create") })) - } - - @Test -// @Ignore - public void deleteAaiAR() { - ExecutionEntity mex = setupMock() - initDeleteAaiAR(mex) - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml") - MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS) - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - DoDeleteAllottedResourceBRG.deleteAaiAR(mex) - } - - @Test -// @Ignore - public void deleteAaiAR_NoArPath() { - ExecutionEntity mex = setupMock() - initDeleteAaiAR(mex) - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml") - MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS) - - when(mex.getVariable("aaiARPath")).thenReturn("") - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - - assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceBRG.deleteAaiAR(mex) })) - } - - @Test -// @Ignore - public void deleteAaiAR_BpmnError() { - ExecutionEntity mex = setupMock() - initDeleteAaiAR(mex) - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml") - MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS) - - when(mex.getVariable("aaiARPath")).thenThrow(new BpmnError("expected exception")) - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - - assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceBRG.deleteAaiAR(mex) })) - } - - @Test -// @Ignore - public void deleteAaiAR_Ex() { - ExecutionEntity mex = setupMock() - initDeleteAaiAR(mex) - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml") - MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS) - - when(mex.getVariable("aaiARPath")).thenThrow(new RuntimeException("expected exception")) - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - - assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceBRG.deleteAaiAR(mex) })) - } - - private boolean checkMissingPreProcessRequest(String fieldnm) { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG() - - when(mex.getVariable(fieldnm)).thenReturn("") - - return doBpmnError( { _ -> DoDeleteAllottedResourceBRG.preProcessRequest(mex) }) - } - - private void initPreProcess(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("sdncurn") - when(mex.getVariable("serviceInstanceId")).thenReturn("sii") - when(mex.getVariable("allottedResourceId")).thenReturn("ari") - } - - private void initGetAaiAR(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("allottedResourceType")).thenReturn("BRG") - when(mex.getVariable("allottedResourceRole")).thenReturn("BRG") - when(mex.getVariable("allottedResourceId")).thenReturn(ARID) - when(mex.getVariable("CSI_service")).thenReturn(FileUtil.readResourceFile("__files/VCPE/DoDeleteAllottedResourceBRG/getAR.xml")) - when(mex.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn(urnProps.get("mso.workflow.global.default.aai.namespace")) - when(mex.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn(urnProps.get("mso.workflow.global.default.aai.version")) - when(mex.getVariable("URN_mso_workflow_default_aai_v8_nodes_query_uri")).thenReturn(urnProps.get("mso.workflow.default.aai.v8.nodes-query.uri")) - when(mex.getVariable("URN_aai_endpoint")).thenReturn(aaiUriPfx) - when(mex.getVariable("aaiARPath")).thenReturn(aaiUriPfx + "/aai/v9/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID) - when(mex.getVariable("aaiAROrchStatus")).thenReturn("Active") - } - - private initUpdateAaiAROrchStatus(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("aaiARPath")).thenReturn(aaiUriPfx + "/aai/v9/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID) - } - - private initBuildSDNCRequest(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("allottedResourceId")).thenReturn("ari") - when(mex.getVariable("serviceInstanceId")).thenReturn("sii") - when(mex.getVariable("parentServiceInstanceId")).thenReturn("psii") - when(mex.getVariable("subscriptionServiceType")).thenReturn("sst") - when(mex.getVariable("globalCustomerId")).thenReturn("gci") - when(mex.getVariable("sdncCallbackUrl")).thenReturn("scu") - when(mex.getVariable("msoRequestId")).thenReturn("mri") - } - - private initPreProcessSDNC(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - } - - private initValidateSDNCResp(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("prefix")).thenReturn(Prefix) - when(mex.getVariable("SDNCA_SuccessIndicator")).thenReturn(true) - } - - private String initValidateSDNCResp_Resp(int code) { - return "<response-data><response-code>${code}</response-code></response-data>" - } - - private initDeleteAaiAR(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("aaiARPath")).thenReturn(aaiUriPfx + "/aai/v9/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID) - when(mex.getVariable("aaiARResourceVersion")).thenReturn("myvers") - when(mex.getVariable("URN_aai_endpoint")).thenReturn(aaiUriPfx) - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXCTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXCTest.groovy deleted file mode 100644 index 115f298062..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXCTest.groovy +++ /dev/null @@ -1,603 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.bpmn.vcpe.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.junit.Before -import org.junit.BeforeClass -import org.junit.Rule -import org.junit.Test -import org.junit.Ignore -import org.mockito.MockitoAnnotations -import org.camunda.bpm.engine.delegate.BpmnError -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.delete -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.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 java.util.Map - -import org.openecomp.mso.bpmn.core.RollbackData -import org.openecomp.mso.bpmn.vcpe.scripts.MapSetter - -import com.github.tomakehurst.wiremock.junit.WireMockRule - -class DoDeleteAllottedResourceTXCTest extends GroovyTestBase { - - @Rule - public WireMockRule wireMockRule = new WireMockRule(PORT) - - String Prefix = "DDARTXC_" - - @BeforeClass - public static void setUpBeforeClass() { - // nothing for now - } - - @Before - public void init() - { - MockitoAnnotations.initMocks(this) - } - - public DoDeleteAllottedResourceTXCTest() { - super("DoDeleteAllottedResourceTXC") - } - - - // ***** preProcessRequest ***** - - @Test -// @Ignore - public void preProcessRequest() { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - DoDeleteAllottedResourceTXC.preProcessRequest(mex) - - verify(mex).getVariable(DBGFLAG) - verify(mex).setVariable("prefix", Prefix) - verify(mex).setVariable("sdncCallbackUrl", "sdncurn") - - assertTrue(checkMissingPreProcessRequest("URN_mso_workflow_sdncadapter_callback")) - assertTrue(checkMissingPreProcessRequest("serviceInstanceId")) - assertTrue(checkMissingPreProcessRequest("allottedResourceId")) - } - - @Test -// @Ignore - public void preProcessRequest_BpmnError() { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - when(mex.getVariable("serviceInstanceId")).thenThrow(new BpmnError("expected exception")) - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - - assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceTXC.preProcessRequest(mex) })) - } - - @Test -// @Ignore - public void preProcessRequest_Ex() { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - when(mex.getVariable("serviceInstanceId")).thenThrow(new RuntimeException("expected exception")) - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - - assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceTXC.preProcessRequest(mex) })) - } - - - // ***** getAaiAR ***** - - @Test -// @Ignore - public void getAaiAR() { - MockQueryAllottedResourceById(ARID, "GenericFlows/getARUrlById.xml") - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml") - - ExecutionEntity mex = setupMock() - initGetAaiAR(mex) - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - DoDeleteAllottedResourceTXC.getAaiAR(mex) - - verify(mex).setVariable("parentServiceInstanceId", INST) - } - - @Test -// @Ignore - public void getAaiAR_EmptyResponse() { - - // note: empty result-link - wireMockRule - .stubFor(get(urlMatching("/aai/.*/search/.*")) - .willReturn(aResponse() - .withStatus(200) - .withHeader("Content-Type", "text/xml") - .withBody("<result-data></result-data>"))) - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml") - - ExecutionEntity mex = setupMock() - initGetAaiAR(mex) - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - - assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceTXC.getAaiAR(mex) })) - } - - - // ***** updateAaiAROrchStatus ***** - - @Test -// @Ignore - public void updateAaiAROrchStatus() { - ExecutionEntity mex = setupMock() - initUpdateAaiAROrchStatus(mex) - - MockPatchAllottedResource(CUST, SVC, INST, ARID) - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - DoDeleteAllottedResourceTXC.updateAaiAROrchStatus(mex, "success") - } - - - // ***** buildSDNCRequest ***** - - @Test -// @Ignore - public void buildSDNCRequest() { - ExecutionEntity mex = setupMock() - initBuildSDNCRequest(mex) - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - - String result = DoDeleteAllottedResourceTXC.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>sii</") >= 0) - assertTrue(result.indexOf("<parent-service-instance-id>psii</") >= 0) - assertTrue(result.indexOf("<subscription-service-type>sst</") >= 0) - assertTrue(result.indexOf("<global-customer-id>gci</") >= 0) - assertTrue(result.indexOf("<sdncadapter:CallbackUrl>scu</") >= 0) - assertTrue(result.indexOf("<request-id>mri</") >= 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")) - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - - assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceTXC.buildSDNCRequest(mex, "myact", "myreq") })) - } - - - // ***** preProcessSDNCUnassign ***** - - @Test -// @Ignore - public void preProcessSDNCUnassign() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPreProcessSDNC(mex) - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - DoDeleteAllottedResourceTXC.preProcessSDNCUnassign(mex) - - def req = map.get("sdncUnassignRequest") - - assertTrue(req.indexOf("<sdncadapter:SvcAction>unassign</") >= 0) - assertTrue(req.indexOf("<request-action>DeleteTunnelXConnInstance</") >= 0) - assertTrue(req.indexOf("<sdncadapter:RequestId>") >= 0) - } - - @Test -// @Ignore - public void preProcessSDNCUnassign_BpmnError() { - ExecutionEntity mex = setupMock() - initPreProcessSDNC(mex) - - when(mex.getVariable("allottedResourceId")).thenThrow(new BpmnError("expected exception")) - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - - assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceTXC.preProcessSDNCUnassign(mex) })) - } - - @Test -// @Ignore - public void preProcessSDNCUnassign_Ex() { - ExecutionEntity mex = setupMock() - initPreProcessSDNC(mex) - - when(mex.getVariable("allottedResourceId")).thenThrow(new RuntimeException("expected exception")) - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - - assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceTXC.preProcessSDNCUnassign(mex) })) - } - - - // ***** preProcessSDNCDelete ***** - - @Test -// @Ignore - public void preProcessSDNCDelete() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPreProcessSDNC(mex) - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - DoDeleteAllottedResourceTXC.preProcessSDNCDelete(mex) - - def req = map.get("sdncDeleteRequest") - - assertTrue(req.indexOf("<sdncadapter:SvcAction>delete</") >= 0) - assertTrue(req.indexOf("<request-action>DeleteTunnelXConnInstance</") >= 0) - assertTrue(req.indexOf("<sdncadapter:RequestId>") >= 0) - } - - @Test -// @Ignore - public void preProcessSDNCDelete_BpmnError() { - ExecutionEntity mex = setupMock() - initPreProcessSDNC(mex) - - when(mex.getVariable("allottedResourceId")).thenThrow(new BpmnError("expected exception")) - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - - assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceTXC.preProcessSDNCDelete(mex) })) - } - - @Test -// @Ignore - public void preProcessSDNCDelete_Ex() { - ExecutionEntity mex = setupMock() - initPreProcessSDNC(mex) - - when(mex.getVariable("allottedResourceId")).thenThrow(new RuntimeException("expected exception")) - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - - assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceTXC.preProcessSDNCDelete(mex) })) - } - - - // ***** preProcessSDNCDeactivate ***** - - @Test -// @Ignore - public void preProcessSDNCDeactivate() { - ExecutionEntity mex = setupMock() - def map = setupMap(mex) - initPreProcessSDNC(mex) - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - DoDeleteAllottedResourceTXC.preProcessSDNCDeactivate(mex) - - def req = map.get("sdncDeactivateRequest") - - assertTrue(req.indexOf("<sdncadapter:SvcAction>deactivate</") >= 0) - assertTrue(req.indexOf("<request-action>DeleteTunnelXConnInstance</") >= 0) - assertTrue(req.indexOf("<sdncadapter:RequestId>") >= 0) - } - - @Test -// @Ignore - public void preProcessSDNCDeactivate_BpmnError() { - ExecutionEntity mex = setupMock() - initPreProcessSDNC(mex) - - when(mex.getVariable("allottedResourceId")).thenThrow(new BpmnError("expected exception")) - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - - assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceTXC.preProcessSDNCDeactivate(mex) })) - } - - @Test -// @Ignore - public void preProcessSDNCDeactivate_Ex() { - ExecutionEntity mex = setupMock() - initPreProcessSDNC(mex) - - when(mex.getVariable("allottedResourceId")).thenThrow(new RuntimeException("expected exception")) - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - - assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceTXC.preProcessSDNCDeactivate(mex) })) - } - - - // ***** validateSDNCResp ***** - - @Test -// @Ignore - public void validateSDNCResp() { - ExecutionEntity mex = setupMock() - def data = initValidateSDNCResp(mex) - def resp = initValidateSDNCResp_Resp(200) - - when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(true) - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - - DoDeleteAllottedResourceTXC.validateSDNCResp(mex, resp, "create") - - verify(mex).getVariable("WorkflowException") - verify(mex).getVariable("SDNCA_SuccessIndicator") - verify(mex).getVariable(Prefix+"sdncResponseSuccess") - - verify(mex, never()).getVariable(Prefix + "sdncRequestDataResponseCode") - verify(mex, never()).setVariable("wasDeleted", false) - } - - @Test -// @Ignore - public void validateSDNCResp_Fail404_Deactivate_FailNotFound() { - ExecutionEntity mex = setupMock() - def data = initValidateSDNCResp(mex) - - def resp = initValidateSDNCResp_Resp(404) - when(mex.getVariable(Prefix+"sdncRequestDataResponseCode")).thenReturn("404") - when(mex.getVariable("failNotFound")).thenReturn("true") - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - - assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceTXC.validateSDNCResp(mex, resp, "deactivate")})) - } - - @Test -// @Ignore - public void validateSDNCResp_Fail404_Deactivate() { - ExecutionEntity mex = setupMock() - def data = initValidateSDNCResp(mex) - - def resp = initValidateSDNCResp_Resp(404) - when(mex.getVariable(Prefix+"sdncRequestDataResponseCode")).thenReturn("404") - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - - DoDeleteAllottedResourceTXC.validateSDNCResp(mex, resp, "deactivate") - - verify(mex).setVariable("ARNotFoundInSDNC", true) - verify(mex).setVariable("wasDeleted", false) - } - - @Test -// @Ignore - public void validateSDNCResp_Fail404() { - ExecutionEntity mex = setupMock() - def data = initValidateSDNCResp(mex) - - def resp = initValidateSDNCResp_Resp(404) - when(mex.getVariable(Prefix+"sdncRequestDataResponseCode")).thenReturn("404") - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - - assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceTXC.validateSDNCResp(mex, resp, "create")})) - } - - @Test -// @Ignore - public void validateSDNCResp_Deactivate() { - ExecutionEntity mex = setupMock() - def data = initValidateSDNCResp(mex) - def resp = initValidateSDNCResp_Resp(200) - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - - assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceTXC.validateSDNCResp(mex, resp, "deactivate")})) - } - - @Test -// @Ignore - public void validateSDNCResp_BpmnError() { - ExecutionEntity mex = setupMock() - initValidateSDNCResp(mex) - def resp = initValidateSDNCResp_Resp(200) - - when(mex.getVariable("WorkflowException")).thenThrow(new BpmnError("expected exception")) - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - - assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceTXC.validateSDNCResp(mex, resp, "create") })) - } - - @Test -// @Ignore - public void validateSDNCResp_Ex() { - ExecutionEntity mex = setupMock() - initValidateSDNCResp(mex) - def resp = initValidateSDNCResp_Resp(200) - - when(mex.getVariable("WorkflowException")).thenThrow(new RuntimeException("expected exception")) - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - - assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceTXC.validateSDNCResp(mex, resp, "create") })) - } - - @Test -// @Ignore - public void deleteAaiAR() { - ExecutionEntity mex = setupMock() - initDeleteAaiAR(mex) - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml") - MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS) - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - DoDeleteAllottedResourceTXC.deleteAaiAR(mex) - } - - @Test -// @Ignore - public void deleteAaiAR_NoArPath() { - ExecutionEntity mex = setupMock() - initDeleteAaiAR(mex) - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml") - MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS) - - when(mex.getVariable("aaiARPath")).thenReturn("") - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - - assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceTXC.deleteAaiAR(mex) })) - } - - @Test -// @Ignore - public void deleteAaiAR_BpmnError() { - ExecutionEntity mex = setupMock() - initDeleteAaiAR(mex) - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml") - MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS) - - when(mex.getVariable("aaiARPath")).thenThrow(new BpmnError("expected exception")) - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - - assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceTXC.deleteAaiAR(mex) })) - } - - @Test -// @Ignore - public void deleteAaiAR_Ex() { - ExecutionEntity mex = setupMock() - initDeleteAaiAR(mex) - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml") - MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS) - - when(mex.getVariable("aaiARPath")).thenThrow(new RuntimeException("expected exception")) - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - - assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceTXC.deleteAaiAR(mex) })) - } - - private boolean checkMissingPreProcessRequest(String fieldnm) { - ExecutionEntity mex = setupMock() - initPreProcess(mex) - - DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC() - - when(mex.getVariable(fieldnm)).thenReturn("") - - return doBpmnError( { _ -> DoDeleteAllottedResourceTXC.preProcessRequest(mex) }) - } - - private void initPreProcess(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("sdncurn") - when(mex.getVariable("serviceInstanceId")).thenReturn("sii") - when(mex.getVariable("allottedResourceId")).thenReturn("ari") - } - - private void initGetAaiAR(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("allottedResourceType")).thenReturn("TXC") - when(mex.getVariable("allottedResourceRole")).thenReturn("TXC") - when(mex.getVariable("allottedResourceId")).thenReturn(ARID) - when(mex.getVariable("CSI_service")).thenReturn(FileUtil.readResourceFile("__files/VCPE/DoDeleteAllottedResourceTXC/getAR.xml")) - when(mex.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn(urnProps.get("mso.workflow.global.default.aai.namespace")) - when(mex.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn(urnProps.get("mso.workflow.global.default.aai.version")) - when(mex.getVariable("URN_mso_workflow_default_aai_v8_nodes_query_uri")).thenReturn(urnProps.get("mso.workflow.default.aai.v8.nodes-query.uri")) - when(mex.getVariable("URN_aai_endpoint")).thenReturn(aaiUriPfx) - when(mex.getVariable("aaiARPath")).thenReturn(aaiUriPfx + "/aai/v9/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID) - when(mex.getVariable("aaiAROrchStatus")).thenReturn("Active") - } - - private initUpdateAaiAROrchStatus(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("aaiARPath")).thenReturn(aaiUriPfx + "/aai/v9/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID) - } - - private initBuildSDNCRequest(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("allottedResourceId")).thenReturn("ari") - when(mex.getVariable("serviceInstanceId")).thenReturn("sii") - when(mex.getVariable("parentServiceInstanceId")).thenReturn("psii") - when(mex.getVariable("subscriptionServiceType")).thenReturn("sst") - when(mex.getVariable("globalCustomerId")).thenReturn("gci") - when(mex.getVariable("sdncCallbackUrl")).thenReturn("scu") - when(mex.getVariable("msoRequestId")).thenReturn("mri") - } - - private initPreProcessSDNC(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - } - - private initValidateSDNCResp(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("prefix")).thenReturn(Prefix) - when(mex.getVariable("SDNCA_SuccessIndicator")).thenReturn(true) - } - - private String initValidateSDNCResp_Resp(int code) { - return "<response-data><response-code>${code}</response-code></response-data>" - } - - private initDeleteAaiAR(ExecutionEntity mex) { - when(mex.getVariable(DBGFLAG)).thenReturn("true") - when(mex.getVariable("aaiARPath")).thenReturn(aaiUriPfx + "/aai/v9/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID) - when(mex.getVariable("aaiARResourceVersion")).thenReturn("myvers") - when(mex.getVariable("URN_aai_endpoint")).thenReturn(aaiUriPfx) - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/GroovyTestBase.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/GroovyTestBase.groovy deleted file mode 100644 index ef67a75d10..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/GroovyTestBase.groovy +++ /dev/null @@ -1,127 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.bpmn.vcpe.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.junit.Before -import org.junit.BeforeClass -import org.junit.Rule -import org.junit.Test -import org.junit.Ignore -import org.mockito.MockitoAnnotations -import org.camunda.bpm.engine.delegate.BpmnError -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 org.openecomp.mso.bpmn.vcpe.scripts.MapSetter - -import com.github.tomakehurst.wiremock.junit.WireMockRule - -class GroovyTestBase { - - static final int PORT = 28090 - static final String LOCAL_URI = "http://localhost:" + PORT - - static final String CUST = "SDN-ETHERNET-INTERNET" - static final String SVC = "123456789" - static final String INST = "MIS%252F1604%252F0026%252FSW_INTERNET" - static final String ARID = "arId-1" - static final String VERS = "myvers" - - static final String DBGFLAG = "isDebugLogEnabled" - - static Properties urnProps = new Properties() - static String aaiUriPfx - - String processName - - static { - def fr = new FileReader("src/test/resources/mso.bpmn.urn.properties") - urnProps.load(fr) - fr.close() - - aaiUriPfx = urnProps.get("aai.endpoint") - } - - public static void setUpBeforeClass() { - // moved to the above static block to get the static aaiUriPfx assignment correctly. - } - - public GroovyTestBase(String processName) { - this.processName = processName - } - - public boolean doBpmnError(def func) { - - try { - func() - return false; - - } catch(BpmnError e) { - return true; - } - } - - public ExecutionEntity setupMock() { - - ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class) - when(mockProcessDefinition.getKey()).thenReturn(processName) - RepositoryService mockRepositoryService = mock(RepositoryService.class) - when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition) - when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn(processName) - 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(processName) - when(mex.getProcessInstanceId()).thenReturn(processName) - when(mex.getProcessEngineServices()).thenReturn(mockProcessEngineServices) - when(mex.getProcessEngineServices().getRepositoryService().getProcessDefinition(mex.getProcessDefinitionId())).thenReturn(mockProcessDefinition) - - when(mex.getVariable("isAsyncProcess")).thenReturn("true") - when(mex.getVariable(processName+"WorkflowResponseSent")).thenReturn("false") - - return mex - } - - public Map<String,Object> setupMap(ExecutionEntity mex) { - MapSetter mapset = new MapSetter(); - doAnswer(mapset).when(mex).setVariable(any(), any()) - return mapset.getMap(); - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/MapGetter.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/MapGetter.groovy deleted file mode 100644 index 062cc0697e..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/MapGetter.groovy +++ /dev/null @@ -1,48 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.bpmn.vcpe.scripts; - -import java.util.HashMap; -import java.util.Map; - -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; - -class MapGetter implements Answer<Object> { - final Map<String,Object> map; - - public MapGetter() { - map = new HashMap<>(); - } - - public MapGetter(Map<String,Object> map) { - this.map = map; - } - - public Map<String, Object> getMap() { - return map; - } - - @Override - public Object answer(InvocationOnMock invocation) throws Throwable { - return map.get(invocation.getArgumentAt(0, String.class)); - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/MapSetter.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/MapSetter.groovy deleted file mode 100644 index e3395323d7..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/MapSetter.groovy +++ /dev/null @@ -1,49 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.bpmn.vcpe.scripts; - -import java.util.HashMap; -import java.util.Map; - -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; - -class MapSetter implements Answer<Void> { - final Map<String,Object> map; - - public MapSetter() { - map = new HashMap<>(); - } - - public MapSetter(Map<String,Object> map) { - this.map = map; - } - - public Map<String, Object> getMap() { - return map; - } - - @Override - public Void answer(InvocationOnMock invocation) throws Throwable { - map.put(invocation.getArgumentAt(0, String.class), invocation.getArgumentAt(1, Object.class)); - return null; - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/AAITasks/AAICreateOwningEntityTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/AAITasks/AAICreateOwningEntityTest.java deleted file mode 100644 index 4f643e1119..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/AAITasks/AAICreateOwningEntityTest.java +++ /dev/null @@ -1,35 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2018 Huawei Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.bpmn.infrastructure.AAITasks; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.camunda.bpm.engine.impl.pvm.runtime.ExecutionImpl; -import org.junit.Test; - -public class AAICreateOwningEntityTest { - - DelegateExecution delegateExecution = new ExecutionImpl(); - - @Test(expected = UnsupportedOperationException.class) - public void executeTest() throws Exception { - new AAICreateServiceInstance().execute(delegateExecution); - } - -}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/BeansTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/BeansTest.java deleted file mode 100644 index 723639c505..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/BeansTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure; - -import org.junit.Test; - -import com.openpojo.validation.Validator; -import com.openpojo.validation.ValidatorBuilder; -import com.openpojo.validation.rule.impl.GetterMustExistRule; -import com.openpojo.validation.rule.impl.SetterMustExistRule; -import com.openpojo.validation.test.impl.GetterTester; -import com.openpojo.validation.test.impl.SetterTester; -import com.openpojo.reflection.PojoClass; -import com.openpojo.reflection.PojoClassFilter; -import com.openpojo.reflection.filters.FilterEnum; -import com.openpojo.reflection.filters.FilterNonConcrete; -import com.openpojo.reflection.filters.FilterPackageInfo; - - -public class BeansTest { - - - private PojoClassFilter filterTestClasses = new FilterTestClasses(); - - private PojoClassFilter enumFilter = new FilterEnum(); - - - @Test - public void pojoStructure() { - test("org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity"); - } - - private void test(String pojoPackage) { - Validator validator = ValidatorBuilder.create() - .with(new GetterMustExistRule()) - .with(new SetterMustExistRule()) - - .with(new SetterTester()) - .with(new GetterTester()) - .with(new SetterTester()) - .with(new GetterTester()) - - .build(); - - - validator.validate(pojoPackage, new FilterPackageInfo(), filterTestClasses,enumFilter,new FilterNonConcrete()); - } - - private static class FilterTestClasses implements PojoClassFilter { - public boolean include(PojoClass pojoClass) { - return !pojoClass.getSourcePath().contains("/test-classes/"); - } - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateGenericALaCarteServiceInstanceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateGenericALaCarteServiceInstanceTest.java deleted file mode 100644 index a1a9e35865..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateGenericALaCarteServiceInstanceTest.java +++ /dev/null @@ -1,137 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.openecomp.mso.bpmn.common.BPMNUtil.executeWorkFlow; -import static org.openecomp.mso.bpmn.common.BPMNUtil.waitForWorkflowToFinish; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetCustomer; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceByName; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutServiceInstance; -import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.MockGetServiceResourcesCatalogData; -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.Ignore; -import org.junit.Test; -import org.openecomp.mso.bpmn.common.BPMNUtil; -import org.openecomp.mso.bpmn.common.WorkflowTest; -import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse; -import org.openecomp.mso.bpmn.mock.FileUtil; - -/** - * Unit test cases for CreateGenericALaCarteServiceInstance.bpmn - */ -public class CreateGenericALaCarteServiceInstanceTest extends WorkflowTest { - - private final CallbackSet callbacks = new CallbackSet(); - - public CreateGenericALaCarteServiceInstanceTest() throws IOException { - callbacks.put("assign", FileUtil.readResourceFile("__files/VfModularity/SDNCSITopologyAssignCallback.xml")); - } - - /** - * Sunny day VID scenario. - * - * @throws Exception - */ - //@Ignore // File not found - unable to run the test. Also, Stubs need updating.. - @Test - @Ignore // 1802 merge - @Deployment(resources = { - "process/CreateGenericALaCarteServiceInstance.bpmn", - "subprocess/BuildingBlock/DecomposeService.bpmn", - "subprocess/DoCreateServiceInstance.bpmn", - "subprocess/DoCreateServiceInstanceRollback.bpmn", - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/GenericPutService.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - "subprocess/FalloutHandler.bpmn" }) - public void sunnyDayAlaCarte() throws Exception { - - logStart(); - - //AAI - MockGetCustomer("MCBH-1610", "CreateServiceInstance/createServiceInstance_queryGlobalCustomerId_AAIResponse_Success.xml"); - MockPutServiceInstance("MCBH-1610", "viprsvc", "RaaTest-1-id", ""); - MockGetServiceInstance("MCBH-1610", "viprsvc", "RaaTest-1-id", "GenericFlows/getServiceInstance.xml"); - MockNodeQueryServiceInstanceByName("RAATest-1", null); - MockNodeQueryServiceInstanceById("RaaTest-1-id", null); - //SDNC - mockSDNCAdapter(200); - //DB - MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef","2","/VIPR/getCatalogServiceResourcesData.json"); - mockUpdateRequestDB(200, "DBUpdateResponse.xml"); - MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef","InfrastructureFlows/DoCreateServiceInstance_request.json"); - - - String businessKey = UUID.randomUUID().toString(); - - //String createVfModuleRequest = FileUtil.readResourceFile("__files/SIRequest.json"); - - Map<String, String> variables = setupVariables(); - WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CreateGenericALaCarteServiceInstance", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); - - String workflowResp = BPMNUtil.getVariable(processEngineRule, "CreateGenericALaCarteServiceInstance", "WorkflowResponse"); - //assertNotNull(workflowResp); - System.out.println("Workflow (Synch) Response:\n" + workflowResp); - String workflowException = BPMNUtil.getVariable(processEngineRule, "CreateGenericALaCarteServiceInstance", "WorkflowException"); - String completionReq = BPMNUtil.getVariable(processEngineRule, "CreateGenericALaCarteServiceInstance", "completionRequest"); - System.out.println("completionReq:\n" + completionReq); - System.out.println("workflowException:\n" + workflowException); - assertNotNull(completionReq); - assertEquals(null, workflowException); - - - //injectSDNCCallbacks(callbacks, "assign"); - - logEnd(); - } - - // Success Scenario - private Map<String, String> setupVariables() { - Map<String, String> variables = new HashMap<>(); - variables.put("isDebugLogEnabled", "true"); - variables.put("bpmnRequest", getRequest()); - variables.put("mso-request-id", "RaaCSIRequestId-1"); - variables.put("serviceInstanceId","RaaTest-1-id"); - variables.put("sdncVersion", "1802"); - variables.put("serviceInstanceName", "some-junk-name"); - return variables; - } - - public String getRequest() { - String request = "{\"requestDetails\":{\"project\": {\"projectName\": \"projectName\"},\"owningEntity\": {\"owningEntityId\": \"randomStrings\",\"owningEntityName\": \"randomStrings\"},\"modelInfo\":{\"modelType\":\"service\",\"modelInvariantUuid\":\"uuid-miu-svc-011-abcdef\",\"modelVersionUuid\":\"ASDC_TOSCA_UUID\",\"modelName\":\"SIModelName1\",\"modelVersion\":\"2\"},\"subscriberInfo\":{\"globalSubscriberId\":\"MCBH-1610\",\"subscriberName\":\"Kaneohe\"},\"requestInfo\":{\"instanceName\":\"RAATest-1\",\"source\":\"VID\",\"suppressRollback\":\"true\",\"productFamilyId\":\"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\"},\"cloudConfiguration\":{\"lcpCloudRegionId\":\"mdt1\",\"tenantId\":\"8b1df54faa3b49078e3416e21370a3ba\"},\"requestParameters\":{\"subscriptionServiceType\":\"viprsvc\",\"aLaCarte\":\"false\",\"userParams\":[]}}}"; - return request; - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateNetworkInstanceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateNetworkInstanceTest.java deleted file mode 100644 index f993d066e4..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateNetworkInstanceTest.java +++ /dev/null @@ -1,665 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure; - -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.*; -import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.MockUpdateRequestDB; -import static org.openecomp.mso.bpmn.mock.StubResponseNetworkAdapter.MockNetworkAdapterPost; -import static org.openecomp.mso.bpmn.mock.StubResponseNetworkAdapter.MockNetworkAdapterRestRollbackDelete; -// new mock methods -import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapterTopology; -import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter_500; -import org.openecomp.mso.bpmn.mock.SDNCAdapterNetworkTopologyMockTransformer; - -import static org.openecomp.mso.bpmn.common.BPMNUtil.executeAsyncWorkflow; -import static org.openecomp.mso.bpmn.common.BPMNUtil.getVariable; -import static org.junit.Assert.assertEquals; - -import java.util.HashMap; -import java.util.Map; - -import org.camunda.bpm.engine.test.Deployment; -import org.junit.Assert; -import org.junit.Rule; -import org.junit.Test; - -import org.openecomp.mso.bpmn.common.BPMNUtil; -import org.openecomp.mso.bpmn.common.WorkflowTest; -import org.openecomp.mso.bpmn.common.WorkflowTestTransformer; -import org.openecomp.mso.bpmn.common.SDNCAdapterCallbackRule; -import com.github.tomakehurst.wiremock.extension.ResponseTransformer; - -/** - * Unit test cases for CreateNetworkInstance.bpmn - * - */ -public class CreateNetworkInstanceTest extends WorkflowTest { - @WorkflowTestTransformer - public static final ResponseTransformer sdncAdapterMockTransformer = - new SDNCAdapterNetworkTopologyMockTransformer(); - - @Rule - public final SDNCAdapterCallbackRule sdncAdapterCallbackRule = - new SDNCAdapterCallbackRule(processEngineRule); - - /** - * End-to-End flow - Unit test for CreateNetworkInstance.bpmn - * - String input & String response - */ - - - @Test - //@Ignore - @Deployment(resources = {"process/CreateNetworkInstance.bpmn", - "subprocess/DoCreateNetworkInstance.bpmn", - "subprocess/DoCreateNetworkInstanceRollback.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/SDNCAdapterV1.bpmn"}) - - public void shouldInvokeServiceCreateNetworkInstance_vIPER_Success1() throws Exception { - - System.out.println("-----------------------------------------------------------------"); - System.out.println(" Success vIPER 1 - CreateNetworkInstance flow Started! "); - System.out.println("-----------------------------------------------------------------"); - - // setup simulators - mockSDNCAdapterTopology("CreateNetworkV2mock/sdncCreateNetworkTopologyRsrcAssignResponse.xml", "SvcAction>assign"); - mockSDNCAdapterTopology("CreateNetworkV2mock/sdncCreateNetworkTopologySimResponse.xml", "SvcAction>activate"); - MockNetworkAdapterPost("CreateNetworkV2/createNetworkResponse_Success.xml", "createNetworkRequest"); - MockGetNetworkByName("MNS-25180-L-01-dmz_direct_net_1", "CreateNetworkV2/createNetwork_queryName_AAIResponse_Success.xml"); - MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP"); - MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml", "all"); - MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017"); - MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6"); - MockGetNetworkPolicy("CreateNetworkV2/createNetwork_queryNetworkPolicy_AAIResponse_Success.xml", "cee6d136-e378-4678-a024-2cd15f0ee0cg"); - MockGetNetworkTableReference("CreateNetworkV2/createNetwork_queryNetworkTableRef1_AAIResponse_Success.xml", "refFQDN1"); - MockGetNetworkTableReference("CreateNetworkV2/createNetwork_queryNetworkTableRef2_AAIResponse_Success.xml", "refFQDN2"); - MockPutNetworkIdWithDepth("CreateNetworkV2/createNetwork_updateContrail_AAIResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "all"); - MockUpdateRequestDB("DBUpdateResponse.xml"); - //MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "CreateNetworkV2/createNetwork_queryInstance_Success.xml", "v8"); - MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "CreateNetworkV2/createNetwork_queryInstance_Success.xml"); - - Map<String, String> variables = setupVariables1(); - //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables); - executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables); - System.out.println("----------------------------------------------------------"); - System.out.println("- got workflow response -"); - System.out.println("----------------------------------------------------------"); - //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); - - assertEquals("true", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_Success")); - assertEquals("true", getVariable(processEngineRule, "DoCreateNetworkInstance", "CRENWKI_Success")); - Assert.assertNotNull("CRENI_CompleteMsoProcessRequest - ", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_CompleteMsoProcessRequest")); - - String workflowResp = BPMNUtil.getVariable(processEngineRule, "CreateNetworkInstance", "WorkflowResponse"); - Assert.assertNotNull(workflowResp); - - System.out.println("----------------------------------------------------------"); - System.out.println(" Success vIPER 1 - CreateNetworkInstance flow Completed "); - System.out.println("----------------------------------------------------------"); - - } - - @Test - //@Ignore - @Deployment(resources = {"process/CreateNetworkInstance.bpmn", - "subprocess/DoCreateNetworkInstance.bpmn", - "subprocess/DoCreateNetworkInstanceRollback.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - "subprocess/SDNCAdapterV1.bpmn"}) - - public void shouldInvokeServiceCreateNetworkInstance_vIPER_Success2() throws Exception { - - System.out.println("----------------------------------------------------------------"); - System.out.println(" Success viPER 2 - CreateNetworkInstance flow Started! "); - System.out.println("----------------------------------------------------------------"); - - // setup simulators - mockSDNCAdapterTopology("CreateNetworkV2mock/sdncCreateNetworkTopologyRsrcAssignResponse.xml", "SvcAction>assign"); - mockSDNCAdapterTopology("CreateNetworkV2mock/sdncCreateNetworkTopologySimResponse.xml", "SvcAction>activate"); - MockNetworkAdapterPost("CreateNetworkV2/createNetworkResponse_Success.xml", "createNetworkRequest"); - MockGetNetworkByName_404("CreateNetworkV2/createNetwork_queryName_AAIResponse_Success.xml", "myOwn_Network"); - MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP"); - MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml", "all"); - MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017"); - MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6"); - MockGetNetworkPolicy("CreateNetworkV2/createNetwork_queryNetworkPolicy_AAIResponse_Success.xml", "cee6d136-e378-4678-a024-2cd15f0ee0cg"); - MockGetNetworkTableReference("CreateNetworkV2/createNetwork_queryNetworkTableRef1_AAIResponse_Success.xml", "refFQDN1"); - MockGetNetworkTableReference("CreateNetworkV2/createNetwork_queryNetworkTableRef2_AAIResponse_Success.xml", "refFQDN2"); - MockPutNetworkIdWithDepth("CreateNetworkV2/createNetwork_updateContrail_AAIResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "all"); - MockUpdateRequestDB("DBUpdateResponse.xml"); - //MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "CreateNetworkV2/createNetwork_queryInstance_Success.xml", "v8"); - MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "CreateNetworkV2/createNetwork_queryInstance_Success.xml"); - - Map<String, String> variables = setupVariables2(); - //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables); - executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables); - //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); - - assertEquals("true", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_Success")); - assertEquals("true", getVariable(processEngineRule, "DoCreateNetworkInstance", "CRENWKI_Success")); - Assert.assertNotNull("CRENI_CompleteMsoProcessRequest - ", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_CompleteMsoProcessRequest")); - - String completeMsoProcessRequest = - "<aetgt:MsoCompletionRequest xmlns:aetgt=\"http://org.openecomp/mso/workflow/schema/v1\"" + '\n' - + " xmlns:ns=\"http://org.openecomp/mso/request/types/v1\"" + '\n' - + " xmlns=\"http://org.openecomp/mso/infra/vnf-request/v1\">" + '\n' - + " <request-info>" + '\n' - + " <request-id>testRequestId</request-id>" + '\n' - + " <action>CREATE</action>" + '\n' - + " <source>VID</source>" + '\n' - + " </request-info>" + '\n' - + " <aetgt:status-message>Network has been created successfully.</aetgt:status-message>" + '\n' - + " <aetgt:mso-bpel-name>BPMN Network action: CREATE</aetgt:mso-bpel-name>" + '\n' - + "</aetgt:MsoCompletionRequest>"; - - Assert.assertEquals(completeMsoProcessRequest, getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_CompleteMsoProcessRequest")); - - System.out.println("---------------------------------------------------------"); - System.out.println(" Success viPER 2 - CreateNetworkInstance flow Completed "); - System.out.println("---------------------------------------------------------"); - - } - - @Test - //@Ignore - @Deployment(resources = {"process/CreateNetworkInstance.bpmn", - "subprocess/DoCreateNetworkInstance.bpmn", - "subprocess/DoCreateNetworkInstanceRollback.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - "subprocess/SDNCAdapterV1.bpmn"}) - - public void shouldInvokeServiceCreateNetworkInstance_VID_1610_Network_SDNC_Rollback() throws Exception { - - System.out.println("--------------------------------------------------------------------------"); - System.out.println(" Network and SDNC Rollback - CreateNetworkInstance flow Started! "); - System.out.println("--------------------------------------------------------------------------"); - - // setup simulators - mockSDNCAdapterTopology("CreateNetworkV2mock/sdncCreateNetworkTopologySimResponse.xml", "SvcAction>assign"); - mockSDNCAdapterTopology("CreateNetworkV2mock/sdncCreateNetworkTopologySimResponse.xml", "SvcAction>rollback"); - MockNetworkAdapterPost("CreateNetworkV2/createNetworkResponse_Success.xml", "createNetworkRequest"); - MockGetNetworkByName("MNS-25180-L-01-dmz_direct_net_1", "CreateNetworkV2/createNetwork_queryName_AAIResponse_Success.xml"); - MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP"); - MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml", "1"); - MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017"); - MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6"); - MockGetNetworkPolicy("CreateNetworkV2/createNetwork_queryNetworkPolicy_AAIResponse_Success.xml", "cee6d136-e378-4678-a024-2cd15f0ee0cg"); - MockGetNetworkTableReference("CreateNetworkV2/createNetwork_queryNetworkTableRef1_AAIResponse_Success.xml", "refFQDN1"); - MockGetNetworkTableReference("CreateNetworkV2/createNetwork_queryNetworkTableRef2_AAIResponse_Success.xml", "refFQDN2"); - MockUpdateRequestDB("DBUpdateResponse.xml"); - //MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "CreateNetworkV2/createNetwork_queryInstance_Success.xml", "v8"); - MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "CreateNetworkV2/createNetwork_queryInstance_Success.xml"); - MockNetworkAdapterRestRollbackDelete("deleteNetworkResponse_Success.xml","49c86598-f766-46f8-84f8-8d1c1b10f9b4"); - - Map<String, String> variables = setupVariablesVID1(); - executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables); - //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables); - //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); - - assertEquals("false", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_Success")); - assertEquals("false", getVariable(processEngineRule, "DoCreateNetworkInstance", "CRENWKI_Success")); - Assert.assertNotNull("CRENI_FalloutHandlerRequest - ", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_FalloutHandlerRequest")); - - System.out.println("--------------------------------------------------------------------"); - System.out.println(" Network and SCNC Rollback - CreateNetworkInstance flow Completed "); - System.out.println("--------------------------------------------------------------------"); - - } - - @Test - //@Ignore - @Deployment(resources = {"process/CreateNetworkInstance.bpmn", - "subprocess/DoCreateNetworkInstance.bpmn", - "subprocess/DoCreateNetworkInstanceRollback.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - "subprocess/SDNCAdapterV1.bpmn"}) - - public void shouldInvokeServiceCreateNetworkInstance_vIPER_1702_Network_SDNC_Rollback() throws Exception { - - System.out.println("--------------------------------------------------------------------------"); - System.out.println(" Network and SDNC Rollback - CreateNetworkInstance flow Started! "); - System.out.println("--------------------------------------------------------------------------"); - - // setup simulators - mockSDNCAdapterTopology("CreateNetworkV2mock/sdncCreateNetworkTopologyRsrcAssignResponse.xml", "SvcAction>assign"); - mockSDNCAdapterTopology("CreateNetworkV2mock/sdncCreateNetworkTopologySimResponse.xml", "SvcAction>unassign"); - mockSDNCAdapterTopology("CreateNetworkV2mock/sdncCreateNetworkTopologySimResponse.xml", "SvcAction>activate"); - mockSDNCAdapterTopology("CreateNetworkV2mock/sdncCreateNetworkTopologySimResponse.xml", "SvcAction>deactivate"); - MockNetworkAdapterPost("CreateNetworkV2/createNetworkResponse_Success.xml", "createNetworkRequest"); - MockGetNetworkByName("MNS-25180-L-01-dmz_direct_net_1", "CreateNetworkV2/createNetwork_queryName_AAIResponse_Success.xml"); - MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP"); - MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml", "1"); - MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017"); - MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6"); - MockGetNetworkPolicy("CreateNetworkV2/createNetwork_queryNetworkPolicy_AAIResponse_Success.xml", "cee6d136-e378-4678-a024-2cd15f0ee0cg"); - MockGetNetworkTableReference("CreateNetworkV2/createNetwork_queryNetworkTableRef1_AAIResponse_Success.xml", "refFQDN1"); - MockGetNetworkTableReference("CreateNetworkV2/createNetwork_queryNetworkTableRef2_AAIResponse_Success.xml", "refFQDN2"); - MockUpdateRequestDB("DBUpdateResponse.xml"); - //MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "CreateNetworkV2/createNetwork_queryInstance_Success.xml", "v8"); - MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "CreateNetworkV2/createNetwork_queryInstance_Success.xml"); - MockNetworkAdapterRestRollbackDelete("deleteNetworkResponse_Success.xml","49c86598-f766-46f8-84f8-8d1c1b10f9b4"); - - Map<String, String> variables = setupVariables1(); - executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables); - //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables); - //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); - - assertEquals("false", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_Success")); - assertEquals("false", getVariable(processEngineRule, "DoCreateNetworkInstance", "CRENWKI_Success")); - Assert.assertNotNull("CRENI_FalloutHandlerRequest - ", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_FalloutHandlerRequest")); - - System.out.println("--------------------------------------------------------------------"); - System.out.println(" Network and SCNC Rollback - CreateNetworkInstance flow Completed "); - System.out.println("--------------------------------------------------------------------"); - - } - - @Test - //@Ignore - @Deployment(resources = {"process/CreateNetworkInstance.bpmn", - "subprocess/DoCreateNetworkInstance.bpmn", - "subprocess/DoCreateNetworkInstanceRollback.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - "subprocess/SDNCAdapterV1.bpmn"}) - - public void shouldInvokeServiceCreateNetworkInstance_sdncFailure() throws Exception { - - System.out.println("----------------------------------------------------------------"); - System.out.println(" SNDC Failure - CreateNetworkInstance flow Started! "); - System.out.println("----------------------------------------------------------------"); - - // setup simulators - mockSDNCAdapter_500("SvcAction>query"); - MockGetNetworkByName_404("CreateNetworkV2/createNetwork_queryName_AAIResponse_Success.xml", "myOwn_Network"); - MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP"); - MockUpdateRequestDB("DBUpdateResponse.xml"); - //MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "CreateNetworkV2/createNetwork_queryInstance_Success.xml", "v8"); - MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "CreateNetworkV2/createNetwork_queryInstance_Success.xml"); - - Map<String, String> variables = setupVariables2(); - //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables); - executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables); - //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); - - assertEquals("false", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_Success")); - assertEquals("false", getVariable(processEngineRule, "DoCreateNetworkInstance", "CRENWKI_Success")); - Assert.assertNotNull("CRENI_FalloutHandlerRequest - ", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_FalloutHandlerRequest")); - - System.out.println("---------------------------------------------------------"); - System.out.println(" SNDC Failure - CreateNetworkInstance flow Completed "); - System.out.println("---------------------------------------------------------"); - - } - - @Test - //@Ignore - @Deployment(resources = {"process/CreateNetworkInstance.bpmn", - "subprocess/DoCreateNetworkInstance.bpmn", - "subprocess/DoCreateNetworkInstanceRollback.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - "subprocess/SDNCAdapterV1.bpmn"}) - - public void shouldInvokeServiceCreateNetworkInstance_queryServiceInstance404() throws Exception { - - System.out.println("----------------------------------------------------------------------------------"); - System.out.println(" Query ServiceIntance Not found - CreateNetworkInstance flow Started! "); - System.out.println("----------------------------------------------------------------------------------"); - - //setup simulators - mockSDNCAdapter_500("SvcAction>query"); - MockGetNetworkByName_404("CreateNetworkV2/createNetwork_queryName_AAIResponse_Success.xml", "myOwn_Network"); - MockUpdateRequestDB("DBUpdateResponse.xml"); - MockNodeQueryServiceInstanceById_404("f70e927b-6087-4974-9ef8-c5e4d5847ca4"); - - Map<String, String> variables = setupVariables2(); - //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables); - executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables); - //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); - - assertEquals("false", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_Success")); - assertEquals("false", getVariable(processEngineRule, "DoCreateNetworkInstance", "CRENWKI_Success")); - Assert.assertNotNull("CRENI_FalloutHandlerRequest - ", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_FalloutHandlerRequest")); - - System.out.println("---------------------------------------------------------------------------------"); - System.out.println(" Query ServiceIntance Not found - CreateNetworkInstance flow Completed "); - System.out.println("---------------------------------------------------------------------------------"); - - } - - @Test - //@Ignore - @Deployment(resources = {"process/CreateNetworkInstance.bpmn", - "subprocess/DoCreateNetworkInstance.bpmn", - "subprocess/DoCreateNetworkInstanceRollback.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - "subprocess/SDNCAdapterV1.bpmn"}) - - public void shouldInvokeServiceCreateNetworkInstance_VID_Success1() throws Exception { - - System.out.println("----------------------------------------------------------"); - System.out.println(" Success VID1 - CreateNetworkInstance flow Started! "); - System.out.println("----------------------------------------------------------"); - - // setup simulators - mockSDNCAdapterTopology("CreateNetworkV2mock/sdncCreateNetworkTopologySimResponse.xml", "SvcAction>assign"); - MockNetworkAdapterPost("CreateNetworkV2/createNetworkResponse_Success.xml", "createNetworkRequest"); - MockGetNetworkByName("MNS-25180-L-01-dmz_direct_net_1", "CreateNetworkV2/createNetwork_queryName_AAIResponse_Success.xml"); - MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP"); - MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml", "all"); - MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017"); - MockGetNetworkVpnBinding("CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6"); - MockGetNetworkPolicy("CreateNetworkV2/createNetwork_queryNetworkPolicy_AAIResponse_Success.xml", "cee6d136-e378-4678-a024-2cd15f0ee0cg"); - MockGetNetworkTableReference("CreateNetworkV2/createNetwork_queryNetworkTableRef1_AAIResponse_Success.xml", "refFQDN1"); - MockGetNetworkTableReference("CreateNetworkV2/createNetwork_queryNetworkTableRef2_AAIResponse_Success.xml", "refFQDN2"); - MockPutNetworkIdWithDepth("CreateNetworkV2/createNetwork_updateContrail_AAIResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "all"); - MockUpdateRequestDB("DBUpdateResponse.xml"); - //MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "CreateNetworkV2/createNetwork_queryInstance_Success.xml", "v8"); - MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "CreateNetworkV2/createNetwork_queryInstance_Success.xml"); - - Map<String, String> variables = setupVariablesVID1(); - //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables); - executeAsyncWorkflow(processEngineRule, "CreateNetworkInstance", variables); - System.out.println("----------------------------------------------------------"); - System.out.println("- got workflow response -"); - System.out.println("----------------------------------------------------------"); - //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); - - assertEquals("true", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_Success")); - Assert.assertNotNull("CRENI_CompleteMsoProcessRequest - ", getVariable(processEngineRule, "CreateNetworkInstance", "CRENI_CompleteMsoProcessRequest")); - - String workflowResp = BPMNUtil.getVariable(processEngineRule, "CreateNetworkInstance", "WorkflowResponse"); - Assert.assertNotNull(workflowResp); - - System.out.println("-----------------------------------------------------------"); - System.out.println(" Success VID1 - CreateNetworkInstanceInfra flow Completed "); - System.out.println("-----------------------------------------------------------"); - - } - - // ***************** - // Utility Section - // ***************** - - String networkModelInfo = - " {\"modelUuid\": \"mod-inst-uuid-123\", " + '\n' + - " \"modelName\": \"mod_inst_z_123\", " + '\n' + - " \"modelVersion\": \"mod-inst-uuid-123\", " + '\n' + - " \"modelCustomizationUuid\": \"z_network_123\", " + '\n' + - " \"modelInvariantUuid\": \"mod-invar-uuid-123\" " + '\n' + - " }"; - - String serviceModelInfo = - " {\"modelUuid\": \"36a3a8ea-49a6-4ac8-b06c-89a54544b9b6\", " + '\n' + - " \"modelName\": \"HNGW Protected OAM\", " + '\n' + - " \"modelVersion\": \"1.0\", " + '\n' + - " \"modelInvariantUuid\": \"fcc85cb0-ad74-45d7-a5a1-17c8744fdb71\" " + '\n' + - " }"; - - // Success Scenario - private Map<String, String> setupVariables1() { - Map<String, String> variables = new HashMap<>(); - variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56"); - variables.put("msoRequestId", "testRequestId"); - variables.put("requestId", "testRequestId"); - variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4"); - variables.put("networkId", "networkId"); - variables.put("networkName", "MNS-25180-L-01-dmz_direct_net_1"); - variables.put("lcpCloudRegionId", "RDM2WAGPLCP"); - variables.put("tenantId", "7dd5365547234ee8937416c65507d266"); - variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"); - variables.put("disableRollback", "false"); // macro - variables.put("failIfExists", "false"); - variables.put("sdncVersion", "1702"); - variables.put("subscriptionServiceType", "MSO-dev-service-type"); - variables.put("globalSubscriberId", "globalId_45678905678"); - variables.put("networkModelInfo", networkModelInfo); - variables.put("serviceModelInfo", serviceModelInfo); - - - return variables; - - } - - // Success Scenario 2 - private Map<String, String> setupVariables2() { - Map<String, String> variables = new HashMap<>(); - variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56"); - variables.put("msoRequestId", "testRequestId"); - variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4"); - variables.put("networkId", "networkId"); - variables.put("networkName", "myOwn_Network"); // Name Not found in AA&I - variables.put("lcpCloudRegionId", "RDM2WAGPLCP"); - variables.put("tenantId", "7dd5365547234ee8937416c65507d266"); - variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"); - variables.put("disableRollback", "false"); // 1702 - variables.put("failIfExists", "false"); - //variables.put("sdncVersion", "1702"); - variables.put("sdncVersion", "1707"); - variables.put("subscriptionServiceType", "MSO-dev-service-type"); - variables.put("globalSubscriberId", "globalId_45678905678"); - variables.put("networkModelInfo", networkModelInfo); - variables.put("serviceModelInfo", serviceModelInfo); - - return variables; - - } - - // Active Scenario - private Map<String, String> setupVariablesActive() { - Map<String, String> variables = new HashMap<>(); - variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56"); - variables.put("msoRequestId", "testRequestId"); - variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4"); - variables.put("networkId", "networkId"); - variables.put("networkName", "MNS-25180-L-01-dmz_direct_net_2"); // Unique name for Active - variables.put("lcpCloudRegionId", "RDM2WAGPLCP"); - variables.put("tenantId", "7dd5365547234ee8937416c65507d266"); - variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"); - variables.put("suppressRollback", "false"); - variables.put("disableRollback", "false"); - variables.put("failIfExists", "false"); - variables.put("sdncVersion", "1702"); - variables.put("subscriptionServiceType", "MSO-dev-service-type"); - variables.put("globalSubscriberId", "globalId_45678905678"); - variables.put("networkModelInfo", networkModelInfo); - variables.put("serviceModelInfo", serviceModelInfo); - - return variables; - - } - - // Missing Name Scenario - private Map<String, String> setupVariablesMissingName() { - Map<String, String> variables = new HashMap<>(); - //variables.put("bpmnRequest", getCreateNetworkRequestMissingName()); - variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56"); - variables.put("msoRequestId", "testRequestId"); - variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4"); - variables.put("networkId", "networkId"); - // variables.put("networkName", "MNS-25180-L-01-dmz_direct_net_2"); // Missing 'name' variable - // variables.put("networkName", ""); // Missing 'value' of name variable - variables.put("modelName", "CONTRAIL_EXTERNAL"); - variables.put("cloudConfiguration", "RDM2WAGPLCP"); - variables.put("tenantId", "7dd5365547234ee8937416c65507d266"); - variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"); - variables.put("suppressRollback", "true"); - variables.put("failIfExists", "false"); - - return variables; - - } - - // SDNC Rollback Scenario - private Map<String, String> setupVariablesSDNCRollback() { - Map<String, String> variables = new HashMap<>(); - variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56"); - variables.put("msoRequestId", "testRequestId"); - variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4"); - variables.put("networkId", "networkId"); - variables.put("networkName", "MNS-25180-L-01-dmz_direct_net_3"); // Unique name for Rollback - variables.put("modelName", "CONTRAIL_EXTERNAL"); - variables.put("cloudConfiguration", "RDM2WAGPLCP"); - variables.put("tenantId", "7dd5365547234ee8937416c65507d266"); - variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"); - variables.put("suppressRollback", "true"); - variables.put("disableRollback", "false"); - - return variables; - - } - - // old - public String getCreateNetworkRequestActive() { - - String request = - "{ \"requestDetails\": { " + '\n' + - " \"modelInfo\": { " + '\n' + - " \"modelType\": \"modelType\", " + '\n' + - " \"modelId\": \"modelId\", " + '\n' + - " \"modelCustomizationUuid\": \"modelCustUuid\", " + '\n' + - " \"modelName\": \"CONTRAIL_EXTERNAL\", " + '\n' + - " \"modelVersion\": \"1\" " + '\n' + - " }, " + '\n' + - " \"cloudConfiguration\": { " + '\n' + - " \"lcpCloudRegionId\": \"RDM2WAGPLCP\", " + '\n' + - " \"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\" " + '\n' + - " }, " + '\n' + - " \"requestInfo\": { " + '\n' + - " \"instanceName\": \"MNS-25180-L-01-dmz_direct_net_2\", " + '\n' + - " \"source\": \"VID\", " + '\n' + - " \"callbackUrl\": \"\", " + '\n' + - " \"suppressRollback\": \"false\" ," + '\n' + - " \"productFamilyId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\" " + '\n' + - " }, " + '\n' + - " \"requestParameters\": { " + '\n' + - " \"userParams\": [] " + '\n' + - " } " + '\n' + - " } " + '\n' + - "}"; - - return request; - - } - - public String getCreateNetworkRequestSDNCRollback() { - - String request = - "{ \"requestDetails\": { " + '\n' + - " \"modelInfo\": { " + '\n' + - " \"modelType\": \"modelType\", " + '\n' + - " \"modelId\": \"modelId\", " + '\n' + - " \"modelNameVersionId\": \"modelNameVersionId\", " + '\n' + - " \"modelName\": \"CONTRAIL_EXTERNAL\", " + '\n' + - " \"modelVersion\": \"1\" " + '\n' + - " }, " + '\n' + - " \"cloudConfiguration\": { " + '\n' + - " \"lcpCloudRegionId\": \"RDM2WAGPLCP\", " + '\n' + - " \"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\" " + '\n' + - " }, " + '\n' + - " \"requestInfo\": { " + '\n' + - " \"instanceName\": \"MNS-25180-L-01-dmz_direct_net_3\", " + '\n' + - " \"source\": \"VID\", " + '\n' + - " \"callbackUrl\": \"\", " + '\n' + - " \"suppressRollback\": \"true\" ," + '\n' + - " \"productFamilyId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\" " + '\n' + - " }, " + '\n' + - " \"requestParameters\": { " + '\n' + - " \"userParams\": [] " + '\n' + - " } " + '\n' + - " } " + '\n' + - "}"; - - - return request; - } - - - // VID json input - private Map<String, String> setupVariablesVID1() { - Map<String, String> variables = new HashMap<>(); - variables.put("bpmnRequest", getCreateNetworkRequestVID1()); - variables.put("mso-request-id", "testRequestId"); - //variables.put("msoRequestId", "testRequestId"); - variables.put("requestId", "testRequestId"); - variables.put("isBaseVfModule", "true"); - variables.put("recipeTimeout", "0"); - variables.put("requestAction", "CREATE"); - variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4"); - variables.put("vnfId", ""); - variables.put("vfModuleId", ""); - variables.put("volumeGroupId", ""); - //variables.put("networkId", "networkId"); - variables.put("serviceType", "vMOG"); - variables.put("vfModuleType", ""); - variables.put("networkType", "modelName"); - - return variables; - - } - - public String getCreateNetworkRequestVID1() { - - String request = - "{ \"requestDetails\": { " + '\n' + - " \"modelInfo\": { " + '\n' + - " \"modelType\": \"modelType\", " + '\n' + - " \"modelCustomizationId\": \"f21df226-8093-48c3-be7e-0408fcda0422\", " + '\n' + - " \"modelName\": \"CONTRAIL_EXTERNAL\", " + '\n' + - " \"modelVersion\": \"1.0\" " + '\n' + - " }, " + '\n' + - " \"cloudConfiguration\": { " + '\n' + - " \"lcpCloudRegionId\": \"RDM2WAGPLCP\", " + '\n' + - " \"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\" " + '\n' + - " }, " + '\n' + - " \"requestInfo\": { " + '\n' + - " \"instanceName\": \"MNS-25180-L-01-dmz_direct_net_1\", " + '\n' + - " \"source\": \"VID\", " + '\n' + - " \"callbackUrl\": \"\", " + '\n' + - " \"suppressRollback\": \"false\" ," + '\n' + - " \"productFamilyId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\" " + '\n' + - " }, " + '\n' + - " \"requestParameters\": { " + '\n' + - " \"backoutOnFailure\": false, " + '\n' + - " \"serviceId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\", " + '\n' + - " \"userParams\": [] " + '\n' + - " } " + '\n' + - " } " + '\n' + - "}"; - - return request; - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleInfraTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleInfraTest.java deleted file mode 100644 index 1e865dfd14..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleInfraTest.java +++ /dev/null @@ -1,367 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.bpmn.infrastructure;
-
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchGenericVnf;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfsByVnfId;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchVfModuleId;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockAAIVfModule;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockSDNCAdapterVfModule;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockVNFAdapterRestVfModule;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDBUpdateVfModule;
-import static org.openecomp.mso.bpmn.mock.StubResponseAPPC.MockAppcError;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-import org.junit.Ignore;
-import org.camunda.bpm.engine.test.Deployment;
-import org.junit.Test;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse;
-import org.openecomp.mso.bpmn.mock.FileUtil;
-
-/**
- * Unit test cases for CreateVfModuleInfra.bpmn
- */
-@Ignore
-public class CreateVfModuleInfraTest extends WorkflowTest {
-
- private final CallbackSet callbacks = new CallbackSet();
-
- public CreateVfModuleInfraTest() throws IOException {
- callbacks.put("assign", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyAssignCallback.xml"));
- callbacks.put("query", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyQueryCallbackVfModule.xml"));
- callbacks.put("activate", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyActivateCallback.xml"));
- callbacks.put("vnfCreate", FileUtil.readResourceFile(
- "__files/VfModularity/VNFAdapterRestCreateCallback.xml"));
- }
-
-
- /**
- * Sunny day VID scenario with preloads.
- *
- * @throws Exception
- */
- @Test
- @Deployment(resources = {
- "process/CreateVfModuleInfra.bpmn",
- "subprocess/BuildingBlock/AppCClient.bpmn",
- "subprocess/DoCreateVfModule.bpmn",
- "subprocess/GenericGetVnf.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/GenericNotificationService.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/ConfirmVolumeGroupTenant.bpmn",
- "subprocess/ConfirmVolumeGroupName.bpmn",
- "subprocess/CreateAAIVfModule.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn",
- "subprocess/CompleteMsoProcess.bpmn",
- "subprocess/FalloutHandler.bpmn",
- "subprocess/BuildingBlock/AppCClient.bpmn"
- })
- public void sunnyDayVIDWithPreloads() throws Exception {
-
- logStart();
-
- MockAAIVfModule();
- MockGetGenericVnfsByVnfId("skask","__files/AAI/AAI_genericVnfGet.json",200);
- MockPatchGenericVnf("skask");
- MockPatchVfModuleId("skask", ".*");
- MockSDNCAdapterVfModule();
- MockVNFAdapterRestVfModule();
- MockDBUpdateVfModule();
- MockAppcError();
-
- String businessKey = UUID.randomUUID().toString();
- String createVfModuleRequest =
- FileUtil.readResourceFile("__files/CreateVfModule_VID_request.json");
-
- Map<String, Object> variables = setupVariablesSunnyDayVID();
-
- TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVfModuleInfra",
- "v1", businessKey, createVfModuleRequest, variables);
-
- WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
-
- String responseBody = response.getContent();
- System.out.println("Workflow (Synch) Response:\n" + responseBody);
-
- injectSDNCCallbacks(callbacks, "assign, query");
- injectVNFRestCallbacks(callbacks, "vnfCreate");
- injectSDNCCallbacks(callbacks, "activate");
-
- // TODO add appropriate assertions
-
- waitForProcessEnd(businessKey, 10000);
- checkVariable(businessKey, "CreateVfModuleSuccessIndicator", true);
-
- logEnd();
- }
-
- /**
- * Sunny day VID scenario with no preloads.
- *
- * @throws Exception
- */
- @Test
- @Deployment(resources = {
- "process/CreateVfModuleInfra.bpmn",
- "subprocess/BuildingBlock/AppCClient.bpmn",
- "subprocess/DoCreateVfModule.bpmn",
- "subprocess/GenericGetVnf.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/ConfirmVolumeGroupTenant.bpmn",
- "subprocess/GenericNotificationService.bpmn",
- "subprocess/ConfirmVolumeGroupName.bpmn",
- "subprocess/CreateAAIVfModule.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn",
- "subprocess/CompleteMsoProcess.bpmn",
- "subprocess/FalloutHandler.bpmn",
- "subprocess/BuildingBlock/AppCClient.bpmn"
- })
- public void sunnyDayVIDNoPreloads() throws Exception {
-
- logStart();
-
- MockAAIVfModule();
- MockGetGenericVnfsByVnfId("skask","__files/AAI/AAI_genericVnfGet.json",200);
- MockPatchGenericVnf("skask");
- MockPatchVfModuleId("skask", ".*");
- MockSDNCAdapterVfModule();
- MockVNFAdapterRestVfModule();
- MockDBUpdateVfModule();
- MockAppcError();
-
- String businessKey = UUID.randomUUID().toString();
- String createVfModuleRequest =
- FileUtil.readResourceFile("__files/CreateVfModule_VID_request_noPreloads.json");
-
- Map<String, Object> variables = setupVariablesSunnyDayVID();
-
- TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVfModuleInfra",
- "v1", businessKey, createVfModuleRequest, variables);
-
- WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
-
- String responseBody = response.getContent();
- System.out.println("Workflow (Synch) Response:\n" + responseBody);
-
- injectSDNCCallbacks(callbacks, "assign, query");
- injectVNFRestCallbacks(callbacks, "vnfCreate");
- injectSDNCCallbacks(callbacks, "activate");
-
- // TODO add appropriate assertions
-
- waitForProcessEnd(businessKey, 10000);
- checkVariable(businessKey, "CreateVfModuleSuccessIndicator", true);
-
- logEnd();
- }
-
- // Active Scenario
- private Map<String, Object> setupVariablesSunnyDayVID() {
- Map<String, Object> variables = new HashMap<>();
- //try {
- //variables.put("bpmnRequest", FileUtil.readResourceFile("__files/CreateVfModule_VID_request.json"));
- //}
- //catch (Exception e) {
-
- //}
- //variables.put("mso-request-id", "testRequestId");
- variables.put("requestId", "testRequestId");
- variables.put("isBaseVfModule", false);
- variables.put("isDebugLogEnabled", "true");
- variables.put("recipeTimeout", "0");
- variables.put("requestAction", "CREATE_VF_MODULE");
- variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
- variables.put("vnfId", "skask");
- variables.put("vnfType", "vSAMP12");
- variables.put("vfModuleId", "");
- variables.put("volumeGroupId", "");
- variables.put("serviceType", "MOG");
- variables.put("vfModuleType", "");
- return variables;
-
- }
-
- /**
- * Sunny day VID with volume attach scenario.
- *
- * @throws Exception
- */
- @Test
- @Ignore
- @Deployment(resources = {
- "process/CreateVfModuleInfra.bpmn",
- "subprocess/BuildingBlock/AppCClient.bpmn",
- "subprocess/DoCreateVfModule.bpmn",
- "subprocess/GenericGetVnf.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/ConfirmVolumeGroupTenant.bpmn",
- "subprocess/ConfirmVolumeGroupName.bpmn",
- "subprocess/CreateAAIVfModule.bpmn",
- "subprocess/CreateAAIVfModuleVolumeGroup.bpmn",
- "subprocess/GenericNotificationService.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn",
- "subprocess/CompleteMsoProcess.bpmn",
- "subprocess/FalloutHandler.bpmn",
- "subprocess/BuildingBlock/AppCClient.bpmn"
- })
-
- public void sunnyDayVIDWithVolumeGroupAttach() throws Exception {
-
- logStart();
-
-
- MockAAIVfModule();
- MockGetGenericVnfsByVnfId("skask","__files/AAI/AAI_genericVnfGet.json",200);
- MockPatchGenericVnf("skask");
- MockPatchVfModuleId("skask", ".*");
- MockSDNCAdapterVfModule();
- MockVNFAdapterRestVfModule();
- MockDBUpdateVfModule();
- MockAppcError();
-
- String businessKey = UUID.randomUUID().toString();
- String createVfModuleRequest =
- FileUtil.readResourceFile("__files/CreateVfModuleVolumeGroup_VID_request.json");
-
- Map<String, Object> variables = setupVariablesSunnyDayVIDWVolumeAttach();
-
- TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVfModuleInfra",
- "v1", businessKey, createVfModuleRequest, variables);
-
- WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
-
- String responseBody = response.getContent();
- System.out.println("Workflow (Synch) Response:\n" + responseBody);
-
- injectSDNCCallbacks(callbacks, "assign, query");
- injectVNFRestCallbacks(callbacks, "vnfCreate");
- injectSDNCCallbacks(callbacks, "activate");
-
- // TODO add appropriate assertions
-
- waitForProcessEnd(businessKey, 10000);
- checkVariable(businessKey, "CreateVfModuleSuccessIndicator", true);
-
- logEnd();
- }
-
- // Active Scenario
- private Map<String, Object> setupVariablesSunnyDayVIDWVolumeAttach() {
- Map<String, Object> variables = new HashMap<>();
- //try {
- // variables.put("bpmnRequest", FileUtil.readResourceFile("__files/CreateVfModule_VID_request.json"));
- //}
- //catch (Exception e) {
-
- //}
- //variables.put("mso-request-id", "testRequestId");
- variables.put("requestId", "testRequestId");
- variables.put("isBaseVfModule", false);
- variables.put("isDebugLogEnabled", "true");
- variables.put("recipeTimeout", "0");
- variables.put("requestAction", "CREATE_VF_MODULE");
- variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
- variables.put("vnfId", "skask");
- variables.put("vnfType", "vSAMP12");
- variables.put("vfModuleId", "");
- variables.put("volumeGroupId", "78987");
- variables.put("serviceType", "MOG");
- variables.put("vfModuleType", "");
- return variables;
-
- }
- /**
- * Sunny day VID scenario with no preloads.
- *
- * @throws Exception
- */
- @Test
- @Deployment(resources = {
- "process/CreateVfModuleInfra.bpmn",
- "subprocess/BuildingBlock/AppCClient.bpmn",
- "subprocess/DoCreateVfModule.bpmn",
- "subprocess/GenericGetVnf.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/ConfirmVolumeGroupTenant.bpmn",
- "subprocess/GenericNotificationService.bpmn",
- "subprocess/ConfirmVolumeGroupName.bpmn",
- "subprocess/CreateAAIVfModule.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn",
- "subprocess/CompleteMsoProcess.bpmn",
- "subprocess/FalloutHandler.bpmn",
- "subprocess/BuildingBlock/AppCClient.bpmn"
- })
- public void sunnyDayVIDMultipleUserParamValues() throws Exception {
-
- logStart();
-
- MockAAIVfModule();
- MockGetGenericVnfsByVnfId("skask","__files/AAI/AAI_genericVnfGet.json",200);
- MockPatchGenericVnf("skask");
- MockPatchVfModuleId("skask", ".*");
- MockSDNCAdapterVfModule();
- MockVNFAdapterRestVfModule();
- MockDBUpdateVfModule();
- MockAppcError();
-
- String businessKey = UUID.randomUUID().toString();
- String createVfModuleRequest =
- FileUtil.readResourceFile("__files/CreateVfModule_VID_request_userParam.json");
-
- Map<String, Object> variables = setupVariablesSunnyDayVID();
-
- TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVfModuleInfra",
- "v1", businessKey, createVfModuleRequest, variables);
-
- WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
-
- String responseBody = response.getContent();
- System.out.println("Workflow (Synch) Response:\n" + responseBody);
-
- injectSDNCCallbacks(callbacks, "assign, query");
- injectVNFRestCallbacks(callbacks, "vnfCreate");
- injectSDNCCallbacks(callbacks, "activate");
-
- // TODO add appropriate assertions
-
- waitForProcessEnd(businessKey, 10000);
- checkVariable(businessKey, "CreateVfModuleSuccessIndicator", true);
-
- logEnd();
- }
-
-
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleVolumeInfraV1Test.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleVolumeInfraV1Test.java deleted file mode 100644 index 2e5a7a418a..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleVolumeInfraV1Test.java +++ /dev/null @@ -1,368 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.get; -import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; -import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteVolumeGroupById; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfById; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetVolumeGroupByName; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutVolumeGroupById; -import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB; -import static org.openecomp.mso.bpmn.mock.StubResponseVNFAdapter.mockPostVNFVolumeGroup; -import static org.openecomp.mso.bpmn.mock.StubResponseVNFAdapter.mockPutVNFVolumeGroupRollback; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import org.camunda.bpm.engine.test.Deployment; -import org.junit.Ignore; -import org.junit.Test; -import org.openecomp.mso.bpmn.common.WorkflowTest; -import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse; -import org.openecomp.mso.bpmn.mock.FileUtil; -import org.openecomp.mso.bpmn.mock.StubResponseAAI; - -public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest { - - public static final String _prefix = "CVFMODVOL2_"; - - private final CallbackSet callbacks = new CallbackSet(); - - public CreateVfModuleVolumeInfraV1Test() throws IOException { - callbacks.put("volumeGroupCreate", FileUtil.readResourceFile( - "__files/CreateVfModuleVolumeInfraV1/CreateVfModuleVolumeCallbackResponse.xml")); - callbacks.put("volumeGroupDelete", FileUtil.readResourceFile( - "__files/DeleteVfModuleVolumeInfraV1/DeleteVfModuleVolumeCallbackResponse.xml")); - callbacks.put("volumeGroupException", FileUtil.readResourceFile( - "__files/CreateVfModuleVolumeInfraV1/CreateVfModuleCallbackException.xml")); - callbacks.put("volumeGroupRollback", FileUtil.readResourceFile( - "__files/CreateVfModuleVolumeInfraV1/RollbackVfModuleVolumeCallbackResponse.xml")); - } - - /** - * Happy path scenario for VID - *****************************/ - @Test - //@Ignore - @Deployment(resources = {"process/CreateVfModuleVolumeInfraV1.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/DoCreateVfModuleVolumeV2.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - "subprocess/VnfAdapterRestV1.bpmn"}) - public void TestSuccess() throws Exception { - - logStart(); - - MockNodeQueryServiceInstanceById("test-service-instance-id", "CreateVfModuleVolumeInfraV1/getSIUrlById.xml"); - MockGetGenericVnfById("/TEST-VNF-ID-0123", "CreateVfModuleVolumeInfraV1/GenericVnf.xml", 200); - MockPutVolumeGroupById("AAIAIC25", "TEST-VOLUME-GROUP-ID-0123", "CreateVfModuleVolumeInfraV1/createVfModuleVolume_createVolumeName_AAIResponse_Success.xml", 201); - MockGetVolumeGroupByName("AAIAIC25", "MSOTESTVOL101a-vSAMP12_base_vol_module-0", "CreateVfModuleVolumeInfraV1/createVfModuleVolume_queryVolumeName_AAIResponse_Success.xml", 200); - MockPutVolumeGroupById("AAIAIC25", "8424bb3c-c3e7-4553-9662-469649ed9379", "CreateVfModuleVolumeInfraV1/createVfModuleVolume_updateVolumeName_AAIResponse_Success.xml", 200); - mockPostVNFVolumeGroup(202); - - String businessKey = UUID.randomUUID().toString(); - String createVfModuleVolRequest = FileUtil.readResourceFile("__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request.json"); - - Map<String, Object> testVariables = new HashMap<>(); - testVariables.put("requestId", "TEST-REQUEST-ID-0123"); - testVariables.put("serviceInstanceId", "test-service-instance-id"); - testVariables.put("vnfId", "TEST-VNF-ID-0123"); - testVariables.put("test-volume-group-name", "TEST-MSOTESTVOL101a-vSAMP12_base_vol_module-0"); - testVariables.put("test-volume-group-id", "TEST-VOLUME-GROUP-ID-0123"); - - TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVfModuleVolumeInfraV1", "v1", businessKey, createVfModuleVolRequest, testVariables); - WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 1000000); - - String responseBody = response.getContent(); - System.out.println("Workflow (Synch) Response:\n" + responseBody); - - injectVNFRestCallbacks(callbacks, "volumeGroupCreate"); - - waitForProcessEnd(businessKey, 100000); - checkVariable(businessKey, "CVMVINFRAV1_SuccessIndicator", true); - - logEnd(); - } - - /** - * Fail - trigger rollback - *****************************/ - @Test - //@Ignore - @Deployment(resources = {"process/CreateVfModuleVolumeInfraV1.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/DoCreateVfModuleVolumeV2.bpmn", - "subprocess/DoCreateVfModuleVolumeRollback.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - "subprocess/VnfAdapterRestV1.bpmn"}) - public void TestRollback() throws Exception { - - logStart(); - - MockNodeQueryServiceInstanceById("test-service-instance-id", "CreateVfModuleVolumeInfraV1/getSIUrlById.xml"); - MockGetGenericVnfById("/TEST-VNF-ID-0123", "CreateVfModuleVolumeInfraV1/GenericVnf.xml", 200); - MockPutVolumeGroupById("AAIAIC25", "TEST-VOLUME-GROUP-ID-0123", "CreateVfModuleVolumeInfraV1/createVfModuleVolume_createVolumeName_AAIResponse_Success.xml", 201); - mockPostVNFVolumeGroup(202); - mockPutVNFVolumeGroupRollback("TEST-VOLUME-GROUP-ID-0123", 202); - MockDeleteVolumeGroupById("AAIAIC25", "8424bb3c-c3e7-4553-9662-469649ed9379", "1460134360", 202); - StubResponseAAI.MockGetVolumeGroupByName_404("AAIAIC25", "TEST-MSOTESTVOL101a-vSAMP12_base_vol_module-0"); - StubResponseAAI.MockGetVolumeGroupByName("AAIAIC25", "MSOTESTVOL101a-vSAMP12_base_vol_module-0", "CreateVfModuleVolumeInfraV1/createVfModuleVolume_queryVolumeName_AAIResponse_Success.xml", 200); - StubResponseAAI.MockDeleteVolumeGroup("AAIAIC25", "8424bb3c-c3e7-4553-9662-469649ed9379", "1460134360"); - - String businessKey = UUID.randomUUID().toString(); - String createVfModuleVolRequest = FileUtil.readResourceFile("__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request.json"); - - Map<String, Object> testVariables = new HashMap<>(); - testVariables.put("requestId", "TEST-REQUEST-ID-0123"); - testVariables.put("serviceInstanceId", "test-service-instance-id"); - testVariables.put("vnfId", "TEST-VNF-ID-0123"); - testVariables.put("test-volume-group-name", "TEST-MSOTESTVOL101a-vSAMP12_base_vol_module-0"); - testVariables.put("test-volume-group-id", "TEST-VOLUME-GROUP-ID-0123"); - - TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVfModuleVolumeInfraV1", "v1", businessKey, createVfModuleVolRequest, testVariables); - WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 1000000); - - String responseBody = response.getContent(); - System.out.println("Workflow (Synch) Response:\n" + responseBody); - - injectVNFRestCallbacks(callbacks, "volumeGroupCreate"); - injectVNFRestCallbacks(callbacks, "volumeGroupDelete"); - - waitForProcessEnd(businessKey, 100000); - checkVariable(businessKey, "CVMVINFRAV1_SuccessIndicator", false); - - logEnd(); - } - - /** - * Happy path scenario for VID - *****************************/ - @Test - @Ignore - @Deployment(resources = {"process/CreateVfModuleVolumeInfraV1.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/DoCreateVfModuleVolumeV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - "subprocess/VnfAdapterRestV1.bpmn"}) - public void TestVolumeGroupAlreadyExists() throws Exception { - - logStart(); - - MockGetVolumeGroupByName("AAIAIC25", "TEST-MSOTESTVOL101a-vSAMP12_base_vol_module-0", "CreateVfModuleVolumeInfraV1/createVfModuleVolume_queryVolumeName_AAIResponse_Success.xml", 200); - MockGetGenericVnfById("TEST-VNF-ID-0123", "CreateVfModuleVolumeInfraV1/GenericVnf.xml", 200); - MockNodeQueryServiceInstanceById("test-service-instance-id", "CreateVfModuleVolumeInfraV1/getSIUrlById.xml"); - - String businessKey = UUID.randomUUID().toString(); - String createVfModuleVolRequest = FileUtil.readResourceFile("__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request.json"); - - Map<String, Object> testVariables = new HashMap<>(); - testVariables.put("requestId", "TEST-REQUEST-ID-0123"); - testVariables.put("serviceInstanceId", "test-service-instance-id"); - testVariables.put("vnfId", "TEST-VNF-ID-0123"); - testVariables.put("test-volume-group-name", "TEST-MSOTESTVOL101a-vSAMP12_base_vol_module-0"); - testVariables.put("test-volume-group-id", "TEST-VOLUME-GROUP-ID-0123"); - - TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVfModuleVolumeInfraV1", "v1", businessKey, createVfModuleVolRequest, testVariables); - WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 1000000); - - String responseBody = response.getContent(); - System.out.println("Workflow (Synch) Response:\n" + responseBody); - - //injectVNFRestCallbacks(callbacks, "volumeGroupCreate"); - - waitForProcessEnd(businessKey, 100000); - checkVariable(businessKey, "CVMVINFRAV1_SuccessIndicator", false); - - logEnd(); - } - - /** - *Vnf Create fail - *****************************/ - @Test - @Ignore - @Deployment(resources = {"process/CreateVfModuleVolumeInfraV1.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/DoCreateVfModuleVolumeV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - "subprocess/VnfAdapterRestV1.bpmn"}) - public void TestVNfCreateFail() throws Exception { - - logStart(); - - MockNodeQueryServiceInstanceById("test-service-instance-id", "CreateVfModuleVolumeInfraV1/getSIUrlById.xml"); - MockGetGenericVnfById("/TEST-VNF-ID-0123", "CreateVfModuleVolumeInfraV1/GenericVnf.xml", 200); - MockPutVolumeGroupById("AAIAIC25", "TEST-VOLUME-GROUP-ID-0123", "CreateVfModuleVolumeInfraV1/createVfModuleVolume_createVolumeName_AAIResponse_Success.xml", 201); - MockGetVolumeGroupByName("AAIAIC25", "MSOTESTVOL101a-vSAMP12_base_vol_module-0", "CreateVfModuleVolumeInfraV1/createVfModuleVolume_queryVolumeName_AAIResponse_Success.xml", 200); - MockPutVolumeGroupById("AAIAIC25", "8424bb3c-c3e7-4553-9662-469649ed9379", "CreateVfModuleVolumeInfraV1/createVfModuleVolume_updateVolumeName_AAIResponse_Success.xml", 200); - mockPostVNFVolumeGroup(202); - MockDeleteVolumeGroupById("AAIAIC25", "8424bb3c-c3e7-4553-9662-469649ed9379", "1460134360", 204); - - String businessKey = UUID.randomUUID().toString(); - String createVfModuleVolRequest = FileUtil.readResourceFile("__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request.json"); - - Map<String, Object> testVariables = new HashMap<>(); - testVariables.put("requestId", "TEST-REQUEST-ID-0123"); - testVariables.put("serviceInstanceId", "test-service-instance-id"); - testVariables.put("vnfId", "TEST-VNF-ID-0123"); - testVariables.put("test-volume-group-name", "TEST-MSOTESTVOL101a-vSAMP12_base_vol_module-0"); - testVariables.put("test-volume-group-id", "TEST-VOLUME-GROUP-ID-0123"); - - TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVfModuleVolumeInfraV1", "v1", businessKey, createVfModuleVolRequest, testVariables); - WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 1000000); - - String responseBody = response.getContent(); - System.out.println("Workflow (Synch) Response:\n" + responseBody); - - injectVNFRestCallbacks(callbacks, "volumeGroupException"); - - waitForProcessEnd(businessKey, 100000); - checkVariable(businessKey, "CVMVINFRAV1_SuccessIndicator", false); - - logEnd(); - } - - - /** - * Error scenario - vnf not found - ********************************/ - @Test - @Ignore - @Deployment(resources = {"process/CreateVfModuleVolumeInfraV1.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/DoCreateVfModuleVolumeV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - "subprocess/VnfAdapterRestV1.bpmn"}) - public void TestFailVnfNotFound() throws Exception { - - logStart(); - - MockNodeQueryServiceInstanceById("test-service-instance-id", "CreateVfModuleVolumeInfraV1/getSIUrlById.xml"); - - String businessKey = UUID.randomUUID().toString(); - String createVfModuleVolRequest = FileUtil.readResourceFile("__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request_noreqparm.json"); - - Map<String, Object> testVariables = new HashMap<>(); - testVariables.put("requestId", "TEST-REQUEST-ID-0123"); - testVariables.put("serviceInstanceId", "test-service-instance-id"); - testVariables.put("vnfId", "TEST-VNF-ID-0123"); - testVariables.put("test-volume-group-name", "TEST-MSOTESTVOL101a-vSAMP12_base_vol_module-0"); - - TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVfModuleVolumeInfraV1", "v1", businessKey, createVfModuleVolRequest, testVariables); - WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 1000000); - - String responseBody = response.getContent(); - System.out.println("Workflow (Synch) Response:\n" + responseBody); - - //injectVNFRestCallbacks(callbacks, "volumeGroupCreate"); - - waitForProcessEnd(businessKey, 100000); - checkVariable(businessKey, "CVMVINFRAV1_SuccessIndicator", false); - - logEnd(); - } - - /** - * Error scenario - error in validation - **************************************/ - @Test - @Ignore - @Deployment(resources = {"process/CreateVfModuleVolumeInfraV1.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/DoCreateVfModuleVolumeV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - "subprocess/VnfAdapterRestV1.bpmn"}) - public void TestFailNoVnfPassed() throws Exception { - - logStart(); - - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - String createVfModuleVolRequest = FileUtil.readResourceFile("__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request.json"); - - Map<String, Object> testVariables = new HashMap<>(); - testVariables.put("requestId", "TEST-REQUEST-ID-0123"); - testVariables.put("serviceInstanceId", "test-service-instance-id"); - //testVariables.put("vnfId", "TEST-VNF-ID-0123"); - testVariables.put("test-volume-group-name", "TEST-MSOTESTVOL101a-vSAMP12_base_vol_module-0"); - - TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVfModuleVolumeInfraV1", "v1", businessKey, createVfModuleVolRequest, testVariables); - WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 1000000); - - String responseBody = response.getContent(); - System.out.println("Workflow (Synch) Response:\n" + responseBody); - waitForProcessEnd(businessKey, 100000); - checkVariable(businessKey, "CVMVINFRAV1_SuccessIndicator", false); - - logEnd(); - } - - /** - * Error scenario - service instance not found - *********************************************/ - @Test - @Ignore - @Deployment(resources = {"process/CreateVfModuleVolumeInfraV1.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/DoCreateVfModuleVolumeV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - "subprocess/VnfAdapterRestV1.bpmn"}) - public void TestFailServiceInstanceNotFound() throws Exception { - - logStart(); - - MockNodeQueryServiceInstanceById("test-service-instance-id", "CreateVfModuleVolumeInfraV1/getSIUrlById.xml"); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - String createVfModuleVolRequest = FileUtil.readResourceFile("__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request.json"); - - Map<String, Object> testVariables = new HashMap<>(); - testVariables.put("requestId", "TEST-REQUEST-ID-0123"); - testVariables.put("serviceInstanceId", "test-service-instance-id"); - //testVariables.put("vnfId", "TEST-VNF-ID-0123"); - testVariables.put("test-volume-group-name", "TEST-MSOTESTVOL101a-vSAMP12_base_vol_module-0"); - - TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVfModuleVolumeInfraV1", "v1", businessKey, createVfModuleVolRequest, testVariables); - WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 1000000); - - String responseBody = response.getContent(); - System.out.println("Workflow (Synch) Response:\n" + responseBody); - waitForProcessEnd(businessKey, 100000); - checkVariable(businessKey, "CVMVINFRAV1_SuccessIndicator", false); - - logEnd(); - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVnfInfraTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVnfInfraTest.java deleted file mode 100644 index db43de7f14..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVnfInfraTest.java +++ /dev/null @@ -1,225 +0,0 @@ -/* - * © 2014 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property. - */ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.get; -import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; -import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching; -import static org.junit.Assert.assertEquals; -import static org.openecomp.mso.bpmn.common.BPMNUtil.executeWorkFlow; -import static org.openecomp.mso.bpmn.common.BPMNUtil.waitForWorkflowToFinish; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByName_404; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById_404; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutGenericVnf; -import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.MockGetVnfCatalogDataCustomizationUuid; -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.Ignore; -import org.junit.Test; -import org.openecomp.mso.bpmn.common.BPMNUtil; -import org.openecomp.mso.bpmn.common.WorkflowTest; -import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse; -import org.openecomp.mso.bpmn.mock.FileUtil; - -/** - * Unit Test for the CreateVnfInfra Flow - */ -public class CreateVnfInfraTest extends WorkflowTest { - - private String createVnfInfraRequest; - private final CallbackSet callbacks = new CallbackSet(); - - - public CreateVnfInfraTest() throws IOException { - createVnfInfraRequest = FileUtil.readResourceFile("__files/InfrastructureFlows/CreateVnfInfraRequest.json"); - callbacks.put("assign", FileUtil.readResourceFile( - "__files/VfModularity/SDNCTopologyAssignCallback.xml")); - callbacks.put("activate", FileUtil.readResourceFile( - "__files/VfModularity/SDNCTopologyActivateCallback.xml")); - } - - @Test - @Deployment(resources = {"subprocess/DoCreateVnf.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/GenericGetVnf.bpmn", - "subprocess/GenericPutVnf.bpmn", - "subprocess/SDNCAdapterV1.bpmn", - "process/CreateVnfInfra.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/CompleteMsoProcess.bpmn"}) - public void testCreateVnfInfra_success() throws Exception{ - - MockNodeQueryServiceInstanceById("MIS%2F1604%2F0026%2FSW_INTERNET", "GenericFlows/getSIUrlById.xml"); - MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml"); - MockGetGenericVnfByName_404(); - MockPutGenericVnf(); - MockGetVnfCatalogDataCustomizationUuid("customizationId123", "VIPR/getCatalogVnfData.json"); - mockSDNCAdapter("/SDNCAdapter", "vnf-type>STMTN", 200, "VfModularity/StandardSDNCSynchResponse.xml"); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - setVariablesSuccess(variables, createVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET"); - TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVnfInfra", - "v1", businessKey, createVnfInfraRequest, variables); - - WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000); - - String responseBody = response.getContent(); - System.out.println("Workflow (Synch) Response:\n" + responseBody); - - //injectSDNCCallbacks(callbacks, "assign, query"); - //injectSDNCCallbacks(callbacks, "activate"); - - // TODO add appropriate assertions - - waitForProcessEnd(businessKey, 10000); - String status = BPMNUtil.getVariable(processEngineRule, "CreateVnfInfra", "CreateVnfInfraStatus"); - assertEquals("Success", status); - - logEnd(); - - //WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CreateVnfInfra", variables); - // injectSDNCCallbacks(callbacks, "assign"); - // injectSDNCCallbacks(callbacks, "activate"); - //waitForProcessEnd(businessKey, 10000); - //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); - - //assertVariables("true", "true", "false", "true", "Success", null); - - } - - @Test - @Deployment(resources = {"subprocess/GenericGetService.bpmn", "subprocess/GenericGetVnf.bpmn", "subprocess/GenericPutVnf.bpmn", "process/CreateVnfInfra.bpmn", "subprocess/FalloutHandler.bpmn", "subprocess/CompleteMsoProcess.bpmn"}) - public void testCreateVnfInfra_error_badRequest() throws Exception{ - - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - Map<String, String> variables = new HashMap<>(); - setVariables(variables, null, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET"); - - WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CreateVnfInfra", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); - - assertVariables(null, null, null, null, null, "WorkflowException[processKey=CreateVnfInfra,errorCode=2500,errorMessage=Internal Error - WorkflowException Object and/or RequestInfo is null! CreateVnfInfra]"); - - } - - @Test - @Ignore - @Deployment(resources = {"subprocess/DoCreateVnf.bpmn", "subprocess/GenericGetService.bpmn", "subprocess/GenericGetVnf.bpmn", "subprocess/GenericPutVnf.bpmn", "process/CreateVnfInfra.bpmn", "subprocess/FalloutHandler.bpmn", "subprocess/CompleteMsoProcess.bpmn"}) - public void testCreateVnfInfra_error_siNotFound() throws Exception{ - - MockNodeQueryServiceInstanceById_404("MIS%2F1604%2F0026%2FSW_INTERNET"); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - Map<String, String> variables = new HashMap<>(); - setVariables(variables, createVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET"); - - WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CreateVnfInfra", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); - - assertVariables(null, null, null, null, null, "WorkflowException[processKey=DoCreateVnf,errorCode=404,errorMessage=Service Instance Not Found]"); - - } - - @Test - @Ignore - @Deployment(resources = {"subprocess/DoCreateVnf.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/GenericGetVnf.bpmn", - "subprocess/GenericPutVnf.bpmn", - "process/CreateVnfInfra.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/CompleteMsoProcess.bpmn"}) - public void testCreateVnfInfra_error_vnfExist() throws Exception{ - MockNodeQueryServiceInstanceById("MIS%2F1604%2F0026%2FSW_INTERNET", "GenericFlows/getSIUrlById.xml"); - MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml"); - - stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=testVnfName123&depth=1")) - .willReturn(aResponse() - .withStatus(200) - .withHeader("Content-Type", "text/xml") - .withBodyFile("GenericFlows/getGenericVnfResponse.xml"))); - - MockPutGenericVnf(); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - Map<String, String> variables = new HashMap<>(); - setVariables(variables, createVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET"); - - WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CreateVnfInfra", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); - - assertVariables(null, null, null, null, null, "WorkflowException[processKey=DoCreateVnf,errorCode=5000,errorMessage=Generic Vnf Already Exist.]"); - - } - - private void assertVariables(String exSIFound, String exSISucc, String exVnfFound, String exVnfSucc, String exResponse, String exWorkflowException) { - - String siFound = BPMNUtil.getVariable(processEngineRule, "CreateVnfInfra", "GENGS_FoundIndicator"); - String siSucc = BPMNUtil.getVariable(processEngineRule, "CreateVnfInfra", "GENGS_SuccessIndicator"); - String vnfFound = BPMNUtil.getVariable(processEngineRule, "CreateVnfInfra", "GENGV_FoundIndicator"); - String vnfSucc = BPMNUtil.getVariable(processEngineRule, "CreateVnfInfra", "GENGV_SuccessIndicator"); - String response = BPMNUtil.getVariable(processEngineRule, "CreateVnfInfra", "WorkflowResponse"); - String workflowException = BPMNUtil.getVariable(processEngineRule, "CreateVnfInfra", "SavedWorkflowException1"); - - assertEquals(exSIFound, siFound); - assertEquals(exSISucc, siSucc); - assertEquals(exVnfFound, vnfFound); - assertEquals(exVnfSucc, vnfSucc); - assertEquals(exResponse, response); - assertEquals(exWorkflowException, workflowException); - } - - private void setVariables(Map<String, String> variables, String request, String requestId, String siId) { - variables.put("isDebugLogEnabled", "true"); - variables.put("bpmnRequest", request); - variables.put("mso-request-id", requestId); - variables.put("serviceInstanceId",siId); - variables.put("testVnfId","testVnfId123"); - variables.put("vnfType", "STMTN"); - } - - private void setVariablesSuccess(Map<String, Object> variables, String request, String requestId, String siId) { - variables.put("isDebugLogEnabled", "true"); - //variables.put("bpmnRequest", request); - //variables.put("mso-request-id", requestId); - variables.put("serviceInstanceId",siId); - variables.put("requestId", requestId); - variables.put("testVnfId","testVnfId123"); - variables.put("vnfType", "STMTN"); - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteGenericALaCarteServiceInstanceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteGenericALaCarteServiceInstanceTest.java deleted file mode 100644 index 1a52041bd7..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteGenericALaCarteServiceInstanceTest.java +++ /dev/null @@ -1,111 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.bpmn.infrastructure;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.openecomp.mso.bpmn.common.BPMNUtil.executeWorkFlow;
-import static org.openecomp.mso.bpmn.common.BPMNUtil.waitForWorkflowToFinish;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteServiceInstance;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById;
-import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.camunda.bpm.engine.test.Deployment;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.openecomp.mso.bpmn.common.BPMNUtil;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse;
-
-/**
- * Unit test cases for DelServiceInstance.bpmn
- */
-public class DeleteGenericALaCarteServiceInstanceTest extends WorkflowTest {
-
- public DeleteGenericALaCarteServiceInstanceTest() throws IOException {
- }
-
- /**
- * Sunny day VID scenario.
- *
- * @throws Exception
- */
- @Ignore // IGNORED FOR 1710 MERGE TO ONAP
- @Test
- @Deployment(resources = {
- "process/DeleteGenericALaCarteServiceInstance.bpmn",
- "subprocess/DoDeleteServiceInstance.bpmn",
- "subprocess/GenericDeleteService.bpmn",
- "subprocess/GenericGetService.bpmn",
- "subprocess/CompleteMsoProcess.bpmn",
- "subprocess/FalloutHandler.bpmn" })
- public void sunnyDayAlaCarte() throws Exception {
-
- logStart();
-
- //AAI
- MockDeleteServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "");
- MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getSINoRelations.xml");
- MockNodeQueryServiceInstanceById("MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getSIUrlById.xml");
- //DB
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
-
- String businessKey = UUID.randomUUID().toString();
-
- Map<String, String> variables = setupVariables();
- WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "DeleteGenericALaCarteServiceInstance", variables);
- waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
-
- String workflowResp = BPMNUtil.getVariable(processEngineRule, "DeleteGenericALaCarteServiceInstance", "WorkflowResponse");
- //assertNotNull(workflowResp);
- System.out.println("Workflow (Synch) Response:\n" + workflowResp);
- String workflowException = BPMNUtil.getVariable(processEngineRule, "DeleteGenericALaCarteServiceInstance", "WorkflowException");
- String completionReq = BPMNUtil.getVariable(processEngineRule, "DeleteGenericALaCarteServiceInstance", "completionRequest");
- System.out.println("completionReq:\n" + completionReq);
- System.out.println("workflowException:\n" + workflowException);
- assertNotNull(completionReq);
- assertEquals(null, workflowException);
-
- logEnd();
- }
-
- // Success Scenario
- private Map<String, String> setupVariables() {
- Map<String, String> variables = new HashMap<>();
- variables.put("isDebugLogEnabled", "true");
- variables.put("bpmnRequest", getRequest());
- variables.put("mso-request-id", "RaaTestRequestId-1");
- variables.put("serviceInstanceId","MIS%252F1604%252F0026%252FSW_INTERNET");
- return variables;
- }
-
- public String getRequest() {
- String request = "{\"requestDetails\":{\"modelInfo\":{\"modelType\":\"service\",\"modelInvariantUuid\":\"uuid-miu-svc-011-abcdef\",\"modelUuid\":\"ASDC_TOSCA_UUID\",\"modelName\":\"SIModelName1\",\"modelVersion\":\"2\"},\"subscriberInfo\":{\"globalSubscriberId\":\"SDN-ETHERNET-INTERNET\",\"subscriberName\":\"\"},\"requestInfo\":{\"instanceName\":\"1604-MVM-26\",\"source\":\"VID\",\"suppressRollback\":\"true\",\"productFamilyId\":\"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\"},\"cloudConfiguration\":{\"lcpCloudRegionId\":\"mdt1\",\"tenantId\":\"8b1df54faa3b49078e3416e21370a3ba\"},\"requestParameters\":{\"subscriptionServiceType\":\"123456789\",\"aLaCarte\":\"false\",\"userParams\":\"somep\"}}}";
- return request;
- }
-
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteNetworkInstanceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteNetworkInstanceTest.java deleted file mode 100644 index 9c32abe373..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteNetworkInstanceTest.java +++ /dev/null @@ -1,341 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.bpmn.infrastructure;
-
-import static org.openecomp.mso.bpmn.common.BPMNUtil.executeAsyncWorkflow;
-import static org.openecomp.mso.bpmn.common.BPMNUtil.getVariable;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetCloudRegion;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkByIdWithDepth;
-import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
-import static org.openecomp.mso.bpmn.mock.StubResponseNetworkAdapter.MockNetworkAdapter;
-import static org.openecomp.mso.bpmn.mock.StubResponseNetworkAdapter.MockNetworkAdapterContainingRequest;
-import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
-import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapterTopology;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.camunda.bpm.engine.test.Deployment;
-import org.junit.Assert;
-import org.junit.Rule;
-import org.junit.Test;
-import org.openecomp.mso.bpmn.common.BPMNUtil;
-import org.openecomp.mso.bpmn.common.SDNCAdapterCallbackRule;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
-import org.openecomp.mso.bpmn.common.WorkflowTestTransformer;
-import org.openecomp.mso.bpmn.mock.SDNCAdapterNetworkTopologyMockTransformer;
-
-import com.github.tomakehurst.wiremock.extension.ResponseTransformer;
-
-
-/**
- * Unit test cases for DeleteNetworkInstance.bpmn
- *
- */
-//@Ignore
-public class DeleteNetworkInstanceTest extends WorkflowTest {
- @WorkflowTestTransformer
- public static final ResponseTransformer sdncAdapterMockTransformer =
- new SDNCAdapterNetworkTopologyMockTransformer();
-
- @Rule
- public final SDNCAdapterCallbackRule sdncAdapterCallbackRule =
- new SDNCAdapterCallbackRule(processEngineRule);
-
- /**
- * End-to-End flow - Unit test for DeleteNetworkInstance.bpmn
- * - String input & String response
- */
-
- @Test
- //@Ignore
- @Deployment(resources = {"process/DeleteNetworkInstance.bpmn",
- "subprocess/DoDeleteNetworkInstance.bpmn",
- "subprocess/DoDeleteNetworkInstanceRollback.bpmn",
- "subprocess/FalloutHandler.bpmn",
- "subprocess/CompleteMsoProcess.bpmn",
- "subprocess/SDNCAdapterV1.bpmn"})
-
- public void shouldInvokeServiceDeleteNetworkInstance_VID_Success() throws Exception {
-
- System.out.println("----------------------------------------------------------");
- System.out.println(" Success VID - DeleteNetworkInstance flow Started! ");
- System.out.println("----------------------------------------------------------");
-
- // setup simulators
- mockSDNCAdapterTopology("DeleteNetworkV2mock/sdncDeleteNetworkTopologySimResponse.xml", "SvcAction>delete");
- MockNetworkAdapter("bdc5efe8-404a-409b-85f6-0dcc9eebae30", 200, "deleteNetworkResponse_Success.xml");
- MockGetNetworkByIdWithDepth("bdc5efe8-404a-409b-85f6-0dcc9eebae30", "DeleteNetworkV2/deleteNetworkAAIResponse_Success.xml", "all");
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
- MockGetCloudRegion("RDM2WAGPLCP", 200, "DeleteNetworkV2/cloudRegion30_AAIResponse_Success.xml");
-
- Map<String, String> variables = new HashMap<>();
- variables.put("mso-request-id", "testRequestId");
- variables.put("requestId", "testRequestId");
- variables.put("isBaseVfModule", "true");
- variables.put("recipeTimeout", "0");
- variables.put("requestAction", "DELETE");
- variables.put("serviceInstanceId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
- variables.put("vnfId", "");
- variables.put("vfModuleId", "");
- variables.put("volumeGroupId", "");
- variables.put("networkId", "bdc5efe8-404a-409b-85f6-0dcc9eebae30");
- variables.put("serviceType", "MOG");
- variables.put("vfModuleType", "");
- variables.put("networkType", "modelName");
- variables.put("bpmnRequest", getDeleteNetworkInstanceInfraRequest());
-
- executeAsyncWorkflow(processEngineRule, "DeleteNetworkInstance", variables);
-
- Assert.assertNotNull("DELNI_CompleteMsoProcessRequest - ", getVariable(processEngineRule, "DeleteNetworkInstance", "DELNI_CompleteMsoProcessRequest"));
- Assert.assertEquals("true", getVariable(processEngineRule, "DeleteNetworkInstance", "DELNI_Success"));
-
- String workflowResp = BPMNUtil.getVariable(processEngineRule, "DeleteNetworkInstance", "WorkflowResponse");
- Assert.assertNotNull(workflowResp);
- System.out.println("DeleteNetworkInstanceTest.shouldInvokeServiceDeleteNetworkInstance_Success() WorkflowResponse:\n" + workflowResp);
-
- String completeMsoProcessRequest =
- "<aetgt:MsoCompletionRequest xmlns:aetgt=\"http://org.openecomp/mso/workflow/schema/v1\"" + '\n'
- + " xmlns:ns=\"http://org.openecomp/mso/request/types/v1\"" + '\n'
- + " xmlns=\"http://org.openecomp/mso/infra/vnf-request/v1\">" + '\n'
- + " <request-info>" + '\n'
- + " <request-id>testRequestId</request-id>" + '\n'
- + " <action>DELETE</action>" + '\n'
- + " <source>VID</source>" + '\n'
- + " </request-info>" + '\n'
- + " <aetgt:status-message>Network has been deleted successfully.</aetgt:status-message>" + '\n'
- + " <aetgt:mso-bpel-name>BPMN Network action: DELETE</aetgt:mso-bpel-name>" + '\n'
- + "</aetgt:MsoCompletionRequest>";
-
- Assert.assertEquals(completeMsoProcessRequest, getVariable(processEngineRule, "DeleteNetworkInstance", "DELNI_CompleteMsoProcessRequest"));
-
- System.out.println("----------------------------------------------------------");
- System.out.println(" Success VID - DeleteNetworkInstance flow Completed ");
- System.out.println("----------------------------------------------------------");
-
-
- }
-
- @Test
- //@Ignore
- @Deployment(resources = {"process/DeleteNetworkInstance.bpmn",
- "subprocess/DoDeleteNetworkInstance.bpmn",
- //"subprocess/DoDeleteNetworkInstanceRollback.bpmn",
- "subprocess/FalloutHandler.bpmn",
- "subprocess/CompleteMsoProcess.bpmn",
- "subprocess/SDNCAdapterV1.bpmn"})
-
- public void shouldInvokeServiceDeleteNetworkInstance_vIPER_Success() throws Exception {
-
- System.out.println("----------------------------------------------------------");
- System.out.println(" Success vIPER - DeleteNetworkInstance flow Started! ");
- System.out.println("----------------------------------------------------------");
-
- // setup simulators
- mockSDNCAdapterTopology("DeleteNetworkV2mock/sdncDeleteNetworkTopologySimResponse.xml", "SvcAction>unassign");
- mockSDNCAdapterTopology("DeleteNetworkV2mock/sdncDeleteNetworkTopologySimResponse.xml", "SvcAction>deactivate");
- MockNetworkAdapter("bdc5efe8-404a-409b-85f6-0dcc9eebae30", 200, "deleteNetworkResponse_Success.xml");
- MockGetNetworkByIdWithDepth("bdc5efe8-404a-409b-85f6-0dcc9eebae30", "DeleteNetworkV2/deleteNetworkAAIResponse_Success.xml", "all");
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
- MockGetCloudRegion("RDM2WAGPLCP", 200, "DeleteNetworkV2/cloudRegion30_AAIResponse_Success.xml");
-
- String networkModelInfo = " {\"modelName\": \"modelName\", " + '\n' +
- " \"networkType\": \"modelName\" }";
-
- Map<String, String> variables = new HashMap<>();
- variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");
- variables.put("msoRequestId", "testRequestId");
- variables.put("requestId", "testRequestId");
- variables.put("serviceInstanceId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
- variables.put("networkId", "bdc5efe8-404a-409b-85f6-0dcc9eebae30");
- variables.put("networkName", "HSL_direct_net_2");
- variables.put("lcpCloudRegionId", "RDM2WAGPLCP");
- variables.put("tenantId", "88a6ca3ee0394ade9403f075db23167e");
- variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
- variables.put("disableRollback", "false"); // 1702
- variables.put("failIfExists", "false");
- //variables.put("sdncVersion", "1702");
- variables.put("sdncVersion", "1707");
- variables.put("subscriptionServiceType", "MSO-dev-service-type");
- variables.put("networkModelInfo", networkModelInfo);
-
- executeAsyncWorkflow(processEngineRule, "DeleteNetworkInstance", variables);
-
- Assert.assertNotNull("DELNI_CompleteMsoProcessRequest - ", getVariable(processEngineRule, "DeleteNetworkInstance", "DELNI_CompleteMsoProcessRequest"));
- Assert.assertEquals("true", getVariable(processEngineRule, "DeleteNetworkInstance", "DELNI_Success"));
-
- String workflowResp = BPMNUtil.getVariable(processEngineRule, "DeleteNetworkInstance", "WorkflowResponse");
- Assert.assertNotNull(workflowResp);
- System.out.println("DeleteNetworkInstanceTest.shouldInvokeServiceDeleteNetworkInstance_vIPER_Success() WorkflowResponse:\n" + workflowResp);
-
- String completeMsoProcessRequest =
- "<aetgt:MsoCompletionRequest xmlns:aetgt=\"http://org.openecomp/mso/workflow/schema/v1\"" + '\n'
- + " xmlns:ns=\"http://org.openecomp/mso/request/types/v1\"" + '\n'
- + " xmlns=\"http://org.openecomp/mso/infra/vnf-request/v1\">" + '\n'
- + " <request-info>" + '\n'
- + " <request-id>testRequestId</request-id>" + '\n'
- + " <action>DELETE</action>" + '\n'
- + " <source>VID</source>" + '\n'
- + " </request-info>" + '\n'
- + " <aetgt:status-message>Network has been deleted successfully.</aetgt:status-message>" + '\n'
- + " <aetgt:mso-bpel-name>BPMN Network action: DELETE</aetgt:mso-bpel-name>" + '\n'
- + "</aetgt:MsoCompletionRequest>";
-
- Assert.assertEquals(completeMsoProcessRequest, getVariable(processEngineRule, "DeleteNetworkInstance", "DELNI_CompleteMsoProcessRequest"));
-
- System.out.println("----------------------------------------------------------");
- System.out.println(" Success VID - DeleteNetworkInstance flow Completed ");
- System.out.println("----------------------------------------------------------");
-
-
- }
-
- @Test
- //@Ignore
- @Deployment(resources = {"process/DeleteNetworkInstance.bpmn",
- "subprocess/DoDeleteNetworkInstance.bpmn",
- "subprocess/DoDeleteNetworkInstanceRollback.bpmn",
- "subprocess/FalloutHandler.bpmn",
- "subprocess/CompleteMsoProcess.bpmn",
- "subprocess/SDNCAdapterV1.bpmn"})
-
- public void shouldInvokeServiceDeleteNetworkInstanceInfra_vIPER_Rollback() throws Exception {
- // Rollback is not Applicable for DeleteNetwork (no requirements). Rollback should not be invoked.
- System.out.println("----------------------------------------------------------");
- System.out.println(" Rollback - DeleteNetworkInstance flow Started! ");
- System.out.println("----------------------------------------------------------");
-
- // setup simulatores
- mockSDNCAdapter("/SDNCAdapter", "SvcAction>unassign", 500, "");
- mockSDNCAdapterTopology("DeleteNetworkV2mock/sdncDeleteNetworkTopologySimResponse.xml", "SvcAction>deactivate");
- mockSDNCAdapterTopology("CreateNetworkV2mock/sdncCreateNetworkTopologySimResponse.xml", "SvcAction>activate");
- MockNetworkAdapter("bdc5efe8-404a-409b-85f6-0dcc9eebae30", 200, "deleteNetworkResponse_Success.xml");
- MockNetworkAdapterContainingRequest("createNetworkRequest", 200, "CreateNetworkV2/createNetworkResponse_Success.xml");
- MockGetNetworkByIdWithDepth ("bdc5efe8-404a-409b-85f6-0dcc9eebae30", "DeleteNetworkV2/deleteNetworkAAIResponse_Success.xml", "all");
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
- MockGetCloudRegion("RDM2WAGPLCP", 200, "DeleteNetworkV2/cloudRegion30_AAIResponse_Success.xml");
-
- String networkModelInfo = " {\"modelCustomizationId\": \"uuid-nrc-001-1234\", " + '\n' +
- " \"modelInvariantId\": \"was-ist-das-001-1234\" }";
-
- Map<String, String> variables = new HashMap<>();
- variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");
- variables.put("msoRequestId", "testRequestId");
- variables.put("requestId", "testRequestId");
- variables.put("serviceInstanceId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
- variables.put("networkId", "bdc5efe8-404a-409b-85f6-0dcc9eebae30");
- variables.put("networkName", "HSL_direct_net_2");
- variables.put("lcpCloudRegionId", "RDM2WAGPLCP");
- variables.put("tenantId", "88a6ca3ee0394ade9403f075db23167e");
- variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
- variables.put("disableRollback", "false"); // 1702
- variables.put("failIfExists", "false");
- variables.put("sdncVersion", "1702");
- variables.put("subscriptionServiceType", "MSO-dev-service-type");
- variables.put("networkModelInfo", networkModelInfo);
-
- executeAsyncWorkflow(processEngineRule, "DeleteNetworkInstance", variables);
- //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "DeleteNetworkInstance", variables);
- //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId());
-
- String workflowResp = BPMNUtil.getVariable(processEngineRule, "DeleteNetworkInstance", "WorkflowResponse");
- Assert.assertNotNull(workflowResp);
-
- Assert.assertNotNull("DELNI_FalloutHandlerRequest - ", getVariable(processEngineRule, "DeleteNetworkInstance", "DELNI_FalloutHandlerRequest"));
- Assert.assertEquals("false", getVariable(processEngineRule, "DeleteNetworkInstance", "DELNI_Success"));
- Assert.assertEquals("false", BPMNUtil.getVariable(processEngineRule, "DoDeleteNetworkInstance", "DELNWKI_Success"));
-
- System.out.println("----------------------------------------------------------");
- System.out.println(" Rollback - DeleteNetworkInstanceModular flow Completed ");
- System.out.println("----------------------------------------------------------");
-
-
- }
-
-
- // *****************
- // Utility Section
- // *****************
-
- public String getDeleteNetworkInstanceInfraRequest() {
-
- String request =
- "{ \"requestDetails\": { " + '\n' +
- " \"modelInfo\": { " + '\n' +
- " \"modelType\": \"modelType\", " + '\n' +
- " \"modelCustomizationId\": \"f21df226-8093-48c3-be7e-0408fcda0422\", " + '\n' +
- " \"modelName\": \"CONTRAIL_EXTERNAL\", " + '\n' +
- " \"modelVersion\": \"1.0\" " + '\n' +
- " }, " + '\n' +
- " \"cloudConfiguration\": { " + '\n' +
- " \"lcpCloudRegionId\": \"RDM2WAGPLCP\", " + '\n' +
- " \"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\" " + '\n' +
- " }, " + '\n' +
- " \"requestInfo\": { " + '\n' +
- " \"instanceName\": \"HSL_direct_net_2\", " + '\n' +
- " \"source\": \"VID\", " + '\n' +
- " \"suppressRollback\": \"false\", " + '\n' +
- " \"callbackUrl\": \"\" " + '\n' +
- " }, " + '\n' +
- " \"requestParameters\": { " + '\n' +
- " \"backoutOnFailure\": true, " + '\n' +
- " \"serviceId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\", " + '\n' +
- " \"userParams\": {} " + '\n' +
- " } " + '\n' +
- " } " + '\n' +
- "}";
- return request;
-
- }
-
-
- public String getDeleteNetworkInstanceInfraRequest_MissingId() {
-
- String request =
- "{ \"requestDetails\": { " + '\n' +
- " \"modelInfo\": { " + '\n' +
- " \"modelType\": \"modelType\", " + '\n' +
- " \"modelId\": \"modelId\", " + '\n' +
- " \"modelNameVersionId\": \"modelNameVersionId\", " + '\n' +
- " \"modelName\": \"CONTRAIL_EXTERNAL\", " + '\n' +
- " \"modelVersion\": \"1\" " + '\n' +
- " }, " + '\n' +
- " \"cloudConfiguration\": { " + '\n' +
- " \"lcpCloudRegionId\": \"RDM2WAGPLCP\", " + '\n' +
- " \"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\" " + '\n' +
- " }, " + '\n' +
- " \"requestInfo\": { " + '\n' +
- " \"instanceName\": \"HSL_direct_net_2\", " + '\n' +
- " \"source\": \"VID\", " + '\n' +
- " \"callbackUrl\": \"\" " + '\n' +
- " }, " + '\n' +
- " \"requestParameters\": { " + '\n' +
- " \"backoutOnFailure\": true, " + '\n' +
- " \"serviceId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\", " + '\n' +
- " \"userParams\": [] " + '\n' +
- " } " + '\n' +
- " } " + '\n' +
- "}";
- return request;
-
- }
-
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleInfraTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleInfraTest.java deleted file mode 100644 index ba375f5d78..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleInfraTest.java +++ /dev/null @@ -1,605 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.bpmn.infrastructure;
-
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
-import static com.github.tomakehurst.wiremock.client.WireMock.containing;
-import static com.github.tomakehurst.wiremock.client.WireMock.delete;
-import static com.github.tomakehurst.wiremock.client.WireMock.get;
-import static com.github.tomakehurst.wiremock.client.WireMock.post;
-import static com.github.tomakehurst.wiremock.client.WireMock.put;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchVfModuleId;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockVNFAdapterRestVfModule;
-import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
-import static org.openecomp.mso.bpmn.mock.StubResponseVNFAdapter.mockVNFDelete;
-
-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.core.WorkflowException;
-import org.openecomp.mso.bpmn.mock.FileUtil;
-
-import com.github.tomakehurst.wiremock.client.WireMock;
-/**
- * Unit test for DoDeleteVfModule.bpmn.
- */
-public class DeleteVfModuleInfraTest extends WorkflowTest {
- private final CallbackSet callbacks = new CallbackSet();
-
- private static final String EOL = "\n";
-
- private final String vnfAdapterDeleteCallback =
- "<deleteVfModuleResponse>" + EOL +
- " <vnfId>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnfId>" + EOL +
- " <vfModuleId>973ed047-d251-4fb9-bf1a-65b8949e0a73</vfModuleId>" + EOL +
- " <vfModuleDeleted>true</vfModuleDeleted>" + EOL +
- " <messageId>{{MESSAGE-ID}}</messageId>" + EOL +
- "</deleteVfModuleResponse>" + EOL;
-
- //private final String vnfAdapterDeleteCallback =
- // "<deleteVfModuleResponse>" + EOL +
- // " <vnfId>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnfId>" + EOL +
- // " <vfModuleId>973ed047-d251-4fb9-bf1a-65b8949e0a73</vfModuleId>" + EOL +
- // " <vfModuleDeleted>true</vfModuleDeleted>" + EOL +
- // " <messageId>{{MESSAGE-ID}}</messageId>" + EOL +
- // " <vfModuleOutputs>" + EOL +
- // " <entry>" + EOL +
- // " <key>policyKey1_contrail_network_policy_fqdn</key>" + EOL +
- // " <value>MSOTest:DefaultPolicyFQDN1</value>" + EOL +
- // "</entry>" + EOL +
- // "<entry>" + EOL +
- // "<key>policyKey2_contrail_network_policy_fqdn</key>" + EOL +
- // "<value>MSOTest:DefaultPolicyFQDN2</value>" + EOL +
- // "</entry>" + EOL +
- // " <entry>" + EOL +
- // " <key>oam_management_v4_address</key>" + EOL +
- // " <value>1234</value>" + EOL +
- // "</entry>" + EOL +
- // " <entry>" + EOL +
- // " <key>oam_management_v6_address</key>" + EOL +
- // " <value>1234</value>" + EOL +
- // "</entry>" + EOL +
- // "</vfModuleOutputs>" + EOL +
- // "</deleteVfModuleResponse>" + EOL;
-
- private final String vnfAdapterDeleteCallbackFail =
- "<vfModuleException>" + EOL +
- " <message>Error processing request to VNF-Async. Not Found.</message>" + EOL +
- " <category>INTERNAL</category>" + EOL +
- " <rolledBack>false</rolledBack>" + EOL +
- " <messageId>{{MESSAGE-ID}}</messageId>" + EOL +
- "</vfModuleException>" + EOL;
-
- private final String sdncAdapterDeleteCallback =
- "<output xmlns=\"org:onap:sdnctl:l3api\">" + EOL +
- " <svc-request-id>{{REQUEST-ID}}</svc-request-id>" + EOL +
- " <ack-final-indicator>Y</ack-final-indicator>" + EOL +
- "</output>" + EOL;
-
- public DeleteVfModuleInfraTest() throws IOException {
- callbacks.put("sdncChangeDelete", sdncAdapterDeleteCallback);
- callbacks.put("sdncDelete", sdncAdapterDeleteCallback);
- callbacks.put("vnfDelete", FileUtil.readResourceFile(
- "__files/DeleteVfModuleCallbackResponse.xml"));
- //callbacks.put("vnfDelete", vnfAdapterDeleteCallback);
- callbacks.put("vnfDeleteFail", vnfAdapterDeleteCallbackFail);
- }
-
- @Test
- @Ignore // 1802 merge
- @Deployment(resources = {
- "process/DeleteVfModuleInfra.bpmn",
- "subprocess/DoDeleteVfModule.bpmn",
- "subprocess/PrepareUpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn",
- "subprocess/DeleteAAIVfModule.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/CompleteMsoProcess.bpmn",
- "subprocess/FalloutHandler.bpmn"
- })
-
- public void TestDeleteVfModuleSuccess() throws Exception {
- // delete the Base Module
- // vnf-id=a27ce5a9-29c4-4c22-a017-6615ac73c721, vf-module-id=973ed047-d251-4fb9-bf1a-65b8949e0a73
- String request =
- "<vnf-request xmlns=\"http://openecomp.org/mso/infra/vnf-request/v1\">" + EOL +
- " <request-info>" + EOL +
- " <request-id>a27ce5a9-29c4-4c22-a017-6615ac73c721</request-id>" + EOL +
- " <action>DELETE_VF_MODULE</action>" + EOL +
- " <source>PORTAL</source>" + EOL +
- " </request-info>" + EOL +
- " <vnf-inputs>" + EOL +
- " <vnf-id>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnf-id>" + EOL +
- " <vnf-name>STMTN5MMSC21</vnf-name>" + EOL +
- " <vnf-type>asc_heat-int</vnf-type>" + EOL +
- " <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</vf-module-id>" + EOL +
- " <vf-module-name>STMTN5MMSC21-MMSC::module-0-0</vf-module-name>" + EOL +
- " <service-id>00000000-0000-0000-0000-000000000000</service-id>" + EOL +
- " <service-type>SDN-ETHERNET-INTERNET</service-type>" + EOL +
- " <tenant-id>fba1bd1e195a404cacb9ce17a9b2b421</tenant-id>" + EOL +
- " <orchestration-status>pending-delete</orchestration-status>" + EOL +
- " <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>" + EOL +
- " </vnf-inputs>" + EOL +
- " <vnf-params xmlns:tns=\"http://openecomp.org/mso/infra/vnf-request/v1\"/>" + EOL +
- "</vnf-request>" + EOL;
- logStart();
- WireMock.reset();
-
- stubFor(post(urlEqualTo("/SDNCAdapter"))
- .withRequestBody(containing("SvcAction>changedelete"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("DeleteGenericVNFV1/sdncAdapterResponse.xml")));
- stubFor(post(urlEqualTo("/SDNCAdapter"))
- .withRequestBody(containing("SvcAction>delete"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("DeleteGenericVNFV1/sdncAdapterResponse.xml")));
-
- //mockVNFDelete("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73", 202);
- MockDoDeleteVfModule_DeleteVNFSuccess();
- MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
- // MockVNFAdapterRestVfModule();
-// MockAAIGenericVnfSearch();
-// MockAAIVfModulePUT(false);
-// MockAAIDeleteGenericVnf();
-// MockAAIDeleteVfModule();
- mockUpdateRequestDB(200, "VfModularity/DBUpdateResponse.xml");
-
- stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c721/vf-modules/vf-module/973ed047-d251-4fb9-bf1a-65b8949e0a73/[?]resource-version=0000073"))
- .willReturn(aResponse()
- .withStatus(200)));
- stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c720/vf-modules/vf-module/973ed047-d251-4fb9-bf1a-65b8949e0a75/[?]resource-version=0000075"))
- .willReturn(aResponse()
- .withStatus(200)));
- stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c718/vf-modules/vf-module/973ed047-d251-4fb9-bf1a-65b8949e0a78/[?]resource-version=0000078"))
- .willReturn(aResponse()
- .withStatus(200)));
- stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c719/vf-modules/vf-module/973ed047-d251-4fb9-bf1a-65b8949e0a77/[?]resource-version=0000077"))
- .willReturn(aResponse()
- .withStatus(500)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("aaiFault.xml")));
- stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy\\?network-policy-fqdn=.*"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("VfModularity/QueryNetworkPolicy_AAIResponse_Success.xml")));
-
- stubFor(delete(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/.*"))
- .willReturn(aResponse()
- .withStatus(200)));
-
-
- stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c721/[?]resource-version=0000021"))
- .willReturn(aResponse()
- .withStatus(200)));
- stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c718/[?]resource-version=0000018"))
- .willReturn(aResponse()
- .withStatus(500)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("aaiFault.xml")));
-
- stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/.*/vf-modules/vf-module/.*"))
- .withRequestBody(containing("MMSC"))
- .willReturn(aResponse()
- .withStatus(200)));
- stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/.*/vf-modules/vf-module/.*"))
- .withRequestBody(containing("PCRF"))
- .willReturn(aResponse()
- .withStatus(500)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("aaiFault.xml")));
- stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c721"))
- .willReturn(aResponse()
- .withStatus(200)));
-
- String body;
-
- // The following stubs are for CreateAAIVfModule and UpdateAAIVfModule
-
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/[?]vnf-name=STMTN5MMSC23&depth=1"))
- .willReturn(aResponse()
- .withStatus(500)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("aaiFault.xml")));
-
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/[?]vnf-name=STMTN5MMSC22&depth=1"))
- .willReturn(aResponse()
- .withStatus(404)
- .withHeader("Content-Type", "text/xml")
- .withBody("Generic VNF Not Found")));
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/768073c7-f41f-4822-9323-b75962763d74[?]depth=1"))
- .willReturn(aResponse()
- .withStatus(404)
- .withHeader("Content-Type", "text/xml")
- .withBody("Generic VNF Not Found")));
-
- body =
- "<generic-vnf xmlns=\"http://org.openecomp.aai.inventory/v7\">" + EOL +
- " <vnf-id>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnf-id>" + EOL +
- " <vnf-name>STMTN5MMSC21</vnf-name>" + EOL +
- " <vnf-type>mmsc-capacity</vnf-type>" + EOL +
- " <service-id>SDN-MOBILITY</service-id>" + EOL +
- " <equipment-role>vMMSC</equipment-role>" + EOL +
- " <orchestration-status>pending-create</orchestration-status>" + EOL +
- " <in-maint>false</in-maint>" + EOL +
- " <is-closed-loop-disabled>false</is-closed-loop-disabled>" + EOL +
- " <resource-version>1508691</resource-version>" + EOL +
- " <vf-modules>" + EOL +
- " <vf-module>" + EOL +
- " <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</vf-module-id>" + EOL +
- " <vf-module-name>STMTN5MMSC21-MMSC::module-0-0</vf-module-name>" + EOL +
- " <persona-model-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</persona-model-id>" + EOL +
- " <persona-model-version>1.0</persona-model-version>" + EOL +
- " <is-base-vf-module>true</is-base-vf-module>" + EOL +
- " <heat-stack-id>FILLED-IN-BY-MSO</heat-stack-id>" + EOL +
- " <orchestration-status>pending-create</orchestration-status>" + EOL +
- " <resource-version>1508692</resource-version>" + EOL +
- " </vf-module>" + EOL +
- " </vf-modules>" + EOL +
- " <relationship-list/>" + EOL +
- " <l-interfaces/>" + EOL +
- " <lag-interfaces/>" + EOL +
- "</generic-vnf>" + EOL;
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/[?]vnf-name=STMTN5MMSC21&depth=1"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBody(body)));
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c721[?]depth=1"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBody(body)));
-
- body =
- "<generic-vnf xmlns=\"http://org.openecomp.aai.inventory/v7\">" + EOL +
- " <vnf-id>2f6aee38-1e2a-11e6-82d1-ffc7d9ee8aa4</vnf-id>" + EOL +
- " <vnf-name>STMTN5MMSC20</vnf-name>" + EOL +
- " <vnf-type>mmsc-capacity</vnf-type>" + EOL +
- " <service-id>SDN-MOBILITY</service-id>" + EOL +
- " <equipment-role>vMMSC</equipment-role>" + EOL +
- " <orchestration-status>pending-create</orchestration-status>" + EOL +
- " <in-maint>false</in-maint>" + EOL +
- " <is-closed-loop-disabled>false</is-closed-loop-disabled>" + EOL +
- " <resource-version>1508691</resource-version>" + EOL +
- " <vf-modules>" + EOL +
- " <vf-module>" + EOL +
- " <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</vf-module-id>" + EOL +
- " <vf-module-name>STMTN5MMSC20-MMSC::module-0-0</vf-module-name>" + EOL +
- " <persona-model-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</persona-model-id>" + EOL +
- " <persona-model-version>1.0</persona-model-version>" + EOL +
- " <is-base-vf-module>true</is-base-vf-module>" + EOL +
- " <heat-stack-id>FILLED-IN-BY-MSO</heat-stack-id>" + EOL +
- " <orchestration-status>pending-create</orchestration-status>" + EOL +
- " <resource-version>1508692</resource-version>" + EOL +
- " </vf-module>" + EOL +
- " <vf-module>" + EOL +
- " <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a74</vf-module-id>" + EOL +
- " <vf-module-name>STMTN5MMSC20-MMSC::module-1-0</vf-module-name>" + EOL +
- " <persona-model-id>973ed047-d251-4fb9-bf1a-65b8949e0a74</persona-model-id>" + EOL +
- " <persona-model-version>1.0</persona-model-version>" + EOL +
- " <is-base-vf-module>false</is-base-vf-module>" + EOL +
- " <heat-stack-id>FILLED-IN-BY-MSO</heat-stack-id>" + EOL +
- " <orchestration-status>pending-create</orchestration-status>" + EOL +
- " <resource-version>1508692</resource-version>" + EOL +
- " </vf-module>" + EOL +
- " </vf-modules>" + EOL +
- " <relationship-list/>" + EOL +
- " <l-interfaces/>" + EOL +
- " <lag-interfaces/>" + EOL +
- "</generic-vnf>" + EOL;
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/[?]vnf-name=STMTN5MMSC20&depth=1"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBody(body)));
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/2f6aee38-1e2a-11e6-82d1-ffc7d9ee8aa4[?]depth=1"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBody(body)));
-
- // The following stubs are for DeleteAAIVfModule
-
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c723[?]depth=1"))
- .willReturn(aResponse()
- .withStatus(500)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("aaiFault.xml")));
-
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c722[?]depth=1"))
- .willReturn(aResponse()
- .withStatus(404)
- .withHeader("Content-Type", "text/xml")
- .withBody("Generic VNF Not Found")));
-
- body =
- "<generic-vnf xmlns=\"http://org.openecomp.aai.inventory/v7\">" + EOL +
- " <vnf-id>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnf-id>" + EOL +
- " <vnf-name>STMTN5MMSC21</vnf-name>" + EOL +
- " <vnf-type>mmsc-capacity</vnf-type>" + EOL +
- " <service-id>SDN-MOBILITY</service-id>" + EOL +
- " <equipment-role>vMMSC</equipment-role>" + EOL +
- " <orchestration-status>pending-create</orchestration-status>" + EOL +
- " <in-maint>false</in-maint>" + EOL +
- " <is-closed-loop-disabled>false</is-closed-loop-disabled>" + EOL +
- " <resource-version>0000021</resource-version>" + EOL +
- " <vf-modules>" + EOL +
- " <vf-module>" + EOL +
- " <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</vf-module-id>" + EOL +
- " <vf-module-name>STMTN5MMSC21-MMSC::module-0-0</vf-module-name>" + EOL +
- " <persona-model-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</persona-model-id>" + EOL +
- " <persona-model-version>1.0</persona-model-version>" + EOL +
- " <is-base-vf-module>true</is-base-vf-module>" + EOL +
- " <heat-stack-id>FILLED-IN-BY-MSO</heat-stack-id>" + EOL +
- " <orchestration-status>pending-create</orchestration-status>" + EOL +
- " <resource-version>0000073</resource-version>" + EOL +
- " </vf-module>" + EOL +
- " </vf-modules>" + EOL +
- " <relationship-list/>" + EOL +
- " <l-interfaces/>" + EOL +
- " <lag-interfaces/>" + EOL +
- "</generic-vnf>" + EOL;
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c721[?]depth=1"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBody(body)));
-
- body =
- "<generic-vnf xmlns=\"http://org.openecomp.aai.inventory/v7\">" + EOL +
- " <vnf-id>a27ce5a9-29c4-4c22-a017-6615ac73c720</vnf-id>" + EOL +
- " <vnf-name>STMTN5MMSC20</vnf-name>" + EOL +
- " <vnf-type>mmsc-capacity</vnf-type>" + EOL +
- " <service-id>SDN-MOBILITY</service-id>" + EOL +
- " <equipment-role>vMMSC</equipment-role>" + EOL +
- " <orchestration-status>pending-create</orchestration-status>" + EOL +
- " <in-maint>false</in-maint>" + EOL +
- " <is-closed-loop-disabled>false</is-closed-loop-disabled>" + EOL +
- " <resource-version>0000020</resource-version>" + EOL +
- " <vf-modules>" + EOL +
- " <vf-module>" + EOL +
- " <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a74</vf-module-id>" + EOL +
- " <vf-module-name>STMTN5MMSC20-MMSC::module-0-0</vf-module-name>" + EOL +
- " <persona-model-id>973ed047-d251-4fb9-bf1a-65b8949e0a74</persona-model-id>" + EOL +
- " <persona-model-version>1.0</persona-model-version>" + EOL +
- " <is-base-vf-module>true</is-base-vf-module>" + EOL +
- " <heat-stack-id>FILLED-IN-BY-MSO</heat-stack-id>" + EOL +
- " <orchestration-status>pending-create</orchestration-status>" + EOL +
- " <resource-version>0000074</resource-version>" + EOL +
- " </vf-module>" + EOL +
- " <vf-module>" + EOL +
- " <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a75</vf-module-id>" + EOL +
- " <vf-module-name>STMTN5MMSC20-MMSC::module-1-0</vf-module-name>" + EOL +
- " <persona-model-id>973ed047-d251-4fb9-bf1a-65b8949e0a75</persona-model-id>" + EOL +
- " <persona-model-version>1.0</persona-model-version>" + EOL +
- " <is-base-vf-module>false</is-base-vf-module>" + EOL +
- " <heat-stack-id>FILLED-IN-BY-MSO</heat-stack-id>" + EOL +
- " <orchestration-status>pending-create</orchestration-status>" + EOL +
- " <resource-version>0000075</resource-version>" + EOL +
- " </vf-module>" + EOL +
- " </vf-modules>" + EOL +
- " <relationship-list/>" + EOL +
- " <l-interfaces/>" + EOL +
- " <lag-interfaces/>" + EOL +
- "</generic-vnf>" + EOL;
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c720[?]depth=1"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBody(body)));
-
- body =
- "<generic-vnf xmlns=\"http://org.openecomp.aai.inventory/v7\">" + EOL +
- " <vnf-id>a27ce5a9-29c4-4c22-a017-6615ac73c719</vnf-id>" + EOL +
- " <vnf-name>STMTN5MMSC19</vnf-name>" + EOL +
- " <vnf-type>mmsc-capacity</vnf-type>" + EOL +
- " <service-id>SDN-MOBILITY</service-id>" + EOL +
- " <equipment-role>vMMSC</equipment-role>" + EOL +
- " <orchestration-status>pending-create</orchestration-status>" + EOL +
- " <in-maint>false</in-maint>" + EOL +
- " <is-closed-loop-disabled>false</is-closed-loop-disabled>" + EOL +
- " <resource-version>0000019</resource-version>" + EOL +
- " <vf-modules>" + EOL +
- " <vf-module>" + EOL +
- " <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a76</vf-module-id>" + EOL +
- " <vf-module-name>STMTN5MMSC19-MMSC::module-0-0</vf-module-name>" + EOL +
- " <persona-model-id>973ed047-d251-4fb9-bf1a-65b8949e0a76</persona-model-id>" + EOL +
- " <persona-model-version>1.0</persona-model-version>" + EOL +
- " <is-base-vf-module>true</is-base-vf-module>" + EOL +
- " <heat-stack-id>FILLED-IN-BY-MSO</heat-stack-id>" + EOL +
- " <orchestration-status>pending-create</orchestration-status>" + EOL +
- " <resource-version>0000076</resource-version>" + EOL +
- " </vf-module>" + EOL +
- " <vf-module>" + EOL +
- " <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a77</vf-module-id>" + EOL +
- " <vf-module-name>STMTN5MMSC19-MMSC::module-1-0</vf-module-name>" + EOL +
- " <persona-model-id>973ed047-d251-4fb9-bf1a-65b8949e0a77</persona-model-id>" + EOL +
- " <persona-model-version>1.0</persona-model-version>" + EOL +
- " <is-base-vf-module>false</is-base-vf-module>" + EOL +
- " <heat-stack-id>FILLED-IN-BY-MSO</heat-stack-id>" + EOL +
- " <orchestration-status>pending-create</orchestration-status>" + EOL +
- " <resource-version>0000077</resource-version>" + EOL +
- " </vf-module>" + EOL +
- " </vf-modules>" + EOL +
- " <relationship-list/>" + EOL +
- " <l-interfaces/>" + EOL +
- " <lag-interfaces/>" + EOL +
- "</generic-vnf>" + EOL;
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c719[?]depth=1"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBody(body)));
-
- body =
- "<generic-vnf xmlns=\"http://org.openecomp.aai.inventory/v7\">" + EOL +
- " <vnf-id>a27ce5a9-29c4-4c22-a017-6615ac73c718</vnf-id>" + EOL +
- " <vnf-name>STMTN5MMSC18</vnf-name>" + EOL +
- " <vnf-type>mmsc-capacity</vnf-type>" + EOL +
- " <service-id>SDN-MOBILITY</service-id>" + EOL +
- " <equipment-role>vMMSC</equipment-role>" + EOL +
- " <orchestration-status>pending-create</orchestration-status>" + EOL +
- " <in-maint>false</in-maint>" + EOL +
- " <is-closed-loop-disabled>false</is-closed-loop-disabled>" + EOL +
- " <resource-version>0000018</resource-version>" + EOL +
- " <vf-modules>" + EOL +
- " <vf-module>" + EOL +
- " <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a78</vf-module-id>" + EOL +
- " <vf-module-name>STMTN5MMSC18-MMSC::module-0-0</vf-module-name>" + EOL +
- " <persona-model-id>973ed047-d251-4fb9-bf1a-65b8949e0a78</persona-model-id>" + EOL +
- " <persona-model-version>1.0</persona-model-version>" + EOL +
- " <is-base-vf-module>true</is-base-vf-module>" + EOL +
- " <heat-stack-id>FILLED-IN-BY-MSO</heat-stack-id>" + EOL +
- " <orchestration-status>pending-create</orchestration-status>" + EOL +
- " <resource-version>0000078</resource-version>" + EOL +
- " </vf-module>" + EOL +
- " </vf-modules>" + EOL +
- " <relationship-list/>" + EOL +
- " <l-interfaces/>" + EOL +
- " <lag-interfaces/>" + EOL +
- "</generic-vnf>" + EOL;
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c718[?]depth=1"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBody(body)));
-
- body =
- "<generic-vnf xmlns=\"http://org.openecomp.aai.inventory/v7\">" + EOL +
- " <vnf-id>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnf-id>" + EOL +
- " <vnf-name>STMTN5MMSC21</vnf-name>" + EOL +
- " <vnf-type>mmsc-capacity</vnf-type>" + EOL +
- " <service-id>SDN-MOBILITY</service-id>" + EOL +
- " <equipment-role>vMMSC</equipment-role>" + EOL +
- " <orchestration-status>pending-create</orchestration-status>" + EOL +
- " <in-maint>false</in-maint>" + EOL +
- " <is-closed-loop-disabled>false</is-closed-loop-disabled>" + EOL +
- " <resource-version>0000021</resource-version>" + EOL +
- " <vf-modules>" + EOL +
- " <vf-module>" + EOL +
- " <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</vf-module-id>" + EOL +
- " <vf-module-name>STMTN5MMSC21-MMSC::module-0-0</vf-module-name>" + EOL +
- " <persona-model-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</persona-model-id>" + EOL +
- " <persona-model-version>1.0</persona-model-version>" + EOL +
- " <is-base-vf-module>true</is-base-vf-module>" + EOL +
- " <heat-stack-id>FILLED-IN-BY-MSO</heat-stack-id>" + EOL +
- " <orchestration-status>pending-create</orchestration-status>" + EOL +
- " <resource-version>0000073</resource-version>" + EOL +
- " </vf-module>" + EOL +
- " </vf-modules>" + EOL +
- " <relationship-list/>" + EOL +
- " <l-interfaces/>" + EOL +
- " <lag-interfaces/>" + EOL +
- "</generic-vnf>" + EOL;
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c721/vf-modules/vf-module/973ed047-d251-4fb9-bf1a-65b8949e0a73"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBody(body)));
-
- String businessKey = UUID.randomUUID().toString();
- String deleteVfModuleRequest =
- FileUtil.readResourceFile("__files/DeleteVfModule_VID_request.json");
- //Map<String, Object> variables = new HashMap<>();
-
- //variables.put("isDebugLogEnabled","true");
-// variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
-// variables.put("mso-service-instance-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
-
- Map<String, Object> variables = setupVariablesSunnyDayVID();
-
- TestAsyncResponse asyncResponse = invokeAsyncProcess("DeleteVfModuleInfra",
- "v1", businessKey, deleteVfModuleRequest, variables);
- WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
- String responseBody = response.getContent();
- System.out.println("Workflow (Synch) Response:\n" + responseBody);
-
- // "changedelete" operation not required for deleting a Vf Module
-// injectSDNCCallbacks(callbacks, "sdncChangeDelete");
- injectVNFRestCallbacks(callbacks, "vnfDelete");
- waitForRunningProcessCount("vnfAdapterDeleteV1", 0, 120000);
- injectSDNCCallbacks(callbacks, "sdncDelete");
-
- waitForProcessEnd(businessKey, 10000);
- WorkflowException wfe = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException");
- checkVariable(businessKey, "DeleteVfModuleInfraSuccessIndicator", true);
- checkVariable(businessKey, "WorkflowException", null);
- if (wfe != null) {
- System.out.println("TestDeleteVfModuleInfraSuccess: ErrorCode=" + wfe.getErrorCode() +
- ", ErrorMessage=" + wfe.getErrorMessage());
- }
- logEnd();
- }
-
- // Active Scenario
- private Map<String, Object> setupVariablesSunnyDayVID() {
- Map<String, Object> variables = new HashMap<>();
- //try {
- // variables.put("bpmnRequest", FileUtil.readResourceFile("__files/CreateVfModule_VID_request.json"));
- //}
- //catch (Exception e) {
-
- //}
- //variables.put("mso-request-id", "testRequestId");
- variables.put("requestId", "testRequestId");
- variables.put("isBaseVfModule", "true");
- variables.put("isDebugLogEnabled", "true");
- variables.put("recipeTimeout", "0");
- variables.put("requestAction", "DELETE_VF_MODULE");
- variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
- variables.put("vnfId", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("vfModuleId", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
- variables.put("volumeGroupId", "");
- variables.put("serviceType", "MOG");
- variables.put("vfModuleType", "");
- return variables;
-
- }
-
- public static void MockDoDeleteVfModule_DeleteVNFSuccess() {
- stubFor(delete(urlMatching("/vnfs/v1/vnfs/.*/vf-modules/.*"))
- .willReturn(aResponse()
- .withStatus(202)
- .withHeader("Content-Type", "application/xml")));
- stubFor(delete(urlMatching("/vnfs/v1/volume-groups/78987"))
- .willReturn(aResponse()
- .withStatus(202)
- .withHeader("Content-Type", "application/xml")));
- }
-
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleVolumeInfraV1Test.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleVolumeInfraV1Test.java deleted file mode 100644 index 0e2cf1b6b3..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleVolumeInfraV1Test.java +++ /dev/null @@ -1,166 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import org.camunda.bpm.engine.test.Deployment; -import org.junit.Ignore; -import org.junit.Test; -import org.openecomp.mso.bpmn.common.WorkflowTest; -import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse; -import org.openecomp.mso.bpmn.mock.FileUtil; - -/** - * Unit test cases for UpdateVfModuleVolume.bpmn - */ -public class DeleteVfModuleVolumeInfraV1Test extends WorkflowTest { - - private final CallbackSet callbacks = new CallbackSet(); - - public DeleteVfModuleVolumeInfraV1Test() throws IOException { - callbacks.put("volumeGroupDelete", FileUtil.readResourceFile( - "__files/DeleteVfModuleVolumeInfraV1/DeleteVfModuleVolumeCallbackResponse.xml")); - } - - /** - * Happy path scenario. - * - * @throws Exception - */ - @Test - @Ignore // BROKEN TEST - @Deployment(resources = {"process/DeleteVfModuleVolumeInfraV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - "subprocess/VnfAdapterRestV1.bpmn"}) - public void happyPath() throws Exception { - - logStart(); - -// DeleteVfModuleVolumeInfraV1_success(); - - String businessKey = UUID.randomUUID().toString(); - String deleteVfModuleVolRequest = - FileUtil.readResourceFile("__files/DeleteVfModuleVolumeInfraV1/deleteVfModuleVolume_VID_request_st.json"); - - Map<String, Object> testVariables = new HashMap<>(); - testVariables.put("requestId", "TEST-REQUEST-ID-0123"); - testVariables.put("volumeGroupId", "78987"); - testVariables.put("serviceInstanceId", "test-service-instance-id-0123"); - - TestAsyncResponse asyncResponse = invokeAsyncProcess("DeleteVfModuleVolumeInfraV1", - "v1", businessKey, deleteVfModuleVolRequest, testVariables); - WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 100000); - - String responseBody = response.getContent(); - System.out.println("Workflow (Synch) Response:\n" + responseBody); - - injectVNFRestCallbacks(callbacks, "volumeGroupDelete"); - - waitForProcessEnd(businessKey, 100000); - checkVariable(businessKey, "DELVfModVol_TransactionSuccessIndicator", true); - - logEnd(); - } - - /** - * Test fails - vf module in use - * - * @throws Exception - */ - @Test - @Deployment(resources = {"process/DeleteVfModuleVolumeInfraV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - "subprocess/VnfAdapterRestV1.bpmn"}) - public void TestVfModuleInUseError() throws Exception { - - logStart(); - -// DeleteVfModuleVolumeInfraV1_inUseError(); // no assertions to check - - String businessKey = UUID.randomUUID().toString(); - String deleteVfModuleVolRequest = - FileUtil.readResourceFile("__files/DeleteVfModuleVolumeInfraV1/deleteVfModuleVolume_VID_request_st.json"); - - Map<String, Object> testVariables = new HashMap<>(); - testVariables.put("requestId", "TEST-REQUEST-ID-0123"); - testVariables.put("volumeGroupId", "78987"); - - TestAsyncResponse asyncResponse = invokeAsyncProcess("DeleteVfModuleVolumeInfraV1", - "v1", businessKey, deleteVfModuleVolRequest, testVariables); - WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 100000); - - String responseBody = response.getContent(); - System.out.println("Workflow (Synch) Response:\n" + responseBody); - - //injectVNFRestCallbacks(callbacks, "volumeGroupDelete"); - - waitForProcessEnd(businessKey, 100000); - checkVariable(businessKey, "DELVfModVol_TransactionSuccessIndicator", false); - - logEnd(); - } - - /** - * Test fails on vnf adapter call - * - * @throws Exception - */ - @Test - @Ignore // BROKEN TEST - @Deployment(resources = {"process/DeleteVfModuleVolumeInfraV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - "subprocess/VnfAdapterRestV1.bpmn"}) - public void TestVnfAdapterCallfail() throws Exception { - - logStart(); - -// DeleteVfModuleVolumeInfraV1_fail(); - - String businessKey = UUID.randomUUID().toString(); - String deleteVfModuleVolRequest = - FileUtil.readResourceFile("__files/DeleteVfModuleVolumeInfraV1/deleteVfModuleVolume_VID_request_st.json"); - - Map<String, Object> testVariables = new HashMap<>(); - testVariables.put("requestId", "TEST-REQUEST-ID-0123"); - testVariables.put("volumeGroupId", "78987"); - - TestAsyncResponse asyncResponse = invokeAsyncProcess("DeleteVfModuleVolumeInfraV1", - "v1", businessKey, deleteVfModuleVolRequest, testVariables); - WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 100000); - - String responseBody = response.getContent(); - System.out.println("Workflow (Synch) Response:\n" + responseBody); - - //injectVNFRestCallbacks(callbacks, "volumeGroupDelete"); - - waitForProcessEnd(businessKey, 100000); - checkVariable(businessKey, "DELVfModVol_TransactionSuccessIndicator", false); - - logEnd(); - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVnfInfraTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVnfInfraTest.java deleted file mode 100644 index 3ab3f713f4..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVnfInfraTest.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * © 2014 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property. - */ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.get; -import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; -import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching; -import static org.junit.Assert.assertEquals; -import static org.openecomp.mso.bpmn.common.BPMNUtil.executeWorkFlow; -import static org.openecomp.mso.bpmn.common.BPMNUtil.waitForWorkflowToFinish; -import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteGenericVnf; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteGenericVnf_404; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfById; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -import org.camunda.bpm.engine.test.Deployment; -import org.junit.Ignore; -import org.junit.Test; -import org.openecomp.mso.bpmn.common.BPMNUtil; -import org.openecomp.mso.bpmn.common.WorkflowTest; -import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse; -import org.openecomp.mso.bpmn.mock.FileUtil; - -/** - * Please describe the DeleteVnfInfra.java class - * - */ -public class DeleteVnfInfraTest extends WorkflowTest { - - private String deleteVnfInfraRequest; - private String deleteVnfInfraRequestCascadeDelete; - - public DeleteVnfInfraTest () throws IOException { - deleteVnfInfraRequest = FileUtil.readResourceFile("__files/InfrastructureFlows/CreateVnfInfraRequest.json"); - deleteVnfInfraRequestCascadeDelete = FileUtil.readResourceFile("__files/InfrastructureFlows/DeleteVnfInfraRequestCascadeDelete.json"); - } - - @Test - @Deployment(resources = {"subprocess/GenericGetVnf.bpmn", - "subprocess/GenericDeleteVnf.bpmn", - "subprocess/DoDeleteVnf.bpmn", - "process/DeleteVnfInfra.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/CompleteMsoProcess.bpmn"}) - public void testDeleteVnfInfra_success() throws Exception{ - - stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[?]depth=1")) - .willReturn(aResponse() - .withStatus(200) - .withHeader("Content-Type", "text/xml") - .withBodyFile("GenericFlows/getGenericVnfByNameResponse.xml"))); - - MockDeleteGenericVnf(); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - Map<String, String> variables = new HashMap<>(); - setVariables(variables, deleteVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET"); - WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "DeleteVnfInfra", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); - Object cascadeDelete = BPMNUtil.getRawVariable(processEngineRule, "DeleteVnfInfra", "DELVI_cascadeDelete"); - String found = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "GENGV_FoundIndicator") ; - String inUse = BPMNUtil.getVariable(processEngineRule, "DeleteVnfInfra", "DELVI_vnfInUse"); - String response = BPMNUtil.getVariable(processEngineRule, "DeleteVnfInfra", "WorkflowResponse"); - String workflowException = BPMNUtil.getVariable(processEngineRule, "DeleteVnfInfra", "WorkflowException"); - - assertEquals(false, cascadeDelete); - assertEquals("true", found); - assertEquals("false", inUse); - assertEquals("Success", response); - assertEquals(null, workflowException); - } - - @Test - @Ignore // DoDeleteVnfAndModules not complete yet - @Deployment(resources = {"subprocess/GenericGetVnf.bpmn", - "subprocess/GenericDeleteVnf.bpmn", - "subprocess/DoDeleteVnfAndModules.bpmn", - "process/DeleteVnfInfra.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/CompleteMsoProcess.bpmn"}) - public void testDeleteVnfInfra_cascadeDelete() throws Exception{ - MockGetGenericVnfById(); - MockDeleteGenericVnf(); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - Map<String, String> variables = new HashMap<>(); - setVariables(variables, deleteVnfInfraRequestCascadeDelete, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET"); - WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "DeleteVnfInfra", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); - - String found = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "GENGV_FoundIndicator") ; - String inUse = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "DoDVNF_vnfInUse"); - String response = BPMNUtil.getVariable(processEngineRule, "DeleteVnfInfra", "WorkflowResponse"); - String workflowException = BPMNUtil.getVariable(processEngineRule, "DeleteVnfInfra", "WorkflowException"); - Object cascadeDelete = BPMNUtil.getRawVariable(processEngineRule, "DeleteVnfInfra", "DELVI_cascadeDelete"); - - assertEquals(true, cascadeDelete); - assertEquals("true", found); - assertEquals("false", inUse); - assertEquals("Success", response); - assertEquals(null, workflowException); - } - - @Test - @Deployment(resources = {"subprocess/GenericGetVnf.bpmn", - "subprocess/GenericDeleteVnf.bpmn", - "subprocess/DoDeleteVnf.bpmn", - "process/DeleteVnfInfra.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/CompleteMsoProcess.bpmn"}) - public void testDeleteVnfInfra_success_vnfNotFound() throws Exception{ - - MockDeleteGenericVnf_404(); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - Map<String, String> variables = new HashMap<>(); - setVariables(variables, deleteVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET"); - - WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "DeleteVnfInfra", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); - - String found = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "GENGV_FoundIndicator") ; - String inUse = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "DoDVNF_vnfInUse"); - String response = BPMNUtil.getVariable(processEngineRule, "DeleteVnfInfra", "WorkflowResponse"); - String workflowException = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "WorkflowException"); - - assertEquals("false", found); - assertEquals("false", inUse); - assertEquals("Success", response); - assertEquals(null, workflowException); - } - - @Test - @Deployment(resources = {"subprocess/GenericGetVnf.bpmn", - "subprocess/GenericDeleteVnf.bpmn", - "subprocess/DoDeleteVnf.bpmn", - "process/DeleteVnfInfra.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/CompleteMsoProcess.bpmn"}) - public void testDeleteVnfInfra_error_vnfInUse() throws Exception{ - - stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[?]depth=1")) - .willReturn(aResponse() - .withStatus(200) - .withHeader("Content-Type", "text/xml") - .withBodyFile("GenericFlows/getGenericVnfResponse_hasRelationships.xml"))); - MockDeleteGenericVnf(); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - Map<String, String> variables = new HashMap<>(); - setVariables(variables, deleteVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET"); - - WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "DeleteVnfInfra", variables); - waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); - - String found = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "GENGV_FoundIndicator") ; - String inUse = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "DoDVNF_vnfInUse"); - String workflowException = BPMNUtil.getVariable(processEngineRule, "DeleteVnfInfra", "SavedWorkflowException1"); - - String exWfex = "WorkflowException[processKey=DoDeleteVnf,errorCode=5000,errorMessage=Can't Delete Generic Vnf. Generic Vnf is still in use.]"; - - assertEquals("true", found); - assertEquals("true", inUse); - assertEquals(exWfex, workflowException); - } - - private void setVariables(Map<String, String> variables, String request, String requestId, String siId) { - variables.put("isDebugLogEnabled", "true"); - variables.put("bpmnRequest", request); - variables.put("mso-request-id", requestId); - variables.put("serviceInstanceId",siId); - variables.put("vnfId","testVnfId123"); - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateSIRollbackTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateSIRollbackTest.java deleted file mode 100644 index 8a6c61c89c..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateSIRollbackTest.java +++ /dev/null @@ -1,199 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.bpmn.infrastructure;
-
-import static org.junit.Assert.assertEquals;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteServiceInstance;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById;
-import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
-import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.camunda.bpm.engine.test.Deployment;
-import org.junit.Assert;
-import org.junit.Test;
-import org.openecomp.mso.bpmn.common.BPMNUtil;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
-import org.openecomp.mso.bpmn.core.RollbackData;
-
-/**
- * Unit test cases for DoCreateServiceInstanceRollback.bpmn
- */
-public class DoCreateSIRollbackTest extends WorkflowTest {
- private static final String EOL = "\n";
- private final CallbackSet callbacks = new CallbackSet();
- private final String sdncAdapterCallback =
- "<output xmlns=\"com:att:sdnctl:l3api\">" + EOL +
- " <svc-request-id>((REQUEST-ID))</svc-request-id>" + EOL +
- " <ack-final-indicator>Y</ack-final-indicator>" + EOL +
- "</output>" + EOL;
-
- public DoCreateSIRollbackTest() throws IOException {
- callbacks.put("deactivate", sdncAdapterCallback);
- callbacks.put("delete", sdncAdapterCallback);
- }
-
- /**
- * Sunny day VID scenario.
- *
- * @throws Exception
- */
- //@Ignore // File not found - unable to run the test. Also, Stubs need updating..
- @Test
- @Deployment(resources = {
- "subprocess/DoCreateServiceInstanceRollback.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/GenericDeleteService.bpmn",
- "subprocess/GenericGetService.bpmn",
- "subprocess/CompleteMsoProcess.bpmn",
- "subprocess/FalloutHandler.bpmn" })
- public void sunnyDay() throws Exception {
-
- logStart();
-
- //AAI
- MockDeleteServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "");
- MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getSINoRelations.xml");
- MockNodeQueryServiceInstanceById("MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getSIUrlById.xml");
- //SDNC
- mockSDNCAdapter(200);
- //DB
- mockUpdateRequestDB(200, "DBUpdateResponse.xml");
- String businessKey = UUID.randomUUID().toString();
-
- Map<String, Object> variables = new HashMap<>();
- setupVariables(variables);
- invokeSubProcess("DoCreateServiceInstanceRollback", businessKey, variables);
- injectSDNCCallbacks(callbacks, "deactivate");
- injectSDNCCallbacks(callbacks, "delete");
- waitForProcessEnd(businessKey, 10000);
- Assert.assertTrue(isProcessEnded(businessKey));
- String workflowException = BPMNUtil.getVariable(processEngineRule, "DoCreateServiceInstanceRollback", "WorkflowException");
- System.out.println("workflowException:\n" + workflowException);
- assertEquals(null, workflowException);
-
- logEnd();
- }
-
- // Success Scenario
- private void setupVariables(Map<String, Object> variables) {
- variables.put("isDebugLogEnabled", "true");
- variables.put("msoRequestId", "RaaTestRequestId-1");
- variables.put("mso-request-id", "RaaTestRequestId-1");
- variables.put("serviceInstanceId","MIS%252F1604%252F0026%252FSW_INTERNET");
-
- RollbackData rollbackData = new RollbackData();
-
- rollbackData.put("SERVICEINSTANCE", "serviceInstanceId", "MIS%252F1604%252F0026%252FSW_INTERNET");
- rollbackData.put("SERVICEINSTANCE", "globalCustomerId", "SDN-ETHERNET-INTERNET");
- rollbackData.put("SERVICEINSTANCE", "serviceSubscriptionType", "123456789");
- rollbackData.put("SERVICEINSTANCE", "disablerollback", "false");
- rollbackData.put("SERVICEINSTANCE", "rollbackAAI", "true");
- rollbackData.put("SERVICEINSTANCE", "rollbackSDNC", "true");
-
- String req = "<sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:ns5=\"http://org.openecomp/mso/request/types/v1\"" + EOL +
- "xmlns:sdncadapter=\"http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1\" " + EOL +
- "xmlns:sdncadapterworkflow=\"http://org.openecomp/mso/workflow/schema/v1\">" + EOL +
- "<sdncadapter:RequestHeader>" + EOL +
- "<sdncadapter:RequestId>b043d290-140d-4a38-a9b6-95d3b8bd27d4</sdncadapter:RequestId>" + EOL +
- "<sdncadapter:SvcInstanceId>MIS%252F1604%252F0026%252FSW_INTERNET</sdncadapter:SvcInstanceId>" + EOL +
- "<sdncadapter:SvcAction>deactivate</sdncadapter:SvcAction>" + EOL +
- "<sdncadapter:SvcOperation>service-topology-operation</sdncadapter:SvcOperation>" + EOL +
- "<sdncadapter:CallbackUrl>http://localhost:8080/mso/SDNCAdapterCallbackService</sdncadapter:CallbackUrl>" + EOL +
- "</sdncadapter:RequestHeader>" + EOL +
- "<sdncadapterworkflow:SDNCRequestData>" + EOL +
- "<request-information>" + EOL +
- "<request-id>RaaTestRequestId-1</request-id>" + EOL +
- "<source>MSO</source>" + EOL +
- "<notification-url/>" + EOL +
- "<order-number/>" + EOL +
- "<order-version/>" + EOL +
- "<request-action>DeleteServiceInstance</request-action>" + EOL +
- "</request-information>" + EOL +
- "<service-information>" + EOL +
- "<service-id/>" + EOL +
- "<subscription-service-type>123456789</subscription-service-type>" + EOL +
- "<ecomp-model-information>" + EOL +
- "<model-invariant-uuid/>" + EOL +
- "<model-uuid/>" + EOL +
- "<model-version/>" + EOL +
- "<model-name/>" + EOL +
- "</ecomp-model-information>" + EOL +
- "<service-instance-id>MIS%252F1604%252F0026%252FSW_INTERNET</service-instance-id>" + EOL +
- "<subscriber-name/>" + EOL +
- "<global-customer-id>SDN-ETHERNET-INTERNET</global-customer-id>" + EOL +
- "</service-information>" + EOL +
- "<service-request-input>" + EOL +
- "<service-instance-name/>" + EOL +
- "</service-request-input>" + EOL +
- "</sdncadapterworkflow:SDNCRequestData>" + EOL +
- "</sdncadapterworkflow:SDNCAdapterWorkflowRequest>";
-
- String req1 = "<sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:ns5=\"http://org.openecomp/mso/request/types/v1\"" + EOL +
- "xmlns:sdncadapter=\"http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1\" " + EOL +
- "xmlns:sdncadapterworkflow=\"http://org.openecomp/mso/workflow/schema/v1\">" + EOL +
- "<sdncadapter:RequestHeader>" + EOL +
- "<sdncadapter:RequestId>bca4fede-0804-4c13-af69-9e80b378150f</sdncadapter:RequestId>" + EOL +
- "<sdncadapter:SvcInstanceId>MIS%252F1604%252F0026%252FSW_INTERNET</sdncadapter:SvcInstanceId>" + EOL +
- "<sdncadapter:SvcAction>delete</sdncadapter:SvcAction>" + EOL +
- "<sdncadapter:SvcOperation>service-topology-operation</sdncadapter:SvcOperation>" + EOL +
- "<sdncadapter:CallbackUrl>http://localhost:8080/mso/SDNCAdapterCallbackService</sdncadapter:CallbackUrl>" + EOL +
- "</sdncadapter:RequestHeader>" + EOL +
- "<sdncadapterworkflow:SDNCRequestData>" + EOL +
- "<request-information>" + EOL +
- "<request-id>RaaTestRequestId-1</request-id>" + EOL +
- "<source>MSO</source>" + EOL +
- "<notification-url/>" + EOL +
- "<order-number/>" + EOL +
- "<order-version/>" + EOL +
- "<request-action>DeleteServiceInstance</request-action>" + EOL +
- "</request-information>" + EOL +
- "<service-information>" + EOL +
- "<service-id/>" + EOL +
- "<subscription-service-type>123456789</subscription-service-type>" + EOL +
- "<ecomp-model-information>" + EOL +
- "<model-invariant-uuid/>" + EOL +
- "<model-uuid/>" + EOL +
- "<model-version/>" + EOL +
- "<model-name/>" + EOL +
- "</ecomp-model-information>" + EOL +
- "<service-instance-id>MIS%252F1604%252F0026%252FSW_INTERNET</service-instance-id>" + EOL +
- "<subscriber-name/>" + EOL +
- "<global-customer-id>SDN-ETHERNET-INTERNET</global-customer-id>" + EOL +
- "</service-information>" + EOL +
- "<service-request-input>" + EOL +
- "<service-instance-name/>" + EOL +
- "</service-request-input>" + EOL +
- "</sdncadapterworkflow:SDNCRequestData>" + EOL +
- "</sdncadapterworkflow:SDNCAdapterWorkflowRequest>";
-
- rollbackData.put("SERVICEINSTANCE", "sdncDeactivate", req);
-
- rollbackData.put("SERVICEINSTANCE", "sdncDelete",req1);
- variables.put("rollbackData",rollbackData);
-
- }
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstanceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstanceTest.java deleted file mode 100644 index 4619d33ac5..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstanceTest.java +++ /dev/null @@ -1,130 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure; - -import static org.junit.Assert.assertEquals; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetCustomer; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceByName; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutServiceInstance; -import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB; -import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter; -import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.MockGetServiceResourcesCatalogData; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import org.camunda.bpm.engine.test.Deployment; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; -import org.openecomp.mso.bpmn.common.BPMNUtil; -import org.openecomp.mso.bpmn.common.WorkflowTest; -import org.openecomp.mso.bpmn.mock.FileUtil; - -/** - * Unit test cases for DoCreateServiceInstance.bpmn - */ -public class DoCreateServiceInstanceTest extends WorkflowTest { - private static final String EOL = "\n"; - private final CallbackSet callbacks = new CallbackSet(); - private final String sdncAdapterCallback = - "<output xmlns=\"com:att:sdnctl:l3api\">" + EOL + - " <svc-request-id>((REQUEST-ID))</svc-request-id>" + EOL + - " <ack-final-indicator>Y</ack-final-indicator>" + EOL + - "</output>" + EOL; - private final String input = FileUtil.readResourceFile("__files/CreateServiceInstance/DoCreateServiceInstanceInput.json"); - - - public DoCreateServiceInstanceTest() throws IOException { - callbacks.put("assign", sdncAdapterCallback); - } - - /** - * Sunny day VID scenario. - * - * @throws Exception - */ - @Test - @Ignore // 1802 merge - @Deployment(resources = { - "subprocess/DoCreateServiceInstance.bpmn", - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/GenericPutService.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - "subprocess/DoCreateServiceInstanceRollback.bpmn", - "subprocess/FalloutHandler.bpmn" }) - public void sunnyDay() throws Exception { - - logStart(); - - //AAI - MockGetCustomer("MCBH-1610", "CreateServiceInstance/createServiceInstance_queryGlobalCustomerId_AAIResponse_Success.xml"); - MockPutServiceInstance("MCBH-1610", "viprsvc", "RaaTest-si-id", ""); - MockGetServiceInstance("MCBH-1610", "viprsvc", "RaaTest-si-id", "GenericFlows/getServiceInstance.xml"); - MockNodeQueryServiceInstanceByName("RAATest-si", ""); - - MockNodeQueryServiceInstanceById("RaaTest-si-id", ""); - MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getSINoRelations.xml"); - MockNodeQueryServiceInstanceById("MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getSIUrlById.xml"); - //SDNC - mockSDNCAdapter(200); - //DB - mockUpdateRequestDB(200, "DBUpdateResponse.xml"); - //Catalog DB - MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef","InfrastructureFlows/DoCreateServiceInstance_request.json"); - - String businessKey = UUID.randomUUID().toString(); - - Map<String, Object> variables = new HashMap<>(); - setupVariables(variables); - invokeSubProcess("DoCreateServiceInstance", businessKey, variables); - injectSDNCCallbacks(callbacks, "assign"); - waitForProcessEnd(businessKey, 10000); - Assert.assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, "DoCreateServiceInstance", "WorkflowException"); - System.out.println("workflowException:\n" + workflowException); - assertEquals(null, workflowException); - - logEnd(); - } - - // Success Scenario - private void setupVariables(Map<String, Object> variables) { - variables.put("mso-request-id", "RaaDSITest1"); - variables.put("isDebugLogEnabled", "true"); - variables.put("msoRequestId", "RaaDSITestRequestId-1"); - variables.put("serviceInstanceId","RaaTest-si-id"); - variables.put("serviceModelInfo", "{\"modelType\":\"service\",\"modelInvariantUuid\":\"uuid-miu-svc-011-abcdef\",\"modelVersionUuid\":\"ASDC_TOSCA_UUID\",\"modelName\":\"SIModelName1\",\"modelVersion\":\"2\",\"projectName\":\"proj123\",\"owningEntityId\":\"id123\",\"owningEntityName\":\"name123\"}"); - variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"); - variables.put("globalSubscriberId", "MCBH-1610"); - variables.put("subscriptionServiceType", "viprsvc"); - variables.put("instanceName", "RAATest-1"); - variables.put("serviceInstanceName", "RAT-123"); - variables.put("sdncVersion", "1611"); - variables.put("serviceType", "PORT-MIRROR"); - variables.put("requestJson", input); - } -}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstanceV2Test.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstanceV2Test.java deleted file mode 100644 index a61c8298bc..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstanceV2Test.java +++ /dev/null @@ -1,109 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure;
-
-import static org.junit.Assert.assertEquals;
-import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.MockGetServiceResourcesCatalogData;
-import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
-import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.camunda.bpm.engine.test.Deployment;
-import org.junit.Assert;
-import org.junit.Ignore; -import org.junit.Test; -import org.openecomp.mso.bpmn.common.BPMNUtil;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
-import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition;
-import org.openecomp.mso.bpmn.mock.FileUtil;
-/**
- * Unit test cases for DoCreateServiceInstanceV2.bpmn
- */
-public class DoCreateServiceInstanceV2Test extends WorkflowTest {
-
- private final String input = FileUtil.readResourceFile("__files/CreateServiceInstance/DoCreateServiceInstanceInput.json");
- ServiceDecomposition serviceDecomposition = new ServiceDecomposition("{\"serviceResources\":{\"project\": {\"projectName\": \"projectName\"},\"owningEntity\": {\"owningEntityId\": \"id123\",\"owningEntityName\": \"name123\"}}}","abc123");
-
- public DoCreateServiceInstanceV2Test() throws IOException {
-
-
- }
-
- /**
- * Sunny day VID scenario.
- *
- * @throws Exception
- */
- @Ignore // 1802 merge
- @Test
- @Deployment(resources = {
- "subprocess/DoCreateServiceInstanceV2.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/CompleteMsoProcess.bpmn",
- "subprocess/DoCreateServiceInstanceRollback.bpmn",
- "subprocess/DoCreateServiceInstanceRollbackV2.bpmn",
- "subprocess/FalloutHandler.bpmn" })
-
- public void sunnyDay() throws Exception {
-
- logStart();
-
- //SDNC
- mockSDNCAdapter(200);
- //DB
- mockUpdateRequestDB(200, "DBUpdateResponse.xml");
- //Catalog DB
- MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef","InfrastructureFlows/DoCreateServiceInstance_request.json");
-
- String businessKey = UUID.randomUUID().toString();
-
- Map<String, Object> variables = new HashMap<String, Object>();
- setupVariables(variables);
- invokeSubProcess("DoCreateServiceInstanceV2", businessKey, variables);
- waitForProcessEnd(businessKey, 10000);
- Assert.assertTrue(isProcessEnded(businessKey));
- String workflowException = BPMNUtil.getVariable(processEngineRule, "DoCreateServiceInstanceV2", "WorkflowException");
- System.out.println("workflowException:\n" + workflowException);
- assertEquals(null, workflowException);
-
- logEnd();
- }
-
- // Success Scenario
- private void setupVariables(Map<String, Object> variables) {
- variables.put("isDebugLogEnabled", "true");
- variables.put("msoRequestId", "RaaDSITestRequestId-1");
- variables.put("serviceInstanceId","RaaTest-si-id");
- //variables.put("serviceModelInfo", "{\"modelType\":\"service\",\"modelInvariantUuid\":\"uuid-miu-svc-011-abcdef\",\"modelVersionUuid\":\"ASDC_TOSCA_UUID\",\"modelName\":\"SIModelName1\",\"modelVersion\":\"2\",\"projectName\":\"proj123\",\"owningEntityId\":\"id123\",\"owningEntityName\":\"name123\"}");
- variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
- variables.put("globalSubscriberId", "MCBH-1610");
- variables.put("subscriptionServiceType", "viprsvc");
- variables.put("serviceInstanceName", "RAT-123");
- variables.put("sdncVersion", "1611");
- variables.put("serviceModelInfo", input);
- variables.put("serviceDecomposition", serviceDecomposition);
- variables.put("serviceType", "12e");
- }
-}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstanceV3Test.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstanceV3Test.java deleted file mode 100644 index 88a329b027..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstanceV3Test.java +++ /dev/null @@ -1,70 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import org.camunda.bpm.engine.test.Deployment; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; -import org.openecomp.mso.bpmn.common.WorkflowTest; -import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition; -import org.openecomp.mso.bpmn.core.json.JsonDecomposingException; - -/** - * Unit test cases for DoCreateServiceInstanceV3.bpmn - */ -public class DoCreateServiceInstanceV3Test extends WorkflowTest { - - public DoCreateServiceInstanceV3Test() throws IOException { - - } - - @Test - @Deployment(resources = { "subprocess/DoCreateServiceInstanceV3.bpmn", - "subprocess/DoCreateServiceInstanceV3Rollback.bpmn" - }) - @Ignore // 1802 merge - public void sunnyDay() throws Exception { - logStart(); - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<String, Object>(); - setupVariables(variables); - invokeSubProcess("DoCreateServiceInstanceV3", businessKey, variables); - waitForProcessEnd(businessKey, 10000); - Assert.assertTrue(isProcessEnded(businessKey)); - logEnd(); - } - - // Success Scenario - private void setupVariables(Map<String, Object> variables) throws JsonDecomposingException { - variables.put("abc", "thevalueisabc"); - variables.put("mso-request-id", "213"); - ServiceDecomposition serviceDecomp = new ServiceDecomposition("{\"serviceResources\":{}}", "123"); - serviceDecomp.setServiceType("PORT-MIRRO"); - serviceDecomp.setSdncVersion("1610"); - variables.put("serviceDecomposition", serviceDecomp); - } -}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleRollbackTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleRollbackTest.java deleted file mode 100644 index 25787c79b6..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleRollbackTest.java +++ /dev/null @@ -1,161 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.bpmn.infrastructure;
-
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteGenericVnf;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteVfModuleId;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithDepth;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetVfModuleId;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchGenericVnf;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchVfModuleId;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutGenericVnf;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutVfModuleIdNoResponse;
-import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
-import static org.openecomp.mso.bpmn.mock.StubResponseVNFAdapter.mockVNFDelete;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.camunda.bpm.engine.test.Deployment;
-import org.junit.Test;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
-import org.openecomp.mso.bpmn.core.RollbackData;
-import org.openecomp.mso.bpmn.core.WorkflowException;
-
-/**
- * Unit test for DoDeleteVfModule.bpmn.
- */
-public class DoCreateVfModuleRollbackTest extends WorkflowTest {
- private final CallbackSet callbacks = new CallbackSet();
-
- private static final String EOL = "\n";
-
- private final String vnfAdapterDeleteCallback =
- "<deleteVfModuleResponse>" + EOL +
- " <vnfId>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnfId>" + EOL +
- " <vfModuleId>973ed047-d251-4fb9-bf1a-65b8949e0a73</vfModuleId>" + EOL +
- " <vfModuleDeleted>true</vfModuleDeleted>" + EOL +
- " <messageId>{{MESSAGE-ID}}</messageId>" + EOL +
- "</deleteVfModuleResponse>" + EOL;
-
- private final String vnfAdapterDeleteCallbackFail =
- "<vfModuleException>" + EOL +
- " <message>Error processing request to VNF-Async. Not Found.</message>" + EOL +
- " <category>INTERNAL</category>" + EOL +
- " <rolledBack>false</rolledBack>" + EOL +
- " <messageId>{{MESSAGE-ID}}</messageId>" + EOL +
- "</vfModuleException>" + EOL;
-
- private final String sdncAdapterDeleteCallback =
- "<output xmlns=\"org:onap:sdnctl:l3api\">" + EOL +
- " <svc-request-id>{{REQUEST-ID}}</svc-request-id>" + EOL +
- " <ack-final-indicator>Y</ack-final-indicator>" + EOL +
- "</output>" + EOL;
-
- public DoCreateVfModuleRollbackTest() throws IOException {
- callbacks.put("sdncChangeDelete", sdncAdapterDeleteCallback);
- callbacks.put("sdncDelete", sdncAdapterDeleteCallback);
- callbacks.put("vnfDelete", vnfAdapterDeleteCallback);
- callbacks.put("vnfDeleteFail", vnfAdapterDeleteCallbackFail);
- }
-
- @Test
-
- @Deployment(resources = {
- "subprocess/DoCreateVfModuleRollback.bpmn",
- "subprocess/PrepareUpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn",
- "subprocess/DeleteAAIVfModule.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn"
- })
- public void TestCreateVfModuleRollbackSuccess() {
- logStart();
-
- mockSDNCAdapter("/SDNCAdapter", "SvcAction>delete", 200, "DeleteGenericVNFV1/sdncAdapterResponse.xml");
- mockVNFDelete("a27ce5a9-29c4-4c22-a017-6615ac73c721", "/973ed047-d251-4fb9-bf1a-65b8949e0a73", 202);
- MockDeleteGenericVnf("a27ce5a9-29c4-4c22-a017-6615ac73c721", "0000021", 200);
- MockDeleteVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73", "0000073", 200);
- MockPutVfModuleIdNoResponse("a27ce5a9-29c4-4c22-a017-6615ac73c721", "MMSC", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
- MockPutGenericVnf("a27ce5a9-29c4-4c22-a017-6615ac73c721");
- MockGetGenericVnfByIdWithDepth("a27ce5a9-29c4-4c22-a017-6615ac73c721", 1, "DoCreateVfModuleRollback/GenericVnf.xml");
- MockGetVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73", "DoCreateVfModuleRollback/GenericVnfVfModule.xml", 200);
- MockPatchGenericVnf("a27ce5a9-29c4-4c22-a017-6615ac73c721");
- MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
-
- String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<>();
- RollbackData rollbackData = new RollbackData();
- rollbackData.put("VFMODULE", "source", "PORTAL");
- rollbackData.put("VFMODULE", "vnfid", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- rollbackData.put("VFMODULE", "vnfname", "STMTN5MMSC21");
- rollbackData.put("VFMODULE", "vnftype", "asc_heat-int");
- rollbackData.put("VFMODULE", "vfmoduleid", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
- rollbackData.put("VFMODULE", "vfmodulename", "STMTN5MMSC21-MMSC::module-0-0");
- rollbackData.put("VFMODULE", "tenantid", "fba1bd1e195a404cacb9ce17a9b2b421");
- rollbackData.put("VFMODULE", "aiccloudregion", "RDM2WAGPLCP");
- rollbackData.put("VFMODULE", "heatstackid", "thisisaheatstack");
- rollbackData.put("VFMODULE", "contrailNetworkPolicyFqdn0", "MSOTest:DefaultPolicyFQDN1");
- rollbackData.put("VFMODULE", "contrailNetworkPolicyFqdn1", "MSOTest:DefaultPolicyFQDN2");
- rollbackData.put("VFMODULE", "oamManagementV6Address", "2000:abc:bce:1111");
- rollbackData.put("VFMODULE", "oamManagementV4Address", "127.0.0.1");
-
- rollbackData.put("VFMODULE", "rollbackPrepareUpdateVfModule", "true");
- rollbackData.put("VFMODULE", "rollbackVnfAdapterCreate", "true");
- rollbackData.put("VFMODULE", "rollbackUpdateAAIVfModule", "true");
- rollbackData.put("VFMODULE", "rollbackSDNCRequestActivate", "true");
- rollbackData.put("VFMODULE", "rollbackCreateAAIVfModule", "true");
- rollbackData.put("VFMODULE", "rollbackCreateNetworkPoliciesAAI", "true");
- rollbackData.put("VFMODULE", "rollbackUpdateVnfAAI", "true");
-
-
-
- variables.put("isDebugLogEnabled","true");
- variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("mso-service-instance-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- rollbackData.put("VFMODULE", "msorequestid", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- rollbackData.put("VFMODULE", "serviceinstanceid", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("rollbackData", rollbackData);
- variables.put("sdncVersion", "1702");
- invokeSubProcess("DoCreateVfModuleRollback", businessKey, variables);
-
- // "changedelete" operation not required for deleting a Vf Module
-// injectSDNCCallbacks(callbacks, "sdncChangeDelete");
- injectVNFRestCallbacks(callbacks, "vnfDelete");
- waitForRunningProcessCount("vnfAdapterDeleteV1", 0, 120000);
- injectSDNCCallbacks(callbacks, "sdncDelete");
-
- waitForProcessEnd(businessKey, 10000);
- WorkflowException wfe = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException");
- checkVariable(businessKey, "WorkflowException", null);
- if (wfe != null) {
- System.out.println("TestCreateVfModuleSuccess: ErrorCode=" + wfe.getErrorCode() +
- ", ErrorMessage=" + wfe.getErrorMessage());
- }
- logEnd();
- }
-
-
-}
-
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleTest.java deleted file mode 100644 index 490d31023b..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleTest.java +++ /dev/null @@ -1,477 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.bpmn.infrastructure;
-
-
-import static org.openecomp.mso.bpmn.common.BPMNUtil.getRawVariable;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockAAIVfModule;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithDepth;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithPriority;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetVfModuleByName;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchGenericVnf;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchVfModuleId;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutGenericVnf;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutNetwork;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutVfModuleIdNoResponse;
-import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.MockGetServiceResourcesCatalogData;
-import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.MockGetVnfCatalogDataCustomizationUuid;
-import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
-import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
-import static org.openecomp.mso.bpmn.mock.StubResponseVNFAdapter.mockVNFPost;
-
-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.WorkflowTest;
-import org.openecomp.mso.bpmn.mock.FileUtil;
-
-/**
- * Unit tests for DoCreateVfModuleTest.bpmn.
- */
-public class DoCreateVfModuleTest extends WorkflowTest {
-
- private final CallbackSet callbacks = new CallbackSet();
-
- public DoCreateVfModuleTest() throws IOException {
- callbacks.put("assign", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyAssignCallback.xml"));
- callbacks.put("query", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyQueryCallback.xml"));
- callbacks.put("queryVnf", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyQueryCallbackVnf.xml"));
- callbacks.put("queryModuleNoVnf", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyQueryCallbackVfModuleNoVnf.xml"));
- callbacks.put("queryModule", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyQueryCallbackVfModule.xml"));
- callbacks.put("activate", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyActivateCallback.xml"));
- callbacks.put("vnfCreate", FileUtil.readResourceFile(
- "__files/VfModularity/VNFAdapterRestCreateCallback.xml"));
- }
-
- /**
- * Test the sunny day scenario.
- */
- @Test
-
- @Deployment(resources = {
- "subprocess/DoCreateVfModule.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/GenericGetVnf.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/ConfirmVolumeGroupTenant.bpmn",
- "subprocess/ConfirmVolumeGroupName.bpmn",
- "subprocess/CreateAAIVfModule.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn",
- "subprocess/CreateAAIVfModuleVolumeGroup.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn"
- })
- public void sunnyDay() throws IOException {
-
- logStart();
-
- MockAAIVfModule();
- MockPatchGenericVnf("skask");
- MockPatchVfModuleId("skask", ".*");
- mockSDNCAdapter("VfModularity/StandardSDNCSynchResponse.xml");
- mockVNFPost("", 202, "skask");
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
- //Catalog DB
- MockGetServiceResourcesCatalogData("aa5256d2-5a33-55df-13ab-12abad84e7ff","InfrastructureFlows/DoCreateServiceInstance_request.json");
-
- String businessKey = UUID.randomUUID().toString();
- //RuntimeService runtimeService = processEngineRule.getRuntimeService();
-
- Map<String, Object> variables = setupVariablesSunnyDayBuildingBlocks();
- //runtimeService.startProcessInstanceByKey("DoCreateVfModule", variables);
- invokeSubProcess("DoCreateVfModule", businessKey, variables);
-
- injectSDNCCallbacks(callbacks, "queryVnf");
- injectSDNCCallbacks(callbacks, "assign, queryModuleNoVnf");
- injectVNFRestCallbacks(callbacks, "vnfCreate");
- injectSDNCCallbacks(callbacks, "activate");
-
- waitForProcessEnd(businessKey, 10000);
-
- Assert.assertTrue(isProcessEnded(businessKey));
- Assert.assertTrue((boolean) getRawVariable(processEngineRule, "DoCreateVfModule", "DCVFM_SuccessIndicator"));
-
- logEnd();
- }
-
- /**
- * Test the sunny day scenario with 1702 SDNC interaction.
- */
- @Test
-
- @Deployment(resources = {
- "subprocess/DoCreateVfModule.bpmn",
- "subprocess/GenericGetVnf.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/ConfirmVolumeGroupTenant.bpmn",
- "subprocess/ConfirmVolumeGroupName.bpmn",
- "subprocess/CreateAAIVfModule.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn",
- "subprocess/CreateAAIVfModuleVolumeGroup.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn"
- })
- public void sunnyDay_1702() throws IOException {
-
- logStart();
-
- MockGetGenericVnfByIdWithPriority("skask", ".*", 200, "VfModularity/VfModule-new.xml", 5);
- MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
- MockPutVfModuleIdNoResponse("skask", "PCRF", ".*");
- MockPutNetwork(".*", "VfModularity/AddNetworkPolicy_AAIResponse_Success.xml", 200);
- MockPutGenericVnf("skask");
- mockSDNCAdapter("/SDNCAdapter", "vnf-type>STMTN", 200, "VfModularity/StandardSDNCSynchResponse.xml");
- mockSDNCAdapter("/SDNCAdapter", "SvcAction>query", 200, "VfModularity/StandardSDNCSynchResponse.xml");
- mockVNFPost("", 202, "skask");
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
- MockPatchGenericVnf("skask");
- MockPatchVfModuleId("skask", ".*");
- //Catalog DB
- MockGetServiceResourcesCatalogData("aa5256d2-5a33-55df-13ab-12abad84e7ff","InfrastructureFlows/DoCreateServiceInstance_request.json");
-
-
- String businessKey = UUID.randomUUID().toString();
- //RuntimeService runtimeService = processEngineRule.getRuntimeService();
-
- Map<String, Object> variables = setupVariablesSunnyDayBuildingBlocks();
- variables.put("sdncVersion", "1702");
- //runtimeService.startProcessInstanceByKey("DoCreateVfModule", variables);
- invokeSubProcess("DoCreateVfModule", businessKey, variables);
-
-
- injectSDNCCallbacks(callbacks, "assign, queryModule");
- injectVNFRestCallbacks(callbacks, "vnfCreate");
- injectSDNCCallbacks(callbacks, "activate");
-
- waitForProcessEnd(businessKey, 10000);
-
- Assert.assertTrue(isProcessEnded(businessKey));
- Assert.assertTrue((boolean) getRawVariable(processEngineRule, "DoCreateVfModule", "DCVFM_SuccessIndicator"));
-
- logEnd();
- }
-
- /**
- * Test the sunny day scenario.
- */
- @Test
-
- @Deployment(resources = {
- "subprocess/DoCreateVfModule.bpmn",
- "subprocess/GenerateVfModuleName.bpmn",
- "subprocess/GenericGetVnf.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/ConfirmVolumeGroupTenant.bpmn",
- "subprocess/ConfirmVolumeGroupName.bpmn",
- "subprocess/CreateAAIVfModule.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn",
- "subprocess/CreateAAIVfModuleVolumeGroup.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn"
- })
- public void sunnyDay_withVfModuleNameGeneration() throws IOException {
-
- logStart();
-
- MockGetGenericVnfByIdWithPriority("skask", ".*", 200, "VfModularity/VfModule-new.xml", 5);
- MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
- MockPutVfModuleIdNoResponse("skask", "PCRF", ".*");
- MockPutNetwork(".*", "VfModularity/AddNetworkPolicy_AAIResponse_Success.xml", 200);
- MockPutGenericVnf("skask");
- MockAAIVfModule();
- mockSDNCAdapter("/SDNCAdapter", "vnf-type>STMTN", 200, "VfModularity/StandardSDNCSynchResponse.xml");
- mockSDNCAdapter("/SDNCAdapter", "SvcAction>query", 200, "VfModularity/StandardSDNCSynchResponse.xml");
- mockVNFPost("", 202, "skask");
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
- MockPatchGenericVnf("skask");
- MockPatchVfModuleId("skask", ".*");
- //Catalog DB
- MockGetServiceResourcesCatalogData("aa5256d2-5a33-55df-13ab-12abad84e7ff","InfrastructureFlows/DoCreateServiceInstance_request.json");
-
- String businessKey = UUID.randomUUID().toString();
- //RuntimeService runtimeService = processEngineRule.getRuntimeService();
-
- Map<String, Object> variables = setupVariablesSunnyDayBuildingBlocks();
- variables.put("vfModuleName", null);
- variables.put("vfModuleLabel", "MODULELABEL");
- variables.put("sdncVersion", "1702");
- //runtimeService.startProcessInstanceByKey("DoCreateVfModule", variables);
- invokeSubProcess("DoCreateVfModule", businessKey, variables);
-
- injectSDNCCallbacks(callbacks, "assign, query");
- injectVNFRestCallbacks(callbacks, "vnfCreate");
- injectSDNCCallbacks(callbacks, "activate");
-
- waitForProcessEnd(businessKey, 10000);
-
- Assert.assertTrue(isProcessEnded(businessKey));
- Assert.assertTrue((boolean) getRawVariable(processEngineRule, "DoCreateVfModule", "DCVFM_SuccessIndicator"));
-
- logEnd();
- }
-
- /**
- * Test the sunny day scenario for the aLaCarte request with no multiStageDesign
- */
- @Test
-
- @Deployment(resources = {
- "subprocess/DoCreateVfModule.bpmn",
- "subprocess/GenericGetVnf.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/ConfirmVolumeGroupTenant.bpmn",
- "subprocess/ConfirmVolumeGroupName.bpmn",
- "subprocess/CreateAAIVfModule.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn",
- "subprocess/CreateAAIVfModuleVolumeGroup.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn"
- })
- public void sunnyDay_aLaCarte_noMultistage() throws IOException {
-
- logStart();
-
- MockGetGenericVnfByIdWithPriority("skask", ".*", 200, "VfModularity/VfModule-new.xml", 5);
- MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
- MockPutVfModuleIdNoResponse("skask", "PCRF", ".*");
- MockPutNetwork(".*", "VfModularity/AddNetworkPolicy_AAIResponse_Success.xml", 200);
- MockPutGenericVnf("skask");
- mockSDNCAdapter("/SDNCAdapter", "vnf-type>STMTN", 200, "VfModularity/StandardSDNCSynchResponse.xml");
- mockSDNCAdapter("/SDNCAdapter", "SvcAction>query", 200, "VfModularity/StandardSDNCSynchResponse.xml");
- mockVNFPost("", 202, "skask");
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
- MockPatchGenericVnf("skask");
- MockPatchVfModuleId("skask", ".*");
- //Catalog DB
- MockGetServiceResourcesCatalogData("aa5256d2-5a33-55df-13ab-12abad84e7ff","InfrastructureFlows/DoCreateServiceInstance_request.json");
- MockGetVnfCatalogDataCustomizationUuid("VNF-MODEL-123", "VIPR/getCatalogVnfNoTwoPhasedForVfModule.json");
-
- String businessKey = UUID.randomUUID().toString();
- //RuntimeService runtimeService = processEngineRule.getRuntimeService();
-
- Map<String, Object> variables = setupVariablesSunnyDayBuildingBlocks();
- variables.put("sdncVersion", "1702");
- variables.put("aLaCarte", true);
- //runtimeService.startProcessInstanceByKey("DoCreateVfModule", variables);
- invokeSubProcess("DoCreateVfModule", businessKey, variables);
-
-
- injectSDNCCallbacks(callbacks, "assign, queryModule");
- injectVNFRestCallbacks(callbacks, "vnfCreate");
- injectSDNCCallbacks(callbacks, "activate");
-
- waitForProcessEnd(businessKey, 10000);
-
- Assert.assertTrue(isProcessEnded(businessKey));
- Assert.assertTrue((boolean) getRawVariable(processEngineRule, "DoCreateVfModule", "DCVFM_SuccessIndicator"));
-
- logEnd();
- }
-
- /**
- * Test the sunny day scenario for the first stage of multistage design.
- */
- @Test
-
- @Deployment(resources = {
- "subprocess/DoCreateVfModule.bpmn",
- "subprocess/GenericGetVnf.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/ConfirmVolumeGroupTenant.bpmn",
- "subprocess/ConfirmVolumeGroupName.bpmn",
- "subprocess/CreateAAIVfModule.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn",
- "subprocess/CreateAAIVfModuleVolumeGroup.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn"
- })
- public void sunnyDay_1st_of_multistage() throws IOException {
-
- logStart();
-
- MockGetGenericVnfByIdWithPriority("skask", ".*", 200, "VfModularity/VfModule-new.xml", 5);
- MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
- MockPutVfModuleIdNoResponse("skask", "PCRF", ".*");
- MockPutNetwork(".*", "VfModularity/AddNetworkPolicy_AAIResponse_Success.xml", 200);
- MockPutGenericVnf("skask");
- mockSDNCAdapter("/SDNCAdapter", "vnf-type>STMTN", 200, "VfModularity/StandardSDNCSynchResponse.xml");
- mockSDNCAdapter("/SDNCAdapter", "SvcAction>query", 200, "VfModularity/StandardSDNCSynchResponse.xml");
- mockVNFPost("", 202, "skask");
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
- MockPatchGenericVnf("skask");
- MockPatchVfModuleId("skask", ".*");
- //Catalog DB
- MockGetServiceResourcesCatalogData("aa5256d2-5a33-55df-13ab-12abad84e7ff","InfrastructureFlows/DoCreateServiceInstance_request.json");
- MockGetVnfCatalogDataCustomizationUuid("VNF-MODEL-123", "VIPR/getCatalogVnfYesTwoPhasedForVfModule.json");
-
- String businessKey = UUID.randomUUID().toString();
- //RuntimeService runtimeService = processEngineRule.getRuntimeService();
-
- Map<String, Object> variables = setupVariablesSunnyDayBuildingBlocks();
- variables.put("sdncVersion", "1702");
- variables.put("aLaCarte", true);
- //runtimeService.startProcessInstanceByKey("DoCreateVfModule", variables);
- invokeSubProcess("DoCreateVfModule", businessKey, variables);
-
- injectSDNCCallbacks(callbacks, "assign");
-
- waitForProcessEnd(businessKey, 10000);
-
- Assert.assertTrue(isProcessEnded(businessKey));
- Assert.assertTrue((boolean) getRawVariable(processEngineRule, "DoCreateVfModule", "DCVFM_SuccessIndicator"));
-
- logEnd();
- }
-
- /**
- * Test the sunny day scenario for the second stage of multiStageDesign
- */
- @Test
-
- @Deployment(resources = {
- "subprocess/DoCreateVfModule.bpmn",
- "subprocess/GenericGetVnf.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/ConfirmVolumeGroupTenant.bpmn",
- "subprocess/ConfirmVolumeGroupName.bpmn",
- "subprocess/CreateAAIVfModule.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn",
- "subprocess/CreateAAIVfModuleVolumeGroup.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn"
- })
- public void sunnyDay_2nd_of_multistage() throws IOException {
-
- logStart();
-
- MockGetGenericVnfByIdWithPriority("skask", ".*", 200, "VfModularity/VfModule-new.xml", 5);
- MockGetVfModuleByName("skask", "PCRF%3A%3Amodule-0-2","VfModularity/VfModule-new-PendingActivation.xml", 200);
- MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
- MockPutVfModuleIdNoResponse("skask", "PCRF", ".*");
- MockPutNetwork(".*", "VfModularity/AddNetworkPolicy_AAIResponse_Success.xml", 200);
- MockPutGenericVnf("skask");
- mockSDNCAdapter("/SDNCAdapter", "vnf-type>STMTN", 200, "VfModularity/StandardSDNCSynchResponse.xml");
- mockSDNCAdapter("/SDNCAdapter", "SvcAction>query", 200, "VfModularity/StandardSDNCSynchResponse.xml");
- mockVNFPost("", 202, "skask");
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
- MockPatchGenericVnf("skask");
- MockPatchVfModuleId("skask", ".*");
- //Catalog DB
- MockGetServiceResourcesCatalogData("aa5256d2-5a33-55df-13ab-12abad84e7ff","InfrastructureFlows/DoCreateServiceInstance_request.json");
-
-
- String businessKey = UUID.randomUUID().toString();
- //RuntimeService runtimeService = processEngineRule.getRuntimeService();
-
- Map<String, Object> variables = setupVariablesSunnyDayBuildingBlocks();
- variables.put("sdncVersion", "1702");
- variables.put("aLaCarte", true);
- //runtimeService.startProcessInstanceByKey("DoCreateVfModule", variables);
- invokeSubProcess("DoCreateVfModule", businessKey, variables);
-
- injectSDNCCallbacks(callbacks, "queryModule");
- injectVNFRestCallbacks(callbacks, "vnfCreate");
- injectSDNCCallbacks(callbacks, "activate");
-
- waitForProcessEnd(businessKey, 10000);
-
- Assert.assertTrue(isProcessEnded(businessKey));
- Assert.assertTrue((boolean) getRawVariable(processEngineRule, "DoCreateVfModule", "DCVFM_SuccessIndicator"));
-
- logEnd();
- }
-
-
- private Map<String, Object> setupVariablesSunnyDayBuildingBlocks() {
- Map<String, Object> variables = new HashMap<>();
- //try {
- // variables.put("bpmnRequest", FileUtil.readResourceFile("__files/CreateVfModule_VID_request.json"));
- //}
- //catch (Exception e) {
-
- //}
-
- variables.put("mso-request-id", "testRequestId");
-
- variables.put("msoRequestId", "testRequestId");
- variables.put("isBaseVfModule", false);
- variables.put("isDebugLogEnabled", "true");
- variables.put("disableRollback", "true");
- //variables.put("recipeTimeout", "0");
- //variables.put("requestAction", "CREATE_VF_MODULE");
- variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
- variables.put("vnfId", "skask");
- variables.put("vnfName", "vnfname");
- variables.put("vfModuleName", "PCRF::module-0-2");
- variables.put("vnfType", "vSAMP12");
- variables.put("vfModuleId", "");
- variables.put("volumeGroupId", "");
- variables.put("serviceType", "MOG");
- variables.put("vfModuleType", "");
- variables.put("isVidRequest", "true");
- variables.put("asdcServiceModelVersion", "1.0");
- variables.put("usePreload", true);
-
- String vfModuleModelInfo = "{ "+ "\"modelType\": \"vfModule\"," +
- "\"modelInvariantUuid\": \"ff5256d2-5a33-55df-13ab-12abad84e7ff\"," +
- "\"modelUuid\": \"fe6478e5-ea33-3346-ac12-ab121484a3fe\"," +
- "\"modelName\": \"STMTN5MMSC21-MMSC::model-1-0\"," +
- "\"modelVersion\": \"1\"," +
- "\"modelCustomizationUuid\": \"MODEL-123\"" + "}";
- variables.put("vfModuleModelInfo", vfModuleModelInfo);
-
- variables.put("sdncVersion", "1707");
-
- variables.put("lcpCloudRegionId", "MDTWNJ21");
- variables.put("tenantId", "fba1bd1e195a404cacb9ce17a9b2b421");
-
- String serviceModelInfo = "{ "+ "\"modelType\": \"service\"," +
- "\"modelInvariantUuid\": \"aa5256d2-5a33-55df-13ab-12abad84e7ff\"," +
- "\"modelUuid\": \"bb6478e5-ea33-3346-ac12-ab121484a3fe\"," +
- "\"modelName\": \"SVC-STMTN5MMSC21-MMSC::model-1-0\"," +
- "\"modelVersion\": \"1\"," +
- "}";
- variables.put("serviceModelInfo", serviceModelInfo);
-
- String vnfModelInfo = "{ "+ "\"modelType\": \"vnf\"," +
- "\"modelInvariantUuid\": \"445256d2-5a33-55df-13ab-12abad84e7ff\"," +
- "\"modelUuid\": \"f26478e5-ea33-3346-ac12-ab121484a3fe\"," +
- "\"modelName\": \"VNF-STMTN5MMSC21-MMSC::model-1-0\"," +
- "\"modelVersion\": \"1\"," +
- "\"modelCustomizationUuid\": \"VNF-MODEL-123\"" + "}";
- variables.put("vnfModelInfo", vnfModelInfo);
-
- variables.put("vnfQueryPath", "/restconf/vnfQueryPath");
-
- return variables;
-
- }
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleVolumeV2Test.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleVolumeV2Test.java deleted file mode 100644 index e9082d9d65..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleVolumeV2Test.java +++ /dev/null @@ -1,240 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.bpmn.infrastructure;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.camunda.bpm.engine.test.Deployment;
-import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
-import org.openecomp.mso.bpmn.core.WorkflowException;
-import org.openecomp.mso.bpmn.mock.FileUtil;
-
-@Ignore
-public class DoCreateVfModuleVolumeV2Test extends WorkflowTest {
-
- public static final String _prefix = "CVFMODVOL2_";
-
- private final CallbackSet callbacks = new CallbackSet();
-
- public DoCreateVfModuleVolumeV2Test() throws IOException {
- callbacks.put("volumeGroupCreate", FileUtil.readResourceFile(
- "__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeCallbackResponse.xml"));
- callbacks.put("volumeGroupRollback", FileUtil.readResourceFile(
- "__files/DoCreateVfModuleVolumeV1/RollbackVfModuleVolumeCallbackResponse.xml"));
- }
-
- /**
- * Happy Path
- * @throws Exception
- */
- @Test
- //@Ignore
- @Deployment(resources = {"subprocess/DoCreateVfModuleVolumeV2.bpmn",
- "subprocess/FalloutHandler.bpmn",
- "subprocess/CompleteMsoProcess.bpmn",
- "subprocess/vnfAdapterRestV1.bpmn",
- "subprocess/DoCreateVfModuleVolumeRollback.bpmn"})
- public void TestHappyPath() throws Exception {
-
- logStart();
-
-// DoCreateVfModuleVolume_Success();
-
- String businessKey = UUID.randomUUID().toString();
- String createVfModuleVolRequest = FileUtil.readResourceFile("__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeRequest.xml");
-
- Map<String, Object> testVariables = new HashMap<>();
- testVariables.put("volumeGroupId", "TEST-VOLUME-VOLUME-GROUP-ID-0123");
- testVariables.put("vnfId", "TEST-VNF-ID-0123");
- testVariables.put("lcpCloudRegionId", "AAIAIC25");
- testVariables.put("test-volume-group-name", "MSOTESTVOL101a-vSAMP12_base_vol_module-01");
- testVariables.put("test-volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
- //testVariables.put("DoCreateVfModuleVolumeV1Request", createVfModuleVolRequest);
- TestAsyncResponse asyncResponse = invokeAsyncProcess("DoCreateVfModuleVolumeV2", "v1", businessKey, createVfModuleVolRequest, testVariables);
-
- injectVNFRestCallbacks(callbacks, "volumeGroupCreate");
-
- waitForProcessEnd(businessKey, 100000);
- checkVariable(businessKey, "DCVFMODVOLV2_SuccessIndicator", true);
-
- logEnd();
- }
-
- @Test
-// @Ignore
- @Deployment(resources = {"subprocess/DoCreateVfModuleVolumeV2.bpmn",
- "subprocess/FalloutHandler.bpmn",
- "subprocess/CompleteMsoProcess.bpmn",
- "subprocess/vnfAdapterRestV1.bpmn",
- "subprocess/DoCreateVfModuleVolumeRollback.bpmn"})
- public void TestVolumeGroupExistError() throws Exception {
-
- logStart();
-
-// DoCreateVfModuleVolume_VolumeGroupExistsFail();
-
- String businessKey = UUID.randomUUID().toString();
- String createVfModuleVolRequest = FileUtil.readResourceFile("__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeRequest.xml");
-
- Map<String, Object> testVariables = new HashMap<>();
- testVariables.put("DCVFMODVOLV2_volumeGroupId", "TEST-VOLUME-VOLUME-GROUP-ID-0123");
- testVariables.put("vnf-id", "TEST-VNF-ID-0123");
- testVariables.put("volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
- testVariables.put("test-volume-group-name", "TEST-MSOTESTVOL101a-vSAMP12_base_vol_module-0");
- testVariables.put("DoCreateVfModuleVolumeV1Request", createVfModuleVolRequest);
- TestAsyncResponse asyncResponse = invokeAsyncProcess("DoCreateVfModuleVolumeV2", "v1", businessKey, createVfModuleVolRequest, testVariables);
-
- //injectVNFRestCallbacks(callbacks, "volumeGroupCreate");
-
- waitForProcessEnd(businessKey, 100000);
- WorkflowException wfe = (WorkflowException) getVariableFromHistory(businessKey, "SavedWorkflowException1");
- Assert.assertTrue(wfe.getErrorCode() == 2500);
- Assert.assertTrue(wfe.getErrorMessage().startsWith("Generic vnf null was not found in AAI. Return code: 404."));
- checkVariable(businessKey, "DCVFMODVOLV2_SuccessIndicator", false);
-
- logEnd();
- }
-
- /**
- * Will trigger AAI create rollback
- * @throws Exception
- */
- @Test
-// @Ignore
- @Deployment(resources = {"subprocess/DoCreateVfModuleVolumeV2.bpmn",
- "subprocess/FalloutHandler.bpmn",
- "subprocess/CompleteMsoProcess.bpmn",
- "subprocess/vnfAdapterRestV1.bpmn",
- "subprocess/DoCreateVfModuleVolumeRollback.bpmn"})
- public void TestVnfVolumeGroupCreateError() throws Exception {
-
- logStart();
-
-// DoCreateVfModuleVolume_VnfCreateVolumeGroupFail();
-
- String businessKey = UUID.randomUUID().toString();
- String createVfModuleVolRequest = FileUtil.readResourceFile("__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeRequest.xml");
-
- Map<String, Object> testVariables = new HashMap<>();
- testVariables.put("DCVFMODVOLV2_volumeGroupId", "TEST-VOLUME-VOLUME-GROUP-ID-0123");
- testVariables.put("vnf-id", "TEST-VNF-ID-0123");
- testVariables.put("volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
- testVariables.put("test-volume-group-name", "TEST-MSOTESTVOL101a-vSAMP12_base_vol_module-0");
- testVariables.put("test-volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
- testVariables.put("DoCreateVfModuleVolumeV1Request", createVfModuleVolRequest);
- TestAsyncResponse asyncResponse = invokeAsyncProcess("DoCreateVfModuleVolumeV2", "v1", businessKey, createVfModuleVolRequest, testVariables);
-
- //injectVNFRestCallbacks(callbacks, "volumeGroupCreate");
-
- waitForProcessEnd(businessKey, 100000);
- checkVariable(businessKey, "DCVFMODVOLV2_SuccessIndicator", false);
-
- logEnd();
- }
-
- /**
- * Will trigger AAI create rollback
- * @throws Exception
- */
- @Test
-// @Ignore
- @Deployment(resources = {"subprocess/DoCreateVfModuleVolumeV2.bpmn",
- "subprocess/FalloutHandler.bpmn",
- "subprocess/CompleteMsoProcess.bpmn",
- "subprocess/vnfAdapterRestV1.bpmn",
- "subprocess/DoCreateVfModuleVolumeRollback.bpmn"})
- public void TestUpdateAaiVolumeGroupError() throws Exception {
-
- logStart();
-
-// DoCreateVfModuleVolume_AaiVolumeGroupUpdateFail();
-
- String businessKey = UUID.randomUUID().toString();
- String createVfModuleVolRequest = FileUtil.readResourceFile("__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeRequest.xml");
-
- Map<String, Object> testVariables = new HashMap<>();
- testVariables.put("DCVFMODVOLV2_volumeGroupId", "TEST-VOLUME-VOLUME-GROUP-ID-0123");
- testVariables.put("vnf-id", "TEST-VNF-ID-0123");
- testVariables.put("volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
- testVariables.put("test-volume-group-name", "TEST-MSOTESTVOL101a-vSAMP12_base_vol_module-0");
- testVariables.put("test-volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
- testVariables.put("DoCreateVfModuleVolumeV1Request", createVfModuleVolRequest);
- TestAsyncResponse asyncResponse = invokeAsyncProcess("DoCreateVfModuleVolumeV2", "v1", businessKey, createVfModuleVolRequest, testVariables);
-
- // VNF callback not needed fort this failure scenario
-// injectVNFRestCallbacks(callbacks, "volumeGroupCreate,volumeGroupRollback");
-
- waitForProcessEnd(businessKey, 100000);
- WorkflowException wfe = (WorkflowException) getVariableFromHistory(businessKey, "SavedWorkflowException1");
- Assert.assertTrue(wfe.getErrorCode() == 2500);
- Assert.assertTrue(wfe.getErrorMessage().startsWith("Generic vnf null was not found in AAI. Return code: 404."));
- checkVariable(businessKey, "DCVFMODVOLV2_SuccessIndicator", false);
-
- logEnd();
- }
-
- /**
- * Will trigger not trigger rollback
- * @throws Exception
- */
- @Test
-// @Ignore
- @Deployment(resources = {"subprocess/DoCreateVfModuleVolumeV2.bpmn",
- "subprocess/FalloutHandler.bpmn",
- "subprocess/CompleteMsoProcess.bpmn",
- "subprocess/vnfAdapterRestV1.bpmn",
- "subprocess/DoCreateVfModuleVolumeRollback.bpmn"})
- public void TestUpdateAaiVolumeGroupErrorNoRollback() throws Exception {
-
- logStart();
-
-// DoCreateVfModuleVolume_AaiVolumeGroupUpdateFail();
-
- String businessKey = UUID.randomUUID().toString();
- String createVfModuleVolRequest = FileUtil.readResourceFile("__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeNoRollbackRequest.xml");
-
- Map<String, Object> testVariables = new HashMap<>();
- testVariables.put("DCVFMODVOLV2_volumeGroupId", "TEST-VOLUME-VOLUME-GROUP-ID-0123");
- testVariables.put("vnf-id", "TEST-VNF-ID-0123");
- testVariables.put("volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
- testVariables.put("test-volume-group-name", "TEST-MSOTESTVOL101a-vSAMP12_base_vol_module-0");
- testVariables.put("test-volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
- testVariables.put("DoCreateVfModuleVolumeV1Request", createVfModuleVolRequest);
- TestAsyncResponse asyncResponse = invokeAsyncProcess("DoCreateVfModuleVolumeV2", "v1", businessKey, createVfModuleVolRequest, testVariables);
-
- // VNF callback not needed fort this failure scenario
-// injectVNFRestCallbacks(callbacks, "volumeGroupCreate");
-
- waitForProcessEnd(businessKey, 100000);
- WorkflowException wfe = (WorkflowException) getVariableFromHistory(businessKey, "SavedWorkflowException1");
- Assert.assertTrue(wfe.getErrorCode() == 2500);
- Assert.assertTrue(wfe.getErrorMessage().startsWith("Generic vnf null was not found in AAI. Return code: 404."));
- checkVariable(businessKey, "DCVFMODVOLV2_SuccessIndicator", false);
-
- logEnd();
- }
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfAndModulesRollbackTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfAndModulesRollbackTest.java deleted file mode 100644 index fb2160d970..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfAndModulesRollbackTest.java +++ /dev/null @@ -1,425 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.bpmn.infrastructure;
-
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
-import static com.github.tomakehurst.wiremock.client.WireMock.containing;
-import static com.github.tomakehurst.wiremock.client.WireMock.post;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteGenericVnf;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteVfModuleId;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfById;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithDepth;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByName;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchGenericVnf;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchVfModuleId;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutVfModuleId;
-import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
-import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
-import static org.openecomp.mso.bpmn.mock.StubResponseVNFAdapter.mockVNFDelete;
-import static org.openecomp.mso.bpmn.mock.StubResponseVNFAdapter.mockVfModuleDelete;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.camunda.bpm.engine.test.Deployment;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
-import org.openecomp.mso.bpmn.core.RollbackData;
-import org.openecomp.mso.bpmn.core.WorkflowException;
-import org.openecomp.mso.bpmn.mock.FileUtil;
-
-/**
- * Unit test for DoCreateVnfAndModulesRollback.bpmn.
- */
-public class DoCreateVnfAndModulesRollbackTest extends WorkflowTest {
- private final CallbackSet callbacks = new CallbackSet();
-
- private static final String EOL = "\n";
-
-
-
- private final String vnfAdapterDeleteCallback =
- "<deleteVfModuleResponse>" + EOL +
- " <vnfId>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnfId>" + EOL +
- " <vfModuleId>973ed047-d251-4fb9-bf1a-65b8949e0a73</vfModuleId>" + EOL +
- " <vfModuleDeleted>true</vfModuleDeleted>" + EOL +
- " <messageId>{{MESSAGE-ID}}</messageId>" + EOL +
- "</deleteVfModuleResponse>" + EOL;
-
- private final String vnfAdapterDeleteCallbackFail =
- "<vfModuleException>" + EOL +
- " <message>Error processing request to VNF-Async. Not Found.</message>" + EOL +
- " <category>INTERNAL</category>" + EOL +
- " <rolledBack>false</rolledBack>" + EOL +
- " <messageId>{{MESSAGE-ID}}</messageId>" + EOL +
- "</vfModuleException>" + EOL;
-
- private final String sdncAdapterDeleteCallback =
- "<output xmlns=\"com:att:sdnctl:l3api\">" + EOL +
- " <svc-request-id>{{REQUEST-ID}}</svc-request-id>" + EOL +
- " <ack-final-indicator>Y</ack-final-indicator>" + EOL +
- "</output>" + EOL;
-
- public DoCreateVnfAndModulesRollbackTest() throws IOException {
- callbacks.put("sdncChangeDelete", sdncAdapterDeleteCallback);
- callbacks.put("sdncDelete", sdncAdapterDeleteCallback);
- callbacks.put("vnfDelete", vnfAdapterDeleteCallback);
- callbacks.put("vnfDeleteFail", vnfAdapterDeleteCallbackFail);
- callbacks.put("deactivate", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyActivateCallback.xml"));
- callbacks.put("unassign", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyActivateCallback.xml"));
- }
-
- @Test
- @Ignore
- @Deployment(resources = {
- "subprocess/DoCreateVnfAndModulesRollback.bpmn",
- "subprocess/DoCreateVfModuleRollback.bpmn",
- "subprocess/PrepareUpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn",
- "subprocess/DeleteAAIVfModule.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/GenericGetVnf.bpmn",
- "subprocess/GenericDeleteVnf.bpmn",
- "subprocess/DoDeleteVnf.bpmn"
- })
- public void TestDoCreateVnfAndModulesRollbackSuccess_BaseOnly() {
- // delete the Base Module and Generic Vnf
- // vnf-id=a27ce5a9-29c4-4c22-a017-6615ac73c721, vf-module-id=973ed047-d251-4fb9-bf1a-65b8949e0a73
- String request =
- "<vnf-request xmlns=\"http://org.openecomp/mso/infra/vnf-request/v1\">" + EOL +
- " <request-info>" + EOL +
- " <action>DELETE_VF_MODULE</action>" + EOL +
- " <source>PORTAL</source>" + EOL +
- " </request-info>" + EOL +
- " <vnf-inputs>" + EOL +
- " <vnf-id>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnf-id>" + EOL +
- " <vnf-name>STMTN5MMSC21</vnf-name>" + EOL +
- " <vnf-type>asc_heat-int</vnf-type>" + EOL +
- " <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</vf-module-id>" + EOL +
- " <vf-module-name>STMTN5MMSC21-MMSC::module-0-0</vf-module-name>" + EOL +
- " <service-id>00000000-0000-0000-0000-000000000000</service-id>" + EOL +
- " <service-type>SDN-ETHERNET-INTERNET</service-type>" + EOL +
- " <tenant-id>fba1bd1e195a404cacb9ce17a9b2b421</tenant-id>" + EOL +
- " <orchestration-status>pending-delete</orchestration-status>" + EOL +
- " <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>" + EOL +
- " </vnf-inputs>" + EOL +
- " <vnf-params xmlns:tns=\"http://org.openecomp/mso/infra/vnf-request/v1\"/>" + EOL +
- "</vnf-request>" + EOL;
- logStart();
- mockSDNCAdapter("/SDNCAdapter", "SvcAction>changedelete", 200, "DeleteGenericVNFV1/sdncAdapterResponse.xml");
- mockSDNCAdapter("/SDNCAdapter", "SvcAction>delete", 200, "DeleteGenericVNFV1/sdncAdapterResponse.xml");
- mockVNFDelete(".*", "/.*", 202);
- mockVfModuleDelete("78987");
- MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
- MockPatchGenericVnf("a27ce5a9-29c4-4c22-a017-6615ac73c721");
- MockGetGenericVnfByName("STMTN5MMSC21", "DoCreateVfModule_getVnfResponse.xml");
- MockGetGenericVnfById("/a27ce5a9-29c4-4c22-a017-6615ac73c721.*", "DoCreateVfModule_getVnfResponse.xml", 200);
- MockPutVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
- MockDeleteGenericVnf("a27ce5a9-29c4-4c22-a017-6615ac73c721", "0000021");
- MockDeleteVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73", "0000073", 200);
- String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<>();
- RollbackData rollbackData = new RollbackData();
-
- rollbackData.put("VFMODULE_BASE", "source", "PORTAL");
- rollbackData.put("VFMODULE_BASE", "vnfid", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- rollbackData.put("VFMODULE_BASE", "vnfname", "STMTN5MMSC21");
- rollbackData.put("VFMODULE_BASE", "vnftype", "asc_heat-int");
- rollbackData.put("VFMODULE_BASE", "vfmoduleid", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
- rollbackData.put("VFMODULE_BASE", "vfmodulename", "STMTN5MMSC21-MMSC::module-0-0");
- rollbackData.put("VFMODULE_BASE", "tenantid", "fba1bd1e195a404cacb9ce17a9b2b421");
- rollbackData.put("VFMODULE_BASE", "aiccloudregion", "RDM2WAGPLCP");
- rollbackData.put("VFMODULE_BASE", "heatstackid", "thisisaheatstack");
- rollbackData.put("VFMODULE_BASE", "contrailNetworkPolicyFqdn0", "MSOTest:DefaultPolicyFQDN1");
- rollbackData.put("VFMODULE_BASE", "contrailNetworkPolicyFqdn1", "MSOTest:DefaultPolicyFQDN2");
- rollbackData.put("VFMODULE_BASE", "oamManagementV6Address", "2000:abc:bce:1111");
- rollbackData.put("VFMODULE_BASE", "oamManagementV4Address", "127.0.0.1");
-
- rollbackData.put("VFMODULE_BASE", "rollbackPrepareUpdateVfModule", "true");
- rollbackData.put("VFMODULE_BASE", "rollbackVnfAdapterCreate", "true");
- rollbackData.put("VFMODULE_BASE", "rollbackUpdateAAIVfModule", "true");
- rollbackData.put("VFMODULE_BASE", "rollbackSDNCRequestActivate", "true");
- rollbackData.put("VFMODULE_BASE", "rollbackCreateAAIVfModule", "true");
- rollbackData.put("VFMODULE_BASE", "rollbackCreateNetworkPoliciesAAI", "true");
- rollbackData.put("VFMODULE_BASE", "rollbackUpdateVnfAAI", "true");
-
- rollbackData.put("VNF", "vnfId", "testVnfId123");
-
- rollbackData.put("VNFANDMODULES", "numOfCreatedAddOnModules", "0");
-
- variables.put("isDebugLogEnabled","true");
- variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("mso-service-instance-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- rollbackData.put("VFMODULE_BASE", "msorequestid", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- rollbackData.put("VFMODULE_BASE", "serviceinstanceid", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
-
- variables.put("rollbackData", rollbackData);
- invokeSubProcess("DoCreateVnfAndModulesRollback", businessKey, variables);
-
- // "changedelete" operation not required for deleting a Vf Module
-// injectSDNCCallbacks(callbacks, "sdncChangeDelete");
- injectVNFRestCallbacks(callbacks, "vnfDelete");
- //waitForRunningProcessCount("DoCreateVnfAndModulesRollback", 0, 120000);
- injectSDNCCallbacks(callbacks, "sdncDelete");
-
- waitForProcessEnd(businessKey, 10000);
- WorkflowException wfe = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException");
- checkVariable(businessKey, "WorkflowException", null);
- if (wfe != null) {
- System.out.println("TestCreateVfModuleSuccess: ErrorCode=" + wfe.getErrorCode() +
- ", ErrorMessage=" + wfe.getErrorMessage());
- }
- logEnd();
- }
-
- @Test
- @Deployment(resources = {
- "subprocess/DoCreateVnfAndModulesRollback.bpmn",
- "subprocess/PrepareUpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn",
- "subprocess/DeleteAAIVfModule.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/GenericGetVnf.bpmn",
- "subprocess/GenericDeleteVnf.bpmn",
- "subprocess/DoDeleteVnf.bpmn"
- })
- public void TestDoCreateVnfAndModulesRollbackSuccess_vnfOnly() {
- // delete the Base Module and Generic Vnf
- // vnf-id=a27ce5a9-29c4-4c22-a017-6615ac73c721, vf-module-id=973ed047-d251-4fb9-bf1a-65b8949e0a73
- String request =
- "<vnf-request xmlns=\"http://org.openecomp/mso/infra/vnf-request/v1\">" + EOL +
- " <request-info>" + EOL +
- " <action>DELETE_VF_MODULE</action>" + EOL +
- " <source>PORTAL</source>" + EOL +
- " </request-info>" + EOL +
- " <vnf-inputs>" + EOL +
- " <vnf-id>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnf-id>" + EOL +
- " <vnf-name>STMTN5MMSC21</vnf-name>" + EOL +
- " <vnf-type>asc_heat-int</vnf-type>" + EOL +
- " <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</vf-module-id>" + EOL +
- " <vf-module-name>STMTN5MMSC21-MMSC::module-0-0</vf-module-name>" + EOL +
- " <service-id>00000000-0000-0000-0000-000000000000</service-id>" + EOL +
- " <service-type>SDN-ETHERNET-INTERNET</service-type>" + EOL +
- " <tenant-id>fba1bd1e195a404cacb9ce17a9b2b421</tenant-id>" + EOL +
- " <orchestration-status>pending-delete</orchestration-status>" + EOL +
- " <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>" + EOL +
- " </vnf-inputs>" + EOL +
- " <vnf-params xmlns:tns=\"http://org.openecomp/mso/infra/vnf-request/v1\"/>" + EOL +
- "</vnf-request>" + EOL;
- logStart();
- MockGetGenericVnfById("testVnfId123.*", "GenericFlows/getGenericVnfByNameResponse.xml");
- MockDeleteGenericVnf("testVnfId123", "testReVer123");
- MockDoDeleteVfModule_SDNCSuccess();
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
- String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<>();
- RollbackData rollbackData = new RollbackData();
-
- rollbackData.put("VNF", "vnfId", "testVnfId123");
- rollbackData.put("VNF", "rollbackVnfCreate", "true");
- rollbackData.put("VNF", "rollbackSDNCAssign", "true");
- rollbackData.put("VNF", "rollbackSDNCActivate", "true");
- rollbackData.put("VNFANDMODULES", "numOfCreatedAddOnModules", "0");
-
-
- variables.put("isDebugLogEnabled","true");
- variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("mso-service-instance-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
-
-
- variables.put("rollbackData", rollbackData);
- variables.put("sdncVersion", "1707");
- invokeSubProcess("DoCreateVnfAndModulesRollback", businessKey, variables);
-
- // "changedelete" operation not required for deleting a Vf Module
-// injectSDNCCallbacks(callbacks, "sdncChangeDelete");
-
- //waitForRunningProcessCount("DoCreateVnfAndModulesRollback", 0, 120000);
- // injectSDNCCallbacks(callbacks, "sdncDelete");
-
- waitForProcessEnd(businessKey, 10000);
- WorkflowException wfe = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException");
- checkVariable(businessKey, "WorkflowException", null);
- if (wfe != null) {
- System.out.println("TestCreateVfModuleSuccess: ErrorCode=" + wfe.getErrorCode() +
- ", ErrorMessage=" + wfe.getErrorMessage());
- }
- logEnd();
- }
-
- @Test
- @Ignore
- @Deployment(resources = {
- "subprocess/DoCreateVnfAndModulesRollback.bpmn",
- "subprocess/DoCreateVfModuleRollback.bpmn",
- "subprocess/PrepareUpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn",
- "subprocess/DeleteAAIVfModule.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/GenericGetVnf.bpmn",
- "subprocess/GenericDeleteVnf.bpmn",
- "subprocess/DoDeleteVnf.bpmn"
- })
- public void TestDoCreateVnfAndModulesRollbackSuccess_AddOn() {
- // delete the Base Module and Generic Vnf
- // vnf-id=a27ce5a9-29c4-4c22-a017-6615ac73c721, vf-module-id=973ed047-d251-4fb9-bf1a-65b8949e0a73
- String request =
- "<vnf-request xmlns=\"http://org.openecomp/mso/infra/vnf-request/v1\">" + EOL +
- " <request-info>" + EOL +
- " <action>DELETE_VF_MODULE</action>" + EOL +
- " <source>PORTAL</source>" + EOL +
- " </request-info>" + EOL +
- " <vnf-inputs>" + EOL +
- " <vnf-id>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnf-id>" + EOL +
- " <vnf-name>STMTN5MMSC21</vnf-name>" + EOL +
- " <vnf-type>asc_heat-int</vnf-type>" + EOL +
- " <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</vf-module-id>" + EOL +
- " <vf-module-name>STMTN5MMSC21-MMSC::module-0-0</vf-module-name>" + EOL +
- " <service-id>00000000-0000-0000-0000-000000000000</service-id>" + EOL +
- " <service-type>SDN-ETHERNET-INTERNET</service-type>" + EOL +
- " <tenant-id>fba1bd1e195a404cacb9ce17a9b2b421</tenant-id>" + EOL +
- " <orchestration-status>pending-delete</orchestration-status>" + EOL +
- " <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>" + EOL +
- " </vnf-inputs>" + EOL +
- " <vnf-params xmlns:tns=\"http://org.openecomp/mso/infra/vnf-request/v1\"/>" + EOL +
- "</vnf-request>" + EOL;
- logStart();
- mockSDNCAdapter("/SDNCAdapter", "SvcAction>changedelete", 200, "DeleteGenericVNFV1/sdncAdapterResponse.xml");
- mockSDNCAdapter("/SDNCAdapter", "SvcAction>delete", 200, "DeleteGenericVNFV1/sdncAdapterResponse.xml");
- mockVNFDelete(".*", "/.*", 202);
- mockVfModuleDelete("78987");
- MockGetGenericVnfByName("STMTN5MMSC21", "DoCreateVfModule_getVnfResponse.xml");
- MockGetGenericVnfById("/a27ce5a9-29c4-4c22-a017-6615ac73c721", "DoCreateVfModule_getVnfResponse.xml", 200);
- MockGetGenericVnfByIdWithDepth("a27ce5a9-29c4-4c22-a017-6615ac73c721", 1, "DoCreateVfModuleRollback/GenericVnf.xml");
- MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
- MockPatchGenericVnf("a27ce5a9-29c4-4c22-a017-6615ac73c721");
- MockPutVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
- MockDeleteGenericVnf("a27ce5a9-29c4-4c22-a017-6615ac73c721", "0000021");
- MockDeleteVfModuleId("", "", "", 200);
- String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<>();
- RollbackData rollbackData = new RollbackData();
-
- rollbackData.put("VFMODULE_BASE", "source", "PORTAL");
- rollbackData.put("VFMODULE_BASE", "vnfid", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- rollbackData.put("VFMODULE_BASE", "vnfname", "STMTN5MMSC21");
- rollbackData.put("VFMODULE_BASE", "vnftype", "asc_heat-int");
- rollbackData.put("VFMODULE_BASE", "vfmoduleid", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
- rollbackData.put("VFMODULE_BASE", "vfmodulename", "STMTN5MMSC21-MMSC::module-0-0");
- rollbackData.put("VFMODULE_BASE", "tenantid", "fba1bd1e195a404cacb9ce17a9b2b421");
- rollbackData.put("VFMODULE_BASE", "aiccloudregion", "RDM2WAGPLCP");
- rollbackData.put("VFMODULE_BASE", "heatstackid", "thisisaheatstack");
- rollbackData.put("VFMODULE_BASE", "contrailNetworkPolicyFqdn0", "MSOTest:DefaultPolicyFQDN1");
- rollbackData.put("VFMODULE_BASE", "contrailNetworkPolicyFqdn1", "MSOTest:DefaultPolicyFQDN2");
- rollbackData.put("VFMODULE_BASE", "oamManagementV6Address", "2000:abc:bce:1111");
- rollbackData.put("VFMODULE_BASE", "oamManagementV4Address", "127.0.0.1");
- rollbackData.put("VFMODULE_BASE", "rollbackPrepareUpdateVfModule", "true");
- rollbackData.put("VFMODULE_BASE", "rollbackVnfAdapterCreate", "true");
- rollbackData.put("VFMODULE_BASE", "rollbackUpdateAAIVfModule", "true");
- rollbackData.put("VFMODULE_BASE", "rollbackSDNCRequestActivate", "true");
- rollbackData.put("VFMODULE_BASE", "rollbackCreateAAIVfModule", "true");
- rollbackData.put("VFMODULE_BASE", "rollbackCreateNetworkPoliciesAAI", "true");
- rollbackData.put("VFMODULE_BASE", "rollbackUpdateVnfAAI", "true");
- rollbackData.put("VFMODULE_BASE", "msorequestid", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- rollbackData.put("VFMODULE_BASE", "serviceinstanceid", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
-
-
- rollbackData.put("VFMODULE_ADDON_1", "source", "PORTAL");
- rollbackData.put("VFMODULE_ADDON_1", "vnfid", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- rollbackData.put("VFMODULE_ADDON_1", "vnfname", "STMTN5MMSC21");
- rollbackData.put("VFMODULE_ADDON_1", "vnftype", "asc_heat-int");
- rollbackData.put("VFMODULE_ADDON_1", "vfmoduleid", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
- rollbackData.put("VFMODULE_ADDON_1", "vfmodulename", "STMTN5MMSC21-MMSC::module-0-0");
- rollbackData.put("VFMODULE_ADDON_1", "tenantid", "fba1bd1e195a404cacb9ce17a9b2b421");
- rollbackData.put("VFMODULE_ADDON_1", "aiccloudregion", "RDM2WAGPLCP");
- rollbackData.put("VFMODULE_ADDON_1", "heatstackid", "thisisaheatstack");
- rollbackData.put("VFMODULE_ADDON_1", "contrailNetworkPolicyFqdn0", "MSOTest:DefaultPolicyFQDN1");
- rollbackData.put("VFMODULE_ADDON_1", "contrailNetworkPolicyFqdn1", "MSOTest:DefaultPolicyFQDN2");
- rollbackData.put("VFMODULE_ADDON_1", "oamManagementV6Address", "2000:abc:bce:1111");
- rollbackData.put("VFMODULE_ADDON_1", "oamManagementV4Address", "127.0.0.1");
- rollbackData.put("VFMODULE_ADDON_1", "rollbackPrepareUpdateVfModule", "true");
- rollbackData.put("VFMODULE_ADDON_1", "rollbackVnfAdapterCreate", "true");
- rollbackData.put("VFMODULE_ADDON_1", "rollbackUpdateAAIVfModule", "true");
- rollbackData.put("VFMODULE_ADDON_1", "rollbackSDNCRequestActivate", "true");
- rollbackData.put("VFMODULE_ADDON_1", "rollbackCreateAAIVfModule", "true");
- rollbackData.put("VFMODULE_ADDON_1", "rollbackCreateNetworkPoliciesAAI", "true");
- rollbackData.put("VFMODULE_ADDON_1", "rollbackUpdateVnfAAI", "true");
- rollbackData.put("VFMODULE_ADDON_1", "msorequestid", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- rollbackData.put("VFMODULE_ADDON_1", "serviceinstanceid", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
-
- rollbackData.put("VNF", "vnfId", "testVnfId123");
-
- rollbackData.put("VNFANDMODULES", "numOfCreatedAddOnModules", "1");
-
- variables.put("isDebugLogEnabled","true");
- variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("mso-service-instance-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
-
-
- variables.put("rollbackData", rollbackData);
- invokeSubProcess("DoCreateVnfAndModulesRollback", businessKey, variables);
-
- // "changedelete" operation not required for deleting a Vf Module
- // injectSDNCCallbacks(callbacks, "sdncChangeDelete");
- injectVNFRestCallbacks(callbacks, "vnfDelete");
- injectVNFRestCallbacks(callbacks, "vnfDelete");
- //waitForRunningProcessCount("DoCreateVnfAndModulesRollback", 0, 120000);
- injectSDNCCallbacks(callbacks, "sdncDelete");
-
- waitForProcessEnd(businessKey, 10000);
- WorkflowException wfe = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException");
- checkVariable(businessKey, "WorkflowException", null);
- if (wfe != null) {
- System.out.println("TestCreateVfModuleSuccess: ErrorCode=" + wfe.getErrorCode() +
- ", ErrorMessage=" + wfe.getErrorMessage());
- }
- logEnd();
- }
-
- public static void MockDoDeleteVfModule_SDNCSuccess() {
- stubFor(post(urlEqualTo("/SDNCAdapter"))
- .withRequestBody(containing("SvcAction>deactivate"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("DeleteGenericVNFV1/sdncAdapterResponse.xml")));
- stubFor(post(urlEqualTo("/SDNCAdapter"))
- .withRequestBody(containing("SvcAction>unassign"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("DeleteGenericVNFV1/sdncAdapterResponse.xml")));
- }
-
-
-}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfAndModulesTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfAndModulesTest.java deleted file mode 100644 index dc0af4186e..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfAndModulesTest.java +++ /dev/null @@ -1,374 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.bpmn.infrastructure;
-
-import static org.junit.Assert.assertEquals;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockAAIVfModule;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDBUpdateVfModule;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfById_404;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchGenericVnf;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchVfModuleId;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutGenericVnf;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockSDNCAdapterVfModule;
-import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockVNFAdapterRestVfModule;
-import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.camunda.bpm.engine.test.Deployment;
-import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.openecomp.mso.bpmn.common.BPMNUtil;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
-import org.openecomp.mso.bpmn.core.domain.ModelInfo;
-import org.openecomp.mso.bpmn.core.domain.ModuleResource;
-import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition;
-import org.openecomp.mso.bpmn.core.domain.VnfResource;
-import org.openecomp.mso.bpmn.mock.FileUtil;
-
-/**
- * Unit Test for the DoCreateVnfAndModules Flow
- *
- */
-public class DoCreateVnfAndModulesTest extends WorkflowTest {
-
- private final CallbackSet callbacks = new CallbackSet();
-
- public DoCreateVnfAndModulesTest() throws IOException {
-
- callbacks.put("assign", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyAssignCallback.xml"));
- callbacks.put("activate", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyActivateCallback.xml"));
- callbacks.put("query", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyQueryCallback.xml"));
- callbacks.put("queryVnf", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyQueryCallbackVnf.xml"));
- callbacks.put("queryModuleNoVnf", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyQueryCallbackVfModuleNoVnf.xml"));
- callbacks.put("queryModule", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyQueryCallbackVfModule.xml"));
- callbacks.put("vnfCreate", FileUtil.readResourceFile(
- "__files/VfModularity/VNFAdapterRestCreateCallback.xml"));
- }
-
- @Test
-
- @Deployment(resources = {"subprocess/GenericGetService.bpmn",
- "subprocess/GenericGetVnf.bpmn",
- "subprocess/GenericPutVnf.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/DoCreateVnf.bpmn",
- "subprocess/GenerateVfModuleName.bpmn",
- "subprocess/DoCreateVfModule.bpmn",
- "subprocess/DoCreateVnfAndModules.bpmn",
- "subprocess/GenericGetVnf.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/ConfirmVolumeGroupTenant.bpmn",
- "subprocess/ConfirmVolumeGroupName.bpmn",
- "subprocess/CreateAAIVfModule.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn",
- "subprocess/CreateAAIVfModuleVolumeGroup.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn",
- "subprocess/DoCreateVnfAndModulesRollback.bpmn"})
- public void testDoCreateVnfAndModulesBaseOnly_success() throws Exception{
-
- MockNodeQueryServiceInstanceById("MIS%2F1604%2F0026%2FSW_INTERNET", "GenericFlows/getSIUrlByIdVipr.xml");
- MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
- MockGetGenericVnfById_404("testVnfId");
- MockPutGenericVnf(".*");
- MockAAIVfModule();
- MockPatchGenericVnf("skask");
- MockPatchVfModuleId("skask", ".*");
- mockSDNCAdapter("VfModularity/StandardSDNCSynchResponse.xml");
- MockVNFAdapterRestVfModule();
- MockDBUpdateVfModule();
-
- mockSDNCAdapter("VfModularity/StandardSDNCSynchResponse.xml");
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
-
- String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<>();
- setVariablesSuccess(variables, "", "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
- invokeSubProcess("DoCreateVnfAndModules", businessKey, variables);
-
- injectSDNCCallbacks(callbacks, "assign");
- injectSDNCCallbacks(callbacks, "query");
- injectSDNCCallbacks(callbacks, "activate");
- injectSDNCCallbacks(callbacks, "queryVnf");
- injectSDNCCallbacks(callbacks, "assign, queryModuleNoVnf");
- injectVNFRestCallbacks(callbacks, "vnfCreate");
- injectSDNCCallbacks(callbacks, "activate");
- waitForProcessEnd(businessKey, 10000);
-
- Assert.assertTrue(isProcessEnded(businessKey));
- assertVariables("true", "true", "false", "true", "Success", null);
-
- }
-
- @Test
-
- @Deployment(resources = {"subprocess/GenericGetService.bpmn",
- "subprocess/GenericGetVnf.bpmn",
- "subprocess/GenericPutVnf.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/DoCreateVnf.bpmn",
- "subprocess/GenerateVfModuleName.bpmn",
- "subprocess/DoCreateVfModule.bpmn",
- "subprocess/DoCreateVnfAndModules.bpmn",
- "subprocess/GenericGetVnf.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/ConfirmVolumeGroupTenant.bpmn",
- "subprocess/ConfirmVolumeGroupName.bpmn",
- "subprocess/CreateAAIVfModule.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn",
- "subprocess/CreateAAIVfModuleVolumeGroup.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn",
- "subprocess/DoCreateVnfAndModulesRollback.bpmn"})
- public void testDoCreateVnfAndModulesWithAddon_success() throws Exception{
-
- MockNodeQueryServiceInstanceById("MIS%2F1604%2F0026%2FSW_INTERNET", "GenericFlows/getSIUrlByIdVipr.xml");
- MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
- MockGetGenericVnfById_404("testVnfId");
- MockPutGenericVnf(".*");
- MockAAIVfModule();
- MockPatchGenericVnf("skask");
- MockPatchVfModuleId("skask", ".*");
- mockSDNCAdapter("VfModularity/StandardSDNCSynchResponse.xml");
- MockVNFAdapterRestVfModule();
- MockDBUpdateVfModule();
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
- mockSDNCAdapter("VfModularity/StandardSDNCSynchResponse.xml");
-
- String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<>();
- setVariablesAddonSuccess(variables, "", "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
- invokeSubProcess("DoCreateVnfAndModules", businessKey, variables);
-
- injectSDNCCallbacks(callbacks, "assign");
- injectSDNCCallbacks(callbacks, "query");
- injectSDNCCallbacks(callbacks, "activate");
- injectSDNCCallbacks(callbacks, "queryVnf");
- injectSDNCCallbacks(callbacks, "assign, queryModuleNoVnf");
- injectVNFRestCallbacks(callbacks, "vnfCreate");
- injectSDNCCallbacks(callbacks, "activate");
- injectSDNCCallbacks(callbacks, "queryVnf");
- injectSDNCCallbacks(callbacks, "assign, queryModuleNoVnf");
- injectVNFRestCallbacks(callbacks, "vnfCreate");
- injectSDNCCallbacks(callbacks, "activate");
- waitForProcessEnd(businessKey, 10000);
-
- Assert.assertTrue(isProcessEnded(businessKey));
- assertVariables("true", "true", "false", "true", "Success", null);
-
- }
-
- private void assertVariables(String exSIFound, String exSISucc, String exVnfFound, String exVnfSucc, String exResponse, String exWorkflowException) {
-
- String siFound = BPMNUtil.getVariable(processEngineRule, "DoCreateVnf", "GENGS_FoundIndicator");
- String siSucc = BPMNUtil.getVariable(processEngineRule, "DoCreateVnf", "GENGS_SuccessIndicator");
- String vnfFound = BPMNUtil.getVariable(processEngineRule, "DoCreateVnf", "GENGV_FoundIndicator");
- String vnfSucc = BPMNUtil.getVariable(processEngineRule, "DoCreateVnf", "GENGV_SuccessIndicator");
- String response = BPMNUtil.getVariable(processEngineRule, "DoCreateVnf", "WorkflowResponse");
- String workflowException = BPMNUtil.getVariable(processEngineRule, "DoCreateVnf", "SavedWorkflowException1");
-
- //assertEquals(exSIFound, siFound);
- //assertEquals(exSISucc, siSucc);
- //assertEquals(exVnfFound, vnfFound);
- //assertEquals(exVnfSucc, vnfSucc);
- //assertEquals(exResponse, response);
- assertEquals(exWorkflowException, workflowException);
- }
-
- private void setVariables(Map<String, String> variables, String request, String requestId, String siId) {
- variables.put("isDebugLogEnabled", "true");
- variables.put("bpmnRequest", request);
- variables.put("mso-request-id", requestId);
- variables.put("serviceInstanceId",siId);
- variables.put("testVnfId","testVnfId123");
- variables.put("vnfType", "STMTN");
- }
-
- private void setVariablesSuccess(Map<String, Object> variables, String request, String requestId, String siId) {
- variables.put("isDebugLogEnabled", "true");
- variables.put("mso-request-id", requestId);
- variables.put("requestId", requestId);
- variables.put("msoRequestId", requestId);
- variables.put("serviceInstanceId",siId);
- variables.put("disableRollback", "true");
- //variables.put("testVnfId","testVnfId123");
- variables.put("vnfType", "STMTN");
-
- String serviceModelInfo = "{ "+ "\"modelType\": \"service\"," +
- "\"modelInvariantUuid\": \"995256d2-5a33-55df-13ab-12abad84e7ff\"," +
- "\"modelUuid\": \"ab6478e5-ea33-3346-ac12-ab121484a3fe\"," +
- "\"modelName\": \"ServicevSAMP12\"," +
- "\"modelVersion\": \"1.0\"," +
- "}";
- variables.put("serviceModelInfo", serviceModelInfo);
- variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
- String vnfModelInfo = "{" + "\"modelType\": \"vnf\"," +
- "\"modelInvariantUuid\": \"ff5256d2-5a33-55df-13ab-12abad84e7ff\"," +
- "\"modelUuid\": \"fe6478e5-ea33-3346-ac12-ab121484a3fe\"," +
- "\"modelName\": \"vSAMP12\"," +
- "\"modelVersion\": \"1.0\"," +
- "\"modelCustomizationUuid\": \"MODEL-ID-1234\"" + "}";
- variables.put("vnfModelInfo", vnfModelInfo);
-
- String cloudConfiguration = "{" + "\"cloudConfiguration\": { " +
- "\"lcpCloudRegionId\": \"mdt1\"," +
- "\"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\"" + "}}";
- variables.put("cloudConfiguration", cloudConfiguration);
- variables.put("sdncVersion", "1707");
- variables.put("globalSubscriberId", "subscriber123");
-
- try {
- String serviceDecomposition = FileUtil.readResourceFile("__files/VIPR/serviceDecompositionATMFW.json");
- ServiceDecomposition sd = new ServiceDecomposition();
- ModelInfo serviceModel = new ModelInfo();
- serviceModel.setModelName("servicewithVNFs");
- sd.setModelInfo(serviceModel);
- VnfResource vr = new VnfResource();
- ModelInfo mvr = new ModelInfo();
- mvr.setModelName("vSAMP12");
- mvr.setModelInstanceName("v123");
- mvr.setModelInvariantUuid("");
- mvr.setModelVersion("1.0");
- mvr.setModelCustomizationUuid("MODEL-ID-1234");
- vr.setModelInfo(mvr);
- vr.constructVnfType("vnf1");
- vr.setNfType("somenftype");
- vr.setNfRole("somenfrole");
- vr.setNfFunction("somenffunction");
- vr.setNfNamingCode("somenamingcode");
- ModuleResource mr = new ModuleResource();
- ModelInfo mvmr = new ModelInfo();
- mvmr.setModelInvariantUuid("ff5256d2-5a33-55df-13ab-12abad84e7ff");
- mvmr.setModelName("STMTN5MMSC21-MMSC::model-1-0");
- mvmr.setModelVersion("1");
- mvmr.setModelCustomizationUuid("MODEL-123");
- mr.setModelInfo(mvmr);
- mr.setIsBase(true);
- mr.setVfModuleLabel("MODULELABEL");
- vr.addVfModule(mr);
- sd.addVnfResource(vr);
-
- variables.put("serviceDecomposition", sd);
- variables.put("isTest", true);
- } catch(Exception e) {
-
- }
-
- }
-
- private void setVariablesAddonSuccess(Map<String, Object> variables, String request, String requestId, String siId) {
- variables.put("isDebugLogEnabled", "true");
- variables.put("mso-request-id", requestId);
- variables.put("requestId", requestId);
- variables.put("msoRequestId", requestId);
- variables.put("serviceInstanceId",siId);
- variables.put("disableRollback", "true");
- //variables.put("testVnfId","testVnfId123");
- variables.put("vnfType", "STMTN");
-
- String serviceModelInfo = "{ "+ "\"modelType\": \"service\"," +
- "\"modelInvariantUuid\": \"995256d2-5a33-55df-13ab-12abad84e7ff\"," +
- "\"modelUuid\": \"ab6478e5-ea33-3346-ac12-ab121484a3fe\"," +
- "\"modelName\": \"ServicevSAMP12\"," +
- "\"modelVersion\": \"1.0\"," +
- "}";
- variables.put("serviceModelInfo", serviceModelInfo);
- variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
- String vnfModelInfo = "{" + "\"modelType\": \"vnf\"," +
- "\"modelInvariantUuid\": \"ff5256d2-5a33-55df-13ab-12abad84e7ff\"," +
- "\"modelUuid\": \"fe6478e5-ea33-3346-ac12-ab121484a3fe\"," +
- "\"modelName\": \"vSAMP12\"," +
- "\"modelVersion\": \"1.0\"," +
- "\"modelCustomizationUuid\": \"MODEL-ID-1234\"" + "}";
- variables.put("vnfModelInfo", vnfModelInfo);
-
- String cloudConfiguration = "{" + "\"cloudConfiguration\": { " +
- "\"lcpCloudRegionId\": \"mdt1\"," +
- "\"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\"" + "}}";
- variables.put("cloudConfiguration", cloudConfiguration);
- variables.put("sdncVersion", "1707");
- variables.put("globalSubscriberId", "subscriber123");
-
- try {
- String serviceDecomposition = FileUtil.readResourceFile("__files/VIPR/serviceDecompositionATMFW.json");
- ServiceDecomposition sd = new ServiceDecomposition();
- ModelInfo serviceModel = new ModelInfo();
- serviceModel.setModelName("servicewithVNFs");
- sd.setModelInfo(serviceModel);
- VnfResource vr = new VnfResource();
- ModelInfo mvr = new ModelInfo();
- mvr.setModelName("vSAMP12");
- mvr.setModelInstanceName("v123");
- mvr.setModelInvariantUuid("");
- mvr.setModelVersion("1.0");
- mvr.setModelCustomizationUuid("MODEL-ID-1234");
- vr.setModelInfo(mvr);
- vr.setNfType("somenftype");
- vr.setNfRole("somenfrole");
- vr.setNfFunction("somenffunction");
- vr.setNfNamingCode("somenamingcode");
- ModuleResource mr = new ModuleResource();
- ModelInfo mvmr = new ModelInfo();
- mvmr.setModelInvariantUuid("ff5256d2-5a33-55df-13ab-12abad84e7ff");
- mvmr.setModelName("STMTN5MMSC21-MMSC::model-1-0");
- mvmr.setModelVersion("1");
- mvmr.setModelCustomizationUuid("MODEL-123");
- mr.setModelInfo(mvmr);
- mr.setIsBase(true);
- mr.setVfModuleLabel("MODULELABEL");
- vr.addVfModule(mr);
- ModuleResource mr1 = new ModuleResource();
- ModelInfo mvmr1 = new ModelInfo();
- mvmr1.setModelInvariantUuid("ff5256d2-5a33-55df-13ab-12abad84e7ff");
- mvmr1.setModelName("STMTN5MMSC21-MMSC::model-1-0");
- mvmr1.setModelVersion("1");
- mvmr1.setModelCustomizationUuid("MODEL-123");
- mr1.setModelInfo(mvmr1);
- mr1.setIsBase(false);
- mr1.setVfModuleLabel("MODULELABEL");
- mr1.setInitialCount(1);
- vr.addVfModule(mr1);
-
- sd.addVnfResource(vr);
-
- variables.put("serviceDecomposition", sd);
- variables.put("isTest", true);
- } catch(Exception e) {
-
-
-
- }
- }
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfTest.java deleted file mode 100644 index 7537ffa4c0..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfTest.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * © 2014 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property. - */ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure; - -import static org.junit.Assert.assertEquals; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByName_404; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutGenericVnf; -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.common.WorkflowTest.CallbackSet; -import org.openecomp.mso.bpmn.core.domain.VnfResource; -import org.openecomp.mso.bpmn.mock.FileUtil; - -/** - * Unit Test for the DoCreateVnf Flow - * - */ -public class DoCreateVnfTest extends WorkflowTest { - - private String createVnfInfraRequest; - private final CallbackSet callbacks = new CallbackSet(); - - - public DoCreateVnfTest() throws IOException { - createVnfInfraRequest = FileUtil.readResourceFile("__files/InfrastructureFlows/CreateVnfInfraRequest.json"); - callbacks.put("assign", FileUtil.readResourceFile( - "__files/VfModularity/SDNCTopologyAssignCallback.xml")); - callbacks.put("activate", FileUtil.readResourceFile( - "__files/VfModularity/SDNCTopologyActivateCallback.xml")); - } - - @Test - @Deployment(resources = {"subprocess/GenericGetService.bpmn", "subprocess/GenericGetVnf.bpmn", "subprocess/GenericPutVnf.bpmn", "subprocess/SDNCAdapterV1.bpmn", "subprocess/DoCreateVnf.bpmn"}) - public void testDoCreateVnfInfra_success() throws Exception{ - - MockNodeQueryServiceInstanceById("MIS%2F1604%2F0026%2FSW_INTERNET", "GenericFlows/getSIUrlById.xml"); - MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml"); - MockGetGenericVnfByName_404("testVnfName123"); - MockPutGenericVnf("testVnfId123"); - mockSDNCAdapter("/SDNCAdapter", "vnf-type>STMTN", 200, "VfModularity/StandardSDNCSynchResponse.xml"); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - setVariablesSuccess(variables, createVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET"); - invokeSubProcess("DoCreateVnf", businessKey, variables); - - waitForProcessEnd(businessKey, 10000); - - Assert.assertTrue(isProcessEnded(businessKey)); - assertVariables("true", "true", "false", "true", "Success", null); - } - - private void assertVariables(String exSIFound, String exSISucc, String exVnfFound, String exVnfSucc, String exResponse, String exWorkflowException) { - String workflowException = BPMNUtil.getVariable(processEngineRule, "DoCreateVnf", "SavedWorkflowException1"); - - assertEquals(exWorkflowException, workflowException); - } - - private void setVariablesSuccess(Map<String, Object> variables, String request, String requestId, String siId) { - variables.put("isDebugLogEnabled", "true"); - //variables.put("bpmnRequest", request); - variables.put("mso-request-id", requestId); - variables.put("serviceInstanceId",siId); - variables.put("vnfName", "testVnfName123"); - variables.put("disableRollback", "true"); - variables.put("requestId", requestId); - variables.put("testVnfId","testVnfId123"); - variables.put("vnfType", "STMTN"); - variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"); - String vnfModelInfo = "{ "+ "\"modelType\": \"vnf\"," + - "\"modelInvariantUuid\": \"ff5256d2-5a33-55df-13ab-12abad84e7ff\"," + - "\"modelUuid\": \"fe6478e5-ea33-3346-ac12-ab121484a3fe\"," + - "\"modelName\": \"vSAMP12\"," + - "\"modelVersion\": \"1.0\"," + - "\"modelCustomizationUuid\": \"MODEL-ID-1234\"," + - "}"; - variables.put("vnfModelInfo", vnfModelInfo); - - String cloudConfiguration = "{ " + - "\"lcpCloudRegionId\": \"mdt1\"," + - "\"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\"" + "}"; - variables.put("cloudConfiguration", cloudConfiguration); - - String serviceModelInfo = "{ "+ "\"modelType\": \"service\"," + - "\"modelInvariantUuid\": \"995256d2-5a33-55df-13ab-12abad84e7ff\"," + - "\"modelUuid\": \"ab6478e5-ea33-3346-ac12-ab121484a3fe\"," + - "\"modelName\": \"ServicevSAMP12\"," + - "\"modelVersion\": \"1.0\"," + - "}"; - variables.put("serviceModelInfo", serviceModelInfo); - variables.put("globalSubscriberId", "MSO-1610"); - VnfResource vnfResource = new VnfResource(); - variables.put("vnfResourceDecomposition", vnfResource); - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteServiceInstanceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteServiceInstanceTest.java deleted file mode 100644 index 37814999ba..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteServiceInstanceTest.java +++ /dev/null @@ -1,108 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure; - -import static org.junit.Assert.assertEquals; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteServiceInstance; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById; -import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB; -import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import org.camunda.bpm.engine.test.Deployment; -import org.junit.Assert; -import org.junit.Test; -import org.openecomp.mso.bpmn.common.BPMNUtil; -import org.openecomp.mso.bpmn.common.WorkflowTest; - -/** - * Unit test cases for DoDeleteServiceInstance.bpmn - */ -public class DoDeleteServiceInstanceTest extends WorkflowTest { - - private final CallbackSet callbacks = new CallbackSet(); - private static final String EOL = "\n"; - private final String sdncAdapterCallback = - "<output xmlns=\"com:att:sdnctl:l3api\">" + EOL + - " <svc-request-id>((REQUEST-ID))</svc-request-id>" + EOL + - " <ack-final-indicator>Y</ack-final-indicator>" + EOL + - "</output>" + EOL; - - public DoDeleteServiceInstanceTest() throws IOException { - callbacks.put("deactivate", sdncAdapterCallback); - callbacks.put("delete", sdncAdapterCallback); - } - - /** - * Sunny day VID scenario. - * - * @throws Exception - */ - //@Ignore // File not found - unable to run the test. Also, Stubs need updating.. - @Test - @Deployment(resources = { - "subprocess/DoDeleteServiceInstance.bpmn", - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/GenericDeleteService.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - "subprocess/FalloutHandler.bpmn" }) - public void sunnyDay() throws Exception { - - logStart(); - - //AAI - MockDeleteServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "", 204); - MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getSINoRelations.xml"); - MockNodeQueryServiceInstanceById("MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getSIUrlById.xml"); - //SDNC - mockSDNCAdapter(200); - //DB - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - String businessKey = UUID.randomUUID().toString(); - - Map<String, Object> variables = new HashMap<>(); - setupVariables(variables); - invokeSubProcess("DoDeleteServiceInstance", businessKey, variables); - injectSDNCCallbacks(callbacks, "deactivate"); - injectSDNCCallbacks(callbacks, "delete"); - waitForProcessEnd(businessKey, 10000); - Assert.assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, "DoDeleteServiceInstance", "WorkflowException"); - System.out.println("workflowException:\n" + workflowException); - assertEquals(null, workflowException); - - logEnd(); - } - - // Success Scenario - private void setupVariables(Map<String, Object> variables) { - variables.put("isDebugLogEnabled", "true"); - variables.put("msoRequestId", "RaaDDSIRequestId-1"); - variables.put("mso-request-id", "RaaDDSIRequestId-1"); - variables.put("serviceInstanceId","MIS%252F1604%252F0026%252FSW_INTERNET"); - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleFromVnfTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleFromVnfTest.java deleted file mode 100644 index 13b2f5432d..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleFromVnfTest.java +++ /dev/null @@ -1,177 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.bpmn.infrastructure;
-
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
-import static com.github.tomakehurst.wiremock.client.WireMock.containing;
-import static com.github.tomakehurst.wiremock.client.WireMock.delete;
-import static com.github.tomakehurst.wiremock.client.WireMock.post;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
-import static org.openecomp.mso.bpmn.common.DeleteAAIVfModuleTest.MockAAIDeleteVfModule;
-import static org.openecomp.mso.bpmn.common.DeleteAAIVfModuleTest.MockAAIGenericVnfSearch;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.camunda.bpm.engine.test.Deployment;
-import org.junit.Test;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
-import org.openecomp.mso.bpmn.core.WorkflowException;
-
-public class DoDeleteVfModuleFromVnfTest extends WorkflowTest {
- private final CallbackSet callbacks = new CallbackSet();
-
- private static final String EOL = "\n";
-
- private final String vnfAdapterDeleteCallback =
- "<deleteVfModuleResponse>" + EOL +
- " <vnfId>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnfId>" + EOL +
- " <vfModuleId>973ed047-d251-4fb9-bf1a-65b8949e0a73</vfModuleId>" + EOL +
- " <vfModuleDeleted>true</vfModuleDeleted>" + EOL +
- " <messageId>{{MESSAGE-ID}}</messageId>" + EOL +
- "</deleteVfModuleResponse>" + EOL;
-
- private final String vnfAdapterDeleteCallbackFail =
- "<vfModuleException>" + EOL +
- " <message>Error processing request to VNF-Async. Not Found.</message>" + EOL +
- " <category>INTERNAL</category>" + EOL +
- " <rolledBack>false</rolledBack>" + EOL +
- " <messageId>{{MESSAGE-ID}}</messageId>" + EOL +
- "</vfModuleException>" + EOL;
-
- private final String sdncAdapterDeleteCallback =
- "<output xmlns=\"com:att:sdnctl:l3api\">" + EOL +
- " <svc-request-id>{{REQUEST-ID}}</svc-request-id>" + EOL +
- " <ack-final-indicator>Y</ack-final-indicator>" + EOL +
- "</output>" + EOL;
-
- public DoDeleteVfModuleFromVnfTest() throws IOException {
- callbacks.put("deactivate", sdncAdapterDeleteCallback);
- callbacks.put("unassign", sdncAdapterDeleteCallback);
- callbacks.put("vnfDelete", vnfAdapterDeleteCallback);
- callbacks.put("vnfDeleteFail", vnfAdapterDeleteCallbackFail);
- }
-
- private final String wfeString = "WorkflowException";
-
- @Test
- @Deployment(resources = {
- "subprocess/DoDeleteVfModuleFromVnf.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/DeleteAAIVfModule.bpmn"
- })
- public void TestDoDeleteVfModuleFromVnfSuccess() {
- // delete the Base Module and Generic Vnf
- // vnf-id=a27ce5a9-29c4-4c22-a017-6615ac73c721, vf-module-id=973ed047-d251-4fb9-bf1a-65b8949e0a73
- String request =
- "<vnf-request xmlns=\"http://org.openecomp/mso/infra/vnf-request/v1\">" + EOL +
- " <request-info>" + EOL +
- " <action>DELETE_VF_MODULE</action>" + EOL +
- " <source>PORTAL</source>" + EOL +
- " </request-info>" + EOL +
- " <vnf-inputs>" + EOL +
- " <vnf-id>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnf-id>" + EOL +
- " <vnf-name>STMTN5MMSC21</vnf-name>" + EOL +
- " <vnf-type>asc_heat-int</vnf-type>" + EOL +
- " <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</vf-module-id>" + EOL +
- " <vf-module-name>STMTN5MMSC21-MMSC::module-0-0</vf-module-name>" + EOL +
- " <service-id>00000000-0000-0000-0000-000000000000</service-id>" + EOL +
- " <service-type>SDN-ETHERNET-INTERNET</service-type>" + EOL +
- " <tenant-id>fba1bd1e195a404cacb9ce17a9b2b421</tenant-id>" + EOL +
- " <orchestration-status>pending-delete</orchestration-status>" + EOL +
- " <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>" + EOL +
- " </vnf-inputs>" + EOL +
- " <vnf-params xmlns:tns=\"http://org.openecomp/mso/infra/vnf-request/v1\"/>" + EOL +
- "</vnf-request>" + EOL;
- logStart();
- MockDoDeleteVfModule_SDNCSuccess();
- MockDoDeleteVfModule_DeleteVNFSuccess();
- MockAAIGenericVnfSearch();
- MockAAIDeleteVfModule();
-
- String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<>();
- variables.put("isDebugLogEnabled","true");
- variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("msoRequestId", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("serviceInstanceId", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("vnfId", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("vfModuleId", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
- variables.put("lcpCloudRegionId", "RDM2WAGPLCP");
- variables.put("tenantId", "fba1bd1e195a404cacb9ce17a9b2b421");
- variables.put("sdncVersion", "1707");
-
- invokeSubProcess("DoDeleteVfModuleFromVnf", businessKey, variables);
-
- injectSDNCCallbacks(callbacks, "deactivate");
- injectVNFRestCallbacks(callbacks, "vnfDelete");
- //waitForRunningProcessCount("vnfAdapterDeleteV1", 0, 120000);
- injectSDNCCallbacks(callbacks, "unassign");
-
- waitForProcessEnd(businessKey, 10000);
- WorkflowException wfe = (WorkflowException) getVariableFromHistory(businessKey, wfeString);
- checkVariable(businessKey, wfeString, null);
- if (wfe != null) {
- System.out.println("TestDoDeleteVfModuleSuccess: ErrorCode=" + wfe.getErrorCode() +
- ", ErrorMessage=" + wfe.getErrorMessage());
- }
- logEnd();
- }
-
-
- // start of mocks used locally and by other VF Module unit tests
-
-
-
- public static void MockDoDeleteVfModule_SDNCSuccess() {
- stubFor(post(urlEqualTo("/SDNCAdapter"))
- .withRequestBody(containing("SvcAction>deactivate"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("DeleteGenericVNFV1/sdncAdapterResponse.xml")));
- stubFor(post(urlEqualTo("/SDNCAdapter"))
- .withRequestBody(containing("SvcAction>unassign"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("DeleteGenericVNFV1/sdncAdapterResponse.xml")));
- }
-
-
- public static void MockDoDeleteVfModule_DeleteVNFSuccess() {
- stubFor(delete(urlMatching("/vnfs/v1/vnfs/.*/vf-modules/.*"))
- .willReturn(aResponse()
- .withStatus(202)
- .withHeader("Content-Type", "application/xml")));
- stubFor(delete(urlMatching("/vnfs/v1/volume-groups/78987"))
- .willReturn(aResponse()
- .withStatus(202)
- .withHeader("Content-Type", "application/xml")));
- }
-
-
-}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleTest.java deleted file mode 100644 index 8f5f63d4c4..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleTest.java +++ /dev/null @@ -1,631 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.bpmn.infrastructure;
-
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
-import static com.github.tomakehurst.wiremock.client.WireMock.containing;
-import static com.github.tomakehurst.wiremock.client.WireMock.delete;
-import static com.github.tomakehurst.wiremock.client.WireMock.post;
-import static com.github.tomakehurst.wiremock.client.WireMock.put;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
-import static org.openecomp.mso.bpmn.common.DeleteAAIVfModuleTest.MockAAIDeleteGenericVnf;
-import static org.openecomp.mso.bpmn.common.DeleteAAIVfModuleTest.MockAAIDeleteVfModule;
-import static org.openecomp.mso.bpmn.common.DeleteAAIVfModuleTest.MockAAIGenericVnfSearch;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchVfModuleId;
-
-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.WorkflowTest;
-import org.openecomp.mso.bpmn.core.WorkflowException;
-import org.openecomp.mso.bpmn.mock.FileUtil;
-
-/**
- * Unit test for DoDeleteVfModule.bpmn.
- */
-public class DoDeleteVfModuleTest extends WorkflowTest {
- private final CallbackSet callbacks = new CallbackSet();
-
- private static final String EOL = "\n";
-
- private final String vnfAdapterDeleteCallback =
- "<deleteVfModuleResponse>" + EOL +
- " <vnfId>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnfId>" + EOL +
- " <vfModuleId>973ed047-d251-4fb9-bf1a-65b8949e0a73</vfModuleId>" + EOL +
- " <vfModuleDeleted>true</vfModuleDeleted>" + EOL +
- " <messageId>{{MESSAGE-ID}}</messageId>" + EOL +
- "</deleteVfModuleResponse>" + EOL;
-
- private final String vnfAdapterDeleteCallbackFail =
- "<vfModuleException>" + EOL +
- " <message>Error processing request to VNF-Async. Not Found.</message>" + EOL +
- " <category>INTERNAL</category>" + EOL +
- " <rolledBack>false</rolledBack>" + EOL +
- " <messageId>{{MESSAGE-ID}}</messageId>" + EOL +
- "</vfModuleException>" + EOL;
-
- private final String sdncAdapterDeleteCallback =
- "<output xmlns=\"org:onap:sdnctl:l3api\">" + EOL +
- " <svc-request-id>{{REQUEST-ID}}</svc-request-id>" + EOL +
- " <ack-final-indicator>Y</ack-final-indicator>" + EOL +
- "</output>" + EOL;
-
- public DoDeleteVfModuleTest() throws IOException {
- callbacks.put("sdncChangeDelete", sdncAdapterDeleteCallback);
- callbacks.put("sdncDelete", sdncAdapterDeleteCallback);
- callbacks.put("vnfDelete", FileUtil.readResourceFile(
- "__files/DeleteVfModuleCallbackResponse.xml"));
- callbacks.put("vnfDeleteFail", vnfAdapterDeleteCallbackFail);
- }
-
- private final String wfeString = "WorkflowException";
-
- @Test
- @Deployment(resources = {
- "subprocess/DoDeleteVfModule.bpmn",
- "subprocess/PrepareUpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn",
- "subprocess/DeleteAAIVfModule.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn"
- })
- public void TestDoDeleteVfModuleSuccess() {
- // delete the Base Module and Generic Vnf
- // vnf-id=a27ce5a9-29c4-4c22-a017-6615ac73c721, vf-module-id=973ed047-d251-4fb9-bf1a-65b8949e0a73
- String request =
- "<vnf-request xmlns=\"http://openecomp.org/mso/infra/vnf-request/v1\">" + EOL +
- " <request-info>" + EOL +
- " <action>DELETE_VF_MODULE</action>" + EOL +
- " <source>PORTAL</source>" + EOL +
- " </request-info>" + EOL +
- " <vnf-inputs>" + EOL +
- " <vnf-id>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnf-id>" + EOL +
- " <vnf-name>STMTN5MMSC21</vnf-name>" + EOL +
- " <vnf-type>asc_heat-int</vnf-type>" + EOL +
- " <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</vf-module-id>" + EOL +
- " <vf-module-name>STMTN5MMSC21-MMSC::module-0-0</vf-module-name>" + EOL +
- " <service-id>00000000-0000-0000-0000-000000000000</service-id>" + EOL +
- " <service-type>SDN-ETHERNET-INTERNET</service-type>" + EOL +
- " <tenant-id>fba1bd1e195a404cacb9ce17a9b2b421</tenant-id>" + EOL +
- " <orchestration-status>pending-delete</orchestration-status>" + EOL +
- " <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>" + EOL +
- " </vnf-inputs>" + EOL +
- " <vnf-params xmlns:tns=\"http://openecomp.org/mso/infra/vnf-request/v1\"/>" + EOL +
- "</vnf-request>" + EOL;
- logStart();
- MockDoDeleteVfModule_SDNCSuccess();
- MockDoDeleteVfModule_DeleteVNFSuccess();
- MockAAIGenericVnfSearch();
- MockAAIVfModulePUT(false);
- MockAAIDeleteGenericVnf();
- MockAAIDeleteVfModule();
- MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
-
- String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<>();
- variables.put("isDebugLogEnabled","true");
- variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("mso-service-instance-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("DoDeleteVfModuleRequest",request);
- variables.put("isVidRequest", "true");
- invokeSubProcess("DoDeleteVfModule", businessKey, variables);
-
- // "changedelete" operation not required for deleting a Vf Module
-// injectSDNCCallbacks(callbacks, "sdncChangeDelete");
- injectVNFRestCallbacks(callbacks, "vnfDelete");
- waitForRunningProcessCount("vnfAdapterDeleteV1", 0, 120000);
- injectSDNCCallbacks(callbacks, "sdncDelete");
-
- waitForProcessEnd(businessKey, 10000);
- WorkflowException wfe = (WorkflowException) getVariableFromHistory(businessKey, wfeString);
- checkVariable(businessKey, wfeString, null);
- if (wfe != null) {
- System.out.println("TestDoDeleteVfModuleSuccess: ErrorCode=" + wfe.getErrorCode() +
- ", ErrorMessage=" + wfe.getErrorMessage());
- }
- logEnd();
- }
-
- @Test
- @Deployment(resources = {
- "subprocess/DoDeleteVfModule.bpmn",
- "subprocess/PrepareUpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn",
- "subprocess/DeleteAAIVfModule.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn"
- })
- public void TestDoDeleteVfModule_Building_Block_Success() {
- logStart();
- MockDoDeleteVfModule_SDNCSuccess();
- MockDoDeleteVfModule_DeleteVNFSuccess();
- MockAAIGenericVnfSearch();
- MockAAIVfModulePUT(false);
- MockAAIDeleteGenericVnf();
- MockAAIDeleteVfModule();
- MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
-
- String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<>();
-
- variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("requestId", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("isDebugLogEnabled","true");
- variables.put("vnfId", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("vfModuleId", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
- variables.put("serviceInstanceId", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("vfModuleName", "STMTN5MMSC21-MMSC::module-0-0");
- variables.put("sdncVersion", "1610");
- variables.put("isVidRequest", "true");
- variables.put("retainResources", false);
- String vfModuleModelInfo = "{" + "\"modelType\": \"vnf\"," +
- "\"modelInvariantUuid\": \"ff5256d2-5a33-55df-13ab-12abad84e7ff\"," +
- "\"modelUuid\": \"fe6478e5-ea33-3346-ac12-ab121484a3fe\"," +
- "\"modelName\": \"vSAMP12\"," +
- "\"modelVersion\": \"1.0\"," +
- "\"modelCustomizationUuid\": \"MODEL-ID-1234\"," +
- "}";
- variables.put("vfModuleModelInfo", vfModuleModelInfo);
-
- String cloudConfiguration = "{" +
- "\"lcpCloudRegionId\": \"RDM2WAGPLCP\"," +
- "\"tenantId\": \"fba1bd1e195a404cacb9ce17a9b2b421\"" + "}";
- variables.put("cloudConfiguration", cloudConfiguration);
-
-
- invokeSubProcess("DoDeleteVfModule", businessKey, variables);
-
- // "changedelete" operation not required for deleting a Vf Module
-// injectSDNCCallbacks(callbacks, "sdncChangeDelete");
- injectVNFRestCallbacks(callbacks, "vnfDelete");
- waitForRunningProcessCount("vnfAdapterDeleteV1", 0, 120000);
- injectSDNCCallbacks(callbacks, "sdncDelete");
-
- waitForProcessEnd(businessKey, 10000);
- WorkflowException wfe = (WorkflowException) getVariableFromHistory(businessKey, wfeString);
- checkVariable(businessKey, wfeString, null);
- if (wfe != null) {
- System.out.println("TestDoDeleteVfModule_Building_Block_Success: ErrorCode=" + wfe.getErrorCode() +
- ", ErrorMessage=" + wfe.getErrorMessage());
- }
- logEnd();
- }
-
- @Test
- @Deployment(resources = {
- "subprocess/DoDeleteVfModule.bpmn",
- "subprocess/PrepareUpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn",
- "subprocess/DeleteAAIVfModule.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn"
- })
- public void TestDoDeleteVfModule_Building_Block_ModuleInAssignedState() {
- logStart();
- MockDoDeleteVfModule_SDNCSuccess();
- MockDoDeleteVfModule_DeleteVNFSuccess();
- MockAAIGenericVnfSearch();
- MockAAIVfModulePUT(false);
- MockAAIDeleteGenericVnf();
- MockAAIDeleteVfModule();
- MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
-
- String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<>();
-
- variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("requestId", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("isDebugLogEnabled","true");
- variables.put("vnfId", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("vfModuleId", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
- variables.put("serviceInstanceId", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("vfModuleName", "STMTN5MMSC21-MMSC::module-0-0");
- variables.put("sdncVersion", "1610");
- variables.put("isVidRequest", "true");
- variables.put("retainResources", false);
- variables.put("aLaCarte", true);
- String vfModuleModelInfo = "{" + "\"modelType\": \"vnf\"," +
- "\"modelInvariantUuid\": \"ff5256d2-5a33-55df-13ab-12abad84e7ff\"," +
- "\"modelUuid\": \"fe6478e5-ea33-3346-ac12-ab121484a3fe\"," +
- "\"modelName\": \"vSAMP12\"," +
- "\"modelVersion\": \"1.0\"," +
- "\"modelCustomizationUuid\": \"MODEL-ID-1234\"," +
- "}";
- variables.put("vfModuleModelInfo", vfModuleModelInfo);
-
- String cloudConfiguration = "{" +
- "\"lcpCloudRegionId\": \"RDM2WAGPLCP\"," +
- "\"tenantId\": \"fba1bd1e195a404cacb9ce17a9b2b421\"" + "}";
- variables.put("cloudConfiguration", cloudConfiguration);
-
-
- invokeSubProcess("DoDeleteVfModule", businessKey, variables);
-
- // "changedelete" operation not required for deleting a Vf Module
-// injectSDNCCallbacks(callbacks, "sdncChangeDelete");
- injectVNFRestCallbacks(callbacks, "vnfDelete");
- waitForRunningProcessCount("vnfAdapterDeleteV1", 0, 120000);
- injectSDNCCallbacks(callbacks, "sdncDelete");
-
- waitForProcessEnd(businessKey, 10000);
- WorkflowException wfe = (WorkflowException) getVariableFromHistory(businessKey, wfeString);
- checkVariable(businessKey, wfeString, null);
- if (wfe != null) {
- System.out.println("TestDoDeleteVfModule_Building_Block_Success: ErrorCode=" + wfe.getErrorCode() +
- ", ErrorMessage=" + wfe.getErrorMessage());
- }
- logEnd();
- }
-
-
- @Test
- @Deployment(resources = {
- "subprocess/DoDeleteVfModule.bpmn",
- "subprocess/PrepareUpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn",
- "subprocess/DeleteAAIVfModule.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn"
- })
- public void TestDoDeleteVfModuleSDNCFailure() {
- // delete the Base Module and Generic Vnf - SDNCAdapter failure
- // vnf-id=a27ce5a9-29c4-4c22-a017-6615ac73c721, vf-module-id=973ed047-d251-4fb9-bf1a-65b8949e0a73
- String request =
- "<vnf-request xmlns=\"http://openecomp.org/mso/infra/vnf-request/v1\">" + EOL +
- " <request-info>" + EOL +
- " <action>DELETE_VF_MODULE</action>" + EOL +
- " <source>PORTAL</source>" + EOL +
- " </request-info>" + EOL +
- " <vnf-inputs>" + EOL +
- " <vnf-id>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnf-id>" + EOL +
- " <vnf-name>STMTN5MMSC21</vnf-name>" + EOL +
- " <vnf-type>asc_heat-int</vnf-type>" + EOL +
- " <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</vf-module-id>" + EOL +
- " <vf-module-name>STMTN5MMSC21-MMSC::module-0-0</vf-module-name>" + EOL +
- " <service-id>00000000-0000-0000-0000-000000000000</service-id>" + EOL +
- " <service-type>SDN-ETHERNET-INTERNET</service-type>" + EOL +
- " <tenant-id>fba1bd1e195a404cacb9ce17a9b2b421</tenant-id>" + EOL +
- " <orchestration-status>pending-delete</orchestration-status>" + EOL +
- " <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>" + EOL +
- " </vnf-inputs>" + EOL +
- " <vnf-params xmlns:tns=\"http://openecomp.org/mso/infra/vnf-request/v1\"/>" + EOL +
- "</vnf-request>" + EOL;
-
- logStart();
- MockDoDeleteVfModule_SDNCFailure();
- MockDoDeleteVfModule_DeleteVNFSuccess();
- MockAAIGenericVnfSearch();
- MockAAIVfModulePUT(false);
- MockAAIDeleteGenericVnf();
- MockAAIDeleteVfModule();
- MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
-
- String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<>();
- variables.put("isDebugLogEnabled","true");
- variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("mso-service-instance-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("DoDeleteVfModuleRequest", request);
- variables.put("isVidRequest", "true");
- invokeSubProcess("DoDeleteVfModule", businessKey, variables);
-
- // "changedelete" operation not required for deleting a Vf Module
-// injectSDNCCallbacks(callbacks, "sdncChangeDelete");
- injectVNFRestCallbacks(callbacks, "vnfDelete");
- waitForRunningProcessCount("vnfAdapterDeleteV1", 0, 120000);
- // cause a failure by not injecting a callback
-// injectSDNCCallbacks(callbacks, "sdncDelete");
-
- waitForProcessEnd(businessKey, 10000);
- WorkflowException wfe = (WorkflowException) getVariableFromHistory(businessKey, wfeString);
- Assert.assertNotNull(wfe);
- if (wfe != null) {
- System.out.println("TestDoDeleteVfModuleSDNCFailure: ErrorCode=" + wfe.getErrorCode() +
- ", ErrorMessage=" + wfe.getErrorMessage());
- Assert.assertTrue(wfe.getErrorCode() == 7000);
- Assert.assertTrue(wfe.getErrorMessage().startsWith("Could not communicate"));
- }
- logEnd();
- }
-
- @Test
- @Deployment(resources = {
- "subprocess/DoDeleteVfModule.bpmn",
- "subprocess/PrepareUpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn",
- "subprocess/DeleteAAIVfModule.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn"
- })
- public void TestDoDeleteVfModuleSDNCCallbackFailure() {
- // delete the Base Module and Generic Vnf - SDNCAdapter Callback failure
- // vnf-id=a27ce5a9-29c4-4c22-a017-6615ac73c721, vf-module-id=973ed047-d251-4fb9-bf1a-65b8949e0a73
- String request =
- "<vnf-request xmlns=\"http://openecomp.org/mso/infra/vnf-request/v1\">" + EOL +
- " <request-info>" + EOL +
- " <action>DELETE_VF_MODULE</action>" + EOL +
- " <source>PORTAL</source>" + EOL +
- " </request-info>" + EOL +
- " <vnf-inputs>" + EOL +
- " <vnf-id>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnf-id>" + EOL +
- " <vnf-name>STMTN5MMSC21</vnf-name>" + EOL +
- " <vnf-type>asc_heat-int</vnf-type>" + EOL +
- " <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</vf-module-id>" + EOL +
- " <vf-module-name>STMTN5MMSC21-MMSC::module-0-0</vf-module-name>" + EOL +
- " <service-id>00000000-0000-0000-0000-000000000000</service-id>" + EOL +
- " <service-type>SDN-ETHERNET-INTERNET</service-type>" + EOL +
- " <tenant-id>fba1bd1e195a404cacb9ce17a9b2b421</tenant-id>" + EOL +
- " <orchestration-status>pending-delete</orchestration-status>" + EOL +
- " <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>" + EOL +
- " </vnf-inputs>" + EOL +
- " <vnf-params xmlns:tns=\"http://openecomp.org/mso/infra/vnf-request/v1\"/>" + EOL +
- "</vnf-request>" + EOL;
-
- logStart();
- MockDoDeleteVfModule_SDNCSuccess();
- MockDoDeleteVfModule_DeleteVNFSuccess();
- MockAAIGenericVnfSearch();
- MockAAIVfModulePUT(false);
- MockAAIDeleteGenericVnf();
- MockAAIDeleteVfModule();
- MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
-
- String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<>();
- variables.put("isDebugLogEnabled","true");
- variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("mso-service-instance-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("DoDeleteVfModuleRequest",request);
- variables.put("isVidRequest", "true");
- invokeSubProcess("DoDeleteVfModule", businessKey, variables);
-
- // "changedelete" operation not required for deleting a Vf Module
-// injectSDNCCallbacks(callbacks, "sdncChangeDelete:ERR");
- injectVNFRestCallbacks(callbacks, "vnfDelete");
- waitForRunningProcessCount("vnfAdapterDeleteV1", 0, 120000);
- // return a failure in the callback
- injectSDNCCallbacks(callbacks, "sdncDelete:ERR");
-
- waitForProcessEnd(businessKey, 10000);
- WorkflowException wfe = (WorkflowException) getVariableFromHistory(businessKey, wfeString);
- Assert.assertNotNull(wfe);
- if (wfe != null) {
- System.out.println("TestDoDeleteVfModuleSDNCCallbackFailure: ErrorCode=" + wfe.getErrorCode() +
- ", ErrorMessage=" + wfe.getErrorMessage());
- Assert.assertTrue(wfe.getErrorCode() == 5310);
- Assert.assertTrue(wfe.getErrorMessage().startsWith("Received error from SDN-C"));
- }
- logEnd();
- }
-
- @Test
- @Deployment(resources = {
- "subprocess/DoDeleteVfModule.bpmn",
- "subprocess/PrepareUpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn",
- "subprocess/DeleteAAIVfModule.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn"
- })
- public void TestDoDeleteVfModuleVNFFailure() {
- // delete the Base Module and Generic Vnf - VNFAdapter failure
- // vnf-id=a27ce5a9-29c4-4c22-a017-6615ac73c721, vf-module-id=973ed047-d251-4fb9-bf1a-65b8949e0a73
- String request =
- "<vnf-request xmlns=\"http://openecomp.org/mso/infra/vnf-request/v1\">" + EOL +
- " <request-info>" + EOL +
- " <action>DELETE_VF_MODULE</action>" + EOL +
- " <source>PORTAL</source>" + EOL +
- " </request-info>" + EOL +
- " <vnf-inputs>" + EOL +
- " <vnf-id>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnf-id>" + EOL +
- " <vnf-name>STMTN5MMSC21</vnf-name>" + EOL +
- " <vnf-type>asc_heat-int</vnf-type>" + EOL +
- " <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</vf-module-id>" + EOL +
- " <vf-module-name>STMTN5MMSC21-MMSC::module-0-0</vf-module-name>" + EOL +
- " <service-id>00000000-0000-0000-0000-000000000000</service-id>" + EOL +
- " <service-type>SDN-ETHERNET-INTERNET</service-type>" + EOL +
- " <tenant-id>fba1bd1e195a404cacb9ce17a9b2b421</tenant-id>" + EOL +
- " <orchestration-status>pending-delete</orchestration-status>" + EOL +
- " <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>" + EOL +
- " </vnf-inputs>" + EOL +
- " <vnf-params xmlns:tns=\"http://openecomp.org/mso/infra/vnf-request/v1\"/>" + EOL +
- "</vnf-request>" + EOL;
-
- logStart();
- MockDoDeleteVfModule_SDNCSuccess();
- MockDoDeleteVfModule_DeleteVNFFailure();
- MockAAIGenericVnfSearch();
- MockAAIVfModulePUT(false);
- MockAAIDeleteGenericVnf();
- MockAAIDeleteVfModule();
- MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
-
- String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<>();
- variables.put("isDebugLogEnabled","true");
- variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("mso-service-instance-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("DoDeleteVfModuleRequest",request);
- invokeSubProcess("DoDeleteVfModule", businessKey, variables);
-
- // "changedelete" operation not required for deleting a Vf Module
-// injectSDNCCallbacks(callbacks, "sdncChangeDelete");
- // cause a failure by not injecting a callback
-// injectVNFRestCallbacks(callbacks, "vnfDelete");
-// waitForRunningProcessCount("vnfAdapterDeleteV1", 0, 120000);
-// injectSDNCCallbacks(callbacks, "sdncDelete");
-
- waitForProcessEnd(businessKey, 10000);
- WorkflowException wfe = (WorkflowException) getVariableFromHistory(businessKey, wfeString);
- Assert.assertNotNull(wfe);
- if (wfe != null) {
- System.out.println("TestDoDeleteVfModuleVNFFailure: ErrorCode=" + wfe.getErrorCode() +
- ", ErrorMessage=" + wfe.getErrorMessage());
- Assert.assertTrue(wfe.getErrorCode() == 7020);
- Assert.assertTrue(wfe.getErrorMessage().startsWith("Received error from VnfAdapter"));
- }
- logEnd();
- }
-
- @Test
- @Deployment(resources = {
- "subprocess/DoDeleteVfModule.bpmn",
- "subprocess/PrepareUpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn",
- "subprocess/DeleteAAIVfModule.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn"
- })
- public void TestDoDeleteVfModuleVNFCallbackFailure() {
- // delete the Base Module and Generic Vnf - VNFAdapter Callback failure
- // vnf-id=a27ce5a9-29c4-4c22-a017-6615ac73c721, vf-module-id=973ed047-d251-4fb9-bf1a-65b8949e0a73
- String request =
- "<vnf-request xmlns=\"http://openecomp.org/mso/infra/vnf-request/v1\">" + EOL +
- " <request-info>" + EOL +
- " <action>DELETE_VF_MODULE</action>" + EOL +
- " <source>PORTAL</source>" + EOL +
- " </request-info>" + EOL +
- " <vnf-inputs>" + EOL +
- " <vnf-id>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnf-id>" + EOL +
- " <vnf-name>STMTN5MMSC21</vnf-name>" + EOL +
- " <vnf-type>asc_heat-int</vnf-type>" + EOL +
- " <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</vf-module-id>" + EOL +
- " <vf-module-name>STMTN5MMSC21-MMSC::module-0-0</vf-module-name>" + EOL +
- " <service-id>00000000-0000-0000-0000-000000000000</service-id>" + EOL +
- " <service-type>SDN-ETHERNET-INTERNET</service-type>" + EOL +
- " <tenant-id>fba1bd1e195a404cacb9ce17a9b2b421</tenant-id>" + EOL +
- " <orchestration-status>pending-delete</orchestration-status>" + EOL +
- " <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>" + EOL +
- " </vnf-inputs>" + EOL +
- " <vnf-params xmlns:tns=\"http://openecomp.org/mso/infra/vnf-request/v1\"/>" + EOL +
- "</vnf-request>" + EOL;
-
- logStart();
- MockDoDeleteVfModule_SDNCSuccess();
- MockDoDeleteVfModule_DeleteVNFSuccess();
- MockAAIGenericVnfSearch();
- MockAAIVfModulePUT(false);
- MockAAIDeleteGenericVnf();
- MockAAIDeleteVfModule();
- MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
-
- String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<>();
- variables.put("isDebugLogEnabled","true");
- variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("mso-service-instance-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("DoDeleteVfModuleRequest",request);
- invokeSubProcess("DoDeleteVfModule", businessKey, variables);
-
- // "changedelete" operation not required for deleting a Vf Module
-// injectSDNCCallbacks(callbacks, "sdncChangeDelete");
- injectVNFRestCallbacks(callbacks, "vnfDeleteFail");
- waitForRunningProcessCount("vnfAdapterDeleteV1", 0, 120000);
-// injectSDNCCallbacks(callbacks, "sdncDelete");
-
- waitForProcessEnd(businessKey, 10000);
- WorkflowException wfe = (WorkflowException) getVariableFromHistory(businessKey, wfeString);
- Assert.assertNotNull(wfe);
- if (wfe != null) {
- System.out.println("TestDoDeleteVfModuleVNFCallbackFailure: ErrorCode=" + wfe.getErrorCode() +
- ", ErrorMessage=" + wfe.getErrorMessage());
- Assert.assertTrue(wfe.getErrorCode() == 7020);
- Assert.assertTrue(wfe.getErrorMessage().startsWith("Received vfModuleException from VnfAdapter"));
- }
- logEnd();
- }
-
- // start of mocks used locally and by other VF Module unit tests
- public static void MockAAIVfModulePUT(boolean isCreate){
- stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/.*/vf-modules/vf-module/.*"))
- .withRequestBody(containing("MMSC"))
- .willReturn(aResponse()
- .withStatus(isCreate ? 201 : 200)));
- stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/.*/vf-modules/vf-module/.*"))
- .withRequestBody(containing("PCRF"))
- .willReturn(aResponse()
- .withStatus(500)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("aaiFault.xml")));
- stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c721"))
- .willReturn(aResponse()
- .withStatus(200)));
- }
-
- public static void MockDoDeleteVfModule_SDNCSuccess() {
- stubFor(post(urlEqualTo("/SDNCAdapter"))
- .withRequestBody(containing("SvcAction>changedelete"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("DeleteGenericVNFV1/sdncAdapterResponse.xml")));
- stubFor(post(urlEqualTo("/SDNCAdapter"))
- .withRequestBody(containing("SvcAction>delete"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("DeleteGenericVNFV1/sdncAdapterResponse.xml")));
- }
-
- public static void MockDoDeleteVfModule_SDNCFailure() {
- stubFor(post(urlEqualTo("/SDNCAdapter"))
- .withRequestBody(containing("SvcAction>changedelete"))
- .willReturn(aResponse()
- .withStatus(500)));
- stubFor(post(urlEqualTo("/SDNCAdapter"))
- .withRequestBody(containing("SvcAction>delete"))
- .willReturn(aResponse()
- .withStatus(500)));
- }
-
- public static void MockDoDeleteVfModule_DeleteVNFSuccess() {
- stubFor(delete(urlMatching("/vnfs/v1/vnfs/.*/vf-modules/.*"))
- .willReturn(aResponse()
- .withStatus(202)
- .withHeader("Content-Type", "application/xml")));
- stubFor(delete(urlMatching("/vnfs/v1/volume-groups/78987"))
- .willReturn(aResponse()
- .withStatus(202)
- .withHeader("Content-Type", "application/xml")));
- }
-
- public static void MockDoDeleteVfModule_DeleteVNFFailure() {
- stubFor(delete(urlMatching("/vnfs/v1/vnfs/.*/vf-modules/.*"))
- .willReturn(aResponse()
- .withStatus(500)
- .withHeader("Content-Type", "application/xml")));
- }
-}
-
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleVolumeV2Test.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleVolumeV2Test.java deleted file mode 100644 index 165debe7f1..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleVolumeV2Test.java +++ /dev/null @@ -1,198 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.bpmn.infrastructure;
-
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteVolumeGroupById;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetNetworkCloudRegion;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetVolumeGroupById;
-import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
-import static org.openecomp.mso.bpmn.mock.StubResponseVNFAdapter.mockPutVNFVolumeGroup;
-import static org.openecomp.mso.bpmn.mock.StubResponseVNFAdapter.mockVfModuleDelete;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.camunda.bpm.engine.test.Deployment;
-import org.junit.Test;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
-import org.openecomp.mso.bpmn.core.WorkflowException;
-import org.openecomp.mso.bpmn.mock.FileUtil;
-
-public class DoDeleteVfModuleVolumeV2Test extends WorkflowTest {
-
- private final CallbackSet callbacks = new CallbackSet();
-
- public DoDeleteVfModuleVolumeV2Test() throws IOException {
- callbacks.put("volumeGroupDelete", FileUtil.readResourceFile(
- "__files/DeleteVfModuleVolumeInfraV1/DeleteVfModuleVolumeCallbackResponse.xml"));
- }
-
- @Test
- //@Ignore
- @Deployment(resources = {"subprocess/DoDeleteVfModuleVolumeV2.bpmn", "subprocess/VnfAdapterRestV1.bpmn"})
- public void happyPath() throws Exception {
-
- logStart();
-
- MockGetNetworkCloudRegion("MDTWNJ21", "CreateNetworkV2/cloudRegion30_AAIResponse_Success.xml");
- MockGetVolumeGroupById("RDM2WAGPLCP", "78987", "DeleteVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_Success.xml");
- MockDeleteVolumeGroupById("RDM2WAGPLCP", "78987", "0000020", 200);
- mockPutVNFVolumeGroup("78987", 202);
- mockVfModuleDelete("78987");
- MockDeleteVolumeGroupById("AAIAIC25", "78987", "0000020", 200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
- MockGetVolumeGroupById("AAIAIC25", "78987", "VfModularity/VolumeGroup.xml");
- String businessKey = UUID.randomUUID().toString();
-
- Map<String, Object> testVariables = new HashMap<>();
- testVariables.put("mso-request-id", "TEST-REQUEST-ID-0123");
- testVariables.put("msoRequestId", "TEST-REQUEST-ID-0123");
- testVariables.put("isDebugLogEnabled", "true");
- //testVariables.put("lcpCloudRegionId", "MDTWNJ21");
- //testVariables.put("tenantId", "fba1bd1e195a404cacb9ce17a9b2b421");
- testVariables.put("volumeGroupId", "78987");
- testVariables.put("serviceInstanceId", "test-service-instance-id-0123");
-
- String cloudConfiguration = "{" +
- "\"lcpCloudRegionId\": \"MDTWNJ21\"," +
- "\"tenantId\": \"fba1bd1e195a404cacb9ce17a9b2b421\"" + "}";
- testVariables.put("cloudConfiguration", cloudConfiguration);
-
- invokeSubProcess("DoDeleteVfModuleVolumeV2", businessKey, testVariables);
-
- injectVNFRestCallbacks(callbacks, "volumeGroupDelete");
-
- waitForProcessEnd(businessKey, 100000);
- checkVariable(businessKey, "wasDeleted", "true");
-
- logEnd();
- }
-
-
- @Test
- //@Ignore
- @Deployment(resources = {"subprocess/DoDeleteVfModuleVolumeV2.bpmn", "subprocess/VnfAdapterRestV1.bpmn"})
- public void testVolumeGroupInUse() throws Exception {
-
- logStart();
- MockGetNetworkCloudRegion("MDTWNJ21", "CreateNetworkV2/cloudRegion30_AAIResponse_Success.xml");
- MockGetVolumeGroupById("RDM2WAGPLCP", "78987", "DeleteVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_HasVfModRelationship.xml");
- MockDeleteVolumeGroupById("RDM2WAGPLCP", "78987", "0000020", 200);
- mockVfModuleDelete("78987");
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
- String businessKey = UUID.randomUUID().toString();
-
- Map<String, Object> testVariables = new HashMap<>();
- testVariables.put("mso-request-id", "TEST-REQUEST-ID-0123");
- testVariables.put("msoRequestId", "TEST-REQUEST-ID-0123");
- testVariables.put("isDebugLogEnabled", "true");
- testVariables.put("volumeGroupId", "78987");
- testVariables.put("serviceInstanceId", "test-service-instance-id-0123");
-
- String cloudConfiguration = "{" +
- "\"lcpCloudRegionId\": \"MDTWNJ21\"," +
- "\"tenantId\": \"fba1bd1e195a404cacb9ce17a9b2b421\"" + "}";
- testVariables.put("cloudConfiguration", cloudConfiguration);
-
- invokeSubProcess("DoDeleteVfModuleVolumeV2", businessKey, testVariables);
-
- waitForProcessEnd(businessKey, 100000);
- checkVariable(businessKey, "wasDeleted", "false");
- WorkflowException msoException = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException");
- System.out.println("WorkflowException - Code: " + msoException.getErrorCode() + " Message: " + msoException.getErrorMessage());
-
-
- logEnd();
- }
-
- @Test
- //@Ignore
- @Deployment(resources = {"subprocess/DoDeleteVfModuleVolumeV2.bpmn", "subprocess/VnfAdapterRestV1.bpmn"})
- public void testTenantIdMismatch() throws Exception {
-
- logStart();
- MockGetNetworkCloudRegion("MDTWNJ21", "CreateNetworkV2/cloudRegion30_AAIResponse_Success.xml");
- MockGetVolumeGroupById("RDM2WAGPLCP", "78987", "DeleteVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_Success.xml");
- MockDeleteVolumeGroupById("RDM2WAGPLCP", "78987", "0000020", 200);
- mockVfModuleDelete("78987", 404);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
- String businessKey = UUID.randomUUID().toString();
-
- Map<String, Object> testVariables = new HashMap<>();
- testVariables.put("mso-request-id", "TEST-REQUEST-ID-0123");
- testVariables.put("msoRequestId", "TEST-REQUEST-ID-0123");
- testVariables.put("isDebugLogEnabled", "true");
- testVariables.put("volumeGroupId", "78987");
- testVariables.put("serviceInstanceId", "test-service-instance-id-0123");
-
- String cloudConfiguration = "{" +
- "\"lcpCloudRegionId\": \"MDTWNJ21\"," +
- "\"tenantId\": \"fba1bd1e195a404cacb9ce17a9b2b421xxx\"" + "}";
- testVariables.put("cloudConfiguration", cloudConfiguration);
-
- invokeSubProcess("DoDeleteVfModuleVolumeV2", businessKey, testVariables);
-
- waitForProcessEnd(businessKey, 100000);
- checkVariable(businessKey, "wasDeleted", "false");
- WorkflowException msoException = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException");
- System.out.println("WorkflowException - Code: " + msoException.getErrorCode() + " Message: " + msoException.getErrorMessage());
-
-
- logEnd();
- }
-
- @Test
- //@Ignore
- @Deployment(resources = {"subprocess/DoDeleteVfModuleVolumeV2.bpmn", "subprocess/VnfAdapterRestV1.bpmn"})
- public void testVnfAdapterCallfail() throws Exception {
-
- logStart();
- MockGetNetworkCloudRegion("MDTWNJ21", "CreateNetworkV2/cloudRegion30_AAIResponse_Success.xml");
- MockGetVolumeGroupById("RDM2WAGPLCP", "78987", "DeleteVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_Success.xml");
- MockDeleteVolumeGroupById("RDM2WAGPLCP", "78987", "0000020", 200);
- mockVfModuleDelete("78987", 404);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
- String businessKey = UUID.randomUUID().toString();
-
- Map<String, Object> testVariables = new HashMap<>();
- testVariables.put("mso-request-id", "TEST-REQUEST-ID-0123");
- testVariables.put("msoRequestId", "TEST-REQUEST-ID-0123");
- testVariables.put("isDebugLogEnabled", "true");
- testVariables.put("volumeGroupId", "78987");
- testVariables.put("serviceInstanceId", "test-service-instance-id-0123");
-
- String cloudConfiguration = "{" +
- "\"lcpCloudRegionId\": \"MDTWNJ21\"," +
- "\"tenantId\": \"fba1bd1e195a404cacb9ce17a9b2b421\"" + "}";
- testVariables.put("cloudConfiguration", cloudConfiguration);
-
- invokeSubProcess("DoDeleteVfModuleVolumeV2", businessKey, testVariables);
-
- waitForProcessEnd(businessKey, 100000);
- checkVariable(businessKey, "wasDeleted", "false");
- WorkflowException msoException = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException");
- System.out.println("WorkflowException - Code: " + msoException.getErrorCode() + " Message: " + msoException.getErrorMessage());
-
- logEnd();
- }
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVnfAndModulesTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVnfAndModulesTest.java deleted file mode 100644 index c53beb1446..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVnfAndModulesTest.java +++ /dev/null @@ -1,352 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.bpmn.infrastructure;
-
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
-import static com.github.tomakehurst.wiremock.client.WireMock.containing;
-import static com.github.tomakehurst.wiremock.client.WireMock.delete;
-import static com.github.tomakehurst.wiremock.client.WireMock.post;
-import static com.github.tomakehurst.wiremock.client.WireMock.put;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.openecomp.mso.bpmn.common.DeleteAAIVfModuleTest.MockAAIDeleteGenericVnf;
-import static org.openecomp.mso.bpmn.common.DeleteAAIVfModuleTest.MockAAIDeleteVfModule;
-import static org.openecomp.mso.bpmn.common.DeleteAAIVfModuleTest.MockAAIGenericVnfSearch;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteGenericVnf;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfById;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchVfModuleId;
-import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
-import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.camunda.bpm.engine.test.Deployment;
-import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.openecomp.mso.bpmn.common.BPMNUtil;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
-import org.openecomp.mso.bpmn.mock.FileUtil;
-import org.openecomp.mso.bpmn.core.domain.ModelInfo;
-import org.openecomp.mso.bpmn.core.domain.ModuleResource;
-import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition;
-import org.openecomp.mso.bpmn.core.domain.VnfResource;
-
-public class DoDeleteVnfAndModulesTest extends WorkflowTest {
- private final CallbackSet callbacks = new CallbackSet();
- private static final String EOL = "\n";
- private final String vnfAdapterDeleteCallback =
- "<deleteVfModuleResponse>" + EOL +
- " <vnfId>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnfId>" + EOL +
- " <vfModuleId>973ed047-d251-4fb9-bf1a-65b8949e0a73</vfModuleId>" + EOL +
- " <vfModuleDeleted>true</vfModuleDeleted>" + EOL +
- " <messageId>{{MESSAGE-ID}}</messageId>" + EOL +
- "</deleteVfModuleResponse>" + EOL;
- private final String sdncAdapterDeleteCallback =
- "<output xmlns=\"org:openecomp:sdnctl:l3api\">" + EOL +
- " <svc-request-id>{{REQUEST-ID}}</svc-request-id>" + EOL +
- " <ack-final-indicator>Y</ack-final-indicator>" + EOL +
- "</output>" + EOL;
-
- public DoDeleteVnfAndModulesTest () throws IOException {
- callbacks.put("deactivate", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyActivateCallback.xml"));
- callbacks.put("unassign", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyActivateCallback.xml"));
- callbacks.put("vnfDelete", vnfAdapterDeleteCallback);
- callbacks.put("sdncDelete", sdncAdapterDeleteCallback);
-
- }
-
- @Test
- @Deployment(resources = {"subprocess/DoDeleteVnfAndModules.bpmn", "subprocess/SDNCAdapterV1.bpmn", "subprocess/GenericGetVnf.bpmn", "subprocess/GenericDeleteVnf.bpmn", "subprocess/DoDeleteVnf.bpmn", "subprocess/DoDeleteVfModule.bpmn"})
- public void testDoDeleteVnfAndModules_successVnfOnly() throws Exception{
- MockGetGenericVnfById("testVnfId123.*", "GenericFlows/getGenericVnfByNameResponse.xml");
- MockDeleteGenericVnf("testVnfId123", "testReVer123");
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
- mockSDNCAdapter(200);
-
- String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<>();
- setVariablesVnfOnly(variables);
- invokeSubProcess("DoDeleteVnfAndModules", businessKey, variables);
-
- injectSDNCCallbacks(callbacks, "deactivate");
- injectSDNCCallbacks(callbacks, "unassign");
-
- waitForProcessEnd(businessKey, 10000);
-
- Assert.assertTrue(isProcessEnded(businessKey));
-
- String workflowException = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnfAndModules", "WorkflowException");
-
- assertEquals(null, workflowException);
- }
-
-
- private void setVariablesVnfOnly(Map<String, Object> variables) {
- variables.put("mso-request-id", "testRequestId123");
- variables.put("isDebugLogEnabled", "true");
- variables.put("vnfId","testVnfId123");
- variables.put("serviceInstanceId", "MIS%2F1604%2F0026%2FSW_INTERNET");
- //variables.put("vnfName", "testVnfName123");
- variables.put("disableRollback", "true");
- variables.put("msoRequestId", "testVnfId123");
- variables.put("testVnfId","testVnfId123");
- //variables.put("vnfType", "STMTN");
- variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
- String vnfModelInfo = "{ "+ "\"modelType\": \"vnf\"," +
- "\"modelInvariantUuid\": \"ff5256d2-5a33-55df-13ab-12abad84e7ff\"," +
- "\"modelUuid\": \"fe6478e5-ea33-3346-ac12-ab121484a3fe\"," +
- "\"modelName\": \"vSAMP12\"," +
- "\"modelVersion\": \"1.0\"," +
- "\"modelCustomizationUuid\": \"MODEL-ID-1234\"," +
- "}";
- //variables.put("vnfModelInfo", vnfModelInfo);
-
- variables.put("lcpCloudRegionId", "mdt1");
- variables.put("tenantId", "88a6ca3ee0394ade9403f075db23167e");
-
- String serviceModelInfo = "{ "+ "\"modelType\": \"service\"," +
- "\"modelInvariantUuid\": \"995256d2-5a33-55df-13ab-12abad84e7ff\"," +
- "\"modelUuid\": \"ab6478e5-ea33-3346-ac12-ab121484a3fe\"," +
- "\"modelName\": \"ServicevSAMP12\"," +
- "\"modelVersion\": \"1.0\"," +
- "}";
- //variables.put("serviceModelInfo", serviceModelInfo);
- variables.put("globalSubscriberId", "MSO-1610");
- variables.put("sdncVersion", "1707");
-
- }
-
- @Test
- @Deployment(resources = {"subprocess/DoDeleteVnfAndModules.bpmn", "subprocess/SDNCAdapterV1.bpmn", "subprocess/GenericGetVnf.bpmn", "subprocess/GenericDeleteVnf.bpmn", "subprocess/DoDeleteVnf.bpmn", "subprocess/DoDeleteVfModuleFromVnf.bpmn", "subprocess/VnfAdapterRestV1.bpmn", "subprocess/DeleteAAIVfModule.bpmn"})
- public void testDoDeleteVnfAndModules_successVnfAndModules() throws Exception{
- MockAAIGenericVnfSearch();
- MockGetGenericVnfById("testVnfId123.*", "GenericFlows/getGenericVnfByNameResponse.xml");
- MockDeleteGenericVnf("testVnfId123", "testReVer123");
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
- mockSDNCAdapter(200);
- MockDoDeleteVfModule_SDNCSuccess();
- MockDoDeleteVfModule_DeleteVNFSuccess();
- MockAAIDeleteVfModule();
-
- String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<>();
- setVariablesVnfAndModules(variables);
- invokeSubProcess("DoDeleteVnfAndModules", businessKey, variables);
-
- injectSDNCCallbacks(callbacks, "deactivate");
- injectSDNCCallbacks(callbacks, "deactivate");
- injectVNFRestCallbacks(callbacks, "vnfDelete");
- injectSDNCCallbacks(callbacks, "unassign");
- MockGetGenericVnfById("a27ce5a9-29c4-4c22-a017-6615ac73c721", "GenericFlows/getGenericVnfByNameResponse.xml");
- injectSDNCCallbacks(callbacks, "unassign");
- //MockGetGenericVnfById("a27ce5a9-29c4-4c22-a017-6615ac73c721", "GenericFlows/getGenericVnfByNameResponse.xml");
-
- waitForProcessEnd(businessKey, 10000);
-
- Assert.assertTrue(isProcessEnded(businessKey));
-
- String workflowException = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnfAndModules", "WorkflowException");
-
- assertEquals(null, workflowException);
- }
-
-
- private void setVariablesVnfAndModules(Map<String, Object> variables) {
- variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("isDebugLogEnabled", "true");
- variables.put("vnfId","a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("serviceInstanceId", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
-
- variables.put("msoRequestId", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- //variables.put("testVnfId","testVnfId123");
-
- variables.put("lcpCloudRegionId", "RDM2WAGPLCP");
- variables.put("tenantId", "fba1bd1e195a404cacb9ce17a9b2b421");
-
- variables.put("sdncVersion", "1707");
-
-
- ServiceDecomposition sd = new ServiceDecomposition();
- ModelInfo serviceModel = new ModelInfo();
- serviceModel.setModelName("servicewithVNFs");
- sd.setModelInfo(serviceModel);
- VnfResource vr = new VnfResource();
- ModelInfo mvr = new ModelInfo();
- mvr.setModelName("vSAMP12");
- mvr.setModelInstanceName("v123");
- mvr.setModelInvariantUuid("");
- mvr.setModelVersion("1.0");
- mvr.setModelCustomizationUuid("MODEL-ID-1234");
- vr.setModelInfo(mvr);
- vr.constructVnfType("vnf1");
- vr.setNfType("somenftype");
- vr.setNfRole("somenfrole");
- vr.setNfFunction("somenffunction");
- vr.setNfNamingCode("somenamingcode");
- ModuleResource mr = new ModuleResource();
- ModelInfo mvmr = new ModelInfo();
- mvmr.setModelInvariantUuid("ff5256d2-5a33-55df-13ab-12abad84e7ff");
- mvmr.setModelName("STMTN5MMSC21-MMSC::model-1-0");
- mvmr.setModelUuid("1.0");
- mvmr.setModelCustomizationUuid("MODEL-123");
- mr.setModelInfo(mvmr);
- mr.setIsBase(true);
- mr.setVfModuleLabel("MODULELABEL");
- vr.addVfModule(mr);
- sd.addVnfResource(vr);
- variables.put("serviceDecomposition", sd);
-
- }
-
- @Test
- @Deployment(resources = {"subprocess/DoDeleteVnfAndModules.bpmn", "subprocess/SDNCAdapterV1.bpmn", "subprocess/GenericGetVnf.bpmn", "subprocess/GenericDeleteVnf.bpmn", "subprocess/DoDeleteVnf.bpmn", "subprocess/DoDeleteVfModule.bpmn", "subprocess/UpdateAAIVfModule.bpmn", "subprocess/PrepareUpdateAAIVfModule.bpmn", "subprocess/DoDeleteVfModuleFromVnf.bpmn", "subprocess/VnfAdapterRestV1.bpmn", "subprocess/DeleteAAIVfModule.bpmn"})
- public void testDoDeleteVnfAndModulesDirectDelete_successVnfAndModules() throws Exception{
- MockDoDeleteVfModule_SDNCSuccess();
- MockDoDeleteVfModule_DeleteVNFSuccess();
- mockSDNCAdapter(200);
- MockAAIGenericVnfSearch();
- MockAAIVfModulePUT(false);
- MockAAIDeleteGenericVnf();
- MockAAIDeleteVfModule();
- MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
-
- String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<>();
- setVariablesVnfAndModulesDirectDelete(variables);
- invokeSubProcess("DoDeleteVnfAndModules", businessKey, variables);
-
- injectVNFRestCallbacks(callbacks, "vnfDelete");
- injectSDNCCallbacks(callbacks, "sdncDelete");
- MockGetGenericVnfById("a27ce5a9-29c4-4c22-a017-6615ac73c721", "GenericFlows/getGenericVnfByNameResponse.xml");
-
- waitForProcessEnd(businessKey, 10000);
-
- Assert.assertTrue(isProcessEnded(businessKey));
-
- String workflowException = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnfAndModules", "WorkflowException");
-
- // WorkflowException is expected here, since empty VNF cannot be simulated here
- assertNotEquals(null, workflowException);
- }
-
-
- private void setVariablesVnfAndModulesDirectDelete(Map<String, Object> variables) {
- variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("isDebugLogEnabled", "true");
- variables.put("vnfId","a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("serviceInstanceId", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
-
- variables.put("msoRequestId", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- //variables.put("testVnfId","testVnfId123");
-
- variables.put("lcpCloudRegionId", "RDM2WAGPLCP");
- variables.put("tenantId", "fba1bd1e195a404cacb9ce17a9b2b421");
-
- variables.put("sdncVersion", "1702");
-
-
- ServiceDecomposition sd = new ServiceDecomposition();
- ModelInfo serviceModel = new ModelInfo();
- serviceModel.setModelName("servicewithVNFs");
- sd.setModelInfo(serviceModel);
- VnfResource vr = new VnfResource();
- ModelInfo mvr = new ModelInfo();
- mvr.setModelName("vSAMP12");
- mvr.setModelInstanceName("v123");
- mvr.setModelInvariantUuid("");
- mvr.setModelVersion("1.0");
- mvr.setModelCustomizationUuid("MODEL-ID-1234");
- vr.setModelInfo(mvr);
- vr.constructVnfType("vnf1");
- vr.setNfType("somenftype");
- vr.setNfRole("somenfrole");
- vr.setNfFunction("somenffunction");
- vr.setNfNamingCode("somenamingcode");
- ModuleResource mr = new ModuleResource();
- ModelInfo mvmr = new ModelInfo();
- mvmr.setModelInvariantUuid("ff5256d2-5a33-55df-13ab-12abad84e7ff");
- mvmr.setModelName("STMTN5MMSC21-MMSC::model-1-0");
- mvmr.setModelUuid("1.0");
- mvmr.setModelCustomizationUuid("MODEL-123");
- mr.setModelInfo(mvmr);
- mr.setIsBase(true);
- mr.setVfModuleLabel("MODULELABEL");
- vr.addVfModule(mr);
- sd.addVnfResource(vr);
- variables.put("serviceDecomposition", sd);
-
- }
-
- public static void MockAAIVfModulePUT(boolean isCreate){
- stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/.*/vf-modules/vf-module/.*"))
- .withRequestBody(containing("MMSC"))
- .willReturn(aResponse()
- .withStatus(isCreate ? 201 : 200)));
- stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/.*/vf-modules/vf-module/.*"))
- .withRequestBody(containing("PCRF"))
- .willReturn(aResponse()
- .withStatus(500)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("aaiFault.xml")));
- stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c721"))
- .willReturn(aResponse()
- .withStatus(200)));
- }
-
-
-
-
- public static void MockDoDeleteVfModule_SDNCSuccess() {
- stubFor(post(urlEqualTo("/SDNCAdapter"))
- .withRequestBody(containing("SvcAction>deactivate"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("DeleteGenericVNFV1/sdncAdapterResponse.xml")));
- stubFor(post(urlEqualTo("/SDNCAdapter"))
- .withRequestBody(containing("SvcAction>unassign"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("DeleteGenericVNFV1/sdncAdapterResponse.xml")));
- }
-
-
- public static void MockDoDeleteVfModule_DeleteVNFSuccess() {
- stubFor(delete(urlMatching("/vnfs/v1/vnfs/.*/vf-modules/.*"))
- .willReturn(aResponse()
- .withStatus(202)
- .withHeader("Content-Type", "application/xml")));
- stubFor(delete(urlMatching("/vnfs/v1/volume-groups/78987"))
- .willReturn(aResponse()
- .withStatus(202)
- .withHeader("Content-Type", "application/xml")));
- }
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVnfTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVnfTest.java deleted file mode 100644 index 8caa9f22a2..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVnfTest.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * © 2014 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property. - */ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure; - -import static org.junit.Assert.assertEquals; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteGenericVnf; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithDepth; -import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB; - -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; - -/** - * Please describe the DeleteVnfInfra.java class - * - */ -public class DoDeleteVnfTest extends WorkflowTest { - - - @Test - @Deployment(resources = {"subprocess/GenericGetVnf.bpmn", "subprocess/GenericDeleteVnf.bpmn", "subprocess/DoDeleteVnf.bpmn"}) - public void testDoDeleteVnf_success() throws Exception{ - - MockGetGenericVnfByIdWithDepth("testVnfId123", 1, "GenericFlows/getGenericVnfByNameResponse.xml"); - MockDeleteGenericVnf("testVnfId123", "testReVer123"); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - setVariables(variables); - invokeSubProcess("DoDeleteVnf", businessKey, variables); - // Disabled until SDNC support is there -// injectSDNCCallbacks(callbacks, "assign"); -// injectSDNCCallbacks(callbacks, "activate"); - - waitForProcessEnd(businessKey, 10000); - - Assert.assertTrue(isProcessEnded(businessKey)); - String found = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "GENGV_FoundIndicator") ; - String inUse = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "DoDVNF_vnfInUse"); - String workflowException = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "WorkflowException"); - - assertEquals("true", found); - assertEquals("false", inUse); - assertEquals(null, workflowException); - } - - @Test - @Deployment(resources = {"subprocess/GenericGetVnf.bpmn", "subprocess/GenericDeleteVnf.bpmn", "subprocess/DoDeleteVnf.bpmn"}) - public void testDeleteVnfInfra_success_vnfNotFound() throws Exception{ - - MockDeleteGenericVnf("testVnfId123", "testReVer123", 404); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - setVariables(variables); - - invokeSubProcess("DoDeleteVnf", businessKey, variables); - // Disabled until SDNC support is there -// injectSDNCCallbacks(callbacks, "assign"); -// injectSDNCCallbacks(callbacks, "activate"); - - waitForProcessEnd(businessKey, 10000); - - Assert.assertTrue(isProcessEnded(businessKey)); - String found = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "GENGV_FoundIndicator") ; - String inUse = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "DoDVNF_vnfInUse"); - String workflowException = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "WorkflowException"); - - assertEquals("false", found); - assertEquals("false", inUse); - assertEquals(null, workflowException); - } - - @Test - @Deployment(resources = {"subprocess/GenericGetVnf.bpmn", "subprocess/GenericDeleteVnf.bpmn", "subprocess/DoDeleteVnf.bpmn"}) - public void testDeleteVnfInfra_error_vnfInUse() throws Exception{ - - MockGetGenericVnfByIdWithDepth("testVnfId123", 1, "GenericFlows/getGenericVnfResponse_hasRelationships.xml"); - MockDeleteGenericVnf("testVnfId123", "testReVer123"); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - setVariables(variables); - - invokeSubProcess("DoDeleteVnf", businessKey, variables); -// Disabled until SDNC support is there -// injectSDNCCallbacks(callbacks, "assign"); -// injectSDNCCallbacks(callbacks, "activate"); - - waitForProcessEnd(businessKey, 10000); - - Assert.assertTrue(isProcessEnded(businessKey)); - - String found = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "GENGV_FoundIndicator") ; - String inUse = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "DoDVNF_vnfInUse"); - String workflowException = BPMNUtil.getVariable(processEngineRule, "DoDeleteVnf", "WorkflowException"); - String exWfex = "WorkflowException[processKey=DoDeleteVnf,errorCode=5000,errorMessage=Can't Delete Generic Vnf. Generic Vnf is still in use.]"; - - assertEquals("true", found); - assertEquals("true", inUse); - assertEquals(exWfex, workflowException); - } - - private void setVariables(Map<String, Object> variables) { - variables.put("mso-request-id", "123"); - variables.put("isDebugLogEnabled", "true"); - variables.put("vnfId","testVnfId123"); - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoUpdateVfModuleTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoUpdateVfModuleTest.java deleted file mode 100644 index a955c4eb86..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoUpdateVfModuleTest.java +++ /dev/null @@ -1,257 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.bpmn.infrastructure;
-
-
-
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
-import static com.github.tomakehurst.wiremock.client.WireMock.post;
-import static com.github.tomakehurst.wiremock.client.WireMock.put;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockAAIVfModule;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithDepth;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithPriority;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetVfModuleIdNoResponse;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetVolumeGroupById;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchGenericVnf;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchVfModuleId;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutGenericVnf;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutVfModuleIdNoResponse;
-import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.MockGetServiceResourcesCatalogData;
-import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
-import static org.openecomp.mso.bpmn.mock.StubResponseVNFAdapter.mockVNFPut;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.camunda.bpm.engine.test.Deployment;
-import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
-import org.openecomp.mso.bpmn.mock.FileUtil;
-
-/**
- * Unit tests for DoUpdateVfModule.bpmn.
- */
-public class DoUpdateVfModuleTest extends WorkflowTest {
-
- private final CallbackSet callbacks = new CallbackSet();
-
- public DoUpdateVfModuleTest() throws IOException {
- callbacks.put("changeassign", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyChangeAssignCallback.xml"));
- callbacks.put("query", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyQueryCallback.xml"));
- callbacks.put("activate", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyActivateCallback.xml"));
- callbacks.put("vnfUpdate", FileUtil.readResourceFile(
- "__files/VfModularity/VNFAdapterRestUpdateCallback.xml"));
- }
-
- /**
- * Test the happy path through the flow.
- */
- @Test
- @Ignore
- @Deployment(resources = {
- "subprocess/DoUpdateVfModule.bpmn",
- "subprocess/PrepareUpdateAAIVfModule.bpmn",
- "subprocess/ConfirmVolumeGroupTenant.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn"
- })
- public void happyPath() throws IOException {
-
- logStart();
-
- String doUpdateVfModuleRequest = FileUtil.readResourceFile("__files/VfModularity/DoUpdateVfModuleRequest.xml");
- MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
- MockGetVfModuleIdNoResponse("skask", "PCRF", "supercool");
- MockPutVfModuleIdNoResponse("skask", "PCRF", "supercool");
- MockGetVolumeGroupById("MDTWNJ21", "78987", "VfModularity/VolumeGroup.xml");
- mockSDNCAdapter("/SDNCAdapter", "SvcAction>query", 200, "VfModularity/StandardSDNCSynchResponse.xml");
- mockSDNCAdapter("/SDNCAdapter", "SvcInstanceId><", 200, "VfModularity/StandardSDNCSynchResponse.xml");
- mockVNFPut("skask", "/supercool", 202);
- MockPutGenericVnf("skask");
- MockGetGenericVnfByIdWithPriority("skask", "supercool", 200, "VfModularity/VfModule-supercool.xml", 1);
- //Catalog DB
- MockGetServiceResourcesCatalogData("aa5256d2-5a33-55df-13ab-12abad84e7ff","InfrastructureFlows/DoCreateServiceInstance_request.json");
-
- String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<>();
- variables.put("mso-request-id", "DEV-VF-0011");
- variables.put("isDebugLogEnabled","true");
- variables.put("DoUpdateVfModuleRequest", doUpdateVfModuleRequest);
- invokeSubProcess("DoUpdateVfModule", businessKey, variables);
-
- injectSDNCCallbacks(callbacks, "changeassign, query");
- injectVNFRestCallbacks(callbacks, "vnfUpdate");
- injectSDNCCallbacks(callbacks, "activate");
-
- waitForProcessEnd(businessKey, 10000);
-
- Assert.assertTrue(isProcessEnded(businessKey));
- checkVariable(businessKey, "DoUpdateVfModuleSuccessIndicator", true);
-
- String heatStackId = (String) getVariableFromHistory(businessKey, "DOUPVfMod_heatStackId");
- System.out.println("Heat stack Id from AAI: " + heatStackId);
-
- logEnd();
- }
-
- /**
- * Test the happy path through the flow with Building Blocks interface.
- */
- @Test
-
- @Deployment(resources = {
- "subprocess/DoUpdateVfModule.bpmn",
- "subprocess/PrepareUpdateAAIVfModule.bpmn",
- "subprocess/ConfirmVolumeGroupTenant.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn"
- })
- public void happyPathBB() throws IOException {
-
- logStart();
-
- MockAAIVfModule();
- MockPatchGenericVnf("skask");
- MockPatchVfModuleId("skask", ".*");
- MockSDNCAdapterVfModule();
- MockVNFAdapterRestVfModule();
- //Catalog DB
- MockGetServiceResourcesCatalogData("aa5256d2-5a33-55df-13ab-12abad84e7ff","InfrastructureFlows/DoCreateServiceInstance_request.json");
-
- String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<>();
- variables.put("mso-request-id", "DEV-VF-0011");
- variables.put("isDebugLogEnabled","true");
- variables.put("msoRequestId", "DEV-VF-0011");
- variables.put("isBaseVfModule", "false");
- variables.put("isDebugLogEnabled", "true");
- variables.put("disableRollback", "true");
- variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
- variables.put("vnfId", "skask");
- variables.put("vfModuleId", "supercool");
- variables.put("vnfType", "pcrf-capacity");
- variables.put("isVidRequest", "true");
- variables.put("volumeGroupId", "78987");
- variables.put("usePreload", true);
-
- variables.put("sdncVersion", "1702");
-
- variables.put("lcpCloudRegionId", "MDTWNJ21");
- variables.put("tenantId", "fba1bd1e195a404cacb9ce17a9b2b421");
-
- String vfModuleModelInfo = "{ "+ "\"modelType\": \"vfModule\"," +
- "\"modelInvariantUuid\": \"introvert\"," +
- "\"modelUuid\": \"3.14\"," +
- "\"modelName\": \"STMTN5MMSC21-MMSC::model-1-0\"," +
- "\"modelVersion\": \"1\"," +
- "\"modelCustomizationUuid\": \"MODEL-123\"" + "}";
- variables.put("vfModuleModelInfo", vfModuleModelInfo);
-
- String vnfModelInfo = "{ "+ "\"modelType\": \"vnf\"," +
- "\"modelInvariantUuid\": \"introvert\"," +
- "\"modelUuid\": \"3.14\"," +
- "\"modelName\": \"VNF-STMTN5MMSC21-MMSC::model-1-0\"," +
- "\"modelVersion\": \"1\"," +
- "\"modelCustomizationUuid\": \"VNF-MODEL-123\"" + "}";
- variables.put("vnfModelInfo", vnfModelInfo);
-
- String serviceModelInfo = "{ "+ "\"modelType\": \"service\"," +
- "\"modelInvariantUuid\": \"aa5256d2-5a33-55df-13ab-12abad84e7ff\"," +
- "\"modelUuid\": \"bb6478e5-ea33-3346-ac12-ab121484a3fe\"," +
- "\"modelName\": \"SVC-STMTN5MMSC21-MMSC::model-1-0\"," +
- "\"modelVersion\": \"1\"," +
- "}";
- variables.put("serviceModelInfo", serviceModelInfo);
-
- invokeSubProcess("DoUpdateVfModule", businessKey, variables);
-
- injectSDNCCallbacks(callbacks, "changeassign, query");
- injectVNFRestCallbacks(callbacks, "vnfUpdate");
- injectSDNCCallbacks(callbacks, "activate");
-
- waitForProcessEnd(businessKey, 10000);
-
- Assert.assertTrue(isProcessEnded(businessKey));
- checkVariable(businessKey, "DoUpdateVfModuleSuccessIndicator", true);
-
- String heatStackId = (String) getVariableFromHistory(businessKey, "DOUPVfMod_heatStackId");
- System.out.println("Heat stack Id from AAI: " + heatStackId);
-
- logEnd();
- }
-
- // start of mocks used locally and by other VF Module unit tests
- public static void MockSDNCAdapterVfModule() {
- // simplified the implementation to return "success" for all requests
- stubFor(post(urlEqualTo("/SDNCAdapter"))
-// .withRequestBody(containing("SvcInstanceId><"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("VfModularity/StandardSDNCSynchResponse.xml")));
-// stubFor(post(urlEqualTo("/SDNCAdapter"))
-// .withRequestBody(containing("vnf-type>STMTN"))
-// .willReturn(aResponse()
-// .withStatus(200)
-// .withHeader("Content-Type", "text/xml")
-// .withBodyFile("VfModularity/StandardSDNCSynchResponse.xml")));
-// stubFor(post(urlEqualTo("/SDNCAdapter"))
-// .withRequestBody(containing("SvcAction>query"))
-// .willReturn(aResponse()
-// .withStatus(200)
-// .withHeader("Content-Type", "text/xml")
-// .withBodyFile("VfModularity/StandardSDNCSynchResponse.xml")));
- }
-
- public static void MockVNFAdapterRestVfModule() {
- stubFor(put(urlEqualTo("/vnfs/v1/vnfs/skask/vf-modules/supercool"))
- .willReturn(aResponse()
- .withStatus(202)
- .withHeader("Content-Type", "application/xml")));
- stubFor(post(urlMatching("/vnfs/v1/vnfs/.*/vf-modules"))
- .willReturn(aResponse()
- .withStatus(202)
- .withHeader("Content-Type", "application/xml")));
- stubFor(post(urlEqualTo("/vnfs/v1/vnfs/skask/vf-modules"))
- .willReturn(aResponse()
- .withStatus(202)
- .withHeader("Content-Type", "application/xml")));
- stubFor(put(urlEqualTo("/vnfs/v1/volume-groups/78987"))
- .willReturn(aResponse()
- .withStatus(202)
- .withHeader("Content-Type", "application/xml")));
- }
-}
-
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoUpdateVnfAndModulesTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoUpdateVnfAndModulesTest.java deleted file mode 100644 index 2a5a646fb2..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoUpdateVnfAndModulesTest.java +++ /dev/null @@ -1,226 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.bpmn.infrastructure;
-
-import static org.junit.Assert.assertEquals;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockAAIVfModule;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDBUpdateVfModule;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithDepth;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfById_404;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchGenericVnf;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchVfModuleId;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutGenericVnf;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockSDNCAdapterVfModule;
-import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
-import static org.openecomp.mso.bpmn.mock.StubResponseVNFAdapter.mockVNFPut;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockVNFAdapterRestVfModule;
-import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.camunda.bpm.engine.test.Deployment;
-import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.openecomp.mso.bpmn.common.BPMNUtil;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
-import org.openecomp.mso.bpmn.core.domain.ModelInfo;
-import org.openecomp.mso.bpmn.core.domain.ModuleResource;
-import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition;
-import org.openecomp.mso.bpmn.core.domain.VnfResource;
-import org.openecomp.mso.bpmn.mock.FileUtil;
-
-/**
- * Unit Test for the DoUpdateVnfAndModules Flow
- *
- */
-public class DoUpdateVnfAndModulesTest extends WorkflowTest {
-
- private final CallbackSet callbacks = new CallbackSet();
-
- public DoUpdateVnfAndModulesTest() throws IOException {
-
- callbacks.put("changeassign", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyChangeAssignCallback.xml"));
- callbacks.put("activate", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyActivateCallback.xml"));
- callbacks.put("query", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyQueryCallback.xml"));
- callbacks.put("vnfUpdate", FileUtil.readResourceFile(
- "__files/VfModularity/VNFAdapterRestUpdateCallback.xml"));
- }
-
- @Test
-
- @Deployment(resources = {
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/PrepareUpdateAAIVfModule.bpmn",
- "subprocess/DoUpdateVfModule.bpmn",
- "subprocess/DoUpdateVnfAndModules.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/ConfirmVolumeGroupTenant.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn"})
- public void testDoUpdateVnfAndModules_success() throws Exception{
-
- MockNodeQueryServiceInstanceById("MIS%2F1604%2F0026%2FSW_INTERNET", "GenericFlows/getSIUrlByIdVipr.xml");
- MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
- //MockGetGenericVnfById_404("testVnfId");
- MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
- MockPutGenericVnf(".*");
- MockAAIVfModule();
- MockPatchGenericVnf("skask");
- MockPatchVfModuleId("skask", ".*");
- mockSDNCAdapter("VfModularity/StandardSDNCSynchResponse.xml");
- mockVNFPut("skask", "/supercool", 202);
- mockVNFPut("skask", "/lukewarm", 202);
- MockVNFAdapterRestVfModule();
- MockDBUpdateVfModule();
-
- mockSDNCAdapter("VfModularity/StandardSDNCSynchResponse.xml");
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
-
- String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = new HashMap<>();
- setVariablesSuccess(variables, "", "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
- invokeSubProcess("DoUpdateVnfAndModules", businessKey, variables);
-
- injectSDNCCallbacks(callbacks, "changeassign, query");
- injectVNFRestCallbacks(callbacks, "vnfUpdate");
- injectSDNCCallbacks(callbacks, "activate");
- injectSDNCCallbacks(callbacks, "changeassign, query");
- injectVNFRestCallbacks(callbacks, "vnfUpdate");
- injectSDNCCallbacks(callbacks, "activate");
- waitForProcessEnd(businessKey, 10000);
-
- Assert.assertTrue(isProcessEnded(businessKey));
- assertVariables("2", "200", null);
-
- }
-
-
-
- private void assertVariables(String exModuleCount, String exVnfFound, String exWorkflowException) {
-
- String moduleCount = BPMNUtil.getVariable(processEngineRule, "DoUpdateVnfAndModules", "DUVAM_moduleCount");
- String vnfFound = BPMNUtil.getVariable(processEngineRule, "DoUpdateVnfAndModules", "DUVAM_queryAAIVfModuleResponseCode");
- String workflowException = BPMNUtil.getVariable(processEngineRule, "DoUpdateVnfAndModules", "SavedWorkflowException1");
-
- assertEquals(exModuleCount, moduleCount);
- assertEquals(exVnfFound, vnfFound);
- assertEquals(exWorkflowException, workflowException);
- }
-
- private void setVariables(Map<String, String> variables, String request, String requestId, String siId) {
- variables.put("isDebugLogEnabled", "true");
- variables.put("bpmnRequest", request);
- variables.put("msoRequestUdid", requestId);
- variables.put("serviceInstanceId",siId);
- variables.put("testVnfId","testVnfId123");
- variables.put("vnfType", "STMTN");
-
- }
-
- private void setVariablesSuccess(Map<String, Object> variables, String request, String requestId, String siId) {
- variables.put("isDebugLogEnabled", "true");
- variables.put("requestId", requestId);
- variables.put("msoRequestId", requestId);
- variables.put("serviceInstanceId",siId);
- variables.put("disableRollback", "true");
- //variables.put("testVnfId","testVnfId123");
- variables.put("vnfType", "STMTN");
- variables.put("vnfId", "skask");
- variables.put("tenantId", "fba1bd1e195a404cacb9ce17a9b2b421");
- variables.put("lcpCloudRegionId", "mdt1");
-
- String serviceModelInfo = "{ "+ "\"modelType\": \"service\"," +
- "\"modelInvariantUuid\": \"995256d2-5a33-55df-13ab-12abad84e7ff\"," +
- "\"modelUuid\": \"ab6478e5-ea33-3346-ac12-ab121484a3fe\"," +
- "\"modelName\": \"ServicevSAMP12\"," +
- "\"modelVersion\": \"1.0\"," +
- "}";
- variables.put("serviceModelInfo", serviceModelInfo);
- variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
- String vnfModelInfo = "{" + "\"modelType\": \"vnf\"," +
- "\"modelInvariantUuid\": \"ff5256d2-5a33-55df-13ab-12abad84e7ff\"," +
- "\"modelUuid\": \"fe6478e5-ea33-3346-ac12-ab121484a3fe\"," +
- "\"modelName\": \"vSAMP12\"," +
- "\"modelVersion\": \"1.0\"," +
- "\"modelCustomizationUuid\": \"MODEL-ID-1234\"" + "}";
- variables.put("vnfModelInfo", vnfModelInfo);
-
- String cloudConfiguration = "{" + "\"cloudConfiguration\": { " +
- "\"lcpCloudRegionId\": \"mdt1\"," +
- "\"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\"" + "}}";
- variables.put("cloudConfiguration", cloudConfiguration);
- variables.put("sdncVersion", "1702");
- variables.put("globalSubscriberId", "subscriber123");
- variables.put("asdcServiceModelVersion", "serviceVersion01");
-
- try {
- VnfResource vr = new VnfResource();
- ModelInfo mvr = new ModelInfo();
- mvr.setModelName("vSAMP12");
- mvr.setModelInstanceName("v123");
- mvr.setModelInvariantUuid("extrovert");
- mvr.setModelVersion("1.0");
- mvr.setModelCustomizationUuid("MODEL-ID-1234");
- vr.setModelInfo(mvr);
- vr.constructVnfType("vnf1");
- vr.setNfType("somenftype");
- vr.setNfRole("somenfrole");
- vr.setNfFunction("somenffunction");
- vr.setNfNamingCode("somenamingcode");
- ModuleResource mr = new ModuleResource();
- ModelInfo mvmr = new ModelInfo();
- mvmr.setModelInvariantUuid("introvert");
- mvmr.setModelName("STMTN5MMSC21-MMSC::model-1-0");
- mvmr.setModelVersion("1");
- mvmr.setModelCustomizationUuid("MODEL-123");
- mr.setModelInfo(mvmr);
- mr.setIsBase(true);
- mr.setVfModuleLabel("MODULELABEL");
- vr.addVfModule(mr);
- ModuleResource mr1 = new ModuleResource();
- ModelInfo mvmr1 = new ModelInfo();
- mvmr1.setModelInvariantUuid("extrovert");
- mvmr1.setModelName("SECONDMODELNAME");
- mvmr1.setModelVersion("1");
- mvmr1.setModelCustomizationUuid("MODEL-123");
- mr1.setModelInfo(mvmr1);
- mr1.setIsBase(false);
- mr1.setVfModuleLabel("MODULELABEL1");
- vr.addVfModule(mr1);
- variables.put("vnfResourceDecomposition", vr);
- variables.put("isTest", true);
- } catch(Exception e) {
-
- }
-
- }
-
-
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/ReplaceVnfInfraTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/ReplaceVnfInfraTest.java deleted file mode 100644 index 4161431297..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/ReplaceVnfInfraTest.java +++ /dev/null @@ -1,264 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.bpmn.infrastructure;
-
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
-import static com.github.tomakehurst.wiremock.client.WireMock.containing;
-import static com.github.tomakehurst.wiremock.client.WireMock.delete;
-import static com.github.tomakehurst.wiremock.client.WireMock.post;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
-import static org.openecomp.mso.bpmn.common.DeleteAAIVfModuleTest.MockAAIDeleteVfModule;
-import static org.openecomp.mso.bpmn.common.DeleteAAIVfModuleTest.MockAAIGenericVnfSearch;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockAAIVfModule;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDBUpdateVfModule;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteGenericVnf;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteVfModuleId;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfById;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetDefaultCloudRegionByCloudRegionId;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithDepth;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithPriority;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetPserverByVnfId;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfsByVnfId;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchGenericVnf;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchVfModuleId;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutGenericVnf;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutVfModuleIdNoResponse;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockVNFAdapterRestVfModule;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockSetInMaintFlagByVnfId;
-import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.MockGetServiceResourcesCatalogData;
-import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
-import static org.openecomp.mso.bpmn.mock.StubResponsePolicy.MockPolicyAbort;
-import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
-import static org.openecomp.mso.bpmn.mock.StubResponseVNFAdapter.mockVNFPut;
-import static org.openecomp.mso.bpmn.mock.StubResponsePolicy.MockPolicySkip;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.camunda.bpm.engine.test.Deployment;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse;
-import org.openecomp.mso.bpmn.mock.FileUtil;
-
-/**
- * Unit test cases for UpdateVnfInfra.bpmn
- */
-public class ReplaceVnfInfraTest extends WorkflowTest {
-
- private final CallbackSet callbacks = new CallbackSet();
- private static final String EOL = "\n";
- private final String vnfAdapterDeleteCallback =
- "<deleteVfModuleResponse>" + EOL +
- " <vnfId>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnfId>" + EOL +
- " <vfModuleId>973ed047-d251-4fb9-bf1a-65b8949e0a73</vfModuleId>" + EOL +
- " <vfModuleDeleted>true</vfModuleDeleted>" + EOL +
- " <messageId>{{MESSAGE-ID}}</messageId>" + EOL +
- "</deleteVfModuleResponse>" + EOL;
-
- public ReplaceVnfInfraTest() throws IOException {
- callbacks.put("deactivate", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyActivateCallback.xml"));
- callbacks.put("unassign", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyActivateCallback.xml"));
- callbacks.put("vnfDelete", vnfAdapterDeleteCallback);
- callbacks.put("changeassign", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyChangeAssignCallback.xml"));
- callbacks.put("activate", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyActivateCallback.xml"));
- callbacks.put("query", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyQueryCallback.xml"));
- callbacks.put("vnfUpdate", FileUtil.readResourceFile(
- "__files/VfModularity/VNFAdapterRestUpdateCallback.xml"));
- }
-
- /**
- * Sunny day scenario.
- *
- * @throws Exception
- */
- @Test
- @Ignore // 1802 merge
- @Deployment(resources = {
- "process/ReplaceVnfInfra.bpmn",
- "subprocess/RollbackVnf.bpmn",
- "subprocess/DoDeleteVfModule.bpmn",
- "subprocess/DoDeleteVnfAndModules.bpmn",
- "subprocess/DeleteAAIVfModule.bpmn",
- "subprocess/PrepareUpdateAAIVfModule.bpmn",
- "subprocess/ConfirmVolumeGroupTenant.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/DoDeleteVnfAndModules.bpmn",
- "subprocess/GenericDeleteVnf.bpmn",
- "subprocess/DoDeleteVnf.bpmn",
- "subprocess/DoDeleteVfModule.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn",
- "subprocess/GenericGetService.bpmn",
- "subprocess/GenericGetVnf.bpmn",
- "subprocess/GenericPutVnf.bpmn",
- "subprocess/DoCreateVnf.bpmn",
- "subprocess/GenerateVfModuleName.bpmn",
- "subprocess/DoCreateVfModule.bpmn",
- "subprocess/DoCreateVnfAndModules.bpmn",
- "subprocess/ConfirmVolumeGroupName.bpmn",
- "subprocess/CreateAAIVfModule.bpmn",
- "subprocess/CreateAAIVfModuleVolumeGroup.bpmn",
- "subprocess/CompleteMsoProcess.bpmn",
- "subprocess/FalloutHandler.bpmn",
- "subprocess/DoCreateVnfAndModulesRollback.bpmn",
- "subprocess/BuildingBlock/DecomposeService.bpmn",
- "subprocess/BuildingBlock/RainyDayHandler.bpmn",
- "subprocess/BuildingBlock/ManualHandling.bpmn",
- "subprocess/BuildingBlock/AppCClient.bpmn"
-
- })
- public void sunnyDay() throws Exception {
-
- logStart();
- MockAAIGenericVnfSearch();
- MockGetGenericVnfById("testVnfId123.*", "GenericFlows/getGenericVnfByNameResponse.xml");
- MockDeleteGenericVnf("testVnfId123", "testReVer123");
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
- mockSDNCAdapter(200);
- MockDoDeleteVfModule_SDNCSuccess();
- MockDoDeleteVfModule_DeleteVNFSuccess();
- MockAAIDeleteVfModule();
-
- MockNodeQueryServiceInstanceById("MIS%2F1604%2F0026%2FSW_INTERNET", "GenericFlows/getSIUrlByIdVipr.xml");
- MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
- //MockGetGenericVnfById_404("testVnfId");
- MockGetServiceResourcesCatalogData("995256d2-5a33-55df-13ab-12abad84e7ff", "1.0", "VIPR/getCatalogServiceResourcesDataForReplaceVnfInfra.json");
- MockGetServiceResourcesCatalogData("995256d2-5a33-55df-13ab-12abad84e7ff", "VIPR/getCatalogServiceResourcesDataForReplaceVnfInfra.json");
- //MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
- //MockPutGenericVnf(".*");
- MockGetDefaultCloudRegionByCloudRegionId("mdt1", "AAI/AAI_defaultCloudRegionByCloudRegionId.json", 200);
- MockAAIVfModule();
- MockPatchGenericVnf("a27ce5a9-29c4-4c22-a017-6615ac73c721");
- MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", ".*");
- mockSDNCAdapter("VfModularity/StandardSDNCSynchResponse.xml");
- mockVNFPut("skask", "/supercool", 202);
- mockVNFPut("skask", "/lukewarm", 202);
- MockVNFAdapterRestVfModule();
- MockDBUpdateVfModule();
- MockGetPserverByVnfId("skask", "AAI/AAI_pserverByVnfId.json", 200);
- MockGetGenericVnfsByVnfId("skask", "AAI/AAI_genericVnfsByVnfId.json", 200);
- MockSetInMaintFlagByVnfId("skask", "AAI/AAI_genericVnfsByVnfId.json", 200);
- MockPolicySkip();
-
- //mockSDNCAdapter("VfModularity/StandardSDNCSynchResponse.xml");
- //mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
-
- String businessKey = UUID.randomUUID().toString();
- String updaetVnfRequest =
- FileUtil.readResourceFile("__files/InfrastructureFlows/ReplaceVnf_VID_request.json");
-
- Map<String, Object> variables = setupVariablesSunnyDayVID();
-
-
- TestAsyncResponse asyncResponse = invokeAsyncProcess("ReplaceVnfInfra",
- "v1", businessKey, updaetVnfRequest, variables);
-
- WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
-
- String responseBody = response.getContent();
- System.out.println("Workflow (Synch) Response:\n" + responseBody);
-
- //injectSDNCCallbacks(callbacks, "deactivate");
- //injectSDNCCallbacks(callbacks, "deactivate");
- injectVNFRestCallbacks(callbacks, "vnfDelete");
- //injectSDNCCallbacks(callbacks, "unassign");
- MockGetGenericVnfById("a27ce5a9-29c4-4c22-a017-6615ac73c721", "GenericFlows/getGenericVnfByNameResponse.xml");
- injectSDNCCallbacks(callbacks, "unassign");
-
-
- injectSDNCCallbacks(callbacks, "changeassign, query");
- injectVNFRestCallbacks(callbacks, "vnfUpdate");
- injectSDNCCallbacks(callbacks, "activate");
- injectSDNCCallbacks(callbacks, "changeassign, query");
- injectVNFRestCallbacks(callbacks, "vnfUpdate");
- injectSDNCCallbacks(callbacks, "activate");
-
- // TODO add appropriate assertions
-
- waitForProcessEnd(businessKey, 10000);
- checkVariable(businessKey, "ReplaceVfModuleInfraSuccessIndicator", true);
-
- logEnd();
- }
-
- // Active Scenario
- private Map<String, Object> setupVariablesSunnyDayVID() {
- Map<String, Object> variables = new HashMap<>();
- //try {
- // variables.put("bpmnRequest", FileUtil.readResourceFile("__files/CreateVfModule_VID_request.json"));
- //}
- //catch (Exception e) {
-
- //}
- //variables.put("mso-request-id", "testRequestId");
- variables.put("requestId", "testRequestId");
- variables.put("isDebugLogEnabled", "true");
- variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
- variables.put("vnfId", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
- variables.put("vnfType", "vSAMP12");
- variables.put("serviceType", "MOG");
-
- return variables;
-
- }
-
- public static void MockDoDeleteVfModule_SDNCSuccess() {
- stubFor(post(urlEqualTo("/SDNCAdapter"))
- .withRequestBody(containing("SvcAction>deactivate"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("DeleteGenericVNFV1/sdncAdapterResponse.xml")));
- stubFor(post(urlEqualTo("/SDNCAdapter"))
- .withRequestBody(containing("SvcAction>unassign"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("DeleteGenericVNFV1/sdncAdapterResponse.xml")));
- }
-
-
- public static void MockDoDeleteVfModule_DeleteVNFSuccess() {
- stubFor(delete(urlMatching("/vnfs/v1/vnfs/.*/vf-modules/.*"))
- .willReturn(aResponse()
- .withStatus(202)
- .withHeader("Content-Type", "application/xml")));
- stubFor(delete(urlMatching("/vnfs/v1/volume-groups/78987"))
- .willReturn(aResponse()
- .withStatus(202)
- .withHeader("Content-Type", "application/xml")));
- }
-
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/RollbackVnfTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/RollbackVnfTest.java deleted file mode 100644 index 598e783c52..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/RollbackVnfTest.java +++ /dev/null @@ -1,134 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.get; -import static com.github.tomakehurst.wiremock.client.WireMock.put; -import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; -import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching; -import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockAAIVfModule; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDBUpdateVfModule; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithDepth; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithPriority; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetPserverByVnfId; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfsByVnfId; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockSetInMaintFlagByVnfId; -import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.MockGetServiceResourcesCatalogData; -import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB; -import static org.openecomp.mso.bpmn.mock.StubResponsePolicy.MockPolicySkip; -import static org.openecomp.mso.bpmn.mock.StubResponseAPPC.MockAppcError; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import org.camunda.bpm.engine.test.Deployment; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; -import org.openecomp.mso.bpmn.common.WorkflowTest; -import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse; -import org.openecomp.mso.bpmn.mock.FileUtil; -import org.openecomp.mso.client.aai.AAIObjectType; -import org.openecomp.mso.client.aai.entities.uri.AAIResourceUri; -import org.openecomp.mso.client.aai.entities.uri.AAIUriFactory; - -/** - * Unit test cases for RollbackVnf.bpmn - */ -public class RollbackVnfTest extends WorkflowTest { - - public RollbackVnfTest() throws IOException { - - } - - /** - * Sunny day scenario. - * - * @throws Exception - */ - @Test - - - @Deployment(resources = { - "subprocess/RollbackVnf.bpmn", - "subprocess/BuildingBlock/AppCClient.bpmn" - - }) - public void sunnyDay() throws Exception { - - //logStart(); - System.setProperty("mso.config.path", "src/test/resources"); - AAIResourceUri path = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, "skask"); - wireMockRule.stubFor(get( - urlPathEqualTo("/aai/v11" + path.build())) - .willReturn( - aResponse() - .withHeader("Content-Type", "application/json") - .withBodyFile("AAI/mockObject.json") - .withStatus(200))); - - - MockNodeQueryServiceInstanceById("MIS%2F1604%2F0026%2FSW_INTERNET", "GenericFlows/getSIUrlByIdVipr.xml"); - MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml"); - MockAAIVfModule(); - MockGetGenericVnfsByVnfId("skask", "AAI/AAI_genericVnfsByVnfId.json", 200); - MockSetInMaintFlagByVnfId("skask", "AAI/AAI_genericVnfsByVnfId.json", 200); - MockAppcError(); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = setupVariablesSunnyDayVID(); - - invokeSubProcess("RollbackVnf", businessKey, variables); - - // TODO add appropriate assertions - - waitForProcessEnd(businessKey, 10000); - Assert.assertTrue(isProcessEnded(businessKey)); - // assertVariables("true", "true", "false", "true", "Success", null); - - //logEnd(); - } - - // Active Scenario - private Map<String, Object> setupVariablesSunnyDayVID() { - Map<String, Object> variables = new HashMap<String, Object>(); - - variables.put("msoRequestId", "testRequestId"); - variables.put("isDebugLogEnabled", "true"); - variables.put("vnfId", "skask"); - variables.put("rollbackVnfStop", true); - variables.put("rollbackVnfLock", true); - variables.put("rollbackQuiesceTraffic", false); - variables.put("rollbackSetClosedLoopDisabledFlag", true); - variables.put("rollbackSetVnfInMaintenanceFlag", true); - variables.put("errorCode", "1005"); - - return variables; - - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/SetupServiceDecompTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/SetupServiceDecompTest.java deleted file mode 100644 index 264bf6e2be..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/SetupServiceDecompTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.bpmn.infrastructure;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.camunda.bpm.engine.test.Deployment;
-import org.junit.Test;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
-import org.openecomp.mso.bpmn.mock.FileUtil;
-
-public class SetupServiceDecompTest extends WorkflowTest {
-
- private String input = FileUtil.readResourceFile("__files/CreateServiceInstance/SetupServiceDecompJson.json");
-
- public SetupServiceDecompTest() throws IOException {
- }
-
- @Test
- @Deployment(resources = {
- "subprocess/CreateServiceInstanceV3.bpmn",
- "subprocess/CreateServiceInstanceV3Rollback.bpmn",
- "subprocess/SetRefactorServiceDecomp.bpmn"
- })
- public void sunnyDay() throws Exception {
-
- logStart();
-
- String businessKey = UUID.randomUUID().toString();
-
- Map<String, Object> variables = new HashMap<String, Object>();
- setupVariables(variables);
- invokeSubProcess("SetRefactorServiceDecomp", businessKey, variables);
- waitForProcessEnd(businessKey, 10000);
- logEnd();
- }
-
- // Success Scenario
- private void setupVariables(Map<String, Object> variables) {
- variables.put("bpmnRequest", input);
- variables.put("msoRequestId", "RaaDSITestRequestId-1");
- variables.put("isDebugLogEnabled", "true");
- }
-}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/StubResponseAAITest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/StubResponseAAITest.java deleted file mode 100644 index 8f16ed3b1e..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/StubResponseAAITest.java +++ /dev/null @@ -1,168 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 Huawei Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-
-package org.openecomp.mso.bpmn.infrastructure;
-
-import org.junit.Test;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
-import org.openecomp.mso.bpmn.mock.StubResponseAAI;
-
-public class StubResponseAAITest extends WorkflowTest{
-
- @Test
- public void testStubResponseAAIforNullAndDefaultInputs()
- {
- try{
- StubResponseAAI.MockPutTunnelXConnect(null, null, null, null, null);
- StubResponseAAI.MockGetAllottedResource(null, null, null, null, null);
- StubResponseAAI.MockPutAllottedResource(null, null, null, null);
- StubResponseAAI.MockPutAllottedResource_500(null, null, null, null);
- StubResponseAAI.MockDeleteAllottedResource(null, null, null, null, null);
- StubResponseAAI.MockPatchAllottedResource(null, null, null, null);
- StubResponseAAI.MockQueryAllottedResourceById(null, null);
- StubResponseAAI.MockGetServiceInstance(null, null, null, null);
- StubResponseAAI.MockGetServiceInstance_404(null, null, null);
- StubResponseAAI.MockGetServiceInstance_500(null, null, null);
- StubResponseAAI.MockGetServiceInstance_500(null, null, null, null);
- StubResponseAAI.MockNodeQueryServiceInstanceByName(null, null);
- StubResponseAAI.MockNodeQueryServiceInstanceByName_404(null);
- StubResponseAAI.MockNodeQueryServiceInstanceByName_500(null);
- StubResponseAAI.MockNodeQueryServiceInstanceById(null, null);
- StubResponseAAI.MockNodeQueryServiceInstanceById_404(null);
- StubResponseAAI.MockNodeQueryServiceInstanceById_500(null);
- StubResponseAAI.MockDeleteServiceInstance(null, null, null, null);
- StubResponseAAI.MockGetServiceInstance(null, null, null, null, 0);
- StubResponseAAI.MockGetServiceInstance(null, null, null, 0);
- StubResponseAAI.MockDeleteServiceInstance(null, null, null, null, 0);
- StubResponseAAI.MockDeleteServiceInstance(null, null, null, 0);
- StubResponseAAI.MockDeleteServiceInstance_404(null, null, null, null);
- StubResponseAAI.MockDeleteServiceInstance_500(null, null, null, null);
- StubResponseAAI.MockPutServiceInstance(null, null, null, null);
- StubResponseAAI.MockPutServiceInstance_500(null, null, null);
- StubResponseAAI.MockGetServiceSubscription(null, null, null);
- StubResponseAAI.MockDeleteServiceSubscription(null, null, 0);
- StubResponseAAI.MockDeleteServiceInstanceId(null, null, null);
- StubResponseAAI.MockPutServiceSubscription(null, null);
- StubResponseAAI.MockGetServiceSubscription(null, null, 0);
- StubResponseAAI.MockGetCustomer(null, null);
- StubResponseAAI.MockDeleteCustomer(null);
- StubResponseAAI.MockPutCustomer(null);
- StubResponseAAI.MockPutCustomer_500(null);
- StubResponseAAI.MockGetGenericVnfById(null, null);
- StubResponseAAI.MockGetGenericVnfById(null, null, 0);
- StubResponseAAI.MockGetGenericVnfByIdWithPriority(null, 0, null);
- StubResponseAAI.MockGetGenericVnfByIdWithPriority(null, null, 0, null, 0);
- StubResponseAAI.MockGetGenericVnfByIdWithDepth(null, 0, null);
- StubResponseAAI.MockGetGenericVnfById_404(null);
- StubResponseAAI.MockGetGenericVnfById_500(null);
- StubResponseAAI.MockGetGenericVnfByName(null, null);
- StubResponseAAI.MockGetGenericVnfByNameWithDepth(null, 0, null);
- StubResponseAAI.MockGetGenericVnfByName_404(null);
- StubResponseAAI.MockDeleteGenericVnf(null, null);
- StubResponseAAI.MockDeleteGenericVnf(null, null, 0);
- StubResponseAAI.MockDeleteGenericVnf_500(null, null);
- StubResponseAAI.MockPutGenericVnf(null);
- StubResponseAAI.MockPutGenericVnf(null, null, 0);
- StubResponseAAI.MockPutGenericVnf(null, 0);
- StubResponseAAI.MockPutGenericVnf_Bad(null, 0);
- StubResponseAAI.MockPatchGenericVnf(null);
- StubResponseAAI.MockGetVceById(null, null);
- StubResponseAAI.MockGetVceByName(null, null);
- StubResponseAAI.MockDeleteVce(null, null, 0);
- StubResponseAAI.MockPutVce(null);
- StubResponseAAI.MockGetGenericVceByNameWithDepth(null, 0, null);
- StubResponseAAI.MockGetVceGenericQuery(null, 0, 0, null);
- StubResponseAAI.MockGetTenantGenericQuery(null, null, null);
- StubResponseAAI.MockGetTenant(null, null);
- StubResponseAAI.MockGetNetwork(null, null, 0);
- StubResponseAAI.MockGetNetworkByIdWithDepth(null, null, null);
- StubResponseAAI.MockGetNetworkCloudRegion(null, null);
- StubResponseAAI.MockGetNetworkByName(null, null);
- StubResponseAAI.MockGetNetworkByName_404(null, null);
- StubResponseAAI.MockGetNetworkCloudRegion_404(null);
- StubResponseAAI.MockPutNetwork(null, 0, null);
- StubResponseAAI.MockPutNetwork(null, null, 0);
- StubResponseAAI.MockGetNetworkName(null, null, 0);
- StubResponseAAI.MockGetNetworkVpnBinding(null, null);
- StubResponseAAI.MockGetNetworkPolicy(null, null);
- StubResponseAAI.MockGetNetworkVpnBinding(null, null, 0);
- StubResponseAAI.MockGetNetworkPolicy(null, null, 0);
- StubResponseAAI.MockGetNetworkTableReference(null, null);
- StubResponseAAI.MockPutNetworkIdWithDepth(null, null, null);
- StubResponseAAI.MockGetNetworkPolicyfqdn(null, null, 0);
- StubResponseAAI.MockGetNetworkRouteTable(null, null, 0);
- StubResponseAAI.MockPatchVfModuleId(null, null);
- StubResponseAAI.MockVNFAdapterRestVfModule();
- StubResponseAAI.MockDBUpdateVfModule();
- StubResponseAAI.MockSDNCAdapterVfModule();
- StubResponseAAI.MockAAIVfModule();
- StubResponseAAI.MockGetCloudRegion(null, 0, null);
- StubResponseAAI.MockGetVolumeGroupById(null, null, null);
- StubResponseAAI.MockPutVolumeGroupById(null, null, null, 0);
- StubResponseAAI.MockGetVolumeGroupByName(null, null, null, 0);
- StubResponseAAI.MockDeleteVolumeGroupById(null, null, null, 0);
- StubResponseAAI.MockGetVolumeGroupByName_404(null, null);
- StubResponseAAI.MockDeleteVolumeGroup(null, null, null);
- StubResponseAAI.MockGetVfModuleId(null, null, null, 0);
- StubResponseAAI.MockGetVfModuleByNameWithDepth(null, null, 0, null, 0);
- StubResponseAAI.MockGetVfModuleIdNoResponse(null, null, null);
- StubResponseAAI.MockPutVfModuleIdNoResponse(null, null, null);
- StubResponseAAI.MockPutVfModuleId(null, null);
- StubResponseAAI.MockPutVfModuleId(null, null, 0);
- StubResponseAAI.MockDeleteVfModuleId(null, null, null, 0);
- StubResponseAAI.MockAAIVfModuleBadPatch(null, 0);
- StubResponseAAI.MockGetPserverByVnfId(null, null, 0);
- StubResponseAAI.MockGetGenericVnfsByVnfId(null, null, 0);
- StubResponseAAI.MockSetInMaintFlagByVnfId(null, 0);
- StubResponseAAI.MockGetVceById();
- StubResponseAAI.MockGetVceByName();
- StubResponseAAI.MockPutVce();
- StubResponseAAI.MockDeleteVce();
- StubResponseAAI.MockDeleteVce_404();
- StubResponseAAI.MockDeleteServiceSubscription();
- StubResponseAAI.MockGetServiceSubscription();
- StubResponseAAI.MockGetServiceSubscription_200Empty();
- StubResponseAAI.MockGetServiceSubscription_404();
- StubResponseAAI.MockGENPSIPutServiceInstance();
- StubResponseAAI.MockGENPSIPutServiceSubscription();
- StubResponseAAI.MockGENPSIPutServiceInstance_get500();
- StubResponseAAI.MockGetGenericVnfById();
- StubResponseAAI.MockGetGenericVnfById_404();
- StubResponseAAI.MockGetGenericVnfByName();
- StubResponseAAI.MockGetGenericVnfByName_hasRelationships();
- StubResponseAAI.MockGetGenericVnfById_hasRelationships();
- StubResponseAAI.MockGetGenericVnfById_500();
- StubResponseAAI.MockGetGenericVnfByName_404();
- StubResponseAAI.MockPutGenericVnf();
- StubResponseAAI.MockPutGenericVnf_400();
- StubResponseAAI.MockDeleteGenericVnf();
- StubResponseAAI.MockDeleteGenericVnf_404();
- StubResponseAAI.MockDeleteGenericVnf_500();
- StubResponseAAI.MockDeleteGenericVnf_412();
- }
- catch(Exception ex)
- {
-
- System.err.println(ex);
- }
-
- }
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateNetworkInstanceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateNetworkInstanceTest.java deleted file mode 100644 index 80a4518599..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateNetworkInstanceTest.java +++ /dev/null @@ -1,489 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure; - -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.*; -import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.MockUpdateRequestDB; -import static org.openecomp.mso.bpmn.mock.StubResponseNetworkAdapter.MockNetworkAdapterRestPut; -import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapterTopology; -import static org.openecomp.mso.bpmn.common.BPMNUtil.executeAsyncWorkflow; -import static org.openecomp.mso.bpmn.common.BPMNUtil.getVariable; -import static org.junit.Assert.assertEquals; - -import java.util.HashMap; -import java.util.Map; - -import org.camunda.bpm.engine.test.Deployment; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Rule; -import org.junit.Test; - -import org.openecomp.mso.bpmn.common.BPMNUtil; -import org.openecomp.mso.bpmn.common.WorkflowTest; -import org.openecomp.mso.bpmn.common.WorkflowTestTransformer; -import org.openecomp.mso.bpmn.common.SDNCAdapterCallbackRule; -import org.openecomp.mso.bpmn.mock.SDNCAdapterNetworkTopologyMockTransformer; - -import com.github.tomakehurst.wiremock.extension.ResponseTransformer; - -/** - * Unit test cases for DoUpdateNetworkInstance.bpmn - * - */ -public class UpdateNetworkInstanceTest extends WorkflowTest { - @WorkflowTestTransformer - public static final ResponseTransformer sdncAdapterMockTransformer = - new SDNCAdapterNetworkTopologyMockTransformer(); - - @Rule - public final SDNCAdapterCallbackRule sdncAdapterCallbackRule = - new SDNCAdapterCallbackRule(processEngineRule); - - /** - * End-to-End flow - Unit test for DoUpdateNetworkInstance.bpmn - * - String input & String response - */ - - @Test - @Ignore // 1802 merge - @Deployment(resources = {"process/UpdateNetworkInstance.bpmn", - "subprocess/DoUpdateNetworkInstance.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/SDNCAdapterV1.bpmn"}) - - public void shouldInvokeServiceUpdateNetworkInstance_SuccessVID1() throws Exception { - - System.out.println("----------------------------------------------------------"); - System.out.println(" Success1 - UpdateNetworkInstance flow Started! "); - System.out.println("----------------------------------------------------------"); - - // setup simulators - mockSDNCAdapterTopology("UpdateNetworkV2mock/sdncUpdateNetworkTopologySimResponse.xml", "SvcAction>changeassign"); - MockNetworkAdapterRestPut("UpdateNetworkV2/updateNetworkResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4"); - MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP"); - MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "UpdateNetworkV2/updateNetwork_queryNetworkId_AAIResponse_Success.xml", "all"); - MockPutNetworkIdWithDepth("UpdateNetworkV2/updateNetwork_updateContrail_AAIResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "all"); - MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017"); - MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6"); - MockGetNetworkPolicy("UpdateNetworkV2/updateNetwork_queryNetworkPolicy_AAIResponse_Success.xml", "cee6d136-e378-4678-a024-2cd15f0ee0cg"); - MockGetNetworkTableReference("UpdateNetworkV2/updateNetwork_queryNetworkTableRef1_AAIResponse_Success.xml", "refFQDN1"); - MockGetNetworkTableReference("UpdateNetworkV2/updateNetwork_queryNetworkTableRef2_AAIResponse_Success.xml", "refFQDN2"); - MockUpdateRequestDB("DBUpdateResponse.xml"); - //MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "UpdateNetworkV2/updateNetwork_queryInstance_Success.xml", "v8"); - MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "UpdateNetworkV2/updateNetwork_queryInstance_Success.xml"); - - Map<String, String> variables = setupVariablesVID1(); - //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "UpdateNetworkInstance", variables); - executeAsyncWorkflow(processEngineRule, "UpdateNetworkInstance", variables); - System.out.println("----------------------------------------------------------"); - System.out.println("- got workflow response -"); - System.out.println("----------------------------------------------------------"); - //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); - - assertEquals("true", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_Success")); - Assert.assertNotNull("UPDNI_CompleteMsoProcessRequest - ", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_CompleteMsoProcessRequest")); - - String workflowResp = BPMNUtil.getVariable(processEngineRule, "UpdateNetworkInstance", "WorkflowResponse"); - Assert.assertNotNull(workflowResp); - - System.out.println("----------------------------------------------------------"); - System.out.println(" Success1 - UpdateNetworkInstance flow Completed "); - System.out.println("----------------------------------------------------------"); - - } - - @Test - @Ignore // 1802 merge - @Deployment(resources = {"process/UpdateNetworkInstance.bpmn", - "subprocess/DoUpdateNetworkInstance.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/SDNCAdapterV1.bpmn"}) - - public void shouldInvokeServiceUpdateNetworkInstance_SuccessVIPER1() throws Exception { - - System.out.println("----------------------------------------------------------"); - System.out.println(" Success2 - UpdateNetworkInstance flow Started! "); - System.out.println("----------------------------------------------------------"); - - // setup simulators - mockSDNCAdapterTopology("UpdateNetworkV2mock/sdncUpdateNetworkTopologySimResponse.xml", "SvcAction>changeassign"); - MockNetworkAdapterRestPut("UpdateNetworkV2/updateNetworkResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4"); - MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP"); - MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "UpdateNetworkV2/updateNetwork_queryNetworkId_AAIResponse_Success.xml", "all"); - MockPutNetworkIdWithDepth("UpdateNetworkV2/updateNetwork_updateContrail_AAIResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "all"); - MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017"); - MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6"); - MockGetNetworkPolicy("UpdateNetworkV2/updateNetwork_queryNetworkPolicy_AAIResponse_Success.xml", "cee6d136-e378-4678-a024-2cd15f0ee0cg"); - MockGetNetworkTableReference("UpdateNetworkV2/updateNetwork_queryNetworkTableRef1_AAIResponse_Success.xml", "refFQDN1"); - MockGetNetworkTableReference("UpdateNetworkV2/updateNetwork_queryNetworkTableRef2_AAIResponse_Success.xml", "refFQDN2"); - MockUpdateRequestDB("DBUpdateResponse.xml"); - //MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "UpdateNetworkV2/updateNetwork_queryInstance_Success.xml", "v8"); - MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "UpdateNetworkV2/updateNetwork_queryInstance_Success.xml"); - - Map<String, String> variables = setupVariablesVIPER1(); - //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "UpdateNetworkInstance", variables); - executeAsyncWorkflow(processEngineRule, "UpdateNetworkInstance", variables); - //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); - - assertEquals("true", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_Success")); - Assert.assertNotNull("UPDNI_CompleteMsoProcessRequest - ", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_CompleteMsoProcessRequest")); - - String completeMsoProcessRequest = - "<aetgt:MsoCompletionRequest xmlns:aetgt=\"http://org.openecomp/mso/workflow/schema/v1\"" + '\n' - + " xmlns:ns=\"http://org.openecomp/mso/request/types/v1\"" + '\n' - + " xmlns=\"http://org.openecomp/mso/infra/vnf-request/v1\">" + '\n' - + " <request-info>" + '\n' - + " <request-id>testRequestId</request-id>" + '\n' - + " <action>UPDATE</action>" + '\n' - + " <source>VID</source>" + '\n' - + " </request-info>" + '\n' - + " <aetgt:status-message>Network has been updated successfully.</aetgt:status-message>" + '\n' - + " <aetgt:mso-bpel-name>BPMN Network action: UPDATE</aetgt:mso-bpel-name>" + '\n' - + "</aetgt:MsoCompletionRequest>"; - - Assert.assertEquals(completeMsoProcessRequest, getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_CompleteMsoProcessRequest")); - - System.out.println("----------------------------------------------------------"); - System.out.println(" Success2 - UpdateNetworkInstance flow Completed "); - System.out.println("----------------------------------------------------------"); - - } - - - @Test - //@Ignore - @Deployment(resources = {"process/UpdateNetworkInstance.bpmn", - "subprocess/DoUpdateNetworkInstance.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/SDNCAdapterV1.bpmn"}) - - public void shouldInvokeServiceUpdateNetworkInstance_MissingNetworkId() throws Exception { - - System.out.println("--------------------------------------------------------------------"); - System.out.println(" Missing networkId - UpdateNetworkInstance flow Started! "); - System.out.println("--------------------------------------------------------------------"); - - // setup simulators - MockUpdateRequestDB("DBUpdateResponse.xml"); - //MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "UpdateNetworkV2/updateNetwork_queryInstance_Success.xml", "v8"); - MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "UpdateNetworkV2/updateNetwork_queryInstance_Success.xml"); - - Map<String, String> variables = setupVariablesMissingNetworkId(); - //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "UpdateNetworkInstance", variables); - executeAsyncWorkflow(processEngineRule, "UpdateNetworkInstance", variables); - //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); - - assertEquals("false", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_Success")); - Assert.assertNotNull("UPDNI_FalloutHandlerRequest - ", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_FalloutHandlerRequest")); - - String falloutHandlerActual = getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_FalloutHandlerRequest"); - String falloutHandlerExpected = -"<aetgt:FalloutHandlerRequest xmlns:aetgt=\"http://org.openecomp/mso/workflow/schema/v1\"" + "\n" + -" xmlns:ns=\"http://org.openecomp/mso/request/types/v1\"" + "\n" + -" xmlns:wfsch=\"http://org.openecomp/mso/workflow/schema/v1\">" + "\n" + -" <request-info xmlns=\"http://org.openecomp/mso/infra/vnf-request/v1\">" + "\n" + -" <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id>" + "\n" + -" <action>UPDATE</action>" + "\n" + -" <source>VID</source>" + "\n" + -" </request-info>" + "\n" + -" <aetgt:WorkflowException xmlns:aetgt=\"http://org.openecomp/mso/workflow/schema/v1\">" + "\n" + -" <aetgt:ErrorMessage>Variable 'network-id' value/element is missing.</aetgt:ErrorMessage>" + "\n" + -" <aetgt:ErrorCode>7000</aetgt:ErrorCode>" + "\n" + -" </aetgt:WorkflowException>" + "\n" + -" </aetgt:FalloutHandlerRequest>"; - - assertEquals("Response", falloutHandlerExpected, falloutHandlerActual); - - System.out.println("------------------------------------------------------------------"); - System.out.println(" Missing networkId - UpdateNetworkInstance flow Completed "); - System.out.println("------------------------------------------------------------------"); - - } - - - @Test - //@Ignore - @Deployment(resources = {"process/UpdateNetworkInstance.bpmn", - "subprocess/DoUpdateNetworkInstance.bpmn", - "subprocess/DoUpdateNetworkInstanceRollback.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/SDNCAdapterV1.bpmn"}) - - public void shouldInvokeServiceUpdateNetworkInstance_Network_SDNC_Rollback() throws Exception { - - System.out.println("---------------------------------------------------------------"); - System.out.println(" Network and SDNC Rollback - UpdateNetworkInstance flow Started! "); - System.out.println("---------------------------------------------------------------"); - - // setup simulators - mockSDNCAdapterTopology("UpdateNetworkV2mock/sdncUpdateNetworkTopologySimResponse.xml", "SvcAction>changeassign"); - mockSDNCAdapterTopology("UpdateNetworkV2mock/sdncUpdateNetworkTopologySimResponse.xml", "SvcAction>rollback"); - MockNetworkAdapterRestPut("UpdateNetworkV2/updateNetworkResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4"); - MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP"); - MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "UpdateNetworkV2/updateNetwork_queryNetworkId_AAIResponse_Success.xml", "1"); - MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017"); - MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6"); - MockGetNetworkPolicy("UpdateNetworkV2/updateNetwork_queryNetworkPolicy_AAIResponse_Success.xml", "cee6d136-e378-4678-a024-2cd15f0ee0cg"); - MockGetNetworkTableReference("UpdateNetworkV2/updateNetwork_queryNetworkTableRef1_AAIResponse_Success.xml", "refFQDN1"); - MockGetNetworkTableReference("UpdateNetworkV2/updateNetwork_queryNetworkTableRef2_AAIResponse_Success.xml", "refFQDN2"); - MockUpdateRequestDB("DBUpdateResponse.xml"); - //MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "UpdateNetworkV2/updateNetwork_queryInstance_Success.xml", "v8"); - MockNodeQueryServiceInstanceById("f70e927b-6087-4974-9ef8-c5e4d5847ca4", "UpdateNetworkV2/updateNetwork_queryInstance_Success.xml"); - - Map<String, String> variables = setupVariablesVID1(); - //WorkflowResponse workflowResponse = executeAsyncWorkflow(processEngineRule, "UpdateNetworkInstance", variables); - executeAsyncWorkflow(processEngineRule, "UpdateNetworkInstance", variables); - //waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceId()); - - assertEquals("false", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_Success")); - Assert.assertNotNull("UPDNI_FalloutHandlerRequest - ", getVariable(processEngineRule, "UpdateNetworkInstance", "UPDNI_FalloutHandlerRequest")); - - System.out.println("---------------------------------------------------------------------"); - System.out.println(" Network and SCNC Rollback - UpdateNetworkInstance flow Completed "); - System.out.println("---------------------------------------------------------------------"); - - } - - // ***************** - // Utility Section - // ***************** - - String networkModelInfo = - " {\"modelUuid\": \"mod-inst-uuid-123\", " + '\n' + - " \"modelName\": \"mod_inst_z_123\", " + '\n' + - " \"modelVersion\": \"1.0\", " + '\n' + - " \"modelCustomizationUuid\": \"mod-inst-uuid-123\", " + '\n' + - " \"modelInvariantUuid\": \"mod-invar-uuid-123\" " + '\n' + - " }"; - - String serviceModelInfo = - " {\"modelUuid\": \"36a3a8ea-49a6-4ac8-b06c-89a54544b9b6\", " + '\n' + - " \"modelName\": \"HNGW Protected OAM\", " + '\n' + - " \"modelVersion\": \"1.0\", " + '\n' + - " \"modelInvariantUuid\": \"fcc85cb0-ad74-45d7-a5a1-17c8744fdb71\" " + '\n' + - " }"; - - // Success Scenario - private Map<String, String> setupVariablesVID1() { - Map<String, String> variables = new HashMap<>(); - variables.put("bpmnRequest", getCreateNetworkRequest1()); - variables.put("mso-request-id", "testRequestId"); - variables.put("requestId", "testRequestId"); - variables.put("isBaseVfModule", "true"); - variables.put("recipeTimeout", "0"); - variables.put("requestAction", "UPDATE"); - variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4"); - variables.put("vnfId", ""); - variables.put("vfModuleId", ""); - variables.put("volumeGroupId", ""); - variables.put("networkId", "49c86598-f766-46f8-84f8-8d1c1b10f9b4"); - variables.put("serviceType", "vMOG"); - variables.put("vfModuleType", ""); - variables.put("networkType", "modelName"); - return variables; - - } - - public String getCreateNetworkRequest1() { - - String request = - "{ \"requestDetails\": { " + '\n' + - " \"modelInfo\": { " + '\n' + - " \"modelType\": \"modelType\", " + '\n' + - " \"modelCustomizationId\": \"f21df226-8093-48c3-be7e-0408fcda0422\", " + '\n' + - " \"modelName\": \"CONTRAIL_EXTERNAL\", " + '\n' + - " \"modelVersion\": \"1.0\" " + '\n' + - " }, " + '\n' + - " \"cloudConfiguration\": { " + '\n' + - " \"lcpCloudRegionId\": \"RDM2WAGPLCP\", " + '\n' + - " \"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\" " + '\n' + - " }, " + '\n' + - " \"requestInfo\": { " + '\n' + - " \"instanceName\": \"MNS-25180-L-01-dmz_direct_net_1\", " + '\n' + - " \"source\": \"VID\", " + '\n' + - " \"callbackUrl\": \"\", " + '\n' + - " \"suppressRollback\": \"false\" ," + '\n' + - " \"productFamilyId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\" " + '\n' + - " }, " + '\n' + - " \"requestParameters\": { " + '\n' + - " \"backoutOnFailure\": true, " + '\n' + - " \"serviceId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\", " + '\n' + - " \"userParams\": [] " + '\n' + - " } " + '\n' + - " } " + '\n' + - "}"; - - return request; - } - - public String getCreateNetworkRequest2() { - - String request = - "{ \"requestDetails\": { " + '\n' + - " \"modelInfo\": { " + '\n' + - " \"modelType\": \"modelType\", " + '\n' + - " \"modelId\": \"modelId\", " + '\n' + - " \"modelNameVersionId\": \"modelNameVersionId\", " + '\n' + - " \"modelName\": \"CONTRAIL_EXTERNAL\", " + '\n' + - " \"modelVersion\": \"1\" " + '\n' + - " }, " + '\n' + - " \"cloudConfiguration\": { " + '\n' + - " \"lcpCloudRegionId\": \"RDM2WAGPLCP\", " + '\n' + - " \"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\" " + '\n' + - " }, " + '\n' + - " \"requestInfo\": { " + '\n' + - " \"instanceName\": \"myOwn_Network\", " + '\n' + - " \"source\": \"VID\", " + '\n' + - " \"callbackUrl\": \"\", " + '\n' + - " \"suppressRollback\": \"true\" ," + '\n' + - " \"productFamilyId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\" " + '\n' + - " }, " + '\n' + - " \"requestParameters\": { " + '\n' + - " \"backoutOnFailure\": true, " + '\n' + - " \"serviceId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\", " + '\n' + - " \"userParams\": [] " + '\n' + - " } " + '\n' + - " } " + '\n' + - "}"; - - return request; - - } - - // Success Scenario - private Map<String, String> setupVariablesVIPER1() { - Map<String, String> variables = new HashMap<>(); - variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56"); - variables.put("msoRequestId", "testRequestId"); - variables.put("requestId", "testRequestId"); - variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4"); - variables.put("networkId", "49c86598-f766-46f8-84f8-8d1c1b10f9b4"); - variables.put("networkName", "MNS-25180-L-01-dmz_direct_net_1"); - variables.put("lcpCloudRegionId", "RDM2WAGPLCP"); - variables.put("tenantId", "88a6ca3ee0394ade9403f075db23167e"); - variables.put("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"); - variables.put("disableRollback", "false"); // macro - variables.put("failIfExists", "false"); - //variables.put("sdncVersion", "1702"); - variables.put("sdncVersion", "1707"); - variables.put("subscriptionServiceType", "MSO-dev-service-type"); - variables.put("globalSubscriberId", "globalId_45678905678"); - variables.put("networkModelInfo", networkModelInfo); - variables.put("serviceModelInfo", serviceModelInfo); - return variables; - - } - - // Missing Name Scenario - private Map<String, String> setupVariablesMissingNetworkId() { - Map<String, String> variables = new HashMap<>(); - variables.put("mso-request-id", "88f65519-9a38-4c4b-8445-9eb4a5a5af56"); - variables.put("bpmnRequest", getCreateNetworkRequestNetworkId()); - variables.put("requestId", "testRequestId"); - variables.put("isBaseVfModule", "true"); - variables.put("recipeTimeout", "0"); - variables.put("requestAction", "UPDATE"); - variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4"); - variables.put("vnfId", ""); - variables.put("vfModuleId", ""); - variables.put("volumeGroupId", ""); - //variables.put("networkId", "49c86598-f766-46f8-84f8-8d1c1b10f9b4"); // missing, ok - variables.put("serviceType", "vMOG"); - variables.put("vfModuleType", ""); - variables.put("networkType", "modelName"); - - return variables; - - } - - public String getCreateNetworkRequestNetworkId() { - - String request = - "{ \"requestDetails\": { " + '\n' + - " \"modelInfo\": { " + '\n' + - " \"modelType\": \"modelType\", " + '\n' + - " \"modelId\": \"modelId\", " + '\n' + - " \"modelNameVersionId\": \"modelNameVersionId\", " + '\n' + - " \"modelName\": \"CONTRAIL_EXTERNAL\", " + '\n' + - " \"modelVersion\": \"1\" " + '\n' + - " }, " + '\n' + - " \"cloudConfiguration\": { " + '\n' + - " \"lcpCloudRegionId\": \"RDM2WAGPLCP\", " + '\n' + - " \"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\" " + '\n' + - " }, " + '\n' + - " \"requestInfo\": { " + '\n' + - " \"source\": \"VID\", " + '\n' + - " \"callbackUrl\": \"\", " + '\n' + - " \"suppressRollback\": \"true\" ," + '\n' + - " \"productFamilyId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\" " + '\n' + - " }, " + '\n' + - " \"requestParameters\": { " + '\n' + - " \"userParams\": [] " + '\n' + - " } " + '\n' + - " } " + '\n' + - "}"; - - return request; - - } - - public String getCreateNetworkRequestSDNCRollback() { - - String request = - "{ \"requestDetails\": { " + '\n' + - " \"modelInfo\": { " + '\n' + - " \"modelType\": \"modelType\", " + '\n' + - " \"modelId\": \"modelId\", " + '\n' + - " \"modelNameVersionId\": \"modelNameVersionId\", " + '\n' + - " \"modelName\": \"CONTRAIL_EXTERNAL\", " + '\n' + - " \"modelVersion\": \"1\" " + '\n' + - " }, " + '\n' + - " \"cloudConfiguration\": { " + '\n' + - " \"lcpCloudRegionId\": \"RDM2WAGPLCP\", " + '\n' + - " \"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\" " + '\n' + - " }, " + '\n' + - " \"requestInfo\": { " + '\n' + - " \"instanceName\": \"MNS-25180-L-01-dmz_direct_net_3\", " + '\n' + - " \"source\": \"VID\", " + '\n' + - " \"callbackUrl\": \"\", " + '\n' + - " \"suppressRollback\": \"true\" ," + '\n' + - " \"productFamilyId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\" " + '\n' + - " }, " + '\n' + - " \"requestParameters\": { " + '\n' + - " \"userParams\": [] " + '\n' + - " } " + '\n' + - " } " + '\n' + - "}"; - - - return request; - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleInfraTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleInfraTest.java deleted file mode 100644 index 63cf62d17d..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleInfraTest.java +++ /dev/null @@ -1,145 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.bpmn.infrastructure;
-
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithDepth;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithPriority;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutVfModuleIdNoResponse;
-import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
-import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
-import static org.openecomp.mso.bpmn.mock.StubResponseVNFAdapter.mockVNFPut;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.camunda.bpm.engine.test.Deployment;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse;
-import org.openecomp.mso.bpmn.mock.FileUtil;
-
-/**
- * Unit test cases for UpdateVfModule.bpmn
- */
-public class UpdateVfModuleInfraTest extends WorkflowTest {
-
- private final CallbackSet callbacks = new CallbackSet();
-
- public UpdateVfModuleInfraTest() throws IOException {
- callbacks.put("changeassign", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyChangeAssignCallback.xml"));
- callbacks.put("query", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyQueryCallback.xml"));
- callbacks.put("activate", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyActivateCallback.xml"));
- callbacks.put("vnfUpdate", FileUtil.readResourceFile(
- "__files/VfModularity/VNFAdapterRestUpdateCallback.xml"));
- }
-
- /**
- * Sunny day scenario.
- *
- * @throws Exception
- */
- @Test
- @Ignore
- @Deployment(resources = {
- "process/UpdateVfModuleInfra.bpmn",
- "subprocess/DoUpdateVfModule.bpmn",
- "subprocess/PrepareUpdateAAIVfModule.bpmn",
- "subprocess/ConfirmVolumeGroupTenant.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn",
- "subprocess/CompleteMsoProcess.bpmn",
- "subprocess/FalloutHandler.bpmn"
- })
- public void sunnyDay() throws Exception {
-
- logStart();
-
- MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
- MockPutVfModuleIdNoResponse("skask", "PCRF", "supercool");
- MockGetGenericVnfByIdWithPriority("skask", "supercool", 200, "VfModularity/VfModule-supercool.xml", 1);
- mockSDNCAdapter("/SDNCAdapter", "SvcInstanceId><", 200, "VfModularity/StandardSDNCSynchResponse.xml");
- mockSDNCAdapter("/SDNCAdapter", "vnf-type>STMTN", 200, "VfModularity/StandardSDNCSynchResponse.xml");
- mockSDNCAdapter("/SDNCAdapter", "SvcAction>query", 200, "VfModularity/StandardSDNCSynchResponse.xml");
- mockVNFPut("skask", "/supercool", 202);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
-
- String businessKey = UUID.randomUUID().toString();
- String updaetVfModuleRequest =
- FileUtil.readResourceFile("__files/InfrastructureFlows/UpdateVfModule_VID_request.json");
-
- Map<String, Object> variables = setupVariablesSunnyDayVID();
-
-
- TestAsyncResponse asyncResponse = invokeAsyncProcess("UpdateVfModuleInfra",
- "v1", businessKey, updaetVfModuleRequest, variables);
-
- WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
-
- String responseBody = response.getContent();
- System.out.println("Workflow (Synch) Response:\n" + responseBody);
-
- injectSDNCCallbacks(callbacks, "changeassign, query");
- injectVNFRestCallbacks(callbacks, "vnfUpdate");
- injectSDNCCallbacks(callbacks, "activate");
-
- // TODO add appropriate assertions
-
- waitForProcessEnd(businessKey, 10000);
- checkVariable(businessKey, "UpdateVfModuleInfraSuccessIndicator", true);
-
- logEnd();
- }
-
- // Active Scenario
- private Map<String, Object> setupVariablesSunnyDayVID() {
- Map<String, Object> variables = new HashMap<>();
- //try {
- // variables.put("bpmnRequest", FileUtil.readResourceFile("__files/CreateVfModule_VID_request.json"));
- //}
- //catch (Exception e) {
-
- //}
- //variables.put("mso-request-id", "testRequestId");
- variables.put("requestId", "testRequestId");
- variables.put("isBaseVfModule", false);
- variables.put("isDebugLogEnabled", "true");
- variables.put("recipeTimeout", "0");
- variables.put("requestAction", "UPDATE_VF_MODULE");
- variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
- variables.put("vnfId", "skask");
- variables.put("vnfType", "vSAMP12");
- variables.put("vfModuleId", "supercool");
- variables.put("volumeGroupId", "");
- variables.put("serviceType", "MOG");
- variables.put("vfModuleType", "");
- return variables;
-
- }
-
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleInfraV2Test.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleInfraV2Test.java deleted file mode 100644 index 65a514c804..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleInfraV2Test.java +++ /dev/null @@ -1,119 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.bpmn.infrastructure;
-
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithDepth;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithPriority;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutVfModuleIdNoResponse;
-import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
-import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
-import static org.openecomp.mso.bpmn.mock.StubResponseVNFAdapter.mockVNFPut;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.camunda.bpm.engine.test.Deployment;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
-import org.openecomp.mso.bpmn.common.WorkflowTest.CallbackSet;
-import org.openecomp.mso.bpmn.common.WorkflowTest.TestAsyncResponse;
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse;
-import org.openecomp.mso.bpmn.mock.FileUtil;
-
-/**
- * Unit test cases for UpdateVfModuleV2.bpmn
- */
-public class UpdateVfModuleInfraV2Test extends WorkflowTest {
-
- private final CallbackSet callbacks = new CallbackSet();
-
- public UpdateVfModuleInfraV2Test() throws IOException {
- /*callbacks.put("changeassign", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyChangeAssignCallback.xml"));
- callbacks.put("query", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyQueryCallback.xml"));
- callbacks.put("activate", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyActivateCallback.xml"));
- callbacks.put("vnfUpdate", FileUtil.readResourceFile(
- "__files/VfModularity/VNFAdapterRestUpdateCallback.xml"));*/
- }
-
- @Test
- @Ignore // IGNORED FOR 1710 MERGE TO ONAP
- @Deployment(resources = {
- "process/UpdateVfModuleInfraV2.bpmn",
- "subprocess/DoUpdateVfModule.bpmn",
- "subprocess/CompleteMsoProcess.bpmn",
- })
-
- public void sunnyDay() throws Exception {
- //logStart();
-
-
- MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
- MockPutVfModuleIdNoResponse("skask", "PCRF", "supercool");
- MockGetGenericVnfByIdWithPriority("skask", "supercool", 200, "VfModularity/VfModule-supercool.xml", 1);
- mockSDNCAdapter("/SDNCAdapter", "SvcInstanceId><", 200, "VfModularity/StandardSDNCSynchResponse.xml");
- mockSDNCAdapter("/SDNCAdapter", "vnf-type>STMTN", 200, "VfModularity/StandardSDNCSynchResponse.xml");
- mockSDNCAdapter("/SDNCAdapter", "SvcAction>query", 200, "VfModularity/StandardSDNCSynchResponse.xml");
- mockVNFPut("skask", "/supercool", 202);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
-
- String businessKey = UUID.randomUUID().toString();
- Map<String, Object> variables = setupVariablesSunnyDayVID();
-
- String updateVfModuleRequest =
- FileUtil.readResourceFile("__files/InfrastructureFlows/UpdateVfModule_VID_request.json");
- TestAsyncResponse asyncResponse = invokeAsyncProcess("UpdateVfModuleInfraV2",
- "v1", businessKey, updateVfModuleRequest, variables);
-
- WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
-
- //String responseBody = response.getResponse();
- //System.out.println("Workflow (Synch) Response:\n" + responseBody);
-
- //logEnd();
- }
-
- // Active Scenario
- private Map<String, Object> setupVariablesSunnyDayVID() {
- Map<String, Object> variables = new HashMap<>();
- variables.put("requestId", "testRequestId");
- variables.put("isBaseVfModule", false);
- variables.put("isDebugLogEnabled", "true");
- variables.put("recipeTimeout", "0");
- variables.put("requestAction", "UPDATE_VF_MODULE");
- variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
- variables.put("vnfId", "skask");
- variables.put("vnfType", "vSAMP12");
- variables.put("vfModuleId", "supercool");
- variables.put("volumeGroupId", "");
- variables.put("serviceType", "MOG");
- variables.put("vfModuleType", "");
- variables.put("moduleUuid", "fe6985cd-ea33-3346-ac12-ab121484a3fe");
- return variables;
-
- }
-
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleVolumeInfraV1Test.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleVolumeInfraV1Test.java deleted file mode 100644 index 91327b087e..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleVolumeInfraV1Test.java +++ /dev/null @@ -1,143 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.bpmn.infrastructure;
-
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfById;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetVfModuleId;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetVolumeGroupById;
-import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
-import static org.openecomp.mso.bpmn.mock.StubResponseVNFAdapter.mockPutVNFVolumeGroup;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.camunda.bpm.engine.test.Deployment;
-import org.junit.Test;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse;
-import org.openecomp.mso.bpmn.mock.FileUtil;
-
-/**
- * Unit test cases for UpdateVfModuleVolume.bpmn
- */
-public class UpdateVfModuleVolumeInfraV1Test extends WorkflowTest {
-
- private final CallbackSet callbacks = new CallbackSet();
-
- public UpdateVfModuleVolumeInfraV1Test() throws IOException {
- callbacks.put("volumeGroupUpdate", FileUtil.readResourceFile(
- "__files/VfModularity/VNFAdapterRestVolumeGroupCallback.xml"));
- }
-
- /**
- * Happy path scenario.
- *
- * @throws Exception
- */
- @Test
- @Deployment(resources = {
- "process/UpdateVfModuleVolumeInfraV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/CompleteMsoProcess.bpmn",
- "subprocess/GenericNotificationService.bpmn",
- "subprocess/FalloutHandler.bpmn"
- })
- public void happyPath() throws Exception {
-
- logStart();
-
- MockGetGenericVnfById("/TEST-VNF-ID-0123", "CreateVfModuleVolumeInfraV1/GenericVnf.xml", 200);
- MockGetVolumeGroupById("mdt1", "78987", "UpdateVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_Success.xml");
- MockGetVfModuleId("9e48f6ea-f786-46de-800a-d480e5ccc846", "6a1dc898-b590-47b9-bbf0-34424a7a2ec3/", "UpdateVfModuleVolumeInfraV1/vf_module_aai_response.xml", 200);
- mockPutVNFVolumeGroup("78987", 202);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
-
- String businessKey = UUID.randomUUID().toString();
- String updaetVfModuleVolRequest =
- FileUtil.readResourceFile("__files/UpdateVfModuleVolumeInfraV1/updateVfModuleVolume_VID_request.json");
-
- Map<String, Object> testVariables = new HashMap<>();
- testVariables.put("requestId", "TEST-REQUEST-ID-0123");
- testVariables.put("serviceInstanceId", "test-service-instance-id");
- testVariables.put("volumeGroupId", "78987");
- testVariables.put("vnfId", "TEST-VNF-ID-0123");
- TestAsyncResponse asyncResponse = invokeAsyncProcess("UpdateVfModuleVolumeInfraV1", "v1", businessKey, updaetVfModuleVolRequest, testVariables);
- WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
-
- String responseBody = response.getContent();
- System.out.println("Workflow (Synch) Response:\n" + responseBody);
-
- injectVNFRestCallbacks(callbacks, "volumeGroupUpdate");
-
- waitForProcessEnd(businessKey, 10000);
- checkVariable(businessKey, "UpdateVfModuleVolumeSuccessIndicator", true);
-
- logEnd();
- }
-
- /**
- * VF Module Personal model id does not match request model invariant id
- * @throws Exception
- */
- @Test
- //@Ignore
- @Deployment(resources = {
- "process/UpdateVfModuleVolumeInfraV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/CompleteMsoProcess.bpmn",
- "subprocess/GenericNotificationService.bpmn",
- "subprocess/FalloutHandler.bpmn"
- })
- public void testPersonaModelIdNotMatch() throws Exception {
-
- logStart();
-
- MockGetVolumeGroupById("mdt1", "78987", "UpdateVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_Success.xml");
- MockGetGenericVnfById("/TEST-VNF-ID-0123", "CreateVfModuleVolumeInfraV1/GenericVnf.xml", 200);
- MockGetVfModuleId("9e48f6ea-f786-46de-800a-d480e5ccc846", "6a1dc898-b590-47b9-bbf0-34424a7a2ec3/", "UpdateVfModuleVolumeInfraV1/vf_module_aai_response.xml", 200);
- mockPutVNFVolumeGroup("78987", 202);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
-
- String businessKey = UUID.randomUUID().toString();
- String updaetVfModuleVolRequest =
- FileUtil.readResourceFile("__files/UpdateVfModuleVolumeInfraV1/updateVfModuleVolume_VID_request_2.json");
-
- Map<String, Object> testVariables = new HashMap<>();
- testVariables.put("requestId", "TEST-REQUEST-ID-0123");
- testVariables.put("serviceInstanceId", "test-service-instance-id");
- testVariables.put("volumeGroupId", "78987");
- testVariables.put("vnfId", "TEST-VNF-ID-0123");
- TestAsyncResponse asyncResponse = invokeAsyncProcess("UpdateVfModuleVolumeInfraV1", "v1", businessKey, updaetVfModuleVolRequest, testVariables);
- WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
-
- String responseBody = response.getContent();
- System.out.println("Workflow (Synch) Response:\n" + responseBody);
-
- injectVNFRestCallbacks(callbacks, "volumeGroupUpdate");
-
- waitForProcessEnd(businessKey, 10000);
- checkVariable(businessKey, "UpdateVfModuleVolumeSuccessIndicator", true);
-
- logEnd();
- }
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVnfInfraTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVnfInfraTest.java deleted file mode 100644 index 5ab1a04809..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVnfInfraTest.java +++ /dev/null @@ -1,173 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.bpmn.infrastructure;
-
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockAAIVfModule;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDBUpdateVfModule;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithDepth;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithPriority;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetDefaultCloudRegionByCloudRegionId;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetPserverByVnfId;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfsByVnfId;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchGenericVnf;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchVfModuleId;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutGenericVnf;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutVfModuleIdNoResponse;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockVNFAdapterRestVfModule;
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockSetInMaintFlagByVnfId;
-import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.MockGetServiceResourcesCatalogData;
-import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
-import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
-import static org.openecomp.mso.bpmn.mock.StubResponseVNFAdapter.mockVNFPut;
-import static org.openecomp.mso.bpmn.mock.StubResponsePolicy.MockPolicySkip;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.camunda.bpm.engine.test.Deployment;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.openecomp.mso.bpmn.common.WorkflowTest;
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse;
-import org.openecomp.mso.bpmn.mock.FileUtil;
-
-/**
- * Unit test cases for UpdateVnfInfra.bpmn
- */
-public class UpdateVnfInfraTest extends WorkflowTest {
-
- private final CallbackSet callbacks = new CallbackSet();
-
- public UpdateVnfInfraTest() throws IOException {
- callbacks.put("changeassign", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyChangeAssignCallback.xml"));
- callbacks.put("activate", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyActivateCallback.xml"));
- callbacks.put("query", FileUtil.readResourceFile(
- "__files/VfModularity/SDNCTopologyQueryCallback.xml"));
- callbacks.put("vnfUpdate", FileUtil.readResourceFile(
- "__files/VfModularity/VNFAdapterRestUpdateCallback.xml"));
- }
-
- /**
- * Sunny day scenario.
- *
- * @throws Exception
- */
- @Test
- @Ignore // 1802 merge
- @Deployment(resources = {
- "process/UpdateVnfInfra.bpmn",
- "subprocess/RollbackVnf.bpmn",
- "subprocess/DoUpdateVfModule.bpmn",
- "subprocess/DoUpdateVnfAndModules.bpmn",
- "subprocess/PrepareUpdateAAIVfModule.bpmn",
- "subprocess/ConfirmVolumeGroupTenant.bpmn",
- "subprocess/SDNCAdapterV1.bpmn",
- "subprocess/VnfAdapterRestV1.bpmn",
- "subprocess/UpdateAAIGenericVnf.bpmn",
- "subprocess/UpdateAAIVfModule.bpmn",
- "subprocess/CompleteMsoProcess.bpmn",
- "subprocess/FalloutHandler.bpmn",
- "subprocess/BuildingBlock/DecomposeService.bpmn",
- "subprocess/BuildingBlock/RainyDayHandler.bpmn",
- "subprocess/BuildingBlock/ManualHandling.bpmn",
- "subprocess/BuildingBlock/AppCClient.bpmn"
-
- })
- public void sunnyDay() throws Exception {
-
- logStart();
-
- MockNodeQueryServiceInstanceById("MIS%2F1604%2F0026%2FSW_INTERNET", "GenericFlows/getSIUrlByIdVipr.xml");
- MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml");
- //MockGetGenericVnfById_404("testVnfId");
- MockGetServiceResourcesCatalogData("995256d2-5a33-55df-13ab-12abad84e7ff", "1.0", "VIPR/getCatalogServiceResourcesDataForUpdateVnfInfra.json");
- MockGetServiceResourcesCatalogData("995256d2-5a33-55df-13ab-12abad84e7ff", "VIPR/getCatalogServiceResourcesDataForUpdateVnfInfra.json");
- MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
- MockGetDefaultCloudRegionByCloudRegionId("mdt1", "AAI/AAI_defaultCloudRegionByCloudRegionId.json", 200);
- MockPutGenericVnf(".*");
- MockAAIVfModule();
- MockPatchGenericVnf("skask");
- MockPatchVfModuleId("skask", ".*");
- mockSDNCAdapter("VfModularity/StandardSDNCSynchResponse.xml");
- mockVNFPut("skask", "/supercool", 202);
- mockVNFPut("skask", "/lukewarm", 202);
- MockVNFAdapterRestVfModule();
- MockDBUpdateVfModule();
- MockGetPserverByVnfId("skask", "AAI/AAI_pserverByVnfId.json", 200);
- MockGetGenericVnfsByVnfId("skask", "AAI/AAI_genericVnfsByVnfId.json", 200);
- MockSetInMaintFlagByVnfId("skask", "AAI/AAI_genericVnfsByVnfId.json", 200);
- MockPolicySkip();
-
- mockSDNCAdapter("VfModularity/StandardSDNCSynchResponse.xml");
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
-
- String businessKey = UUID.randomUUID().toString();
- String updaetVnfRequest =
- FileUtil.readResourceFile("__files/InfrastructureFlows/UpdateVnf_VID_request.json");
-
- Map<String, Object> variables = setupVariablesSunnyDayVID();
-
-
- TestAsyncResponse asyncResponse = invokeAsyncProcess("UpdateVnfInfra",
- "v1", businessKey, updaetVnfRequest, variables);
-
- WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000);
-
- String responseBody = response.getContent();
- System.out.println("Workflow (Synch) Response:\n" + responseBody);
-
- injectSDNCCallbacks(callbacks, "changeassign, query");
- injectVNFRestCallbacks(callbacks, "vnfUpdate");
- injectSDNCCallbacks(callbacks, "activate");
- injectSDNCCallbacks(callbacks, "changeassign, query");
- injectVNFRestCallbacks(callbacks, "vnfUpdate");
- injectSDNCCallbacks(callbacks, "activate");
-
- // TODO add appropriate assertions
-
- waitForProcessEnd(businessKey, 10000);
- checkVariable(businessKey, "UpdateVfModuleInfraSuccessIndicator", true);
-
- logEnd();
- }
-
- // Active Scenario
- private Map<String, Object> setupVariablesSunnyDayVID() {
- Map<String, Object> variables = new HashMap<>();
-
- variables.put("requestId", "testRequestId");
- variables.put("isDebugLogEnabled", "true");
- variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
- variables.put("vnfId", "skask");
- variables.put("vnfType", "vSAMP12");
- variables.put("serviceType", "MOG");
-
- return variables;
-
- }
-
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/VnfConfigUpdateTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/VnfConfigUpdateTest.java deleted file mode 100644 index aca60026dc..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/VnfConfigUpdateTest.java +++ /dev/null @@ -1,146 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.get; -import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockAAIVfModule; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDBUpdateVfModule; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithDepth; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetPserverByVnfId; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfsByVnfId; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockSetInMaintFlagByVnfId; -import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.MockGetServiceResourcesCatalogData; -import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB; -import static org.openecomp.mso.bpmn.mock.StubResponsePolicy.MockPolicySkip; -import static org.openecomp.mso.bpmn.mock.StubResponseAPPC.MockAppcError; - -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; -import org.openecomp.mso.client.aai.AAIObjectType; -import org.openecomp.mso.client.aai.entities.uri.AAIResourceUri; -import org.openecomp.mso.client.aai.entities.uri.AAIUriFactory; - -/** - * Unit test cases for VnfConfigUpdate.bpmn - */ -public class VnfConfigUpdateTest extends WorkflowTest { - - public VnfConfigUpdateTest() throws IOException { - - } - - /** - * Sunny day scenario. - * - * @throws Exception - */ - @Test - @Ignore // 1802 merge - @Deployment(resources = { - "process/VnfConfigUpdate.bpmn", - "subprocess/RollbackVnf.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/BuildingBlock/RainyDayHandler.bpmn", - "subprocess/BuildingBlock/ManualHandling.bpmn", - "subprocess/BuildingBlock/AppCClient.bpmn" - - }) - public void sunnyDay() throws Exception { - - logStart(); - - System.setProperty("mso.config.path", "src/test/resources"); - AAIResourceUri path = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, "comx9906v"); - wireMockRule.stubFor(get( - urlPathEqualTo("/aai/v11" + path.build())) - .willReturn( - aResponse() - .withHeader("Content-Type", "application/json") - .withBodyFile("AAI/mockObject.json") - .withStatus(200))); - - - MockNodeQueryServiceInstanceById("MIS%2F1604%2F0026%2FSW_INTERNET", "GenericFlows/getSIUrlByIdVipr.xml"); - MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml"); - //MockGetGenericVnfById_404("testVnfId"); - MockGetGenericVnfByIdWithDepth("comx9906v", 1, "AAI/AAI_genericVnfsByVnfIdVnfConfig.json"); - MockAAIVfModule(); - MockDBUpdateVfModule(); - MockGetPserverByVnfId("comx9906v", "AAI/AAI_pserverByVnfId.json", 200); - MockGetGenericVnfsByVnfId("comx9906v", "AAI/AAI_genericVnfsByVnfIdVnfConfig.json", 200); - MockSetInMaintFlagByVnfId("comx9906v", "AAI/AAI_genericVnfsByVnfIdVnfConfig.json", 200); - MockPolicySkip(); - MockAppcError(); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - String updaetVnfRequest = - FileUtil.readResourceFile("__files/InfrastructureFlows/ConfigVnf_VID_request.json"); - - Map<String, Object> variables = setupVariablesSunnyDayVID(); - - - TestAsyncResponse asyncResponse = invokeAsyncProcess("VnfConfigUpdate", - "v1", businessKey, updaetVnfRequest, variables); - - WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 10000); - - String responseBody = response.getContent(); - System.out.println("Workflow (Synch) Response:\n" + responseBody); - - // TODO add appropriate assertions - - waitForProcessEnd(businessKey, 1000000); - checkVariable(businessKey, "VnfConfigUpdateSuccessIndicator", true); - - logEnd(); - } - - // Active Scenario - private Map<String, Object> setupVariablesSunnyDayVID() { - Map<String, Object> variables = new HashMap<String, Object>(); - - variables.put("requestId", "testRequestId"); - variables.put("isDebugLogEnabled", "true"); - variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4"); - variables.put("vnfId", "comx9906v"); - variables.put("vnfType", "vSAMP12"); - variables.put("serviceType", "MOG"); - - return variables; - - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/VnfInPlaceUpdateTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/VnfInPlaceUpdateTest.java deleted file mode 100644 index 7d8a7e1856..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/VnfInPlaceUpdateTest.java +++ /dev/null @@ -1,159 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.get; -import static com.github.tomakehurst.wiremock.client.WireMock.put; -import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; -import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching; -import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockAAIVfModule; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDBUpdateVfModule; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithDepth; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithPriority; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetPserverByVnfId; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetGenericVnfsByVnfId; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockSetInMaintFlagByVnfId; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetDefaultCloudRegionByCloudRegionId; -import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.MockGetServiceResourcesCatalogData; -import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB; -import static org.openecomp.mso.bpmn.mock.StubResponsePolicy.MockPolicySkip; -import static org.openecomp.mso.bpmn.mock.StubResponseAPPC.MockAppcError; - -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; -import org.openecomp.mso.client.aai.AAIObjectType; -import org.openecomp.mso.client.aai.entities.uri.AAIResourceUri; -import org.openecomp.mso.client.aai.entities.uri.AAIUriFactory; - -/** - * Unit test cases for VnfInPlaceUpdate.bpmn - */ -public class VnfInPlaceUpdateTest extends WorkflowTest { - - public VnfInPlaceUpdateTest() throws IOException { - - } - - /** - * Sunny day scenario. - * - * @throws Exception - */ - @Test - - - @Deployment(resources = { - "process/VnfInPlaceUpdate.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/BuildingBlock/RainyDayHandler.bpmn", - "subprocess/BuildingBlock/ManualHandling.bpmn", - "subprocess/BuildingBlock/AppCClient.bpmn" - - }) - public void sunnyDay() throws Exception { - - logStart(); - System.setProperty("mso.config.path", "src/test/resources"); - AAIResourceUri path = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, "skask"); - wireMockRule.stubFor(get( - urlPathEqualTo("/aai/v11" + path.build())) - .willReturn( - aResponse() - .withHeader("Content-Type", "application/json") - .withBodyFile("AAI/mockObject.json") - .withStatus(200))); - - // - - //AAIResourceUri path1 = AAIUriFactory.createResourceUri(AAIObjectType.CUSTOM_QUERY).queryParam("format", "RESOURCE"); - //wireMockRule.stubFor(put( - // urlMatching("/aai/v10/query/pservers-fromVnf")) - // .willReturn( - // aResponse() - // .withHeader("Content-Type", "application/json") - // .withBodyFile("AAI/AAI_pserversByVnfId.json") - // .withStatus(200))); - - MockNodeQueryServiceInstanceById("MIS%2F1604%2F0026%2FSW_INTERNET", "GenericFlows/getSIUrlByIdVipr.xml"); - MockGetServiceInstance("SDN-ETHERNET-INTERNET", "123456789", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericFlows/getServiceInstance.xml"); - //MockGetGenericVnfById_404("testVnfId"); - MockGetGenericVnfByIdWithDepth("skask", 1, "AAI/AAI_genericVnfsByVnfId.json"); - MockAAIVfModule(); - MockDBUpdateVfModule(); - MockGetPserverByVnfId("skask", "AAI/AAI_pserverByVnfId.json", 200); - MockSetInMaintFlagByVnfId("skask", "AAI/AAI_genericVnfsByVnfId.json", 200); - MockGetGenericVnfsByVnfId("skask", "AAI/AAI_genericVnfsByVnfId.json", 200); - MockGetDefaultCloudRegionByCloudRegionId("mdt1", "AAI/AAI_defaultCloudRegionByCloudRegionId.json", 200); - MockPolicySkip(); - MockAppcError(); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - String updaetVnfRequest = - FileUtil.readResourceFile("__files/InfrastructureFlows/VnfInPlaceUpdate_VID_request.json"); - - Map<String, Object> variables = setupVariablesSunnyDayVID(); - - - TestAsyncResponse asyncResponse = invokeAsyncProcess("VnfInPlaceUpdate", - "v1", businessKey, updaetVnfRequest, variables); - - WorkflowResponse response = receiveResponse(businessKey, asyncResponse, 100000); - - String responseBody = response.getContent(); - System.out.println("Workflow (Synch) Response:\n" + responseBody); - - // TODO add appropriate assertions - - waitForProcessEnd(businessKey, 100000); - checkVariable(businessKey, "VnfInPlaceUpdateSuccessIndicator", true); - - logEnd(); - } - - // Active Scenario - private Map<String, Object> setupVariablesSunnyDayVID() { - Map<String, Object> variables = new HashMap<String, Object>(); - - variables.put("requestId", "testRequestId"); - variables.put("isDebugLogEnabled", "true"); - variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4"); - variables.put("vnfId", "skask"); - - return variables; - - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/aai/AAIServiceInstanceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/aai/AAIServiceInstanceTest.java deleted file mode 100644 index b9f339921d..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/aai/AAIServiceInstanceTest.java +++ /dev/null @@ -1,114 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2018 Huawei Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - - -package org.openecomp.mso.bpmn.infrastructure.aai; - -import org.junit.Test; - - -public class AAIServiceInstanceTest { - - AAIServiceInstance test = new AAIServiceInstance("serviceInstanceName","serviceType","serviceRole","orchestrationStatus","modelInvariantUuid","modelVersionId","environmentContext","workloadContext"); - - @Test - public void getServiceInstanceNameTest() throws Exception { - test.getServiceInstanceName(); - } - - @Test - public void setServiceInstanceNameTest() throws Exception { - test.setServiceInstanceName("serviceInstanceName"); - } - - @Test - public void getServiceTypeTest() throws Exception { - test.getServiceType(); - } - - @Test - public void setServiceTypeTest() throws Exception { - test.setServiceType("serviceType"); - } - - - @Test - public void getServiceRoleTest() throws Exception { - test.getServiceRole(); - } - - @Test - public void setServiceRoleTest() throws Exception { - test.setServiceRole("serviceRole"); - } - - @Test - public void getOrchestrationStatusTest() throws Exception { - test.getOrchestrationStatus(); - } - - @Test - public void setOrchestrationStatusTest() throws Exception { - test.setOrchestrationStatus("status"); - } - - @Test - public void getModelInvariantUuidTest() throws Exception { - test.getModelInvariantUuid(); - } - - @Test - public void setModelInvariantUuidTest() throws Exception { - test.setModelInvariantUuid("uuid"); - } - - @Test - public void getModelVersionIdTest() throws Exception { - test.getModelVersionId(); - } - - @Test - public void setModelVersionIdTest() throws Exception { - test.setModelVersionId("versionId"); - } - - @Test - public void getEnvironmentContextTest() throws Exception { - test.getEnvironmentContext(); - } - - @Test - public void setEnvironmentContextTest() throws Exception { - test.setEnvironmentContext("context"); - } - - @Test - public void getWorkloadContextTest() throws Exception { - test.getWorkloadContext(); - } - - @Test - public void setWorkloadContextTest() throws Exception { - test.setWorkloadContext("context"); - } - -} - - diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/AaiConnectionTestImpl.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/AaiConnectionTestImpl.java deleted file mode 100644 index bffae8d892..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/AaiConnectionTestImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure.pnf.delegate; - -import java.io.IOException; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.onap.aai.domain.yang.Pnf; -import org.openecomp.mso.bpmn.infrastructure.pnf.implementation.AaiConnection; - -public class AaiConnectionTestImpl implements AaiConnection { - - public static final String ID_WITH_ENTRY_AND_IP = "idWithEntryAndIp"; - public static final String ID_WITH_IP_V6 = "idWithIpV6"; - public static final String ID_WITHOUT_ENTRY = "IdWithoutEntry"; - public static final String ID_WITH_ENTRY_NO_IP = "idWithEntryNoIp"; - public static final String DEFAULT_IP = "1.2.3.4"; - public static final String DEFAULT_IP_V6 = "2001:db8::ff00:42:8329"; - - private Map<String, Pnf> created = new HashMap<>(); - - @Override - public Optional<Pnf> getEntryFor(String correlationId) throws IOException { - if (Objects.equals(correlationId, ID_WITH_ENTRY_AND_IP)) { - Pnf pnf = new Pnf(); - pnf.setIpaddressV4Oam(DEFAULT_IP); - return Optional.of(pnf); - } else if (Objects.equals(correlationId, ID_WITH_IP_V6)) { - Pnf pnf = new Pnf(); - pnf.setIpaddressV6Oam(DEFAULT_IP_V6); - return Optional.of(pnf); - } else if (Objects.equals(correlationId, ID_WITH_ENTRY_NO_IP)) { - return Optional.of(new Pnf()); - } else { - return Optional.empty(); - } - } - - @Override - public void createEntry(String correlationId, Pnf entry) throws IOException { - created.put(correlationId, entry); - } - - public Map<String, Pnf> getCreated() { - return created; - } - - public void reset() { - created.clear(); - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/AaiConnectionThrowingException.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/AaiConnectionThrowingException.java deleted file mode 100644 index 9a8dd5df24..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/AaiConnectionThrowingException.java +++ /dev/null @@ -1,39 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure.pnf.delegate; - -import java.io.IOException; -import java.util.Optional; -import org.onap.aai.domain.yang.Pnf; -import org.openecomp.mso.bpmn.infrastructure.pnf.implementation.AaiConnection; - -public class AaiConnectionThrowingException implements AaiConnection { - - @Override - public Optional<Pnf> getEntryFor(String correlationId) throws IOException { - throw new IOException(); - } - - @Override - public void createEntry(String correlationId, Pnf entry) throws IOException { - throw new IOException(); - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CancelDmaapSubscriptionTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CancelDmaapSubscriptionTest.java deleted file mode 100644 index d27cf44342..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CancelDmaapSubscriptionTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure.pnf.delegate; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = {CancelDmaapSubscription.class, DmaapClientTestImpl.class}) -public class CancelDmaapSubscriptionTest { - - @Autowired - public CancelDmaapSubscription delegate; - - @Autowired - private DmaapClientTestImpl dmaapClientTest; - - @Test - public void shouldCancelSubscription() throws Exception { - // given - DelegateExecution delegateExecution = mock(DelegateExecution.class); - when(delegateExecution.getVariable(eq(ExecutionVariableNames.CORRELATION_ID))).thenReturn("testCorrelationId"); - when(delegateExecution.getProcessBusinessKey()).thenReturn("testBusinessKey"); - dmaapClientTest.registerForUpdate("testCorrelationId", () -> {}); - // when - delegate.execute(delegateExecution); - // then - assertThat(dmaapClientTest.haveRegisteredConsumer()).isFalse(); - } -}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegateTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegateTest.java deleted file mode 100644 index 75a7450434..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegateTest.java +++ /dev/null @@ -1,132 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure.pnf.delegate; - -import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; -import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.AaiConnectionTestImpl.ID_WITHOUT_ENTRY; -import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.AaiConnectionTestImpl.ID_WITH_ENTRY_AND_IP; -import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.AaiConnectionTestImpl.ID_WITH_ENTRY_NO_IP; -import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.AaiConnectionTestImpl.ID_WITH_IP_V6; -import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.AAI_CONTAINS_INFO_ABOUT_IP; -import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.AAI_CONTAINS_INFO_ABOUT_PNF; -import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.CORRELATION_ID; - -import org.camunda.bpm.engine.delegate.BpmnError; -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.junit.Test; -import org.junit.experimental.runners.Enclosed; -import org.junit.runner.RunWith; -import org.openecomp.mso.bpmn.core.WorkflowException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(Enclosed.class) -public class CheckAaiForCorrelationIdDelegateTest { - - @RunWith(SpringRunner.class) - @SpringBootTest(classes = {CheckAaiForCorrelationIdDelegate.class, AaiConnectionTestImpl.class}) - public static class ConnectionOkTests { - - @Autowired - private CheckAaiForCorrelationIdDelegate delegate; - - @Test - public void shouldThrowExceptionWhenCorrelationIdIsNotSet() throws Exception { - // given - DelegateExecution execution = mock(DelegateExecution.class); - when(execution.getVariable(CORRELATION_ID)).thenReturn(null); - when(execution.getVariable("testProcessKey")).thenReturn("testProcessKeyValue"); - // when, then - assertThatThrownBy(() -> delegate.execute(execution)).isInstanceOf(BpmnError.class); - verify(execution).setVariable(eq("WorkflowException"), any(WorkflowException.class)); - } - - @Test - public void shouldSetCorrectVariablesWhenAaiDoesNotContainInfoAboutPnf() throws Exception { - // given - DelegateExecution execution = mock(DelegateExecution.class); - when(execution.getVariable(CORRELATION_ID)).thenReturn(ID_WITHOUT_ENTRY); - // when - delegate.execute(execution); - // then - verify(execution).setVariableLocal(AAI_CONTAINS_INFO_ABOUT_PNF, false); - } - - @Test - public void shouldSetCorrectVariablesWhenAaiContainsInfoAboutPnf() throws Exception { - shouldSetCorrectVariablesWhenAaiContainsInfoAboutPnf(ID_WITH_ENTRY_AND_IP); - } - - @Test - public void shouldSetCorrectVariablesWhenAaiContainsInfoAboutPnfWithIpV6() throws Exception { - shouldSetCorrectVariablesWhenAaiContainsInfoAboutPnf(ID_WITH_IP_V6); - } - - private void shouldSetCorrectVariablesWhenAaiContainsInfoAboutPnf(String id) throws Exception { - // given - DelegateExecution execution = mock(DelegateExecution.class); - when(execution.getVariable(CORRELATION_ID)).thenReturn(id); - // when - delegate.execute(execution); - // then - verify(execution).setVariableLocal(AAI_CONTAINS_INFO_ABOUT_PNF, true); - verify(execution).setVariableLocal(AAI_CONTAINS_INFO_ABOUT_IP, true); - } - - @Test - public void shouldSetCorrectVariablesWhenAaiContainsInfoAboutPnfWithoutIp() throws Exception { - // given - DelegateExecution execution = mock(DelegateExecution.class); - when(execution.getVariable(CORRELATION_ID)).thenReturn(ID_WITH_ENTRY_NO_IP); - // when - delegate.execute(execution); - // then - verify(execution).setVariableLocal(AAI_CONTAINS_INFO_ABOUT_PNF, true); - verify(execution).setVariableLocal(AAI_CONTAINS_INFO_ABOUT_IP, false); - } - } - - - @RunWith(SpringRunner.class) - @SpringBootTest(classes = {CheckAaiForCorrelationIdDelegate.class, AaiConnectionThrowingException.class}) - public static class NoConnectionTests { - - @Autowired - private CheckAaiForCorrelationIdDelegate delegate; - - @Test - public void shouldThrowExceptionWhenIoExceptionOnConnectionToAai() throws Exception { - // given - DelegateExecution execution = mock(DelegateExecution.class); - when(execution.getVariable(CORRELATION_ID)).thenReturn(ID_WITH_ENTRY_NO_IP); - when(execution.getVariable("testProcessKey")).thenReturn("testProcessKey"); - // when, then - assertThatThrownBy(() -> delegate.execute(execution)).isInstanceOf(BpmnError.class); - verify(execution).setVariable(eq("WorkflowException"), any(WorkflowException.class)); - } - } -}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CreateAaiEntryWithPnfIdDelegateTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CreateAaiEntryWithPnfIdDelegateTest.java deleted file mode 100644 index bc70a09880..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CreateAaiEntryWithPnfIdDelegateTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.bpmn.infrastructure.pnf.delegate; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; -import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.CORRELATION_ID; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.junit.Test; -import org.onap.aai.domain.yang.Pnf; - -public class CreateAaiEntryWithPnfIdDelegateTest { - - @Test - public void shouldSetPnfIdAndPnfName() throws Exception { - // given - CreateAaiEntryWithPnfIdDelegate delegate = new CreateAaiEntryWithPnfIdDelegate(); - AaiConnectionTestImpl aaiConnection = new AaiConnectionTestImpl(); - delegate.setAaiConnection(aaiConnection); - DelegateExecution execution = mock(DelegateExecution.class); - when(execution.getVariable(eq(CORRELATION_ID))).thenReturn("testCorrelationId"); - // when - delegate.execute(execution); - // then - Pnf createdEntry = aaiConnection.getCreated().get("testCorrelationId"); - assertThat(createdEntry.getPnfId()).isEqualTo("testCorrelationId"); - assertThat(createdEntry.getPnfName()).isEqualTo("testCorrelationId"); - assertThat(createdEntry.isInMaint()).isTrue(); - } -}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java deleted file mode 100644 index 8d35f9f8e0..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure.pnf.delegate; - -import org.openecomp.mso.bpmn.infrastructure.pnf.dmaap.DmaapClient; -import java.util.Objects; - -public class DmaapClientTestImpl implements DmaapClient { - - private String correlationId; - private Runnable informConsumer; - - @Override - public void registerForUpdate(String correlationId, Runnable informConsumer) { - this.correlationId = correlationId; - this.informConsumer = informConsumer; - } - - @Override - public Runnable unregister(String correlationId) { - if (Objects.equals(this.correlationId, correlationId)) { - this.correlationId = null; - Runnable informConsumer = this.informConsumer; - this.informConsumer = null; - return informConsumer; - } - return null; - } - - public String getCorrelationId() { - return correlationId; - } - - public Runnable getInformConsumer() { - return informConsumer; - } - - public boolean haveRegisteredConsumer() { - return correlationId != null; - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/InformDmaapClientTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/InformDmaapClientTest.java deleted file mode 100644 index 2bfae461be..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/InformDmaapClientTest.java +++ /dev/null @@ -1,94 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure.pnf.delegate; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.inOrder; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verifyZeroInteractions; -import static org.mockito.Mockito.when; - -import org.camunda.bpm.engine.ProcessEngineServices; -import org.camunda.bpm.engine.RuntimeService; -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.camunda.bpm.engine.runtime.MessageCorrelationBuilder; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InOrder; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = {InformDmaapClient.class, DmaapClientTestImpl.class}) -public class InformDmaapClientTest { - - @Autowired - private InformDmaapClient informDmaapClient; - - @Autowired - private DmaapClientTestImpl dmaapClientTest; - - private DelegateExecution delegateExecution; - - private MessageCorrelationBuilder messageCorrelationBuilder; - - @Test - public void shouldSendListenerToDmaapClient() throws Exception { - // given - mockDelegateExecution(); - // when - informDmaapClient.execute(delegateExecution); - // then - assertThat(dmaapClientTest.getCorrelationId()).isEqualTo("testCorrelationId"); - assertThat(dmaapClientTest.getInformConsumer()).isNotNull(); - verifyZeroInteractions(messageCorrelationBuilder); - } - - @Test - public void shouldSendListenerToDmaapClientAndSendMessageToCamunda() throws Exception { - // given - mockDelegateExecution(); - // when - informDmaapClient.execute(delegateExecution); - dmaapClientTest.getInformConsumer().run(); - // then - assertThat(dmaapClientTest.getCorrelationId()).isEqualTo("testCorrelationId"); - InOrder inOrder = inOrder(messageCorrelationBuilder); - inOrder.verify(messageCorrelationBuilder).processInstanceBusinessKey("testBusinessKey"); - inOrder.verify(messageCorrelationBuilder).correlateWithResult(); - } - - private void mockDelegateExecution() { - delegateExecution = mock(DelegateExecution.class); - when(delegateExecution.getVariable(eq(ExecutionVariableNames.CORRELATION_ID))).thenReturn("testCorrelationId"); - when(delegateExecution.getProcessBusinessKey()).thenReturn("testBusinessKey"); - ProcessEngineServices processEngineServices = mock(ProcessEngineServices.class); - when(delegateExecution.getProcessEngineServices()).thenReturn(processEngineServices); - RuntimeService runtimeService = mock(RuntimeService.class); - when(processEngineServices.getRuntimeService()).thenReturn(runtimeService); - messageCorrelationBuilder = mock(MessageCorrelationBuilder.class); - when(runtimeService.createMessageCorrelation(any())).thenReturn(messageCorrelationBuilder); - when(messageCorrelationBuilder.processInstanceBusinessKey(any())).thenReturn(messageCorrelationBuilder); - } -}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/PnfCheckInputsTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/PnfCheckInputsTest.java deleted file mode 100644 index 1799e7fcbc..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/PnfCheckInputsTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure.pnf.delegate; - -import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; -import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.CORRELATION_ID; -import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.TIMEOUT_FOR_NOTIFICATION; - -import org.camunda.bpm.engine.delegate.BpmnError; -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.junit.Before; -import org.junit.Test; - -public class PnfCheckInputsTest { - - private PnfCheckInputs delegate; - - @Before - public void setUp() throws Exception { - delegate = new PnfCheckInputs(); - } - - private DelegateExecution mockDelegateExecution() { - DelegateExecution delegateExecution = mock(DelegateExecution.class); - when(delegateExecution.getVariable("testProcessKey")).thenReturn("testProcessKeyValue"); - return delegateExecution; - } - - @Test - public void shouldThrowException_whenPnfIdNotSet() throws Exception { - // given - DelegateExecution delegateExecution = mockDelegateExecution(); - // when, then - assertThatThrownBy(() -> delegate.execute(delegateExecution)).isInstanceOf(BpmnError.class); - } - - private DelegateExecution mockDelegateExecutionWithCorrelationId() { - DelegateExecution delegateExecution = mockDelegateExecution(); - when(delegateExecution.getVariable(CORRELATION_ID)).thenReturn("testCorrelationId"); - return delegateExecution; - } - - @Test - public void shouldThrowException_whenTimeoutIsNotSetAndDefaultIsNotDefined() throws Exception { - // given - DelegateExecution delegateExecution = mockDelegateExecutionWithCorrelationId(); - // when, then - assertThatThrownBy(() -> delegate.execute(delegateExecution)).isInstanceOf(BpmnError.class); - } - - @Test - public void shouldSetDefaultTimeout_whenTimeoutIsNotSet() throws Exception { - // given - String defaultTimeout = "T1D"; - delegate.setDefaultTimeout(defaultTimeout); - DelegateExecution delegateExecution = mockDelegateExecutionWithCorrelationId(); - // when - delegate.execute(delegateExecution); - // then - verify(delegateExecution).setVariable(eq(TIMEOUT_FOR_NOTIFICATION), eq(defaultTimeout)); - } -}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/bpmn/CreateAndActivatePnfResourceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/bpmn/CreateAndActivatePnfResourceTest.java deleted file mode 100644 index ada5a902a7..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/bpmn/CreateAndActivatePnfResourceTest.java +++ /dev/null @@ -1,146 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure.pnf.delegate.bpmn; - -import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat; -import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.AaiConnectionTestImpl.ID_WITHOUT_ENTRY; -import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.AaiConnectionTestImpl.ID_WITH_ENTRY_AND_IP; -import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.AaiConnectionTestImpl.ID_WITH_ENTRY_NO_IP; -import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.CORRELATION_ID; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.camunda.bpm.engine.RuntimeService; -import org.camunda.bpm.engine.history.HistoricVariableInstance; -import org.camunda.bpm.engine.runtime.ProcessInstance; -import org.camunda.bpm.engine.test.Deployment; -import org.camunda.bpm.engine.test.ProcessEngineRule; -import org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.openecomp.mso.bpmn.infrastructure.pnf.delegate.AaiConnectionTestImpl; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@ContextConfiguration(locations = "/applicationContext_forPnfTesting.xml") -public class CreateAndActivatePnfResourceTest { - - private static final String TIMEOUT_10_S = "PT10S"; - @Autowired - private RuntimeService runtimeService; - - @Autowired - @Rule - public ProcessEngineRule processEngineRule; - - @Autowired - private AaiConnectionTestImpl aaiConnection; - - @Test - @Deployment(resources = {"process/CreateAndActivatePnfResource.bpmn"}) - public void shouldSaveCurrentIpToVariableIfItAlreadyExistsInAai() throws Exception { - // given - aaiConnection.reset(); - BpmnAwareTests.init(processEngineRule.getProcessEngine()); - Map<String, Object> variables = new HashMap<>(); - variables.put("timeoutForPnfEntryNotification", TIMEOUT_10_S); - variables.put(CORRELATION_ID, ID_WITH_ENTRY_AND_IP); - // when - ProcessInstance instance = runtimeService - .startProcessInstanceByKey("CreateAndActivatePnfResource", variables); - // then - assertThat(instance).isEnded().hasPassedInOrder( - "CreateAndActivatePnf_StartEvent", - "CheckAiiForCorrelationId", - "DoesAaiContainInfoAboutPnf", - "DoesAaiContainInfoAboutIp", - "AaiEntryAlreadyUpToDate" - ); - } - - @Test - @Deployment(resources = {"process/CreateAndActivatePnfResource.bpmn"}) - public void shouldWaitForMessageFromDmaapAndUpdateAaiEntryWhenIpIsMissingInAaiEntry() throws Exception { - // given - aaiConnection.reset(); - BpmnAwareTests.init(processEngineRule.getProcessEngine()); - Map<String, Object> variables = new HashMap<>(); - variables.put("timeoutForPnfEntryNotification", TIMEOUT_10_S); - variables.put(CORRELATION_ID, ID_WITH_ENTRY_NO_IP); - // when - ProcessInstance instance = runtimeService - .startProcessInstanceByKey("CreateAndActivatePnfResource", "businessKey", variables); - assertThat(instance).isWaitingAt("WaitForDmaapPnfReadyNotification").isWaitingFor("WorkflowMessage"); - runtimeService.createMessageCorrelation("WorkflowMessage") - .processInstanceBusinessKey("businessKey") - .correlateWithResult(); - // then - assertThat(instance).isEnded().hasPassedInOrder( - "CreateAndActivatePnf_StartEvent", - "CheckAiiForCorrelationId", - "DoesAaiContainInfoAboutPnf", - "DoesAaiContainInfoAboutIp", - "AaiEntryExists", - "InformDmaapClient", - "WaitForDmaapPnfReadyNotification", - "AaiEntryUpdated" - ); - } - - @Test - @Deployment(resources = {"process/CreateAndActivatePnfResource.bpmn"}) - public void shouldCreateAaiEntryWaitForMessageFromDmaapAndUpdateAaiEntryWhenNoAaiEntry() throws Exception { - // given - aaiConnection.reset(); - BpmnAwareTests.init(processEngineRule.getProcessEngine()); - Map<String, Object> variables = new HashMap<>(); - variables.put("timeoutForPnfEntryNotification", TIMEOUT_10_S); - variables.put(CORRELATION_ID, ID_WITHOUT_ENTRY); - // when - ProcessInstance instance = runtimeService - .startProcessInstanceByKey("CreateAndActivatePnfResource", "businessKey", variables); - assertThat(instance).isWaitingAt("WaitForDmaapPnfReadyNotification").isWaitingFor("WorkflowMessage"); - runtimeService.createMessageCorrelation("WorkflowMessage") - .processInstanceBusinessKey("businessKey") - .correlateWithResult(); - // then - assertThat(instance).isEnded().hasPassedInOrder( - "CreateAndActivatePnf_StartEvent", - "CheckAiiForCorrelationId", - "DoesAaiContainInfoAboutPnf", - "CreateAndActivatePnf_CreateAaiEntry", - "AaiEntryExists", - "InformDmaapClient", - "WaitForDmaapPnfReadyNotification", - "AaiEntryUpdated" - ); - assertThat(aaiConnection.getCreated()).containsOnlyKeys(ID_WITHOUT_ENTRY); - } - - private List<HistoricVariableInstance> getVariables(ProcessInstance instance) { - return processEngineRule.getHistoryService().createHistoricVariableInstanceQuery() - .processInstanceId(instance.getProcessInstanceId()).taskIdIn().list(); - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/dmaap/JsonUtilForCorrelationIdTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/dmaap/JsonUtilForCorrelationIdTest.java deleted file mode 100644 index 95de883dab..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/dmaap/JsonUtilForCorrelationIdTest.java +++ /dev/null @@ -1,76 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure.pnf.dmaap; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.util.List; -import org.junit.Test; - -public class JsonUtilForCorrelationIdTest { - - private static final String JSON_EXAMPLE_WITH_CORRELATION_ID = "[\n" - + " {\n" - + " \"pnfRegistrationFields\" : {\n" - + " \"correlationId\" : \"corrTest1\",\n" - + " \"value\" : \"value1\"\n" - + " }\n" - + " },\n" - + " {\n" - + " \"pnfRegistrationFields\" : {\n" - + " \"correlationId\" : \"corrTest2\",\n" - + " \"value\" : \"value2\"\n" - + " }\n" - + " }\n" - + "]"; - - private static final String JSON_EXAMPLE_WITH_CORRELATION_ID2 = "{\"pnfRegistrationFields\":{\"correlationId\":\"corrTest3\"}}"; - private static final String JSON_EXAMPLE_WITH_CORRELATION_ID3 = "[\"\\{\\\"pnfRegistrationFields\\\":" - + "{\\\"correlationId\\\":\\\"corrTest4\\\"}}\", \"\\{\\\"pnfRegistrationFields\\\":" - + "{\\\"correlationId\\\":\\\"corrTest5\\\"}}\"]"; - private static final String JSON_EXAMPLE_WITH_CORRELATION_ID4 = "{\"header\":{\"key\":\"value\"}}"; - - @Test - public void parseJsonSuccessful() { - List<String> expectedResult = JsonUtilForCorrelationId - .parseJsonToGelAllCorrelationId(JSON_EXAMPLE_WITH_CORRELATION_ID); - assertThat(expectedResult).containsExactly("corrTest1", "corrTest2"); - - List<String> expectedResult2 = JsonUtilForCorrelationId - .parseJsonToGelAllCorrelationId(JSON_EXAMPLE_WITH_CORRELATION_ID2); - assertThat(expectedResult2).containsExactly("corrTest3"); - } - - @Test - public void parseJsonWithEscapeCharacters_Successful() { - List<String> expectedResult = JsonUtilForCorrelationId - .parseJsonToGelAllCorrelationId(JSON_EXAMPLE_WITH_CORRELATION_ID3); - assertThat(expectedResult).containsExactly("corrTest4", "corrTest5"); - } - - @Test - public void parseJson_emptyListReturnedWhenNothingFound() { - List<String> expectedResult = JsonUtilForCorrelationId - .parseJsonToGelAllCorrelationId(JSON_EXAMPLE_WITH_CORRELATION_ID4); - assertThat(expectedResult).isEmpty(); - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClientTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClientTest.java deleted file mode 100644 index c4d2570adb..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClientTest.java +++ /dev/null @@ -1,208 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure.pnf.dmaap; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyZeroInteractions; -import static org.mockito.Mockito.when; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.lang.reflect.Field; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ScheduledExecutorService; -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.ProtocolVersion; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.entity.StringEntity; -import org.apache.http.message.BasicHttpResponse; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.openecomp.mso.bpmn.core.PropertyConfiguration; -import org.openecomp.mso.bpmn.infrastructure.pnf.dmaap.PnfEventReadyDmaapClient.DmaapTopicListenerThread; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.core.classloader.annotations.PowerMockIgnore; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; - -@RunWith(PowerMockRunner.class) -@PrepareForTest({PropertyConfiguration.class}) -@PowerMockIgnore("javax.net.ssl.*") -public class PnfEventReadyDmaapClientTest { - - private static final String CORRELATION_ID = "corrTestId"; - private static final String CORRELATION_ID_NOT_FOUND_IN_MAP = "otherCorrId"; - private static final String JSON_EXAMPLE_WITH_CORRELATION_ID = "[\n" - + " {\n" - + " \"pnfRegistrationFields\" : {\n" - + " \"correlationId\" : \"%s\",\n" - + " \"value\" : \"value1\"\n" - + " }\n" - + " },\n" - + " {\n" - + " \"pnfRegistrationFields\" : {\n" - + " \"correlationId\" : \"corr\",\n" - + " \"value\" : \"value2\"\n" - + " }\n" - + " }\n" - + "]"; - private static final String JSON_EXAMPLE_WITH_NO_CORRELATION_ID = - "{\"pnfRegistrationFields\":{\"field\":\"value\"}}"; - - private static final String HOST = "hostTest"; - private static final int PORT = 1234; - private static final String PROTOCOL = "http"; - private static final String URI_PATH_PREFIX = "eventsForTesting"; - private static final String EVENT_TOPIC_TEST = "eventTopicTest"; - private static final String CONSUMER_ID = "consumerTestId"; - private static final String CONSUMER_GROUP = "consumerGroupTest"; - - private PnfEventReadyDmaapClient testedObject; - private DmaapTopicListenerThread testedObjectInnerClassThread; - private HttpClient httpClientMock; - private Runnable threadMockToNotifyCamundaFlow; - private ScheduledExecutorService executorMock; - - @Before - public void init() throws NoSuchFieldException, IllegalAccessException { - PowerMockito.mockStatic(PropertyConfiguration.class); - PropertyConfiguration propertyConfigurationMock = mock(PropertyConfiguration.class); - PowerMockito.when(PropertyConfiguration.getInstance()).thenReturn(propertyConfigurationMock); - when(propertyConfigurationMock.getProperties(PropertyConfiguration.MSO_BPMN_URN_PROPERTIES)).thenReturn( - createProperties()); - testedObject = new PnfEventReadyDmaapClient(); - testedObject.setDmaapProtocol(PROTOCOL); - testedObject.setDmaapUriPathPrefix(URI_PATH_PREFIX); - testedObject.setDmaapTopicName(EVENT_TOPIC_TEST); - testedObject.setConsumerId(CONSUMER_ID); - testedObject.setConsumerGroup(CONSUMER_GROUP); - testedObject.setDmaapClientDelayInSeconds(1); - testedObject.init(); - testedObjectInnerClassThread = testedObject.new DmaapTopicListenerThread(); - httpClientMock = mock(HttpClient.class); - threadMockToNotifyCamundaFlow = mock(Runnable.class); - executorMock = mock(ScheduledExecutorService.class); - setPrivateField(); - } - - /** - * Test run method, where the are following conditions: - * <p> - DmaapThreadListener is running, flag is set to true - * <p> - map is filled with one entry with the key that we get from response - * <p> run method should invoke thread from map to notify camunda process, remove element from the map (map is - * empty) and shutdown the executor because of empty map - */ - @Test - public void correlationIdIsFoundInHttpResponse_notifyAboutPnfReady() - throws IOException { - when(httpClientMock.execute(any(HttpGet.class))). - thenReturn(createResponse(String.format(JSON_EXAMPLE_WITH_CORRELATION_ID, CORRELATION_ID))); - testedObjectInnerClassThread.run(); - ArgumentCaptor<HttpGet> captor1 = ArgumentCaptor.forClass(HttpGet.class); - verify(httpClientMock).execute(captor1.capture()); - assertThat(captor1.getValue().getURI()).hasHost(HOST).hasPort(PORT).hasScheme(PROTOCOL) - .hasPath( - "/" + URI_PATH_PREFIX + "/" + EVENT_TOPIC_TEST + "/" + CONSUMER_GROUP + "/" + CONSUMER_ID + ""); - verify(threadMockToNotifyCamundaFlow).run(); - verify(executorMock).shutdownNow(); - } - - /** - * Test run method, where the are following conditions: - * <p> - DmaapThreadListener is running, flag is set to true - * <p> - map is filled with one entry with the correlationId that does not match to correlationId - * taken from http response. run method should not do anything with the map not run any thread to notify camunda - * process - */ - @Test - public void correlationIdIsFoundInHttpResponse_NotFoundInMap() - throws IOException { - when(httpClientMock.execute(any(HttpGet.class))). - thenReturn(createResponse( - String.format(JSON_EXAMPLE_WITH_CORRELATION_ID, CORRELATION_ID_NOT_FOUND_IN_MAP))); - testedObjectInnerClassThread.run(); - verifyZeroInteractions(threadMockToNotifyCamundaFlow, executorMock); - } - - /** - * Test run method, where the are following conditions: - * <p> - DmaapThreadListener is running, flag is set to true - * <p> - map is filled with one entry with the correlationId but no correlation id is taken from HttpResponse - * run method should not do anything with the map and not run any thread to notify camunda process - */ - @Test - public void correlationIdIsNotFoundInHttpResponse() throws IOException { - when(httpClientMock.execute(any(HttpGet.class))). - thenReturn(createResponse(JSON_EXAMPLE_WITH_NO_CORRELATION_ID)); - testedObjectInnerClassThread.run(); - verifyZeroInteractions(threadMockToNotifyCamundaFlow, executorMock); - } - - private void setPrivateField() throws NoSuchFieldException, IllegalAccessException { - Field httpClientField = testedObject.getClass().getDeclaredField("httpClient"); - httpClientField.setAccessible(true); - httpClientField.set(testedObject, httpClientMock); - httpClientField.setAccessible(false); - - Field executorField = testedObject.getClass().getDeclaredField("executor"); - executorField.setAccessible(true); - executorField.set(testedObject, executorMock); - executorField.setAccessible(false); - - Field pnfCorrelationToThreadMapField = testedObject.getClass() - .getDeclaredField("pnfCorrelationIdToThreadMap"); - pnfCorrelationToThreadMapField.setAccessible(true); - Map<String, Runnable> pnfCorrelationToThreadMap = new ConcurrentHashMap<>(); - pnfCorrelationToThreadMap.put(CORRELATION_ID, threadMockToNotifyCamundaFlow); - pnfCorrelationToThreadMapField.set(testedObject, pnfCorrelationToThreadMap); - - Field threadRunFlag = testedObject.getClass().getDeclaredField("dmaapThreadListenerIsRunning"); - threadRunFlag.setAccessible(true); - threadRunFlag.set(testedObject, true); - threadRunFlag.setAccessible(false); - } - - private Map<String, String> createProperties() { - Map<String, String> map = new HashMap<>(); - map.put("mso.dmaap.host", HOST); - map.put("mso.dmaap.port", String.valueOf(PORT)); - return map; - } - - private HttpResponse createResponse(String json) throws UnsupportedEncodingException { - HttpEntity entity = new StringEntity(json); - ProtocolVersion protocolVersion = new ProtocolVersion("", 1, 1); - HttpResponse response = new BasicHttpResponse(protocolVersion, 1, ""); - response.setEntity(entity); - response.setStatusCode(200); - return response; - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowResourceApplicationTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowResourceApplicationTest.java deleted file mode 100644 index c667dbf4bb..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowResourceApplicationTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.bpmn.infrastructure.workflow.service; - -import static org.junit.Assert.assertEquals; - -import java.util.Set; - -import org.junit.Test; - -public class WorkflowResourceApplicationTest { - - @Test - public void test() throws Exception { - WorkflowResourceApplication workflowResourceApp = new WorkflowResourceApplication(); - Set<Class<?>> classes = workflowResourceApp.getClasses(); - assertEquals(0, classes.size()); - Set<Object> singleton = workflowResourceApp.getSingletons(); - assertEquals(3, singleton.size()); - } -}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/HeaderUtilTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/HeaderUtilTest.java deleted file mode 100644 index b861a79feb..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/HeaderUtilTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -public class HeaderUtilTest { - - @Test - public void getAuthorizationTest() throws Exception { - String authorization = HeaderUtil.getAuthorization(HeaderUtil.USER, HeaderUtil.PASS); - assertEquals("Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==", authorization); - } - -}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilderTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilderTest.java deleted file mode 100644 index 99a87def80..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilderTest.java +++ /dev/null @@ -1,358 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2018 Huawei Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.builder; - -import org.camunda.bpm.engine.ProcessEngineServices; -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.camunda.bpm.engine.runtime.Incident; -import org.camunda.bpm.engine.variable.VariableMap; -import org.camunda.bpm.engine.variable.value.TypedValue; -import org.camunda.bpm.model.bpmn.BpmnModelInstance; -import org.camunda.bpm.model.bpmn.instance.FlowElement; -import org.junit.Test; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -public class AbstractBuilderTest { - - AbstractBuilder abstractBuilder = new AbstractBuilder() { - @Override - Object build(DelegateExecution execution, Object input) throws Exception { - return null; - } - }; - - DelegateExecution delegateExecution = new DelegateExecution() { - @Override - public String getProcessInstanceId() { - return null; - } - - @Override - public String getProcessBusinessKey() { - return null; - } - - @Override - public String getProcessDefinitionId() { - return null; - } - - @Override - public String getParentId() { - return null; - } - - @Override - public String getCurrentActivityId() { - return null; - } - - @Override - public String getCurrentActivityName() { - return null; - } - - @Override - public String getActivityInstanceId() { - return null; - } - - @Override - public String getParentActivityInstanceId() { - return null; - } - - @Override - public String getCurrentTransitionId() { - return null; - } - - @Override - public DelegateExecution getProcessInstance() { - return null; - } - - @Override - public DelegateExecution getSuperExecution() { - return null; - } - - @Override - public boolean isCanceled() { - return false; - } - - @Override - public String getTenantId() { - return null; - } - - @Override - public void setVariable(String s, Object o, String s1) { - - } - - @Override - public Incident createIncident(String s, String s1) { - return null; - } - - @Override - public Incident createIncident(String s, String s1, String s2) { - return null; - } - - @Override - public void resolveIncident(String s) { - - } - - @Override - public String getId() { - return null; - } - - @Override - public String getEventName() { - return null; - } - - @Override - public String getBusinessKey() { - return null; - } - - @Override - public BpmnModelInstance getBpmnModelInstance() { - return null; - } - - @Override - public FlowElement getBpmnModelElementInstance() { - return null; - } - - @Override - public ProcessEngineServices getProcessEngineServices() { - return null; - } - - @Override - public String getVariableScopeKey() { - return null; - } - - @Override - public Map<String, Object> getVariables() { - return null; - } - - @Override - public VariableMap getVariablesTyped() { - return null; - } - - @Override - public VariableMap getVariablesTyped(boolean b) { - return null; - } - - @Override - public Map<String, Object> getVariablesLocal() { - return null; - } - - @Override - public VariableMap getVariablesLocalTyped() { - return null; - } - - @Override - public VariableMap getVariablesLocalTyped(boolean b) { - return null; - } - - @Override - public Object getVariable(String s) { - return null; - } - - @Override - public Object getVariableLocal(String s) { - return null; - } - - @Override - public <T extends TypedValue> T getVariableTyped(String s) { - return null; - } - - @Override - public <T extends TypedValue> T getVariableTyped(String s, boolean b) { - return null; - } - - @Override - public <T extends TypedValue> T getVariableLocalTyped(String s) { - return null; - } - - @Override - public <T extends TypedValue> T getVariableLocalTyped(String s, boolean b) { - return null; - } - - @Override - public Set<String> getVariableNames() { - return null; - } - - @Override - public Set<String> getVariableNamesLocal() { - return null; - } - - @Override - public void setVariable(String s, Object o) { - - } - - @Override - public void setVariableLocal(String s, Object o) { - - } - - @Override - public void setVariables(Map<String, ?> map) { - - } - - @Override - public void setVariablesLocal(Map<String, ?> map) { - - } - - @Override - public boolean hasVariables() { - return false; - } - - @Override - public boolean hasVariablesLocal() { - return false; - } - - @Override - public boolean hasVariable(String s) { - return false; - } - - @Override - public boolean hasVariableLocal(String s) { - return false; - } - - @Override - public void removeVariable(String s) { - - } - - @Override - public void removeVariableLocal(String s) { - - } - - @Override - public void removeVariables(Collection<String> collection) { - - } - - @Override - public void removeVariablesLocal(Collection<String> collection) { - - } - - @Override - public void removeVariables() { - - } - - @Override - public void removeVariablesLocal() { - - } - }; - - - @Test - public void buildTest() throws Exception { - abstractBuilder.build(null, null); - } - - @Test - public void getRequestActoinTest() throws Exception { - abstractBuilder.getRequestActoin(delegateExecution); - } - - @Test - public void getSvcActionTest() throws Exception { - abstractBuilder.getSvcAction(delegateExecution); - } - - @Test - public void getRequestIdTest() throws Exception { - abstractBuilder.getRequestId(delegateExecution); - } - - @Test - public void getOnapServiceModelInformationEntityTest() throws Exception { - abstractBuilder.getOnapServiceModelInformationEntity(delegateExecution); - } - - @Test - public void getOnapNetworkModelInformationEntityTest() throws Exception { - abstractBuilder.getOnapNetworkModelInformationEntity(delegateExecution); - } - - @Test - public void getParamEntitiesTest() throws Exception { - abstractBuilder.getParamEntities(new HashMap<>()); - } - - @Test - public void getRequestInformationEntityTest() throws Exception { - abstractBuilder.getRequestInformationEntity(delegateExecution); - } - - @Test - public void getServiceInformationEntityTest() throws Exception { - abstractBuilder.getServiceInformationEntity(delegateExecution); - } - - @Test - public void getServiceInstanceNameTest() throws Exception { - abstractBuilder.getServiceInstanceName(delegateExecution); - } - -}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/AbstractTestBase.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/AbstractTestBase.java deleted file mode 100644 index e7b80f12ab..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/AbstractTestBase.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.bpmn.vcpe; - -import org.openecomp.mso.bpmn.common.WorkflowTest; - -public class AbstractTestBase extends WorkflowTest { - - - public static final String CUST = "SDN-ETHERNET-INTERNET"; - public static final String SVC = "123456789"; - public static final String INST = "MIS%252F1604%252F0026%252FSW_INTERNET"; - public static final String PARENT_INST = "MIS%252F1604%252F0027%252FSW_INTERNET"; - public static final String ARID = "arId-1"; - public static final String ARVERS = "1490627351232"; - - public static final String DEC_INST = "MIS%2F1604%2F0026%2FSW_INTERNET"; - public static final String DEC_PARENT_INST = "MIS%2F1604%2F0027%2FSW_INTERNET"; - - public static final String VAR_SUCCESS_IND = "SuccessIndicator"; - public static final String VAR_WFEX = "SavedWorkflowException1"; - public static final String VAR_RESP_CODE = "CMSO_ResponseCode"; - public static final String VAR_COMP_REQ = "CompleteMsoProcessRequest"; -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/CreateVcpeResCustServiceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/CreateVcpeResCustServiceTest.java deleted file mode 100644 index d9534f325f..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/CreateVcpeResCustServiceTest.java +++ /dev/null @@ -1,382 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.bpmn.vcpe; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteAllottedResource; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetCustomer; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutAllottedResource; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutServiceInstance; -import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.MockGetServiceResourcesCatalogData; -import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB; -import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import org.camunda.bpm.engine.test.Deployment; -import org.junit.Ignore; -import org.junit.Test; -import org.openecomp.mso.bpmn.common.BPMNUtil; -import org.openecomp.mso.bpmn.mock.FileUtil; - -public class CreateVcpeResCustServiceTest extends AbstractTestBase { - - private static final String PROCNAME = "CreateVcpeResCustService"; - private static final String Prefix = "CVRCS_"; - - private final CallbackSet callbacks = new CallbackSet(); - private final String request; - - public CreateVcpeResCustServiceTest() throws IOException { - callbacks.put("assign", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyAssignCallback.xml")); - callbacks.put("create", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyCreateCallback.xml")); - callbacks.put("activate", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyActivateCallback.xml")); - callbacks.put("queryTXC", FileUtil.readResourceFile("__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryTXCCallback.xml")); - callbacks.put("queryBRG", FileUtil.readResourceFile("__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryBRGCallback.xml")); - callbacks.put("deactivate", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeactivateCallback.xml")); - callbacks.put("delete", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeleteCallback.xml")); - callbacks.put("unassign", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyUnassignCallback.xml")); - - request = FileUtil.readResourceFile("__files/VCPE/CreateVcpeResCustService/requestNoSIName.json"); - } - - @Test - @Ignore // 1802 merge - @Deployment(resources = { - "process/CreateVcpeResCustService.bpmn", - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/GenericPutService.bpmn", - "subprocess/BuildingBlock/DecomposeService.bpmn", - "subprocess/DoCreateServiceInstance.bpmn", - "subprocess/DoCreateAllottedResourceTXC.bpmn", - "subprocess/DoCreateAllottedResourceBRG.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - - // stubs - "VCPE/stubprocess/Homing.bpmn", - "VCPE/stubprocess/DoCreateVnfAndModules.bpmn"}) - - public void testCreateVcpeResCustService_Success() throws Exception { - - System.out.println("starting: testCreateVcpeResCustService_Success\n"); - MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "2", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json"); - MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json"); - MockGetCustomer(CUST, "VCPE/CreateVcpeResCustService/getCustomer.xml"); - - // TODO: the SI should NOT have to be URL-encoded yet again! - MockPutServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml"); - MockGetServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml"); - - MockNodeQueryServiceInstanceById(INST, "GenericFlows/getSIUrlById.xml"); - MockNodeQueryServiceInstanceById(PARENT_INST, "GenericFlows/getParentSIUrlById.xml"); - MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml"); - MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml"); - MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID); - MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID); - - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - Map<String, Object> variables = setupVariables(); - - String businessKey = UUID.randomUUID().toString(); - invokeAsyncProcess(PROCNAME, "v1", businessKey, request, variables); - - // for SI - injectSDNCCallbacks(callbacks, "assign"); - - // for TXC - injectSDNCCallbacks(callbacks, "assign"); - injectSDNCCallbacks(callbacks, "create"); - injectSDNCCallbacks(callbacks, "activate"); - injectSDNCCallbacks(callbacks, "queryTXC"); - - // for BRG - injectSDNCCallbacks(callbacks, "assign"); - injectSDNCCallbacks(callbacks, "create"); - injectSDNCCallbacks(callbacks, "activate"); - injectSDNCCallbacks(callbacks, "queryBRG"); - - waitForProcessEnd(businessKey, 10000); - - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - - String completionReq = BPMNUtil.getVariable(processEngineRule, PROCNAME, Prefix+VAR_COMP_REQ); - System.out.println("completionReq:\n" + completionReq); - - assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, PROCNAME+VAR_SUCCESS_IND)); - assertEquals("200", BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_RESP_CODE)); - assertEquals(null, workflowException); - assertTrue(completionReq.contains("request-id>testRequestId<")); - assertTrue(completionReq.contains("action>CREATE<")); - assertTrue(completionReq.contains("source>VID<")); - - assertEquals("1", BPMNUtil.getVariable(processEngineRule, PROCNAME, Prefix+"VnfsCreatedCount")); - } - - @Test - @Ignore // 1802 merge - @Deployment(resources = { - "process/CreateVcpeResCustService.bpmn", - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/GenericPutService.bpmn", - "subprocess/BuildingBlock/DecomposeService.bpmn", - "subprocess/DoCreateServiceInstance.bpmn", - "subprocess/DoCreateAllottedResourceTXC.bpmn", - "subprocess/DoCreateAllottedResourceBRG.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - - // stubs - "VCPE/stubprocess/Homing.bpmn", - "VCPE/stubprocess/DoCreateVnfAndModules.bpmn"}) - - public void testCreateVcpeResCustService_NoParts() throws Exception { - - System.out.println("starting: testCreateVcpeResCustService_NoParts\n" ); - MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "2", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesNoData.json"); - MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesNoData.json"); - MockGetCustomer(CUST, "VCPE/CreateVcpeResCustService/getCustomer.xml"); - - // TODO: the SI should NOT have to be URL-encoded yet again! - MockPutServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml"); - MockGetServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml"); - - MockNodeQueryServiceInstanceById(INST, "GenericFlows/getSIUrlById.xml"); - MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml"); - MockNodeQueryServiceInstanceById(PARENT_INST, "GenericFlows/getParentSIUrlById.xml"); - MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml"); - - // TODO: should these really be PARENT_INST, or should they be INST? - MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID); - MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID); - - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - Map<String, Object> variables = setupVariables(); - - String businessKey = UUID.randomUUID().toString(); - invokeAsyncProcess(PROCNAME, "v1", businessKey, request, variables); - - // for SI - injectSDNCCallbacks(callbacks, "assign"); - - waitForProcessEnd(businessKey, 10000); - - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - - String completionReq = BPMNUtil.getVariable(processEngineRule, PROCNAME, Prefix+VAR_COMP_REQ); - System.out.println("completionReq:\n" + completionReq); - - assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, PROCNAME+VAR_SUCCESS_IND)); - assertEquals("200", BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_RESP_CODE)); - assertEquals(null, workflowException); - assertTrue(completionReq.contains("request-id>testRequestId<")); - assertTrue(completionReq.contains("action>CREATE<")); - assertTrue(completionReq.contains("source>VID<")); - - assertEquals("0", BPMNUtil.getVariable(processEngineRule, PROCNAME, Prefix+"VnfsCreatedCount")); - } - - @Test - @Ignore // 1802 merge - @Deployment(resources = { - "process/CreateVcpeResCustService.bpmn", - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/GenericPutService.bpmn", - "subprocess/BuildingBlock/DecomposeService.bpmn", - "subprocess/DoCreateServiceInstance.bpmn", - "subprocess/DoCreateAllottedResourceBRG.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - - // this stub will trigger a fault - "VCPE/stubprocess/DoCreateAllottedResourceTXC.bpmn", - - // stubs - "VCPE/stubprocess/Homing.bpmn", - "VCPE/stubprocess/DoCreateVnfAndModules.bpmn"}) - - public void testCreateVcpeResCustService_Fault_NoRollback() throws Exception { - - System.out.println("starting: testCreateVcpeResCustService_Fault_NoRollback\n"); - MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "2", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json"); - MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json"); - MockGetCustomer(CUST, "VCPE/CreateVcpeResCustService/getCustomer.xml"); - - // TODO: the SI should NOT have to be URL-encoded yet again! - MockPutServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml"); - MockGetServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml"); - - MockNodeQueryServiceInstanceById(INST, "GenericFlows/getSIUrlById.xml"); - MockNodeQueryServiceInstanceById(PARENT_INST, "GenericFlows/getParentSIUrlById.xml"); - MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml"); - MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml"); - MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID); - MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID); - - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - Map<String, Object> variables = setupVariables(); - - String req = FileUtil.readResourceFile("__files/VCPE/CreateVcpeResCustService/requestNoSINameNoRollback.json"); - - String businessKey = UUID.randomUUID().toString(); - invokeAsyncProcess(PROCNAME, "v1", businessKey, req, variables); - - // for SI - injectSDNCCallbacks(callbacks, "assign"); - - waitForProcessEnd(businessKey, 10000); - - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - - String completionReq = BPMNUtil.getVariable(processEngineRule, PROCNAME, Prefix+VAR_COMP_REQ); - System.out.println("completionReq:\n" + completionReq); - - assertEquals(null, BPMNUtil.getVariable(processEngineRule, PROCNAME, PROCNAME+VAR_SUCCESS_IND)); - assertEquals(null, BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_RESP_CODE)); - assertNotNull(workflowException); - - BPMNUtil.assertNoProcessInstance(processEngineRule, "DoCreateAllottedResourceBRGRollback"); - BPMNUtil.assertNoProcessInstance(processEngineRule, "DoCreateVnfAndModulesRollback"); - BPMNUtil.assertNoProcessInstance(processEngineRule, "DoCreateAllottedResourceTXCRollback"); - } - - @Test - @Ignore // 1802 merge - @Deployment(resources = { - "process/CreateVcpeResCustService.bpmn", - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/GenericPutService.bpmn", - "subprocess/BuildingBlock/DecomposeService.bpmn", - "subprocess/DoCreateServiceInstance.bpmn", - "subprocess/DoCreateAllottedResourceTXC.bpmn", - "subprocess/DoCreateAllottedResourceTXCRollback.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - - // this stub will trigger a fault - "VCPE/stubprocess/DoCreateAllottedResourceBRG.bpmn", - - // stubs - "VCPE/stubprocess/DoCreateAllottedResourceBRGRollback.bpmn", - "VCPE/stubprocess/DoCreateVnfAndModulesRollback.bpmn", - "VCPE/stubprocess/DoCreateServiceInstanceRollback.bpmn", - "VCPE/stubprocess/Homing.bpmn", - "VCPE/stubprocess/DoCreateVnfAndModules.bpmn"}) - - public void testCreateVcpeResCustService_Fault_Rollback() throws Exception { - - System.out.println("starting: testCreateVcpeResCustService_Fault_Rollback\n"); - MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "2", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json"); - MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json"); - MockGetCustomer(CUST, "VCPE/CreateVcpeResCustService/getCustomer.xml"); - - // TODO: the SI should NOT have to be URL-encoded yet again! - MockPutServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml"); - MockGetServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml"); - - MockNodeQueryServiceInstanceById(INST, "GenericFlows/getSIUrlById.xml"); - MockNodeQueryServiceInstanceById(PARENT_INST, "GenericFlows/getParentSIUrlById.xml"); - MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml"); - MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml"); - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/CreateVcpeResCustService/arGetById.xml"); - MockGetAllottedResource(CUST, SVC, PARENT_INST, ARID, "VCPE/CreateVcpeResCustService/arGetById.xml"); - MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID); - MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID); - MockDeleteAllottedResource(CUST, SVC, PARENT_INST, ARID, ARVERS); - - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - Map<String, Object> variables = setupVariables(); - - String businessKey = UUID.randomUUID().toString(); - invokeAsyncProcess(PROCNAME, "v1", businessKey, request, variables); - - // for SI - injectSDNCCallbacks(callbacks, "assign"); - - // for TXC - injectSDNCCallbacks(callbacks, "assign"); - injectSDNCCallbacks(callbacks, "create"); - injectSDNCCallbacks(callbacks, "activate"); - injectSDNCCallbacks(callbacks, "queryTXC"); - - // BRG is a stub so don't need SDNC callbacks - - // for TXC rollback - injectSDNCCallbacks(callbacks, "deactivate"); - injectSDNCCallbacks(callbacks, "delete"); - injectSDNCCallbacks(callbacks, "unassign"); - - waitForProcessEnd(businessKey, 10000); - - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - - String completionReq = BPMNUtil.getVariable(processEngineRule, PROCNAME, Prefix+VAR_COMP_REQ); - System.out.println("completionReq:\n" + completionReq); - - assertEquals(null, BPMNUtil.getVariable(processEngineRule, PROCNAME, PROCNAME+VAR_SUCCESS_IND)); - assertEquals(null, BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_RESP_CODE)); - assertEquals(null, completionReq); - assertNotNull(workflowException); - - BPMNUtil.assertAnyProcessInstanceFinished(processEngineRule, "DoCreateAllottedResourceBRGRollback"); - BPMNUtil.assertAnyProcessInstanceFinished(processEngineRule, "DoCreateVnfAndModulesRollback"); - BPMNUtil.assertAnyProcessInstanceFinished(processEngineRule, "DoCreateAllottedResourceTXCRollback"); - } - - // ***************** - // Utility Section - // ***************** - - // Success Scenario - private Map<String, Object> setupVariables() { - Map<String, Object> variables = new HashMap<>(); - variables.put("requestId", "testRequestId"); - variables.put("request-id", "testRequestId"); - variables.put("serviceInstanceId", DEC_INST); - variables.put("allottedResourceId", ARID); - return variables; - - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DeleteVcpeResCustServiceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DeleteVcpeResCustServiceTest.java deleted file mode 100644 index d026b7a949..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DeleteVcpeResCustServiceTest.java +++ /dev/null @@ -1,297 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.bpmn.vcpe; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.get; -import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; -import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteAllottedResource; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockQueryAllottedResourceById; -import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB; -import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import org.camunda.bpm.engine.test.Deployment; -import org.junit.Test; -import org.openecomp.mso.bpmn.common.BPMNUtil; -import org.openecomp.mso.bpmn.mock.FileUtil; - -import com.github.tomakehurst.wiremock.stubbing.Scenario; - -public class DeleteVcpeResCustServiceTest extends AbstractTestBase { - - private static final String PROCNAME = "DeleteVcpeResCustService"; - private static final String Prefix = "DVRCS_"; - private static final String AR_BRG_ID = "ar-brgB"; - private static final String AR_TXC_ID = "ar-txcA"; - - private final CallbackSet callbacks = new CallbackSet(); - private final String request; - - public DeleteVcpeResCustServiceTest() throws IOException { - callbacks.put("deactivate", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeactivateCallback.xml")); - callbacks.put("delete", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeleteCallback.xml")); - callbacks.put("unassign", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyUnassignCallback.xml")); - - request = FileUtil.readResourceFile("__files/VCPE/DeleteVcpeResCustService/request.json"); - } - - @Test - @Deployment(resources = { - "process/DeleteVcpeResCustService.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/GenericDeleteService.bpmn", - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoDeleteServiceInstance.bpmn", - "subprocess/DoDeleteAllottedResourceBRG.bpmn", - "subprocess/DoDeleteAllottedResourceTXC.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - - // stubs - "VCPE/stubprocess/DoDeleteVnfAndModules.bpmn"}) - - public void testDeleteVcpeResCustService_Success() throws Exception { - - MockNodeQueryServiceInstanceById(INST, "GenericFlows/getSIUrlById.xml"); - - // TODO: use INST instead of DEC_INST - /* - * Seems to be a bug in GenericDeleteService (or its subflows) as they - * fail to URL-encode the SI id before performing the query so we'll - * add a stub for that case, too. - */ - MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml"); - - /* - * cannot use MockGetServiceInstance(), because we need to return - * different responses as we traverse through the flow - */ - - // initially, the SI includes the ARs - stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + CUST + "/service-subscriptions/service-subscription/" + SVC + "/service-instances/service-instance/" + INST)) - .inScenario("SI retrieval") - .whenScenarioStateIs(Scenario.STARTED) - .willReturn(aResponse() - .withStatus(200) - .withHeader("Content-Type", "text/xml") - .withBodyFile("VCPE/DeleteVcpeResCustService/getSI.xml")) - .willSetStateTo("ARs Deleted")); - - // once the ARs have been deleted, the SI should be empty - stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + CUST + "/service-subscriptions/service-subscription/" + SVC + "/service-instances/service-instance/" + INST)) - .inScenario("SI retrieval") - .whenScenarioStateIs("ARs Deleted") - .willReturn(aResponse() - .withStatus(200) - .withHeader("Content-Type", "text/xml") - .withBodyFile("VCPE/DeleteVcpeResCustService/getSIAfterDelArs.xml"))); - - // for BRG - MockQueryAllottedResourceById(AR_BRG_ID, "VCPE/DeleteVcpeResCustService/getBRGArUrlById.xml"); - MockGetAllottedResource(CUST, SVC, INST, AR_BRG_ID, "VCPE/DeleteVcpeResCustService/arGetBRGById.xml"); - MockPatchAllottedResource(CUST, SVC, INST, AR_BRG_ID); - MockDeleteAllottedResource(CUST, SVC, INST, AR_BRG_ID, ARVERS); - - // for TXC - MockQueryAllottedResourceById(AR_TXC_ID, "VCPE/DeleteVcpeResCustService/getTXCArUrlById.xml"); - MockGetAllottedResource(CUST, SVC, INST, AR_TXC_ID, "VCPE/DeleteVcpeResCustService/arGetTXCById.xml"); - MockPatchAllottedResource(CUST, SVC, INST, AR_TXC_ID); - MockDeleteAllottedResource(CUST, SVC, INST, AR_TXC_ID, ARVERS); - - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - Map<String, Object> variables = setupVariables(); - - String businessKey = UUID.randomUUID().toString(); - invokeAsyncProcess(PROCNAME, "v1", businessKey, request, variables); - - // for BRG - injectSDNCCallbacks(callbacks, "deactivate"); - injectSDNCCallbacks(callbacks, "delete"); - injectSDNCCallbacks(callbacks, "unassign"); - - // for TXC - injectSDNCCallbacks(callbacks, "deactivate"); - injectSDNCCallbacks(callbacks, "delete"); - injectSDNCCallbacks(callbacks, "unassign"); - - // for SI - injectSDNCCallbacks(callbacks, "deactivate"); - injectSDNCCallbacks(callbacks, "delete"); - - waitForProcessEnd(businessKey, 10000); - - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - - String completionReq = BPMNUtil.getVariable(processEngineRule, PROCNAME, Prefix+VAR_COMP_REQ); - System.out.println("completionReq:\n" + completionReq); - - assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, PROCNAME+VAR_SUCCESS_IND)); - assertEquals("200", BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_RESP_CODE)); - assertEquals(null, workflowException); - assertTrue(completionReq.contains("<request-id>testRequestId<")); - assertTrue(completionReq.contains("<action>DELETE<")); - assertTrue(completionReq.contains("<source>VID<")); - - assertEquals("2", BPMNUtil.getVariable(processEngineRule, PROCNAME, Prefix+"vnfsDeletedCount")); - - BPMNUtil.assertAnyProcessInstanceFinished(processEngineRule, "DoDeleteVnfAndModules"); - } - - @Test - @Deployment(resources = { - "process/DeleteVcpeResCustService.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/GenericDeleteService.bpmn", - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoDeleteServiceInstance.bpmn", - "subprocess/DoDeleteAllottedResourceBRG.bpmn", - "subprocess/DoDeleteAllottedResourceTXC.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - - // stubs - "VCPE/stubprocess/DoDeleteVnfAndModules.bpmn"}) - - public void testDeleteVcpeResCustService_NoBRG_NoTXC_NoVNF() throws Exception { - - MockNodeQueryServiceInstanceById(INST, "GenericFlows/getSIUrlById.xml"); - - // TODO: use INST instead of DEC_INST - /* - * Seems to be a bug in GenericDeleteService (or its subflows) as they - * fail to URL-encode the SI id before performing the query so we'll - * add a stub for that case, too. - */ - MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml"); - - MockGetServiceInstance(CUST, SVC, INST, "VCPE/DeleteVcpeResCustService/getSIAfterDelArs.xml"); - - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - Map<String, Object> variables = setupVariables(); - - String businessKey = UUID.randomUUID().toString(); - invokeAsyncProcess(PROCNAME, "v1", businessKey, request, variables); - - // for SI - injectSDNCCallbacks(callbacks, "deactivate"); - injectSDNCCallbacks(callbacks, "delete"); - - waitForProcessEnd(businessKey, 10000); - - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - - String completionReq = BPMNUtil.getVariable(processEngineRule, PROCNAME, Prefix+VAR_COMP_REQ); - System.out.println("completionReq:\n" + completionReq); - - assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, PROCNAME+VAR_SUCCESS_IND)); - assertEquals("200", BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_RESP_CODE)); - assertEquals(null, workflowException); - assertTrue(completionReq.contains("<request-id>testRequestId<")); - assertTrue(completionReq.contains("<action>DELETE<")); - assertTrue(completionReq.contains("<source>VID<")); - - assertEquals("0", BPMNUtil.getVariable(processEngineRule, PROCNAME, Prefix+"vnfsDeletedCount")); - - BPMNUtil.assertNoProcessInstance(processEngineRule, "DoDeleteVnfAndModules"); - } - - @Test - @Deployment(resources = { - "process/DeleteVcpeResCustService.bpmn", - "subprocess/GenericGetService.bpmn", - "subprocess/GenericDeleteService.bpmn", - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoDeleteServiceInstance.bpmn", - "subprocess/DoDeleteAllottedResourceBRG.bpmn", - "subprocess/DoDeleteAllottedResourceTXC.bpmn", - "subprocess/CompleteMsoProcess.bpmn", - - // stubs - "VCPE/stubprocess/DoDeleteVnfAndModules.bpmn"}) - - public void testDeleteVcpeResCustService_Fault() throws Exception { - - MockNodeQueryServiceInstanceById(INST, "GenericFlows/getSIUrlById.xml"); - - // TODO: use INST instead of DEC_INST - /* - * Seems to be a bug in GenericDeleteService (or its subflows) as they - * fail to URL-encode the SI id before performing the query so we'll - * add a stub for that case, too. - */ - MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml"); - - MockGetServiceInstance(CUST, SVC, INST, "VCPE/DeleteVcpeResCustService/getSIAfterDelArs.xml"); - - // generate failure - mockSDNCAdapter(404); - - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - Map<String, Object> variables = setupVariables(); - - String businessKey = UUID.randomUUID().toString(); - invokeAsyncProcess(PROCNAME, "v1", businessKey, request, variables); - - waitForProcessEnd(businessKey, 10000); - - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - - String completionReq = BPMNUtil.getVariable(processEngineRule, PROCNAME, Prefix+VAR_COMP_REQ); - System.out.println("completionReq:\n" + completionReq); - - assertEquals(null, BPMNUtil.getVariable(processEngineRule, PROCNAME, PROCNAME+VAR_SUCCESS_IND)); - assertEquals(null, BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_RESP_CODE)); - assertNotNull(workflowException); - } - - private Map<String, Object> setupVariables() throws UnsupportedEncodingException { - Map<String, Object> variables = new HashMap<>(); - variables.put("isDebugLogEnabled", "true"); - variables.put("requestId", "testRequestId"); - variables.put("serviceInstanceId", DEC_INST); - variables.put("sdncVersion", "1802"); - variables.put("serviceInstanceName", "some-junk-name"); - return variables; - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGRollbackTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGRollbackTest.java deleted file mode 100644 index 0407e172e2..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGRollbackTest.java +++ /dev/null @@ -1,345 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.bpmn.vcpe; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteAllottedResource; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource; -import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB; -import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import org.camunda.bpm.engine.test.Deployment; -import org.junit.Test; -import org.openecomp.mso.bpmn.common.BPMNUtil; -import org.openecomp.mso.bpmn.core.RollbackData; -import org.openecomp.mso.bpmn.mock.FileUtil; - - -public class DoCreateAllottedResourceBRGRollbackTest extends AbstractTestBase { - - private static final String PROCNAME = "DoCreateAllottedResourceBRGRollback"; - private static final String RbType = "DCARBRG_"; - private final CallbackSet callbacks = new CallbackSet(); - - public DoCreateAllottedResourceBRGRollbackTest() throws IOException { - callbacks.put("deactivate", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeactivateCallback.xml")); - callbacks.put("delete", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeleteCallback.xml")); - callbacks.put("unassign", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyUnassignCallback.xml")); - } - - @Test - @Deployment(resources = { - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoCreateAllottedResourceBRGRollback.bpmn"}) - public void testDoCreateAllottedResourceBRGRollback_Success() throws Exception { - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml"); - MockPatchAllottedResource(CUST, SVC, INST, ARID); - MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS); - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - setVariablesSuccess(variables, "testRequestId1"); - - invokeSubProcess(PROCNAME, businessKey, variables); - - injectSDNCCallbacks(callbacks, "deactivate"); - injectSDNCCallbacks(callbacks, "delete"); - injectSDNCCallbacks(callbacks, "unassign"); - - waitForProcessEnd(businessKey, 10000); - - assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - assertEquals(null, workflowException); - assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack")); - assertNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError")); - } - - @Test - @Deployment(resources = { - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoCreateAllottedResourceBRGRollback.bpmn"}) - public void testDoCreateAllottedResourceBRGRollback_skipRollback() throws Exception { - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml"); - MockPatchAllottedResource(CUST, SVC, INST, ARID); - MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS); - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - RollbackData rollbackData = setVariablesSuccess(variables, "testRequestId1"); - - rollbackData.put(RbType, "rollbackAAI", "false"); - rollbackData.put(RbType, "rollbackSDNCassign", "false"); - - invokeSubProcess(PROCNAME, businessKey, variables); - - waitForProcessEnd(businessKey, 10000); - - assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - assertEquals(null, workflowException); - assertEquals(null, BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack")); - assertNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError")); - } - - @Test - @Deployment(resources = { - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoCreateAllottedResourceBRGRollback.bpmn"}) - public void testDoCreateAllottedResourceBRGRollback_DoNotRollBack() throws Exception { - - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - RollbackData rollbackData = setVariablesSuccess(variables, "testRequestId1"); - - // this will cause "rollbackSDNC" to be set to false - rollbackData.put(RbType, "rollbackSDNCassign", "false"); - - invokeSubProcess(PROCNAME, businessKey, variables); - - waitForProcessEnd(businessKey, 10000); - - assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - assertEquals(null, workflowException); - assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack")); - assertNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError")); - } - - @Test - @Deployment(resources = { - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoCreateAllottedResourceBRGRollback.bpmn"}) - public void testDoCreateAllottedResourceBRGRollback_NoDeactivate() throws Exception { - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml"); - MockPatchAllottedResource(CUST, SVC, INST, ARID); - MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS); - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - RollbackData rollbackData = setVariablesSuccess(variables, "testRequestId1"); - - rollbackData.put(RbType, "rollbackSDNCactivate", "false"); - - invokeSubProcess(PROCNAME, businessKey, variables); - - injectSDNCCallbacks(callbacks, "delete"); - injectSDNCCallbacks(callbacks, "unassign"); - - waitForProcessEnd(businessKey, 10000); - - assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - assertEquals(null, workflowException); - assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack")); - assertNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError")); - } - - @Test - @Deployment(resources = { - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoCreateAllottedResourceBRGRollback.bpmn"}) - public void testDoCreateAllottedResourceBRGRollback_NoDelete() throws Exception { - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml"); - MockPatchAllottedResource(CUST, SVC, INST, ARID); - MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS); - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - RollbackData rollbackData = setVariablesSuccess(variables, "testRequestId1"); - - rollbackData.put(RbType, "rollbackSDNCcreate", "false"); - - invokeSubProcess(PROCNAME, businessKey, variables); - - injectSDNCCallbacks(callbacks, "deactivate"); - injectSDNCCallbacks(callbacks, "unassign"); - - waitForProcessEnd(businessKey, 10000); - - assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - assertEquals(null, workflowException); - assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack")); - assertNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError")); - } - - @Test - @Deployment(resources = { - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoCreateAllottedResourceBRGRollback.bpmn"}) - public void testDoCreateAllottedResourceBRGRollback_NoUnassign() throws Exception { - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml"); - MockPatchAllottedResource(CUST, SVC, INST, ARID); - MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS); - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - RollbackData rollbackData = setVariablesSuccess(variables, "testRequestId1"); - - rollbackData.put(RbType, "rollbackSDNCassign", "false"); - - /* - * Note: if assign == false then the flow/script will set - * "skipRollback" to false, which will cause ALL of the SDNC steps - * to be skipped, not just the unassign step. - */ - - invokeSubProcess(PROCNAME, businessKey, variables); - - waitForProcessEnd(businessKey, 10000); - - assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - assertEquals(null, workflowException); - assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack")); - assertNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError")); - } - - @Test - @Deployment(resources = { - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoCreateAllottedResourceBRGRollback.bpmn"}) - public void testDoCreateAllottedResourceBRGRollback_SubProcessError() throws Exception { - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml"); - MockPatchAllottedResource(CUST, SVC, INST, ARID); - MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - mockSDNCAdapter(404); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - setVariablesSuccess(variables, "testRequestId1"); - - invokeSubProcess(PROCNAME, businessKey, variables); - - waitForProcessEnd(businessKey, 10000); - - assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - assertEquals(null, workflowException); - assertEquals("false", BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack")); - assertNotNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError")); - } - - @Test - @Deployment(resources = { - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoCreateAllottedResourceBRGRollback.bpmn"}) - public void testDoCreateAllottedResourceBRGRollback_JavaException() throws Exception { - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml"); - MockPatchAllottedResource(CUST, SVC, INST, ARID); - MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS); - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - setVariablesSuccess(variables, "testRequestId1"); - - variables.put("rollbackData", "string instead of rollback data"); - - invokeSubProcess(PROCNAME, businessKey, variables); - - waitForProcessEnd(businessKey, 10000); - - assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - assertEquals(null, workflowException); - assertEquals("false", BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack")); - assertNotNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError")); - } - - private RollbackData setVariablesSuccess(Map<String, Object> variables, String requestId) { - variables.put("isDebugLogEnabled", "true"); - variables.put("failNotFound", "true"); - variables.put("msoRequestId", requestId); - variables.put("mso-request-id", "requestId"); - variables.put("allottedResourceId", ARID); - - variables.put("serviceInstanceId", DEC_INST); - variables.put("parentServiceInstanceId", DEC_PARENT_INST); - - RollbackData rollbackData = new RollbackData(); - - rollbackData.put(RbType, "serviceInstanceId", DEC_INST); - rollbackData.put(RbType, "serviceSubscriptionType", SVC); - rollbackData.put(RbType, "disablerollback", "false"); - rollbackData.put(RbType, "rollbackAAI", "true"); - rollbackData.put(RbType, "rollbackSDNCassign", "true"); - rollbackData.put(RbType, "rollbackSDNCactivate", "true"); - rollbackData.put(RbType, "rollbackSDNCcreate", "true"); - rollbackData.put(RbType, "aaiARPath", "http://localhost:28090/aai/v9/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID); - - rollbackData.put(RbType, "sdncActivateRollbackReq", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncActivateRollbackReq.xml")); - rollbackData.put(RbType, "sdncCreateRollbackReq", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncCreateRollbackReq.xml")); - rollbackData.put(RbType, "sdncAssignRollbackReq", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncAssignRollbackReq.xml")); - - variables.put("rollbackData",rollbackData); - - return rollbackData; - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGTest.java deleted file mode 100644 index 0373266ce1..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGTest.java +++ /dev/null @@ -1,296 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.bpmn.vcpe; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource; -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.mock.FileUtil; - - -public class DoCreateAllottedResourceBRGTest extends AbstractTestBase { - - private static final String PROCNAME = "DoCreateAllottedResourceBRG"; - private final CallbackSet callbacks = new CallbackSet(); - - public DoCreateAllottedResourceBRGTest() throws IOException { - callbacks.put("assign", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyAssignCallback.xml")); - callbacks.put("create", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyCreateCallback.xml")); - callbacks.put("activate", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyActivateCallback.xml")); - callbacks.put("query", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceBRG/SDNCTopologyQueryCallback.xml")); - } - - @Test - @Deployment(resources = { - "subprocess/GenericGetService.bpmn", - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoCreateAllottedResourceBRG.bpmn", - "subprocess/DoCreateAllottedResourceBRGRollback.bpmn"}) - public void testDoCreateAllottedResourceBRG_Success() throws Exception{ - - // TODO: use INST instead of DEC_INST - /* - * should be INST instead of DEC_INST, but AAI utilities appear to - * have a bug in that they don't URL-encode the SI id before using - * it in the query - */ - MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml"); - MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml"); - - MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml"); - MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml"); - MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID); - MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID); - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - setVariablesSuccess(variables, "testRequestId123"); - - invokeSubProcess(PROCNAME, 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, PROCNAME, VAR_WFEX); - assertEquals(null, workflowException); - - assertEquals("namefromrequest", BPMNUtil.getVariable(processEngineRule, PROCNAME, "allotedResourceName")); - } - - @Test - @Deployment(resources = { - "subprocess/GenericGetService.bpmn", - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoCreateAllottedResourceBRG.bpmn", - "subprocess/DoCreateAllottedResourceBRGRollback.bpmn"}) - public void testDoCreateAllottedResourceBRG_NoSI() throws Exception{ - - // TODO: use INST instead of DEC_INST - /* - * should be INST instead of DEC_INST, but AAI utilities appear to - * have a bug in that they don't URL-encode the SI id before using - * it in the query - */ - MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getNotFound.xml"); - MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml"); - - MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml"); - MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml"); - MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID); - MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID); - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - setVariablesSuccess(variables, "testRequestId123"); - - invokeSubProcess(PROCNAME, businessKey, variables); - - waitForProcessEnd(businessKey, 10000); - - Assert.assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - assertNotNull(workflowException); - - assertEquals(null, BPMNUtil.getVariable(processEngineRule, PROCNAME, "allotedResourceName")); - } - - @Test - @Deployment(resources = { - "subprocess/GenericGetService.bpmn", - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoCreateAllottedResourceBRG.bpmn", - "subprocess/DoCreateAllottedResourceBRGRollback.bpmn"}) - public void testDoCreateAllottedResourceBRG_ActiveAr() throws Exception{ - - // TODO: use INST instead of DEC_INST - /* - * should be INST instead of DEC_INST, but AAI utilities appear to - * have a bug in that they don't URL-encode the SI id before using - * it in the query - */ - MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml"); - MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml"); - - MockGetServiceInstance(CUST, SVC, INST, "VCPE/DoCreateAllottedResourceBRG/getSIandAR.xml"); - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRG/getArBrg2.xml"); - MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml"); - MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID); - MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID); - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - setVariablesSuccess(variables, "testRequestId123"); - - variables.put("failExists", "false"); - - invokeSubProcess(PROCNAME, businessKey, variables); - - injectSDNCCallbacks(callbacks, "query"); - - waitForProcessEnd(businessKey, 10000); - - Assert.assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - assertEquals(null, workflowException); - - assertEquals("namefromrequest", BPMNUtil.getVariable(processEngineRule, PROCNAME, "allotedResourceName")); - } - - @Test - @Deployment(resources = { - "subprocess/GenericGetService.bpmn", - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoCreateAllottedResourceBRG.bpmn", - "subprocess/DoCreateAllottedResourceBRGRollback.bpmn"}) - public void testDoCreateAllottedResourceBRG_NoParentSI() throws Exception{ - - // TODO: use INST instead of DEC_INST - /* - * should be INST instead of DEC_INST, but AAI utilities appear to - * have a bug in that they don't URL-encode the SI id before using - * it in the query - */ - MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml"); - MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getNotFound.xml"); - - MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml"); - MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml"); - MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID); - MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID); - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - setVariablesSuccess(variables, "testRequestId123"); - - invokeSubProcess(PROCNAME, businessKey, variables); - - waitForProcessEnd(businessKey, 10000); - - Assert.assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - assertNotNull(workflowException); - - assertEquals(null, BPMNUtil.getVariable(processEngineRule, PROCNAME, "allotedResourceName")); - } - - @Test - @Deployment(resources = { - "subprocess/GenericGetService.bpmn", - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoCreateAllottedResourceBRG.bpmn", - "subprocess/DoCreateAllottedResourceBRGRollback.bpmn"}) - public void testDoCreateAllottedResourceBRG_SubProcessError() throws Exception{ - - // TODO: use INST instead of DEC_INST - /* - * should be INST instead of DEC_INST, but AAI utilities appear to - * have a bug in that they don't URL-encode the SI id before using - * it in the query - */ - MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml"); - MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml"); - - MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml"); - MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml"); - MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID); - MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID); - mockSDNCAdapter(404); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - setVariablesSuccess(variables, "testRequestId123"); - - invokeSubProcess(PROCNAME, businessKey, variables); - - waitForProcessEnd(businessKey, 10000); - - Assert.assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - assertNotNull(workflowException); - - assertEquals(null, BPMNUtil.getVariable(processEngineRule, PROCNAME, "allotedResourceName")); - } - - private void setVariablesSuccess(Map<String, Object> variables, String requestId) { - 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); - variables.put("vni", "BRG"); - variables.put("vgmuxBearerIP", "bearerip"); - variables.put("brgWanMacAddress", "wanmac"); - - variables.put("serviceInstanceId", DEC_INST); - variables.put("parentServiceInstanceId", DEC_PARENT_INST); - - 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 deleted file mode 100644 index cdce56ee63..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceTXCRollbackTest.java +++ /dev/null @@ -1,345 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.bpmn.vcpe; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteAllottedResource; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource; -import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB; -import static org.openecomp.mso.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import org.camunda.bpm.engine.test.Deployment; -import org.junit.Test; -import org.openecomp.mso.bpmn.common.BPMNUtil; -import org.openecomp.mso.bpmn.core.RollbackData; -import org.openecomp.mso.bpmn.mock.FileUtil; - - -public class DoCreateAllottedResourceTXCRollbackTest extends AbstractTestBase { - - private static final String PROCNAME = "DoCreateAllottedResourceTXCRollback"; - private static final String RbType = "DCARTXC_"; - private final CallbackSet callbacks = new CallbackSet(); - - public DoCreateAllottedResourceTXCRollbackTest() throws IOException { - callbacks.put("deactivate", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeactivateCallback.xml")); - callbacks.put("delete", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeleteCallback.xml")); - callbacks.put("unassign", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyUnassignCallback.xml")); - } - - @Test - @Deployment(resources = { - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoCreateAllottedResourceTXCRollback.bpmn"}) - public void testDoCreateAllottedResourceTXCRollback_Success() throws Exception { - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml"); - MockPatchAllottedResource(CUST, SVC, INST, ARID); - MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS); - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - setVariablesSuccess(variables, "testRequestId1"); - - invokeSubProcess(PROCNAME, businessKey, variables); - - injectSDNCCallbacks(callbacks, "deactivate"); - injectSDNCCallbacks(callbacks, "delete"); - injectSDNCCallbacks(callbacks, "unassign"); - - waitForProcessEnd(businessKey, 10000); - - assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - assertEquals(null, workflowException); - assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack")); - assertNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError")); - } - - @Test - @Deployment(resources = { - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoCreateAllottedResourceTXCRollback.bpmn"}) - public void testDoCreateAllottedResourceTXCRollback_skipRollback() throws Exception { - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml"); - MockPatchAllottedResource(CUST, SVC, INST, ARID); - MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS); - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - RollbackData rollbackData = setVariablesSuccess(variables, "testRequestId1"); - - rollbackData.put(RbType, "rollbackAAI", "false"); - rollbackData.put(RbType, "rollbackSDNCassign", "false"); - - invokeSubProcess(PROCNAME, businessKey, variables); - - waitForProcessEnd(businessKey, 10000); - - assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - assertEquals(null, workflowException); - assertEquals(null, BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack")); - assertNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError")); - } - - @Test - @Deployment(resources = { - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoCreateAllottedResourceTXCRollback.bpmn"}) - public void testDoCreateAllottedResourceTXCRollback_DoNotRollBack() throws Exception { - - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - RollbackData rollbackData = setVariablesSuccess(variables, "testRequestId1"); - - // this will cause "rollbackSDNC" to be set to false - rollbackData.put(RbType, "rollbackSDNCassign", "false"); - - invokeSubProcess(PROCNAME, businessKey, variables); - - waitForProcessEnd(businessKey, 10000); - - assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - assertEquals(null, workflowException); - assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack")); - assertNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError")); - } - - @Test - @Deployment(resources = { - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoCreateAllottedResourceTXCRollback.bpmn"}) - public void testDoCreateAllottedResourceTXCRollback_NoDeactivate() throws Exception { - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml"); - MockPatchAllottedResource(CUST, SVC, INST, ARID); - MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS); - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - RollbackData rollbackData = setVariablesSuccess(variables, "testRequestId1"); - - rollbackData.put(RbType, "rollbackSDNCactivate", "false"); - - invokeSubProcess(PROCNAME, businessKey, variables); - - injectSDNCCallbacks(callbacks, "delete"); - injectSDNCCallbacks(callbacks, "unassign"); - - waitForProcessEnd(businessKey, 10000); - - assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - assertEquals(null, workflowException); - assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack")); - assertNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError")); - } - - @Test - @Deployment(resources = { - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoCreateAllottedResourceTXCRollback.bpmn"}) - public void testDoCreateAllottedResourceTXCRollback_NoDelete() throws Exception { - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml"); - MockPatchAllottedResource(CUST, SVC, INST, ARID); - MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS); - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - RollbackData rollbackData = setVariablesSuccess(variables, "testRequestId1"); - - rollbackData.put(RbType, "rollbackSDNCcreate", "false"); - - invokeSubProcess(PROCNAME, businessKey, variables); - - injectSDNCCallbacks(callbacks, "deactivate"); - injectSDNCCallbacks(callbacks, "unassign"); - - waitForProcessEnd(businessKey, 10000); - - assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - assertEquals(null, workflowException); - assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack")); - assertNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError")); - } - - @Test - @Deployment(resources = { - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoCreateAllottedResourceTXCRollback.bpmn"}) - public void testDoCreateAllottedResourceTXCRollback_NoUnassign() throws Exception { - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml"); - MockPatchAllottedResource(CUST, SVC, INST, ARID); - MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS); - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - RollbackData rollbackData = setVariablesSuccess(variables, "testRequestId1"); - - rollbackData.put(RbType, "rollbackSDNCassign", "false"); - - /* - * Note: if assign == false then the flow/script will set - * "skipRollback" to false, which will cause ALL of the SDNC steps - * to be skipped, not just the unassign step. - */ - - invokeSubProcess(PROCNAME, businessKey, variables); - - waitForProcessEnd(businessKey, 10000); - - assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - assertEquals(null, workflowException); - assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack")); - assertNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError")); - } - - @Test - @Deployment(resources = { - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoCreateAllottedResourceTXCRollback.bpmn"}) - public void testDoCreateAllottedResourceTXCRollback_SubProcessError() throws Exception { - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml"); - MockPatchAllottedResource(CUST, SVC, INST, ARID); - MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - mockSDNCAdapter(404); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - setVariablesSuccess(variables, "testRequestId1"); - - invokeSubProcess(PROCNAME, businessKey, variables); - - waitForProcessEnd(businessKey, 10000); - - assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - assertEquals(null, workflowException); - assertEquals("false", BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack")); - assertNotNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError")); - } - - @Test - @Deployment(resources = { - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoCreateAllottedResourceTXCRollback.bpmn"}) - public void testDoCreateAllottedResourceTXCRollback_JavaException() throws Exception { - - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml"); - MockPatchAllottedResource(CUST, SVC, INST, ARID); - MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS); - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - setVariablesSuccess(variables, "testRequestId1"); - - variables.put("rollbackData", "string instead of rollback data"); - - invokeSubProcess(PROCNAME, businessKey, variables); - - waitForProcessEnd(businessKey, 10000); - - assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - assertEquals(null, workflowException); - assertEquals("false", BPMNUtil.getVariable(processEngineRule, PROCNAME, "rolledBack")); - assertNotNull(BPMNUtil.getVariable(processEngineRule, PROCNAME, "rollbackError")); - } - - private RollbackData setVariablesSuccess(Map<String, Object> variables, String requestId) { - variables.put("isDebugLogEnabled", "true"); - variables.put("failNotFound", "true"); - variables.put("msoRequestId", requestId); - variables.put("mso-request-id", "requestId"); - variables.put("allottedResourceId", ARID); - - variables.put("serviceInstanceId", DEC_INST); - variables.put("parentServiceInstanceId", DEC_PARENT_INST); - - RollbackData rollbackData = new RollbackData(); - - rollbackData.put(RbType, "serviceInstanceId", DEC_INST); - rollbackData.put(RbType, "serviceSubscriptionType", SVC); - rollbackData.put(RbType, "disablerollback", "false"); - rollbackData.put(RbType, "rollbackAAI", "true"); - rollbackData.put(RbType, "rollbackSDNCassign", "true"); - rollbackData.put(RbType, "rollbackSDNCactivate", "true"); - rollbackData.put(RbType, "rollbackSDNCcreate", "true"); - rollbackData.put(RbType, "aaiARPath", "http://localhost:28090/aai/v9/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID); - - rollbackData.put(RbType, "sdncActivateRollbackReq", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncActivateRollbackReq.xml")); - rollbackData.put(RbType, "sdncCreateRollbackReq", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncCreateRollbackReq.xml")); - rollbackData.put(RbType, "sdncAssignRollbackReq", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncAssignRollbackReq.xml")); - - variables.put("rollbackData",rollbackData); - - return rollbackData; - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceTXCTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceTXCTest.java deleted file mode 100644 index 9cf059c24c..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceTXCTest.java +++ /dev/null @@ -1,302 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.bpmn.vcpe; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetServiceInstance; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource; -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.mock.FileUtil; - - -public class DoCreateAllottedResourceTXCTest extends AbstractTestBase { - - private static final String PROCNAME = "DoCreateAllottedResourceTXC"; - private final CallbackSet callbacks = new CallbackSet(); - - public DoCreateAllottedResourceTXCTest() throws IOException { - callbacks.put("assign", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyAssignCallback.xml")); - callbacks.put("create", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyCreateCallback.xml")); - callbacks.put("activate", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyActivateCallback.xml")); - callbacks.put("query", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceTXC/SDNCTopologyQueryCallback.xml")); - } - - @Test - @Deployment(resources = { - "subprocess/GenericGetService.bpmn", - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoCreateAllottedResourceTXC.bpmn", - "subprocess/DoCreateAllottedResourceTXCRollback.bpmn"}) - public void testDoCreateAllottedResourceTXC_Success() throws Exception{ - - // TODO: use INST instead of DEC_INST - /* - * should be INST instead of DEC_INST, but AAI utilities appear to - * have a bug in that they don't URL-encode the SI id before using - * it in the query - */ - MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml"); - MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml"); - - MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml"); - MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml"); - MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID); - MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID); - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - setVariablesSuccess(variables, "testRequestId123"); - - invokeSubProcess(PROCNAME, 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, PROCNAME, VAR_WFEX); - assertEquals(null, workflowException); - - assertEquals("namefromrequest", BPMNUtil.getVariable(processEngineRule, PROCNAME, "allotedResourceName")); - assertEquals("my-vni", BPMNUtil.getVariable(processEngineRule, PROCNAME, "vni")); - assertEquals("my-bearer-ip", BPMNUtil.getVariable(processEngineRule, PROCNAME, "vgmuxBearerIP")); - assertEquals("my-lan-ip", BPMNUtil.getVariable(processEngineRule, PROCNAME, "vgmuxLanIP")); - } - - @Test - @Deployment(resources = { - "subprocess/GenericGetService.bpmn", - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoCreateAllottedResourceTXC.bpmn", - "subprocess/DoCreateAllottedResourceTXCRollback.bpmn"}) - public void testDoCreateAllottedResourceTXC_NoSI() throws Exception{ - - // TODO: use INST instead of DEC_INST - /* - * should be INST instead of DEC_INST, but AAI utilities appear to - * have a bug in that they don't URL-encode the SI id before using - * it in the query - */ - MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getNotFound.xml"); - MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml"); - - MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml"); - MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml"); - MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID); - MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID); - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - setVariablesSuccess(variables, "testRequestId123"); - - invokeSubProcess(PROCNAME, businessKey, variables); - - waitForProcessEnd(businessKey, 10000); - - Assert.assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - assertNotNull(workflowException); - - assertEquals(null, BPMNUtil.getVariable(processEngineRule, PROCNAME, "allotedResourceName")); - } - - @Test - @Deployment(resources = { - "subprocess/GenericGetService.bpmn", - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoCreateAllottedResourceTXC.bpmn", - "subprocess/DoCreateAllottedResourceTXCRollback.bpmn"}) - public void testDoCreateAllottedResourceTXC_ActiveAr() throws Exception{ - - // TODO: use INST instead of DEC_INST - /* - * should be INST instead of DEC_INST, but AAI utilities appear to - * have a bug in that they don't URL-encode the SI id before using - * it in the query - */ - MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml"); - MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml"); - - MockGetServiceInstance(CUST, SVC, INST, "VCPE/DoCreateAllottedResourceTXC/getSIandAR.xml"); - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc2.xml"); - MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml"); - MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID); - MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID); - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - setVariablesSuccess(variables, "testRequestId123"); - - variables.put("failExists", "false"); - - invokeSubProcess(PROCNAME, businessKey, variables); - - injectSDNCCallbacks(callbacks, "query"); - - waitForProcessEnd(businessKey, 10000); - - Assert.assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - assertEquals(null, workflowException); - - assertEquals("namefromrequest", BPMNUtil.getVariable(processEngineRule, PROCNAME, "allotedResourceName")); - assertEquals("my-vni", BPMNUtil.getVariable(processEngineRule, PROCNAME, "vni")); - assertEquals("my-bearer-ip", BPMNUtil.getVariable(processEngineRule, PROCNAME, "vgmuxBearerIP")); - assertEquals("my-lan-ip", BPMNUtil.getVariable(processEngineRule, PROCNAME, "vgmuxLanIP")); - } - - @Test - @Deployment(resources = { - "subprocess/GenericGetService.bpmn", - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoCreateAllottedResourceTXC.bpmn", - "subprocess/DoCreateAllottedResourceTXCRollback.bpmn"}) - public void testDoCreateAllottedResourceTXC_NoParentSI() throws Exception{ - - // TODO: use INST instead of DEC_INST - /* - * should be INST instead of DEC_INST, but AAI utilities appear to - * have a bug in that they don't URL-encode the SI id before using - * it in the query - */ - MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml"); - - MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getNotFound.xml"); - - MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml"); - MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml"); - MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID); - MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID); - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - setVariablesSuccess(variables, "testRequestId123"); - - invokeSubProcess(PROCNAME, businessKey, variables); - - waitForProcessEnd(businessKey, 10000); - - Assert.assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - assertNotNull(workflowException); - - assertEquals(null, BPMNUtil.getVariable(processEngineRule, PROCNAME, "allotedResourceName")); - } - - @Test - @Deployment(resources = { - "subprocess/GenericGetService.bpmn", - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoCreateAllottedResourceTXC.bpmn", - "subprocess/DoCreateAllottedResourceTXCRollback.bpmn"}) - public void testDoCreateAllottedResourceTXC_SubProcessError() throws Exception{ - - // TODO: use INST instead of DEC_INST - /* - * should be INST instead of DEC_INST, but AAI utilities appear to - * have a bug in that they don't URL-encode the SI id before using - * it in the query - */ - MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml"); - MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml"); - - MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml"); - MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml"); - MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID); - MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID); - mockSDNCAdapter(404); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - setVariablesSuccess(variables, "testRequestId123"); - - invokeSubProcess(PROCNAME, businessKey, variables); - - waitForProcessEnd(businessKey, 10000); - - Assert.assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - assertNotNull(workflowException); - - assertEquals(null, BPMNUtil.getVariable(processEngineRule, PROCNAME, "allotedResourceName")); - } - - private void setVariablesSuccess(Map<String, Object> variables, String requestId) { - // TODO: need all of these? - variables.put("isDebugLogEnabled", "true"); - variables.put("failExists", "true"); - variables.put("disableRollback", "true"); - variables.put("msoRequestId", requestId); - variables.put("mso-request-id", "requestId"); - variables.put("sourceNetworkId", "snId"); - variables.put("sourceNetworkRole", "snRole"); - variables.put("allottedResourceRole", "brg"); - variables.put("allottedResourceType", "TXC"); - variables.put("allottedResourceId", ARID); - variables.put("brgWanMacAddress", "wanmac"); - - variables.put("serviceInstanceId", DEC_INST); - variables.put("parentServiceInstanceId", DEC_PARENT_INST); - - 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 deleted file mode 100644 index 03972da789..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoDeleteAllottedResourceBRGTest.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.bpmn.vcpe; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteAllottedResource; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource; -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.Ignore; -import org.junit.Test; -import org.openecomp.mso.bpmn.common.BPMNUtil; -import org.openecomp.mso.bpmn.mock.FileUtil; - - -public class DoDeleteAllottedResourceBRGTest extends AbstractTestBase { - - private static final String PROCNAME = "DoDeleteAllottedResourceBRG"; - private final CallbackSet callbacks = new CallbackSet(); - - public DoDeleteAllottedResourceBRGTest() throws IOException { - callbacks.put("deactivate", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeactivateCallback.xml")); - callbacks.put("deactivateNF", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeactivateCallbackNotFound.xml")); - callbacks.put("delete", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeleteCallback.xml")); - callbacks.put("unassign", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyUnassignCallback.xml")); - } - - @Test - @Deployment(resources = { - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoDeleteAllottedResourceBRG.bpmn"}) - public void testDoDeleteAllottedResourceBRG_Success() throws Exception { - - MockQueryAllottedResourceById(ARID, "GenericFlows/getARUrlById.xml"); - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml"); - MockPatchAllottedResource(CUST, SVC, INST, ARID); - MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS); - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - setVariablesSuccess(variables, "testRequestId1"); - - invokeSubProcess(PROCNAME, businessKey, variables); - - injectSDNCCallbacks(callbacks, "deactivate"); - injectSDNCCallbacks(callbacks, "delete"); - injectSDNCCallbacks(callbacks, "unassign"); - - waitForProcessEnd(businessKey, 10000); - - Assert.assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - assertEquals(null, workflowException); - } - - @Test - @Deployment(resources = { - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoDeleteAllottedResourceBRG.bpmn"}) - public void testDoDeleteAllottedResourceBRG_ARNotInSDNC() throws Exception { - - MockQueryAllottedResourceById(ARID, "GenericFlows/getARUrlById.xml"); - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml"); - MockPatchAllottedResource(CUST, SVC, INST, ARID); - MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS); - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - setVariablesSuccess(variables, "testRequestId1"); - - variables.put("failNotFound", "false"); - - invokeSubProcess(PROCNAME, businessKey, variables); - - injectSDNCCallbacks(callbacks, "deactivateNF"); - - waitForProcessEnd(businessKey, 10000); - - Assert.assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - assertEquals(null, workflowException); - } - - // TODO - exception is not caught - @Test - @Ignore - @Deployment(resources = { - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoDeleteAllottedResourceBRG.bpmn"}) - public void testDoDeleteAllottedResourceBRG_SubProcessError() throws Exception { - - MockQueryAllottedResourceById(ARID, "GenericFlows/getARUrlById.xml"); - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml"); - MockPatchAllottedResource(CUST, SVC, INST, ARID); - MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - mockSDNCAdapter(500); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - setVariablesSuccess(variables, "testRequestId1"); - - invokeSubProcess(PROCNAME, businessKey, variables); - - waitForProcessEnd(businessKey, 10000); - - Assert.assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - assertNotNull(workflowException); - } - - private void setVariablesSuccess(Map<String, Object> variables, String requestId) { - variables.put("isDebugLogEnabled", "true"); - variables.put("failNotFound", "true"); - variables.put("msoRequestId", requestId); - variables.put("mso-request-id", "requestId"); - variables.put("allottedResourceId", ARID); - - variables.put("serviceInstanceId", DEC_INST); - variables.put("parentServiceInstanceId", DEC_PARENT_INST); - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoDeleteAllottedResourceTXCTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoDeleteAllottedResourceTXCTest.java deleted file mode 100644 index 2b0364c3c9..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoDeleteAllottedResourceTXCTest.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.bpmn.vcpe; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteAllottedResource; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource; -import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource; -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.Ignore; -import org.junit.Test; -import org.openecomp.mso.bpmn.common.BPMNUtil; -import org.openecomp.mso.bpmn.mock.FileUtil; - - -public class DoDeleteAllottedResourceTXCTest extends AbstractTestBase { - - private static final String PROCNAME = "DoDeleteAllottedResourceTXC"; - private final CallbackSet callbacks = new CallbackSet(); - - public DoDeleteAllottedResourceTXCTest() throws IOException { - callbacks.put("deactivate", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeactivateCallback.xml")); - callbacks.put("deactivateNF", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeactivateCallbackNotFound.xml")); - callbacks.put("delete", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeleteCallback.xml")); - callbacks.put("unassign", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyUnassignCallback.xml")); - } - - @Test - @Deployment(resources = { - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoDeleteAllottedResourceTXC.bpmn"}) - public void testDoDeleteAllottedResourceTXC_Success() throws Exception { - - MockQueryAllottedResourceById(ARID, "GenericFlows/getARUrlById.xml"); - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml"); - MockPatchAllottedResource(CUST, SVC, INST, ARID); - MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS); - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - setVariablesSuccess(variables, "testRequestId1"); - - invokeSubProcess(PROCNAME, businessKey, variables); - - injectSDNCCallbacks(callbacks, "deactivate"); - injectSDNCCallbacks(callbacks, "delete"); - injectSDNCCallbacks(callbacks, "unassign"); - - waitForProcessEnd(businessKey, 10000); - - Assert.assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - assertEquals(null, workflowException); - } - - @Test - @Deployment(resources = { - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoDeleteAllottedResourceTXC.bpmn"}) - public void testDoDeleteAllottedResourceTXC_ARNotInSDNC() throws Exception { - - MockQueryAllottedResourceById(ARID, "GenericFlows/getARUrlById.xml"); - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml"); - MockPatchAllottedResource(CUST, SVC, INST, ARID); - MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS); - mockSDNCAdapter(200); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - setVariablesSuccess(variables, "testRequestId1"); - - variables.put("failNotFound", "false"); - - invokeSubProcess(PROCNAME, businessKey, variables); - - injectSDNCCallbacks(callbacks, "deactivateNF"); - - waitForProcessEnd(businessKey, 10000); - - Assert.assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - assertEquals(null, workflowException); - } - - // TODO - exception is not caught - @Test - @Ignore - @Deployment(resources = { - "subprocess/SDNCAdapterV1.bpmn", - "subprocess/FalloutHandler.bpmn", - "subprocess/DoDeleteAllottedResourceTXC.bpmn"}) - public void testDoDeleteAllottedResourceTXC_SubProcessError() throws Exception { - - MockQueryAllottedResourceById(ARID, "GenericFlows/getARUrlById.xml"); - MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml"); - MockPatchAllottedResource(CUST, SVC, INST, ARID); - MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS); - mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml"); - - mockSDNCAdapter(500); - - String businessKey = UUID.randomUUID().toString(); - Map<String, Object> variables = new HashMap<>(); - setVariablesSuccess(variables, "testRequestId1"); - - invokeSubProcess(PROCNAME, businessKey, variables); - - waitForProcessEnd(businessKey, 10000); - - Assert.assertTrue(isProcessEnded(businessKey)); - String workflowException = BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_WFEX); - System.out.println("workflowException:\n" + workflowException); - assertNotNull(workflowException); - } - - private void setVariablesSuccess(Map<String, Object> variables, String requestId) { - variables.put("isDebugLogEnabled", "true"); - variables.put("failNotFound", "true"); - variables.put("msoRequestId", requestId); - variables.put("mso-request-id", "requestId"); - variables.put("allottedResourceId", ARID); - - variables.put("serviceInstanceId", DEC_INST); - variables.put("parentServiceInstanceId", DEC_PARENT_INST); - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/VCPE/stubprocess/DoCreateAllottedResourceBRG.bpmn b/bpmn/MSOInfrastructureBPMN/src/test/resources/VCPE/stubprocess/DoCreateAllottedResourceBRG.bpmn deleted file mode 100644 index b33aad7443..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/VCPE/stubprocess/DoCreateAllottedResourceBRG.bpmn +++ /dev/null @@ -1,54 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_DkzPAHB4EeaJwpcpVN5gXw" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.9.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> - <bpmn2:process id="DoCreateAllottedResourceBRG" name="DoCreateAllottedResourceBRG" isExecutable="true"> - <bpmn2:startEvent id="StartEvent_1"> - <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing> - </bpmn2:startEvent> - <bpmn2:sequenceFlow id="SequenceFlow_1" name="" sourceRef="StartEvent_1" targetRef="initialization" /> - <bpmn2:scriptTask id="initialization" name="set rollbackData"> - <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_1v2f9n5</bpmn2:outgoing> - <bpmn2:script><![CDATA[#{execution.setVariable("rollbackData", true)}]]></bpmn2:script> - </bpmn2:scriptTask> - <bpmn2:endEvent id="EndEvent_1"> - <bpmn2:incoming>SequenceFlow_1v2f9n5</bpmn2:incoming> - <bpmn2:errorEventDefinition id="ErrorEventDefinition_1" errorRef="Error_2" /> - </bpmn2:endEvent> - <bpmn2:sequenceFlow id="SequenceFlow_1v2f9n5" sourceRef="initialization" targetRef="EndEvent_1" /> - </bpmn2:process> - <bpmn2:error id="Error_1" name="Java Lang Exception" errorCode="java.lang.Exception" /> - <bpmn2:error id="Error_2" name="MSO Workflow Exception" errorCode="MSOWorkflowException" /> - <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoCreateAllottedResourceBRG"> - <bpmndi:BPMNShape id="_BPMNShape_StartEvent_68" bpmnElement="StartEvent_1"> - <dc:Bounds x="-91" y="222" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="-73" y="263" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_285" bpmnElement="initialization"> - <dc:Bounds x="35" y="200" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="_BPMNShape_StartEvent_68" targetElement="_BPMNShape_ScriptTask_285"> - <di:waypoint xsi:type="dc:Point" x="-55" y="240" /> - <di:waypoint xsi:type="dc:Point" x="35" y="241" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="-55" y="225.5" width="90" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="_BPMNShape_EndEvent_225" bpmnElement="EndEvent_1"> - <dc:Bounds x="235" y="222" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="208" y="263" width="90" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1v2f9n5_di" bpmnElement="SequenceFlow_1v2f9n5"> - <di:waypoint xsi:type="dc:Point" x="135" y="240" /> - <di:waypoint xsi:type="dc:Point" x="235" y="240" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="140" y="219" width="90" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - </bpmndi:BPMNPlane> - </bpmndi:BPMNDiagram> -</bpmn2:definitions> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/VCPE/stubprocess/DoCreateAllottedResourceBRGRollback.bpmn b/bpmn/MSOInfrastructureBPMN/src/test/resources/VCPE/stubprocess/DoCreateAllottedResourceBRGRollback.bpmn deleted file mode 100644 index 807efae1af..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/VCPE/stubprocess/DoCreateAllottedResourceBRGRollback.bpmn +++ /dev/null @@ -1,55 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_DkzPAHB4EeaJwpcpVN5gXw" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.9.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> - <bpmn2:process id="DoCreateAllottedResourceBRGRollback" name="DoCreateAllottedResourceBRGRollback" isExecutable="true"> - <bpmn2:startEvent id="StartEvent_1"> - <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing> - </bpmn2:startEvent> - <bpmn2:sequenceFlow id="SequenceFlow_1" name="" sourceRef="StartEvent_1" targetRef="ScriptTask_03yvb82" /> - <bpmn2:endEvent id="EndEvent_1sn21jr"> - <bpmn2:incoming>SequenceFlow_1epm19d</bpmn2:incoming> - </bpmn2:endEvent> - <bpmn2:scriptTask id="ScriptTask_03yvb82" name="set Success"> - <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_1epm19d</bpmn2:outgoing> - <bpmn2:script><![CDATA[#{execution.setVariable("rolledBack", true)}]]></bpmn2:script> - </bpmn2:scriptTask> - <bpmn2:sequenceFlow id="SequenceFlow_1epm19d" sourceRef="ScriptTask_03yvb82" targetRef="EndEvent_1sn21jr" /> - </bpmn2:process> - <bpmn2:error id="Error_1" name="Java Lang Exception" errorCode="java.lang.Exception" /> - <bpmn2:error id="Error_2" name="MSO Workflow Exception" errorCode="MSOWorkflowException" /> - <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoCreateAllottedResourceBRGRollback"> - <bpmndi:BPMNShape id="_BPMNShape_StartEvent_68" bpmnElement="StartEvent_1"> - <dc:Bounds x="66" y="392" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="84" y="433" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="_BPMNShape_StartEvent_68" targetElement="ScriptTask_03yvb82_di"> - <di:waypoint xsi:type="dc:Point" x="101" y="412" /> - <di:waypoint xsi:type="dc:Point" x="207" y="410" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="109" y="396" width="90" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="EndEvent_1sn21jr_di" bpmnElement="EndEvent_1sn21jr"> - <dc:Bounds x="413" y="392" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="386" y="432" width="90" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ScriptTask_03yvb82_di" bpmnElement="ScriptTask_03yvb82"> - <dc:Bounds x="207" y="370" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1epm19d_di" bpmnElement="SequenceFlow_1epm19d"> - <di:waypoint xsi:type="dc:Point" x="307" y="410" /> - <di:waypoint xsi:type="dc:Point" x="377" y="410" /> - <di:waypoint xsi:type="dc:Point" x="377" y="410" /> - <di:waypoint xsi:type="dc:Point" x="413" y="410" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="392" y="404" width="0" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - </bpmndi:BPMNPlane> - </bpmndi:BPMNDiagram> -</bpmn2:definitions> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/VCPE/stubprocess/DoCreateAllottedResourceTXC.bpmn b/bpmn/MSOInfrastructureBPMN/src/test/resources/VCPE/stubprocess/DoCreateAllottedResourceTXC.bpmn deleted file mode 100644 index b2f280d7e9..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/VCPE/stubprocess/DoCreateAllottedResourceTXC.bpmn +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_DkzPAHB4EeaJwpcpVN5gXw" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.9.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> - <bpmn2:process id="DoCreateAllottedResourceTXC" name="DoCreateAllottedResourceTXC" isExecutable="true"> - <bpmn2:startEvent id="StartEvent_1"> - <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing> - </bpmn2:startEvent> - <bpmn2:sequenceFlow id="SequenceFlow_1" name="" sourceRef="StartEvent_1" targetRef="EndEvent_1" /> - <bpmn2:endEvent id="EndEvent_1"> - <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming> - <bpmn2:errorEventDefinition id="ErrorEventDefinition_1" errorRef="Error_2" /> - </bpmn2:endEvent> - </bpmn2:process> - <bpmn2:error id="Error_1" name="Java Lang Exception" errorCode="java.lang.Exception" /> - <bpmn2:error id="Error_2" name="MSO Workflow Exception" errorCode="MSOWorkflowException" /> - <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoCreateAllottedResourceTXC"> - <bpmndi:BPMNShape id="_BPMNShape_StartEvent_68" bpmnElement="StartEvent_1"> - <dc:Bounds x="-91" y="222" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="-73" y="263" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="_BPMNShape_StartEvent_68" targetElement="_BPMNShape_EndEvent_225"> - <di:waypoint xsi:type="dc:Point" x="-55" y="240" /> - <di:waypoint xsi:type="dc:Point" x="139" y="240" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="-3" y="225" width="90" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="_BPMNShape_EndEvent_225" bpmnElement="EndEvent_1"> - <dc:Bounds x="139" y="222" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="112" y="263" width="90" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - </bpmndi:BPMNPlane> - </bpmndi:BPMNDiagram> -</bpmn2:definitions> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/VCPE/stubprocess/DoCreateServiceInstanceRollback.bpmn b/bpmn/MSOInfrastructureBPMN/src/test/resources/VCPE/stubprocess/DoCreateServiceInstanceRollback.bpmn deleted file mode 100644 index 532ca867bb..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/VCPE/stubprocess/DoCreateServiceInstanceRollback.bpmn +++ /dev/null @@ -1,53 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.9.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> - <bpmn2:process id="DoCreateServiceInstanceRollback" name="DoCreateServiceInstanceRollback" isExecutable="true"> - <bpmn2:startEvent id="createSIRollback_startEvent" name="Start Flow"> - <bpmn2:outgoing>SequenceFlow_1ipu8um</bpmn2:outgoing> - </bpmn2:startEvent> - <bpmn2:endEvent id="EndEvent_3"> - <bpmn2:incoming>SequenceFlow_1l4c4k0</bpmn2:incoming> - </bpmn2:endEvent> - <bpmn2:scriptTask id="ScriptTask_05ltxyj" name="set Success"> - <bpmn2:incoming>SequenceFlow_1ipu8um</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_1l4c4k0</bpmn2:outgoing> - <bpmn2:script><![CDATA[#{execution.setVariable("rolledBack", true)}]]></bpmn2:script> - </bpmn2:scriptTask> - <bpmn2:sequenceFlow id="SequenceFlow_1ipu8um" sourceRef="createSIRollback_startEvent" targetRef="ScriptTask_05ltxyj" /> - <bpmn2:sequenceFlow id="SequenceFlow_1l4c4k0" sourceRef="ScriptTask_05ltxyj" targetRef="EndEvent_3" /> - </bpmn2:process> - <bpmn2:error id="Error_2" name="MSOWorkflowException" errorCode="MSOWorkflowException" /> - <bpmn2:error id="Error_1" name="java.lang.Exception" errorCode="java.lang.Exception" /> - <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoCreateServiceInstanceRollback"> - <bpmndi:BPMNShape id="_BPMNShape_StartEvent_47" bpmnElement="createSIRollback_startEvent"> - <dc:Bounds x="151" y="79" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="146" y="120" width="48" height="14" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="_BPMNShape_EndEvent_177" bpmnElement="EndEvent_3"> - <dc:Bounds x="484" y="79" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="457" y="120" width="90" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ScriptTask_05ltxyj_di" bpmnElement="ScriptTask_05ltxyj"> - <dc:Bounds x="287" y="57" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1ipu8um_di" bpmnElement="SequenceFlow_1ipu8um"> - <di:waypoint xsi:type="dc:Point" x="187" y="97" /> - <di:waypoint xsi:type="dc:Point" x="287" y="97" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="237" y="76" width="0" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1l4c4k0_di" bpmnElement="SequenceFlow_1l4c4k0"> - <di:waypoint xsi:type="dc:Point" x="387" y="97" /> - <di:waypoint xsi:type="dc:Point" x="484" y="97" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="435.5" y="76" width="0" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - </bpmndi:BPMNPlane> - </bpmndi:BPMNDiagram> -</bpmn2:definitions> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/VCPE/stubprocess/DoCreateVnfAndModules.bpmn b/bpmn/MSOInfrastructureBPMN/src/test/resources/VCPE/stubprocess/DoCreateVnfAndModules.bpmn deleted file mode 100644 index 5e4400e9bd..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/VCPE/stubprocess/DoCreateVnfAndModules.bpmn +++ /dev/null @@ -1,53 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.9.0"> - <bpmn:process id="DoCreateVnfAndModules" name="DoCreateVnfAndModules" isExecutable="true"> - <bpmn:startEvent id="StartEvent_1"> - <bpmn:outgoing>SequenceFlow_11sp3s9</bpmn:outgoing> - </bpmn:startEvent> - <bpmn:sequenceFlow id="SequenceFlow_11sp3s9" sourceRef="StartEvent_1" targetRef="ScriptTask_0y5wsgy" /> - <bpmn:scriptTask id="ScriptTask_0y5wsgy" name="set rollbackData"> - <bpmn:incoming>SequenceFlow_11sp3s9</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0q1lfmf</bpmn:outgoing> - <bpmn:script><![CDATA[#{execution.setVariable("rollbackData", true)}]]></bpmn:script> - </bpmn:scriptTask> - <bpmn:sequenceFlow id="SequenceFlow_0q1lfmf" sourceRef="ScriptTask_0y5wsgy" targetRef="EndEvent_0vgtf5f" /> - <bpmn:endEvent id="EndEvent_0vgtf5f"> - <bpmn:incoming>SequenceFlow_0q1lfmf</bpmn:incoming> - </bpmn:endEvent> - </bpmn:process> - <bpmn:error id="Error_1" name="Java Lang Exception" errorCode="java.lang.Exception" /> - <bpmn:error id="Error_2" name="MSO Workflow Exception" errorCode="MSOWorkflowException" /> - <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoCreateVnfAndModules"> - <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"> - <dc:Bounds x="152" y="147" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="170" y="183" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_11sp3s9_di" bpmnElement="SequenceFlow_11sp3s9"> - <di:waypoint xsi:type="dc:Point" x="188" y="165" /> - <di:waypoint xsi:type="dc:Point" x="268" y="165" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="183" y="144" width="90" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ScriptTask_0y5wsgy_di" bpmnElement="ScriptTask_0y5wsgy"> - <dc:Bounds x="268" y="125" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0q1lfmf_di" bpmnElement="SequenceFlow_0q1lfmf"> - <di:waypoint xsi:type="dc:Point" x="368" y="165" /> - <di:waypoint xsi:type="dc:Point" x="447" y="165" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="362.5" y="144" width="90" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="EndEvent_0vgtf5f_di" bpmnElement="EndEvent_0vgtf5f"> - <dc:Bounds x="447" y="147" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="420" y="187" width="90" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - </bpmndi:BPMNPlane> - </bpmndi:BPMNDiagram> -</bpmn:definitions> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/VCPE/stubprocess/DoCreateVnfAndModulesRollback.bpmn b/bpmn/MSOInfrastructureBPMN/src/test/resources/VCPE/stubprocess/DoCreateVnfAndModulesRollback.bpmn deleted file mode 100644 index 2867a671b6..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/VCPE/stubprocess/DoCreateVnfAndModulesRollback.bpmn +++ /dev/null @@ -1,53 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_Wblj8GyfEeWUWLTvug7ZOg" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.9.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> - <bpmn2:process id="DoCreateVnfAndModulesRollback" name="DoCreateVnfAndModulesRollback" isExecutable="true"> - <bpmn2:startEvent id="StartEvent_1gai4qr"> - <bpmn2:outgoing>SequenceFlow_1537b7m</bpmn2:outgoing> - </bpmn2:startEvent> - <bpmn2:endEvent id="EndEvent_1seag7u"> - <bpmn2:incoming>SequenceFlow_1mz2mgf</bpmn2:incoming> - </bpmn2:endEvent> - <bpmn2:sequenceFlow id="SequenceFlow_1537b7m" sourceRef="StartEvent_1gai4qr" targetRef="ScriptTask_0fpaoo0" /> - <bpmn2:scriptTask id="ScriptTask_0fpaoo0" name="set Success"> - <bpmn2:incoming>SequenceFlow_1537b7m</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_1mz2mgf</bpmn2:outgoing> - <bpmn2:script><![CDATA[#{execution.setVariable("rolledBack", true)}]]></bpmn2:script> - </bpmn2:scriptTask> - <bpmn2:sequenceFlow id="SequenceFlow_1mz2mgf" sourceRef="ScriptTask_0fpaoo0" targetRef="EndEvent_1seag7u" /> - </bpmn2:process> - <bpmn2:error id="Error_1" name="MSO Workflow Exception" errorCode="MSOWorkflowException" /> - <bpmn2:message id="Message_1" name="DoCreateVfModuleRollbackRequest" /> - <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoCreateVnfAndModulesRollback"> - <bpmndi:BPMNShape id="StartEvent_1gai4qr_di" bpmnElement="StartEvent_1gai4qr"> - <dc:Bounds x="-91" y="655" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="-73" y="691" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="EndEvent_1seag7u_di" bpmnElement="EndEvent_1seag7u"> - <dc:Bounds x="248" y="655" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="660" y="676" width="90" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1537b7m_di" bpmnElement="SequenceFlow_1537b7m"> - <di:waypoint xsi:type="dc:Point" x="-55" y="673" /> - <di:waypoint xsi:type="dc:Point" x="55" y="673" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="-45" y="658" width="90" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ScriptTask_0fpaoo0_di" bpmnElement="ScriptTask_0fpaoo0"> - <dc:Bounds x="55" y="633" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1mz2mgf_di" bpmnElement="SequenceFlow_1mz2mgf"> - <di:waypoint xsi:type="dc:Point" x="155" y="673" /> - <di:waypoint xsi:type="dc:Point" x="248" y="673" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="201.5" y="652" width="0" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - </bpmndi:BPMNPlane> - </bpmndi:BPMNDiagram> -</bpmn2:definitions> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/VCPE/stubprocess/DoDeleteVnfAndModules.bpmn b/bpmn/MSOInfrastructureBPMN/src/test/resources/VCPE/stubprocess/DoDeleteVnfAndModules.bpmn deleted file mode 100644 index 517df36c74..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/VCPE/stubprocess/DoDeleteVnfAndModules.bpmn +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_9MhrcHqVEea26OhQB97uCQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.9.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> - <bpmn2:process id="DoDeleteVnfAndModules" name="DoDeleteVnfAndModules" isExecutable="true"> - <bpmn2:startEvent id="StartEvent_1"> - <bpmn2:outgoing>SequenceFlow_0qi7pl3</bpmn2:outgoing> - </bpmn2:startEvent> - <bpmn2:sequenceFlow id="SequenceFlow_0qi7pl3" sourceRef="StartEvent_1" targetRef="EndEvent_11dfyam" /> - <bpmn2:endEvent id="EndEvent_11dfyam"> - <bpmn2:incoming>SequenceFlow_0qi7pl3</bpmn2:incoming> - </bpmn2:endEvent> - </bpmn2:process> - <bpmn2:error id="Error_1" name="MSO Workflow Exception" errorCode="MSOWorkflowException" /> - <bpmn2:error id="Error_2" name="Java Lang Exception" errorCode="java.lang.Exception" /> - <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoDeleteVnfAndModules"> - <bpmndi:BPMNShape id="_BPMNShape_StartEvent_79" bpmnElement="StartEvent_1"> - <dc:Bounds x="238" y="209" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="256" y="250" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0qi7pl3_di" bpmnElement="SequenceFlow_0qi7pl3"> - <di:waypoint xsi:type="dc:Point" x="274" y="227" /> - <di:waypoint xsi:type="dc:Point" x="387" y="227" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="285.5" y="206" width="90" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="EndEvent_11dfyam_di" bpmnElement="EndEvent_11dfyam"> - <dc:Bounds x="387" y="209" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="360" y="249" width="90" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - </bpmndi:BPMNPlane> - </bpmndi:BPMNDiagram> -</bpmn2:definitions> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/VCPE/stubprocess/Homing.bpmn b/bpmn/MSOInfrastructureBPMN/src/test/resources/VCPE/stubprocess/Homing.bpmn deleted file mode 100644 index ad4c3c816d..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/VCPE/stubprocess/Homing.bpmn +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_vwRmIBsREeeIQtzUKIjH4g" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.9.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> - <bpmn2:process id="Homing" name="Homing" isExecutable="true"> - <bpmn2:startEvent id="StartEvent_1"> - <bpmn2:outgoing>SequenceFlow_0tyavm9</bpmn2:outgoing> - </bpmn2:startEvent> - <bpmn2:endEvent id="EndEvent_0n56tas"> - <bpmn2:incoming>SequenceFlow_0tyavm9</bpmn2:incoming> - <bpmn2:terminateEventDefinition /> - </bpmn2:endEvent> - <bpmn2:sequenceFlow id="SequenceFlow_0tyavm9" sourceRef="StartEvent_1" targetRef="EndEvent_0n56tas" /> - </bpmn2:process> - <bpmn2:error id="Error_10hit0u" name="MSO Workflow Exception" errorCode="MSOWorkflowException" /> - <bpmn2:error id="Error_1lwpypa" name="Java Lang Exception" errorCode="java.lang.Exception" /> - <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Homing"> - <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"> - <dc:Bounds x="147" y="275" width="36" height="36" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="EndEvent_0ougemc_di" bpmnElement="EndEvent_0n56tas"> - <dc:Bounds x="263" y="275" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="236" y="311" width="90" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0tyavm9_di" bpmnElement="SequenceFlow_0tyavm9"> - <di:waypoint xsi:type="dc:Point" x="183" y="293" /> - <di:waypoint xsi:type="dc:Point" x="263" y="293" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="223" y="272" width="0" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - </bpmndi:BPMNPlane> - </bpmndi:BPMNDiagram> -</bpmn2:definitions> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/AAI/AAI_defaultCloudRegionByCloudRegionId.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/AAI/AAI_defaultCloudRegionByCloudRegionId.json deleted file mode 100644 index 364afed8ce..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/AAI/AAI_defaultCloudRegionByCloudRegionId.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "cloud-owner": "att-aic", - "cloud-region-id": "mdt1", - "cloud-type": "openstack", - "owner-defined-type": "lcp", - "cloud-region-version": "aic3.0", - "identity-url": "https://identity-aic.mdt1.cci.att.com:5000/v2.0", - "cloud-zone": "z1", - "complex-name": "c1", - "sriov-automation": false, - "resource-version": "1503072127235" -}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/AAI/AAI_genericVnfGet.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/AAI/AAI_genericVnfGet.json deleted file mode 100644 index 09d7758f04..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/AAI/AAI_genericVnfGet.json +++ /dev/null @@ -1,9 +0,0 @@ -{
- "vnf-id": "msoVnf123",
- "vnf-name": "MSO-Test-VNF-123",
- "vnf-type": "vnf-type",
- "orchestration-status": "active",
- "in-maint": false,
- "is-closed-loop-disabled": false,
- "resource-version": "1525360206136"
-}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/AAI/AAI_genericVnfsByVnfId.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/AAI/AAI_genericVnfsByVnfId.json deleted file mode 100644 index dd352fa480..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/AAI/AAI_genericVnfsByVnfId.json +++ /dev/null @@ -1,435 +0,0 @@ -{ - "vnf-id": "example-vnf-id-val-90603", - "vnf-name": "example-vnf-name-val-56838", - "vnf-name2": "example-vnf-name2-val-56319", - "vnf-type": "example-vnf-type-val-30533", - "service-id": "example-service-id-val-28290", - "regional-resource-zone": "example-regional-resource-zone-val-11059", - "prov-status": "example-prov-status-val-59777", - "operational-status": "example-operational-status-val-22513", - "in-maint": true, - - "equipment-role": "example-equipment-role-val-23396", - "orchestration-status": "example-orchestration-status-val-59435", - "heat-stack-id": "example-heat-stack-id-val-96869", - "mso-catalog-key": "example-mso-catalog-key-val-30721", - "management-option": "example-management-option-val-61927", - "ipv4-oam-address": "135.25.10.14", - "ipv4-loopback0-address": "example-ipv4-loopback0-address-val-87072", - "nm-lan-v6-address": "example-nm-lan-v6-address-val-91063", - "management-v6-address": "example-management-v6-address-val-80466", - "vcpu": 45837298, - "vcpu-units": "example-vcpu-units-val-86249", - "vmemory": 57288956, - "vmemory-units": "example-vmemory-units-val-13291", - "vdisk": 16937143, - "vdisk-units": "example-vdisk-units-val-73197", - - "is-closed-loop-disabled": true, - "summary-status": "example-summary-status-val-86438", - "encrypted-access-flag": true, - - - - - "model-invariant-id": "example-model-invariant-id-val-14704", - "model-version-id": "example-model-version-id-val-47847", - "model-customization-id": "example-model-customization-id-val-52688", - "widget-model-id": "example-widget-model-id-val-20939", - "widget-model-version": "example-widget-model-version-val-72210", - "as-number": "example-as-number-val-68358", - "regional-resource-subzone": "example-regional-resource-subzone-val-34391", - "nf-type": "example-nf-type-val-54866", - "nf-function": "example-nf-function-val-24790", - "nf-role": "example-nf-role-val-4780", - "nf-naming-code": "example-nf-naming-code-val-25118", - "selflink": "example-selflink-val-68404", - - "relationship-list": {"relationship": [ - { - "related-to": "service-instance", - "relationship-label": "org.onap.relationships.inventory.ComposedOf", - "related-link": "/aai/v12/business/customers/customer/e433710f-9217-458d-a79d-1c7aff376d89/service-subscriptions/service-subscription/VIRTUAL%20USP/service-instances/service-instance/2c323333-af4f-4849-af03-c862c0e93e3b", - "relationship-data": [ - { - "relationship-key": "customer.global-customer-id", - "relationship-value": "e433710f-9217-458d-a79d-1c7aff376d89" - }, - { - "relationship-key": "service-subscription.service-type", - "relationship-value": "VIRTUAL USP" - }, - { - "relationship-key": "service-instance.service-instance-id", - "relationship-value": "2c323333-af4f-4849-af03-c862c0e93e3b" - } - ], - "related-to-property": [ { - "property-key": "service-instance.service-instance-name", - "property-value": "kjhgfd1" - }] - }, - { - "related-to": "vserver", - "relationship-label": "tosca.relationships.HostedOn", - "related-link": "/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mtn23a/tenants/tenant/e6beab145f6b49098277ac163ac1b4f3/vservers/vserver/1b3f44e5-d96d-4aac-bd9a-310e8cfb0af5", - "relationship-data": [ - { - "relationship-key": "cloud-region.cloud-owner", - "relationship-value": "att-aic" - }, - { - "relationship-key": "cloud-region.cloud-region-id", - "relationship-value": "mtn23a" - }, - { - "relationship-key": "tenant.tenant-id", - "relationship-value": "e6beab145f6b49098277ac163ac1b4f3" - }, - { - "relationship-key": "vserver.vserver-id", - "relationship-value": "1b3f44e5-d96d-4aac-bd9a-310e8cfb0af5" - } - ], - "related-to-property": [ { - "property-key": "vserver.vserver-name", - "property-value": "comx5000vm003" - }] - }, - { - "related-to": "vserver", - "relationship-label": "tosca.relationships.HostedOn", - "related-link": "/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mtn23a/tenants/tenant/e6beab145f6b49098277ac163ac1b4f3/vservers/vserver/14551849-1e70-45cd-bc5d-a256d49548a2", - "relationship-data": [ - { - "relationship-key": "cloud-region.cloud-owner", - "relationship-value": "att-aic" - }, - { - "relationship-key": "cloud-region.cloud-region-id", - "relationship-value": "mtn23a" - }, - { - "relationship-key": "tenant.tenant-id", - "relationship-value": "e6beab145f6b49098277ac163ac1b4f3" - }, - { - "relationship-key": "vserver.vserver-id", - "relationship-value": "14551849-1e70-45cd-bc5d-a256d49548a2" - } - ], - "related-to-property": [ { - "property-key": "vserver.vserver-name", - "property-value": "comx5000vm002" - }] - }, - { - "related-to": "vserver", - "relationship-label": "tosca.relationships.HostedOn", - "related-link": "/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mtn23a/tenants/tenant/e6beab145f6b49098277ac163ac1b4f3/vservers/vserver/48bd7f11-408f-417c-b834-b41c1b98f7d7", - "relationship-data": [ - { - "relationship-key": "cloud-region.cloud-owner", - "relationship-value": "att-aic" - }, - { - "relationship-key": "cloud-region.cloud-region-id", - "relationship-value": "mtn23a" - }, - { - "relationship-key": "tenant.tenant-id", - "relationship-value": "e6beab145f6b49098277ac163ac1b4f3" - }, - { - "relationship-key": "vserver.vserver-id", - "relationship-value": "48bd7f11-408f-417c-b834-b41c1b98f7d7" - } - ], - "related-to-property": [ { - "property-key": "vserver.vserver-name", - "property-value": "comx5000vm001" - }] - } - ]}, - - - - "l-interfaces": { - "l-interface": [ - { - "interface-name": "example-interface-name-val-50593", - "interface-role": "example-interface-role-val-23375", - "v6-wan-link-ip": "example-v6-wan-link-ip-val-5921", - "selflink": "example-selflink-val-75663", - "interface-id": "example-interface-id-val-37465", - "macaddr": "example-macaddr-val-62657", - "network-name": "example-network-name-val-7252", - "management-option": "example-management-option-val-32963", - "interface-description": "example-interface-description-val-89453", - "is-port-mirrored": true, - "vlans": { - "vlan": [ - { - "vlan-interface": "example-vlan-interface-val-16684", - "vlan-id-inner": 8602916, - "vlan-id-outer": 97348542, - "speed-value": "example-speed-value-val-90330", - "speed-units": "example-speed-units-val-15849", - "vlan-description": "example-vlan-description-val-46942", - "backdoor-connection": "example-backdoor-connection-val-78445", - - "orchestration-status": "example-orchestration-status-val-44994", - - - - "l3-interface-ipv4-address-list": [ - { - "l3-interface-ipv4-address": "example-l3-interface-ipv4-address-val-90277", - "l3-interface-ipv4-prefix-length": 3364150, - "vlan-id-inner": 44021171, - "vlan-id-outer": 55708677, - "is-floating": true, - "neutron-network-id": "example-neutron-network-id-val-43267", - "neutron-subnet-id": "example-neutron-subnet-id-val-62870" - } - ], - "l3-interface-ipv6-address-list": [ - { - "l3-interface-ipv6-address": "example-l3-interface-ipv6-address-val-45323", - "l3-interface-ipv6-prefix-length": 56688923, - "vlan-id-inner": 5703071, - "vlan-id-outer": 86682265, - "is-floating": true, - "neutron-network-id": "example-neutron-network-id-val-28366", - "neutron-subnet-id": "example-neutron-subnet-id-val-53034" - } - ] - } - ] - }, - "sriov-vfs": { - "sriov-vf": [ - { - "pci-id": "example-pci-id-val-4720", - "vf-vlan-filter": "example-vf-vlan-filter-val-42594", - "vf-mac-filter": "example-vf-mac-filter-val-13375", - "vf-vlan-strip": true, - "vf-vlan-anti-spoof-check": true, - "vf-mac-anti-spoof-check": true, - "vf-mirrors": "example-vf-mirrors-val-6057", - "vf-broadcast-allow": true, - "vf-unknown-multicast-allow": true, - "vf-unknown-unicast-allow": true, - "vf-insert-stag": true, - "vf-link-status": "example-vf-link-status-val-81448", - "neutron-network-id": "example-neutron-network-id-val-9504" - } - ] - }, - "l-interfaces": { - "l-interface": [ - { - "interface-name": "example-interface-name-val-16738", - "interface-role": "example-interface-role-val-13943", - "v6-wan-link-ip": "example-v6-wan-link-ip-val-63173", - "selflink": "example-selflink-val-43085", - "interface-id": "example-interface-id-val-51379", - "macaddr": "example-macaddr-val-16195", - "network-name": "example-network-name-val-45683", - "management-option": "example-management-option-val-78983", - "interface-description": "example-interface-description-val-34414", - "is-port-mirrored": true - } - ] - }, - "l3-interface-ipv4-address-list": [ - { - "l3-interface-ipv4-address": "example-l3-interface-ipv4-address-val-99078", - "l3-interface-ipv4-prefix-length": 55755841, - "vlan-id-inner": 81525473, - "vlan-id-outer": 90908072, - "is-floating": true, - "neutron-network-id": "example-neutron-network-id-val-47919", - "neutron-subnet-id": "example-neutron-subnet-id-val-84236" - } - ], - "l3-interface-ipv6-address-list": [ - { - "l3-interface-ipv6-address": "example-l3-interface-ipv6-address-val-21939", - "l3-interface-ipv6-prefix-length": 50057584, - "vlan-id-inner": 75774660, - "vlan-id-outer": 4421090, - "is-floating": true, - "neutron-network-id": "example-neutron-network-id-val-46377", - "neutron-subnet-id": "example-neutron-subnet-id-val-16585" - } - ] - } - ] - }, - "lag-interfaces": { - "lag-interface": [ - { - "interface-name": "example-interface-name-val-39234", - "interface-description": "example-interface-description-val-1037", - "speed-value": "example-speed-value-val-1929", - "speed-units": "example-speed-units-val-74937", - "interface-id": "example-interface-id-val-91265", - "interface-role": "example-interface-role-val-19613", - - - "l-interfaces": { - "l-interface": [ - { - "interface-name": "example-interface-name-val-10722", - "interface-role": "example-interface-role-val-95194", - "v6-wan-link-ip": "example-v6-wan-link-ip-val-24328", - "selflink": "example-selflink-val-24987", - "interface-id": "example-interface-id-val-75726", - "macaddr": "example-macaddr-val-36940", - "network-name": "example-network-name-val-65359", - "management-option": "example-management-option-val-49521", - "interface-description": "example-interface-description-val-70528", - "is-port-mirrored": true, - "vlans": { - "vlan": [ - { - "vlan-interface": "example-vlan-interface-val-70827", - "vlan-id-inner": 55659612, - "vlan-id-outer": 90335612, - "speed-value": "example-speed-value-val-54761", - "speed-units": "example-speed-units-val-91398", - "vlan-description": "example-vlan-description-val-17018", - "backdoor-connection": "example-backdoor-connection-val-4021", - - "orchestration-status": "example-orchestration-status-val-18315", - - - "l3-interface-ipv4-address-list": [ - { - "l3-interface-ipv4-address": "example-l3-interface-ipv4-address-val-59336", - "l3-interface-ipv4-prefix-length": 57636053, - "vlan-id-inner": 34068397, - "vlan-id-outer": 48570286, - "is-floating": true, - "neutron-network-id": "example-neutron-network-id-val-69862", - "neutron-subnet-id": "example-neutron-subnet-id-val-75795" - } - ], - "l3-interface-ipv6-address-list": [ - { - "l3-interface-ipv6-address": "example-l3-interface-ipv6-address-val-15038", - "l3-interface-ipv6-prefix-length": 42694503, - "vlan-id-inner": 15929806, - "vlan-id-outer": 87413856, - "is-floating": true, - "neutron-network-id": "example-neutron-network-id-val-52519", - "neutron-subnet-id": "example-neutron-subnet-id-val-24471" - } - ] - } - ] - }, - "sriov-vfs": { - "sriov-vf": [ - { - "pci-id": "example-pci-id-val-44669", - "vf-vlan-filter": "example-vf-vlan-filter-val-53436", - "vf-mac-filter": "example-vf-mac-filter-val-71902", - "vf-vlan-strip": true, - "vf-vlan-anti-spoof-check": true, - "vf-mac-anti-spoof-check": true, - "vf-mirrors": "example-vf-mirrors-val-54963", - "vf-broadcast-allow": true, - "vf-unknown-multicast-allow": true, - "vf-unknown-unicast-allow": true, - "vf-insert-stag": true, - "vf-link-status": "example-vf-link-status-val-1546", - "neutron-network-id": "example-neutron-network-id-val-92159" - } - ] - }, - "l-interfaces": { - "l-interface": [ - { - "interface-name": "example-interface-name-val-9327", - "interface-role": "example-interface-role-val-21859", - "v6-wan-link-ip": "example-v6-wan-link-ip-val-21445", - "selflink": "example-selflink-val-6085", - "interface-id": "example-interface-id-val-39854", - "macaddr": "example-macaddr-val-14433", - "network-name": "example-network-name-val-3722", - "management-option": "example-management-option-val-64739", - "interface-description": "example-interface-description-val-5814", - "is-port-mirrored": true - - - - } - ] - }, - "l3-interface-ipv4-address-list": [ - { - "l3-interface-ipv4-address": "example-l3-interface-ipv4-address-val-64531", - "l3-interface-ipv4-prefix-length": 66545882, - "vlan-id-inner": 12194134, - "vlan-id-outer": 29589286, - "is-floating": true, - "neutron-network-id": "example-neutron-network-id-val-91108", - "neutron-subnet-id": "example-neutron-subnet-id-val-56984" - } - ], - "l3-interface-ipv6-address-list": [ - { - "l3-interface-ipv6-address": "example-l3-interface-ipv6-address-val-37408", - "l3-interface-ipv6-prefix-length": 5116459, - "vlan-id-inner": 39229896, - "vlan-id-outer": 15091934, - "is-floating": true, - "neutron-network-id": "example-neutron-network-id-val-87700", - "neutron-subnet-id": "example-neutron-subnet-id-val-37352" - } - ] - } - ] - } - } - ] - }, - "vf-modules": { - "vf-module": [ - { - "vf-module-id": "example-vf-module-id-val-56249", - "vf-module-name": "example-vf-module-name-val-18987", - "heat-stack-id": "example-heat-stack-id-val-80110", - "orchestration-status": "example-orchestration-status-val-8226", - "is-base-vf-module": true, - "model-invariant-id": "example-model-invariant-id-val-5071", - "model-version-id": "example-model-version-id-val-80793", - "model-customization-id": "example-model-customization-id-val-83277", - "widget-model-id": "example-widget-model-id-val-99814", - "widget-model-version": "example-widget-model-version-val-22799", - "contrail-service-instance-fqdn": "example-contrail-service-instance-fqdn-val-52133", - "module-index": 1933, - "selflink": "example-selflink-val-69992" - } - ] - }, - "licenses": { - "license": [ - { - "group-uuid": "example-group-uuid-val-73012", - "resource-uuid": "example-resource-uuid-val-80045" - } - ] - }, - "entitlements": { - "entitlement": [ - { - "group-uuid": "example-group-uuid-val-14874", - "resource-uuid": "example-resource-uuid-val-49146" - } - ] - } - -}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/AAI/AAI_pserverByVnfId.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/AAI/AAI_pserverByVnfId.json deleted file mode 100644 index 1059d8c9a9..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/AAI/AAI_pserverByVnfId.json +++ /dev/null @@ -1,72 +0,0 @@ - { - - "result": [{ - - "hostname": "8862-PserverHOSTNAME-LB1113", - "equipType": "JUNIPER UCPE", - "equipVendor": "JUNIPER", - "equipModel": "QFX51010-PNF", - "ipv4OamAddress": "190.8.5.199", - "serialNumber": "VX986001PNF", - "pserverId": "5715CE4F-8600-58E103FE60C79", - "internetTopology": "WAN", - "inMaint": false, - "resourceVersion": "1500495668780", - "pserverName2": "test81600", - "relationshipList": { - "relationship": [ - { - "relatedTo": "vserver", - "relatedLink": "/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/tenants/tenant/8862-tenantl-LB1113/vservers/vserver/8862-Lvserver-LB1113", - "relationshipData": [ - { - "relationshipKey": "cloud-region.cloud-owner", - "relationshipValue": "att-aic" - }, - { - "relationshipKey": "cloud-region.cloud-region-id", - "relationshipValue": "AAIAIC25" - }, - { - "relationshipKey": "tenant.tenant-id", - "relationshipValue": "8862-tenantl-LB1113" - }, - { - "relationshipKey": "vserver.vserver-id", - "relationshipValue": "8862-Lvserver-LB1113" - } - ], - "relatedToProperty": [ - { - "propertyKey": "vserver.vserver-name", - "propertyValue": "hjZAYKyl5LO" - } - ] - } - ] - }, - "pinterfaces": { - "pinterface": [ - { - "interfaceName": "ge-0/5/8", - "speedValue": "1", - "speedUnits": "GBPS", - "resourceVersion": "1500495668784", - "inMaint": false - }, - { - "interfaceName": "ge-1/5/8", - "speedValue": "1", - "speedUnits": "GBPS", - "resourceVersion": "1500495668788", - "inMaint": false - } - ] - } - } - - - - ] -} -
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/AAI/mockObject.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/AAI/mockObject.json deleted file mode 100644 index 2f97b47dd3..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/AAI/mockObject.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "id" : "something", - "resource-version" : "1234", - "plural" : { - "singular" : [{ - "id" : "something2", - "resource-version" : "5678" - }] - } -}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/APPC/appc_error.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/APPC/appc_error.json deleted file mode 100644 index e28878d1aa..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/APPC/appc_error.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "output": { - "status": { - "code": 200, - "message": "RESULT_MESSAGE" - }, - "common-header": { - "api-ver": "API_VERSION", - "request-id": "ECOMP_REQUEST_ID", - "originator-id": "ECOMP_SYSTEM_ID", - "sub-request-id": "ECOMP_SUBREQUEST_ID", - "timestamp": "2016-08-08T23:09:00.11Z", - "flags": { - "ttl": 1000, - "force": "TRUE", - "mode": "EXCLUSIVE" - } - }, - "locked": "TRUE" - } -}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/BuildingBlocks/sniroCallback2AR1Vnf b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/BuildingBlocks/sniroCallback2AR1Vnf deleted file mode 100644 index 19f18cce52..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/BuildingBlocks/sniroCallback2AR1Vnf +++ /dev/null @@ -1,107 +0,0 @@ -{ - "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 deleted file mode 100644 index 5a9ef4b4f9..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/BuildingBlocks/sniroCallback2AR1Vnf2Net +++ /dev/null @@ -1,165 +0,0 @@ -{ - "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 deleted file mode 100644 index 5cb748ae9d..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/BuildingBlocks/sniroCallbackNoSolutionFound +++ /dev/null @@ -1,15 +0,0 @@ -{ - "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 deleted file mode 100644 index b82688428e..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/BuildingBlocks/sniroCallbackPolicyException +++ /dev/null @@ -1,9 +0,0 @@ -{ - "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 deleted file mode 100644 index 6cc78a7cdb..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/BuildingBlocks/sniroCallbackServiceException +++ /dev/null @@ -1,12 +0,0 @@ -{ - "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/CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml deleted file mode 100644 index 40eca5a038..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml +++ /dev/null @@ -1,20 +0,0 @@ -<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v8">
- <cloud-owner>att-aic</cloud-owner>
- <cloud-region-id>RDM2WAGPLCP</cloud-region-id>
- <cloud-region-version>2.5</cloud-region-version>
- <complex-name>RDM2WAGPLCP</complex-name>
- </l3-network>
- </rest:payload>
-</rest:RESTResponse>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/cloudRegion30_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/cloudRegion30_AAIResponse_Success.xml deleted file mode 100644 index 1bf6df0d1f..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/cloudRegion30_AAIResponse_Success.xml +++ /dev/null @@ -1,20 +0,0 @@ -<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v8">
- <cloud-owner>att-aic</cloud-owner>
- <cloud-region-id>RDM2WAGPLCP</cloud-region-id>
- <cloud-region-version>3.0</cloud-region-version>
- <complex-name>RDM2WAGPLCP</complex-name>
- </l3-network>
- </rest:payload>
-</rest:RESTResponse>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetworkResponse_400.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetworkResponse_400.xml deleted file mode 100644 index a5640b2b26..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetworkResponse_400.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<createNetworkError> -<messageId>680bd458-5ec1-4a16-b77c-509022e53450</messageId><category>INTERNAL</category> -<message>400 Bad Request: The server could not comply with the request since it is either malformed or otherwise incorrect., error.type=StackValidationFailed, error.message=Property error: : resources.network.properties: : Unknown Property network_ipam_refs_data</message> -<rolledBack>true</rolledBack> -</createNetworkError> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetworkResponse_500.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetworkResponse_500.xml deleted file mode 100644 index 07730e2df9..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetworkResponse_500.xml +++ /dev/null @@ -1,80 +0,0 @@ -<html> - <head> - <title>JBoss Web/7.2.2.Final-redhat-1 - JBWEB000064: Error report - </title> - <style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} - H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} - H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} - BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} - B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} - P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A - {color : black;}A.name {color : black;}HR {color : #525D76;} --> - </style> - </head> - <body> - <h1>JBWEB000065: HTTP Status 500 - java.lang.NullPointerException</h1> - <HR size="1" noshade="noshade" /> - <p> - <b>JBWEB000309: type</b> - JBWEB000066: Exception report - </p> - <p> - <b>JBWEB000068: message</b> - <u>java.lang.NullPointerException</u> - </p> - <p> - <b>JBWEB000069: description</b> - <u>JBWEB000145: The server encountered an internal error that - prevented it from fulfilling this request. - </u> - </p> - <p> - <b>JBWEB000070: exception</b> - <pre>org.jboss.resteasy.spi.UnhandledException: - java.lang.NullPointerException - org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:365) - org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:233) - org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:209) - org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:557) - org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524) - org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126) - org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) - org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) - org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) - javax.servlet.http.HttpServlet.service(HttpServlet.java:847) - org.openecomp.mso.logger.LogFilter.doFilter(LogFilter.java:35) - </pre> - </p> - <p> - <b>JBWEB000071: root cause</b> - <pre>java.lang.NullPointerException - org.openecomp.mso.adapters.network.NetworkAdapterRest$CreateNetworkVolumesTask.run(NetworkAdapterRest.java:128) - org.openecomp.mso.adapters.network.NetworkAdapterRest.createNetwork(NetworkAdapterRest.java:64) - sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - java.lang.reflect.Method.invoke(Method.java:606) - org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:167) - org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:269) - org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:227) - org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:216) - org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:542) - org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524) - org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126) - org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) - org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) - org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) - javax.servlet.http.HttpServlet.service(HttpServlet.java:847) - org.openecomp.mso.logger.LogFilter.doFilter(LogFilter.java:35) - </pre> - </p> - <p> - <b>JBWEB000072: note</b> - <u>JBWEB000073: The full stack trace of the root cause is available - in the JBoss Web/7.2.2.Final-redhat-1 logs. - </u> - </p> - <HR size="1" noshade="noshade" /> - <h3>JBoss Web/7.2.2.Final-redhat-1</h3> - </body> -</html>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetworkResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetworkResponse_Success.xml deleted file mode 100644 index b40bd07a9d..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetworkResponse_Success.xml +++ /dev/null @@ -1,24 +0,0 @@ -<ns2:createNetworkResponse xmlns:ns2="http://org.openecomp.mso/network" - xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> - <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId> - <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId> - <subnetIdMap> - <entry> - <key>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</key> - <value>bd8e87c6-f4e2-41b8-b0bc-9596aa00cd73</value> - </entry> - </subnetIdMap> - <rollback> - <cloudId>RDM2WAGPLCP</cloudId> - <msoRequest> - <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId> - <serviceInstanceId/> - </msoRequest> - <networkCreated>true</networkCreated> - <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId> - <networkType>CONTRAIL_EXTERNAL</networkType> - <networkUpdated>false</networkUpdated> - <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId> - <tenantId>7dd5365547234ee8937416c65507d266</tenantId> - </rollback> -</ns2:createNetworkResponse>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryInstance_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryInstance_Success.xml deleted file mode 100644 index 09f01fb7ca..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryInstance_Success.xml +++ /dev/null @@ -1,4 +0,0 @@ -<result-data>
- <resource-type>service-instance</resource-type>
- <resource-link>https://aai-conexus-e2e.test.com:8443/aai/v8/business/customers/customer/8310000058863/service-subscriptions/service-subscription/vMOG/service-instances/service-instance/f70e927b-6087-4974-9ef8-c5e4d5847ca4</resource-link>
-</result-data>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryName2_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryName2_AAIResponse_Success.xml deleted file mode 100644 index b2d9ce2c5d..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryName2_AAIResponse_Success.xml +++ /dev/null @@ -1,62 +0,0 @@ -<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v8">
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4_3</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>contrail</network-technology>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <orchestration-status>pending-create</orchestration-status>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-create</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <relationship-list/>
- </subnet>
- </subnets>
- <relationship-list>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </l3-network>
- </rest:payload>
-</rest:RESTResponse>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryNameActive_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryNameActive_AAIResponse_Success.xml deleted file mode 100644 index 4dfd8d3f12..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryNameActive_AAIResponse_Success.xml +++ /dev/null @@ -1,74 +0,0 @@ -<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v8">
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_2</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>contrail</network-technology>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <orchestration-status>active</orchestration-status>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>active</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <subnet-name>subnetName</subnet-name>
- <relationship-list/>
- </subnet>
- </subnets>
- <segmentation-assignments>
- <segmentation-id>413</segmentation-id>
- <resource-version>4132176</resource-version>
- </segmentation-assignments>
- <relationship-list>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </l3-network>
- </rest:payload>
-</rest:RESTResponse>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryName_AAIResponse_404.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryName_AAIResponse_404.xml deleted file mode 100644 index 5cda12da2f..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryName_AAIResponse_404.xml +++ /dev/null @@ -1,19 +0,0 @@ -<rest:RESTFault xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd" - errorType="transport"> - <rest:errorCode>404</rest:errorCode> - <rest:message>HTTP method: GET Not Found </rest:message> - <rest:messageDetails><Fault> - <requestError> - <serviceException> - <messageId>SVC3001</messageId> - <text>Resource not found for %1 using id %2 (msg=%3) (ec=%4)</text> - <variables> - <variable>GETl3Networks</variable> - <variable xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/> - <variable>Node Not Found:No Node of type l3Network found for properties: (network-id = null)</variable> - <variable>ERR.5.4.6114</variable> - </variables> - </serviceException> - </requestError> -</Fault></rest:messageDetails> -</rest:RESTFault>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryName_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryName_AAIResponse_Success.xml deleted file mode 100644 index 77e3a649fb..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryName_AAIResponse_Success.xml +++ /dev/null @@ -1,62 +0,0 @@ -<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v8">
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>contrail</network-technology>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <orchestration-status>pending-create</orchestration-status>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-create</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <relationship-list/>
- </subnet>
- </subnets>
- <relationship-list>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </l3-network>
- </rest:payload>
-</rest:RESTResponse>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_404.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_404.xml deleted file mode 100644 index 5cda12da2f..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_404.xml +++ /dev/null @@ -1,19 +0,0 @@ -<rest:RESTFault xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd" - errorType="transport"> - <rest:errorCode>404</rest:errorCode> - <rest:message>HTTP method: GET Not Found </rest:message> - <rest:messageDetails><Fault> - <requestError> - <serviceException> - <messageId>SVC3001</messageId> - <text>Resource not found for %1 using id %2 (msg=%3) (ec=%4)</text> - <variables> - <variable>GETl3Networks</variable> - <variable xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/> - <variable>Node Not Found:No Node of type l3Network found for properties: (network-id = null)</variable> - <variable>ERR.5.4.6114</variable> - </variables> - </serviceException> - </requestError> -</Fault></rest:messageDetails> -</rest:RESTFault>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_NoPayload_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_NoPayload_Success.xml deleted file mode 100644 index fb8c365844..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_NoPayload_Success.xml +++ /dev/null @@ -1,73 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<l3-network xmlns="http://org.openecomp.aai.inventory/v8">
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>contrail</network-technology>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <orchestration-status>pending-create</orchestration-status>
- <physical-network-name>networkName</physical-network-name>
- <is-provider-network>false</is-provider-network>
- <is-shared-network>true</is-shared-network>
- <is-external-network>false</is-external-network>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-create</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <subnet-name>subnetName</subnet-name>
- <relationship-list/>
- </subnet>
- </subnets>
- <segmentation-assignments>
- <segmentation-id>413</segmentation-id>
- <resource-version>4132176</resource-version>
- </segmentation-assignments>
- <relationship-list>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>network-policy</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg</related-link>
- <relationship-data>
- <relationship-key>network-policy.network-policy-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0cg</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
-</l3-network>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml deleted file mode 100644 index 6e33a532af..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml +++ /dev/null @@ -1,110 +0,0 @@ -<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v8">
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>contrail</network-technology>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <orchestration-status>pending-create</orchestration-status>
- <physical-network-name>networkName</physical-network-name>
- <is-provider-network>false</is-provider-network>
- <is-shared-network>true</is-shared-network>
- <is-external-network>false</is-external-network>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-create</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <subnet-name>subnetName</subnet-name>
- <ip-assignment-direction>true</ip-assignment-direction>
- <host-routes>
- <host-route>
- <host-route-id>string</host-route-id>
- <route-prefix>192.10.16.0/24</route-prefix>
- <next-hop>192.10.16.100/24</next-hop>
- <next-hop-type>ip-address</next-hop-type>
- </host-route>
- <host-route>
- <host-route-id>string</host-route-id>
- <route-prefix>192.110.17.0/24</route-prefix>
- <next-hop>192.110.17.110/24</next-hop>
- <next-hop-type>ip-address</next-hop-type>
- </host-route>
- </host-routes>
- <relationship-list/>
- </subnet>
- </subnets>
- <segmentation-assignments>
- <segmentation-id>413</segmentation-id>
- <resource-version>4132176</resource-version>
- </segmentation-assignments>
- <relationship-list>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>network-policy</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg</related-link>
- <relationship-data>
- <relationship-key>network-policy.network-policy-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0cg</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN1</related-link>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN2</related-link>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </l3-network>
- </rest:payload>
-</rest:RESTResponse>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryNetworkPolicy_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryNetworkPolicy_AAIResponse_Success.xml deleted file mode 100644 index 02a280da58..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryNetworkPolicy_AAIResponse_Success.xml +++ /dev/null @@ -1,21 +0,0 @@ -<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Mon,14 Mar 2016 20:53:33 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID"
- value="mtcnjv9aaas01.mtcnj.aic.cip.com-20160314-20:53:33:487-134392"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <network-policy xmlns="http://org.openecomp.aai.inventory/v8">
- <network-policy-id>9a7b327d9-287aa00-82c4b0-105757</network-policy-id>
- <network-policy-fqdn>GN_EVPN_Test</network-policy-fqdn>
- <heat-stack-id>13979:105757</heat-stack-id>
- <resource-version>13979:105757</resource-version>
- </network-policy>
- </rest:payload>
-</rest:RESTResponse>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryNetworkTableRef1_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryNetworkTableRef1_AAIResponse_Success.xml deleted file mode 100644 index 52e9692b4d..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryNetworkTableRef1_AAIResponse_Success.xml +++ /dev/null @@ -1,20 +0,0 @@ -<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Mon,14 Mar 2016 20:53:33 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID"
- value="mtcnjv9aaas01.mtcnj.aic.cip.com-20160314-20:53:33:487-134392"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <route-table-references xmlns="http://org.openecomp.aai.inventory/v8">
- <route-table-reference-id>5938baec-03ca-2bd5-a3f1-d54x123e253a</route-table-reference-id>
- <route-table-reference-fqdn>refFQDN1</route-table-reference-fqdn>
- <resource-version>12345</resource-version>
- </route-table-references>
- </rest:payload>
-</rest:RESTResponse>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryNetworkTableRef2_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryNetworkTableRef2_AAIResponse_Success.xml deleted file mode 100644 index ddae6b1182..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryNetworkTableRef2_AAIResponse_Success.xml +++ /dev/null @@ -1,20 +0,0 @@ -<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Mon,14 Mar 2016 20:53:33 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID"
- value="mtcnjv9aaas01.mtcnj.aic.cip.com-20160314-20:53:33:487-134392"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <route-table-references xmlns="http://org.openecomp.aai.inventory/v8">
- <route-table-reference-id>5938baec-03ca-2bd5-a3f1-d54x123e253a</route-table-reference-id>
- <route-table-reference-fqdn>refFQDN2</route-table-reference-fqdn>
- <resource-version>12345</resource-version>
- </route-table-references>
- </rest:payload>
-</rest:RESTResponse>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryVpnBindingList_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryVpnBindingList_AAIResponse_Success.xml deleted file mode 100644 index d1b7ea7cdf..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryVpnBindingList_AAIResponse_Success.xml +++ /dev/null @@ -1,57 +0,0 @@ -<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Mon,14 Mar 2016 20:53:33 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID"
- value="mtcnjv9aaas01.mtcnj.aic.cip.com-20160314-20:53:33:487-134392"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <vpn-binding xmlns="http://org.openecomp.aai.inventory/v8">
- <vpn-id>9a7b327d9-287aa00-82c4b0-105757</vpn-id>
- <vpn-name>GN_EVPN_Test</vpn-name>
- <route-targets>
- <route-target>
- <global-route-target>13979:105708</global-route-target>
- <route-target-role>EXPORT</route-target-role>
- <resource-version>1504025599510</resource-version>
- </route-target>
- <route-target>
- <global-route-target>13979:105707</global-route-target>
- <route-target-role>IMPORT</route-target-role>
- <resource-version>1504025599519</resource-version>
- </route-target>
- </route-targets>
- <relationship-list>
- <relationship>
- <related-to>l3-network</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/l3-networks/l3-network/689ec39e-c5fc-4462-8db2-4f760763ad28/</related-link>
- <relationship-data>
- <relationship-key>l3-network.network-id</relationship-key>
- <relationship-value>689ec39e-c5fc-4462-8db2-4f760763ad28</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>l3-network</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/l3-networks/l3-network/1a49396b-19b3-40a4-8792-aa2fbd0f0704/</related-link>
- <relationship-data>
- <relationship-key>l3-network.network-id</relationship-key>
- <relationship-value>1a49396b-19b3-40a4-8792-aa2fbd0f0704</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>l3-network</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/l3-networks/l3-network/774f3329-3c83-4771-86c7-9e6207cd50fd/</related-link>
- <relationship-data>
- <relationship-key>l3-network.network-id</relationship-key>
- <relationship-value>774f3329-3c83-4771-86c7-9e6207cd50fd</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </vpn-binding>
- </rest:payload>
-</rest:RESTResponse>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml deleted file mode 100644 index 19aac50ee4..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml +++ /dev/null @@ -1,46 +0,0 @@ -<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Mon,14 Mar 2016 20:53:33 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID"
- value="mtcnjv9aaas01.mtcnj.aic.cip.com-20160314-20:53:33:487-134392"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <vpn-binding xmlns="http://org.openecomp.aai.inventory/v8">
- <vpn-id>9a7b327d9-287aa00-82c4b0-105757</vpn-id>
- <vpn-name>GN_EVPN_Test</vpn-name>
- <global-route-target>13979:105757</global-route-target>
- <relationship-list>
- <relationship>
- <related-to>l3-network</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/l3-networks/l3-network/689ec39e-c5fc-4462-8db2-4f760763ad28/</related-link>
- <relationship-data>
- <relationship-key>l3-network.network-id</relationship-key>
- <relationship-value>689ec39e-c5fc-4462-8db2-4f760763ad28</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>l3-network</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/l3-networks/l3-network/1a49396b-19b3-40a4-8792-aa2fbd0f0704/</related-link>
- <relationship-data>
- <relationship-key>l3-network.network-id</relationship-key>
- <relationship-value>1a49396b-19b3-40a4-8792-aa2fbd0f0704</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>l3-network</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/l3-networks/l3-network/774f3329-3c83-4771-86c7-9e6207cd50fd/</related-link>
- <relationship-data>
- <relationship-key>l3-network.network-id</relationship-key>
- <relationship-value>774f3329-3c83-4771-86c7-9e6207cd50fd</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </vpn-binding>
- </rest:payload>
-</rest:RESTResponse>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_updateContrail_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_updateContrail_AAIResponse_Success.xml deleted file mode 100644 index eedbda9343..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_updateContrail_AAIResponse_Success.xml +++ /dev/null @@ -1,11 +0,0 @@ -<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/CreateNetworkV2mock/sdncCreateNetworkTopologyRsrcAssignResponse.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2mock/sdncCreateNetworkTopologyRsrcAssignResponse.xml deleted file mode 100644 index e6af14123e..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2mock/sdncCreateNetworkTopologyRsrcAssignResponse.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" - xmlns:v1="http://org.openecomp/workflow/sdnc/adapter/schema/v1"> - <soapenv:Header /> - <soapenv:Body> - <v1:SDNCAdapterCallback> - <SDNCAdapterCallbackRequest xmlns="http://org.openecomp/workflow/sdnc/adapter/schema/v1"> - <CallbackHeader> - <RequestId>79ec9006-3695-4fcc-93a8-be6f9e248beb</RequestId> - <ResponseCode>200</ResponseCode> - <ResponseMessage>OK</ResponseMessage> - </CallbackHeader> - <RequestData xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><output xmlns="com:att:sdnctl:generic-resource"><response-message></response-message><svc-request-id>79ec9006-3695-4fcc-93a8-be6f9e248beb</svc-request-id><service-response-information><instance-id>f805ec2b-b4d8-473e-8325-67f110139e5d</instance-id></service-response-information><response-code>200</response-code><network-response-information><instance-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</instance-id><object-path>restconf/config/GENERIC-RESOURCE-API:services/service/f805ec2b-b4d8-473e-8325-67f110139e5d/service-data/networks/network/f7e4db56-aab5-4065-8e65-cec1cd1de24f</object-path></network-response-information><ack-final-indicator>Y</ack-final-indicator></output></RequestData> - </SDNCAdapterCallbackRequest> - </v1:SDNCAdapterCallback> - </soapenv:Body> -</soapenv:Envelope> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2mock/sdncCreateNetworkTopologySimResponse.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2mock/sdncCreateNetworkTopologySimResponse.xml deleted file mode 100644 index 40bb93bda0..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2mock/sdncCreateNetworkTopologySimResponse.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" - xmlns:v1="http://org.openecomp/workflow/sdnc/adapter/schema/v1"> - <soapenv:Header /> - <soapenv:Body> - <v1:SDNCAdapterCallback> - <SDNCAdapterCallbackRequest xmlns="http://org.openecomp/workflow/sdnc/adapter/schema/v1"> - <CallbackHeader> - <RequestId>testRequestId</RequestId> - <ResponseCode>200</ResponseCode> - <ResponseMessage>OK</ResponseMessage> - </CallbackHeader> - <RequestData xmlns:xs="http://www.w3.org/2001/XMLSchema" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:type="xs:string"><?xml version="1.0" encoding="UTF-8"?><output xmlns="com:att:sdnctl:vnf"><svc-request-id>19174929-3809-49ca-89eb-17f84a035389</svc-request-id><response-code>200</response-code><ack-final-indicator>Y</ack-final-indicator><network-information><network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id></network-information><service-information><service-type>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-type><service-instance-id>HSL_direct_net_2</service-instance-id><subscriber-name>notsurewecare</subscriber-name></service-information></output></RequestData> - </SDNCAdapterCallbackRequest> - </v1:SDNCAdapterCallback> - </soapenv:Body> -</soapenv:Envelope> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateServiceInstance/DoCreateServiceInstanceInput.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateServiceInstance/DoCreateServiceInstanceInput.json deleted file mode 100644 index 0d8a22c920..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateServiceInstance/DoCreateServiceInstanceInput.json +++ /dev/null @@ -1,42 +0,0 @@ -{
-"requestDetails": {
-"modelInfo": {
-"modelType": "service",
-"modelInvariantId": "ff3514e3-5a33-55df-13ab-12abad84e7ff",
-"modelVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
-"modelName": "Test",
-"modelVersion": "1.0"
-},
-"cloudConfiguration": {
-"lcpCloudRegionId": "mdt1",
-"tenantId": "88a6ca3ee0394ade9403f075db23167e"
-},
-"owningEntity": {
-"owningEntityId": "a",
-"owningEntityName": "a"
-},
-"project": {
-"projectName": "temp project"
-},
-"subscriberInfo": {
-"globalSubscriberId": "some subscriber id",
-"subscriberName": "some subscriber name"
-},
-"requestInfo": {
-"productFamilyId":"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
-"source": "VID",
-"suppressRollback": true,
-"requestorId": "az2016"
-},
-"requestParameters": {
-"subscriptionServiceType": "MOG",
-"aLaCarte": false,
-"userParams": [
-{
-"name": "someUserParam",
-"value": "someValue"
-}
-]
-}
-}
-}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateServiceInstance/SetupServiceDecompJson.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateServiceInstance/SetupServiceDecompJson.json deleted file mode 100644 index c2cc687066..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateServiceInstance/SetupServiceDecompJson.json +++ /dev/null @@ -1,33 +0,0 @@ -{
-"requestDetails": {
- "serviceInstance":{
- "serviceInstanceId": "MSORefactorTest1",
- "serviceInstanceName": "bensServiceInstance",
- "serviceType": "refactorServiceType",
- "serviceRole": "abc",
- "modelInvariantUuid": "9647dfc4-2083-11e7-93ae-92361f002671",
- "modelUuid": "5df8b6de-2083-11e7-93ae-92361f002671",
- "modelVersion": "1.0",
- "modelName": "MSOTADevInfra_vSAMP10a_Service",
- "environmentContext": "a",
- "workloadContext": "b"
- },
- "project":{
- "projectName": "MSORefactorTest1"
- },
- "owningEntity":{
- "owningEntityId": "MSORefactorTestId123",
- "owningEntityName": "MSORefactorTest1"
- },
- "customer":{
- "subscriptionServiceType": "refactorServiceType",
- "globalSubscriberId": "MSO_1806_Refactor"
- },
- "request":{
- "sdncRequestId": "abc",
- "callbackURL": "abc",
- "requestId": "md5621",
- "productFamilyId": "abc"
- }
-}
-}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateServiceInstance/createServiceInstance_createServiceInstance_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateServiceInstance/createServiceInstance_createServiceInstance_AAIResponse_Success.xml deleted file mode 100644 index eedbda9343..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateServiceInstance/createServiceInstance_createServiceInstance_AAIResponse_Success.xml +++ /dev/null @@ -1,11 +0,0 @@ -<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/CreateServiceInstance/createServiceInstance_queryGlobalCustomerId_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateServiceInstance/createServiceInstance_queryGlobalCustomerId_AAIResponse_Success.xml deleted file mode 100644 index be820b83b1..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateServiceInstance/createServiceInstance_queryGlobalCustomerId_AAIResponse_Success.xml +++ /dev/null @@ -1,62 +0,0 @@ -<rest:RESTResponse - xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd" - statusCode="200"> - <rest:headers> - <rest:header name="Transfer-Encoding" value="chunked" /> - <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT" /> - <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC" /> - <rest:header name="X-AAI-TXID" - value="mtcnjv9aaas03-20160310-00:01:18:502-132671" /> - <rest:header name="Content-Type" value="application/xml" /> - <rest:header name="Server" value="Apache-Coyote/1.1" /> - <rest:header name="Cache-Control" value="private" /> - </rest:headers> - <rest:payload contentType="text/xml"> - <customer xmlns="http://org.openecomp.aai.inventory/v8"> - <global-customer-id>8310000058863</global-customer-id> - <subscriber-name>Mobility</subscriber-name> - <subscriber-type>INFRA</subscriber-type> - <resource-version>1452288058</resource-version> - <service-subscriptions> - <service-subscription> - <service-type>vMOG</service-type> - <resource-version>1452288058</resource-version> - <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> - <relationship-list> - <relationship> - <related-to>tenant</related-to> - <related-link>https://aai-conexus-e2e.test.com:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/tenants/tenant/396d61752cf04c3b8ca2afcb4ee049e9/</related-link> - <relationship-data> - <relationship-key>tenant.tenant-id</relationship-key> - <relationship-value>396d61752cf04c3b8ca2afcb4ee049e9</relationship-value> - </relationship-data> - <relationship-data> - <relationship-key>cloud-region.cloud-owner</relationship-key> - <relationship-value>att-aic</relationship-value> - </relationship-data> - <relationship-data> - <relationship-key>cloud-region.cloud-region-id</relationship-key> - <relationship-value>AAIAIC25</relationship-value> - </relationship-data> - <related-to-property> - <property-key>tenant.tenant-name</property-key> - <property-value>vMOG-AKRON-PROD</property-value> - </related-to-property> - </relationship> - </relationship-list> - </service-subscription> - </service-subscriptions> - <relationship-list /> - </customer> - </rest:payload> -</rest:RESTResponse> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/CreateVfModuleCallbackException.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/CreateVfModuleCallbackException.xml deleted file mode 100644 index 1ede44427a..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/CreateVfModuleCallbackException.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<volumeGroupException> - <messageId>{{MESSAGE-ID}}</messageId> - <category>INTERNAL</category> - <message>Exception during create VF Create VF Module: Unable to determine specific VF Module Type: Nimbus_LU2_PXMC_Svc/PXMC_09_20_2016_v2 3::Pxmc09202016V2..pxmc_base.yaml..module-2 with version = 3.0</message> - <rolledBack>true</rolledBack> -</volumeGroupException>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/CreateVfModuleVolumeCallbackResponse.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/CreateVfModuleVolumeCallbackResponse.xml deleted file mode 100644 index a421355aba..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/CreateVfModuleVolumeCallbackResponse.xml +++ /dev/null @@ -1,53 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<createVolumeGroupResponse> - <messageId>{{MESSAGE-ID}}</messageId> - <volumeGroupCreated>true</volumeGroupCreated> - <volumeGroupId>d485ecee-957c-4a0a-8b95-27a22b90103f</volumeGroupId> - <volumeGroupOutputs> - <entry> - <key>mmsc_vol_1</key> - <value>a73e0fe9-1ce8-49c2-8fef-e2788605be29</value> - </entry> - <entry> - <key>mmsc_vol_2</key> - <value>37b6455a-5ea8-463a-89e3-0efeaf7b7c6d</value> - </entry> - <entry> - <key>nemsfe_vol_1</key> - <value>b7ff1c21-d138-49a3-bf13-4cfd91efaf48</value> - </entry> - <entry> - <key>nemsbe_vol_1</key> - <value>a5988471-cd42-44d8-b078-64f2f13d3d4c</value> - </entry> - <entry> - <key>mmsc_vol_5</key> - <value>f7b91c1e-ab8c-413a-a850-ba80a246c7e0</value> - </entry> - <entry> - <key>nemsfe_vol_2</key> - <value>957ea3f3-2d4a-4707-bfd2-ba66f42037c2</value> - </entry> - <entry> - <key>mmsc_vol_3</key> - <value>de6fccfe-d61a-48b0-b03b-87bf1bf749b3</value> - </entry> - <entry> - <key>mmsc_vol_4</key> - <value>76162310-2c38-4c32-981c-5c2880190077</value> - </entry> - </volumeGroupOutputs> - <volumeGroupRollback> - <cloudSiteId>RDM2WAGPLCP</cloudSiteId> - <messageId>e585e4f4-9452-437a-b294-45a2d6d3b7a3</messageId> - <msoRequest> - <requestId>c30b9453-4b68-4c2e-aacf-58a5ba648bf5</requestId> - <serviceInstanceId>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</serviceInstanceId> - </msoRequest> - <tenantId>1bbab536a19b4756926e7d0ec1eb543c</tenantId> - <volumeGroupCreated>true</volumeGroupCreated> - <volumeGroupId>78987</volumeGroupId> - <volumeGroupStackId>ZRDM1MMSC01_base_vol/7f74e5e1-5fc1-4593-ac7e-cc9899a106ef</volumeGroupStackId> - </volumeGroupRollback> - <volumeGroupStackId>ZRDM1MMSC01_base_vol/7f74e5e1-5fc1-4593-ac7e-cc9899a106ef</volumeGroupStackId> -</createVolumeGroupResponse> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/CreateVfModuleVolumeRequest.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/CreateVfModuleVolumeRequest.xml deleted file mode 100644 index 458426660e..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/CreateVfModuleVolumeRequest.xml +++ /dev/null @@ -1,24 +0,0 @@ -<volume-request xmlns="http://org.openecomp/mso/infra/vnf-request/v1" xmlns:xs="http://www.w3.org/2001/XMLSchema"> - <request-info> - <test-data-only>123abc</test-data-only> <!-- don't remove this tag. Its used for junit test --> - <request-id>d8d4fcfa-fd7e-4413-b19d-c95aa67291b8</request-id> - <action>CREATE_VF_MODULE_VOL</action> - <source>SoapUI-bns-create-base-vol-1001-1</source> - </request-info> - <volume-inputs> - <vnf-type>Test/vSAMP12</vnf-type> - <vf-module-model-name>vSAMP12::base::module-0</vf-module-model-name> - <backout-on-failure/> - <asdc-service-model-version/> - <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id> - <aic-cloud-region>MDTWNJ21</aic-cloud-region> - <tenant-id>897deadc2b954a6bac6d3c197fb3525e</tenant-id> - <volume-group-name>MSOTESTVOL101a-vSAMP12_base_vol_module-0</volume-group-name> - <volume-group-id/> - </volume-inputs> - <volume-params> - <param name="param1">value1</param>" - <param name="param2">value2</param>" - <param name="param3">value3</param>" - </volume-params> -</volume-request> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/GenericVnf.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/GenericVnf.xml deleted file mode 100644 index 4c18356bf9..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/GenericVnf.xml +++ /dev/null @@ -1,38 +0,0 @@ -<generic-vnf xmlns="http://org.openecomp.aai.inventory/v8">
- <vnf-id>TEST-VNF-ID-0123</vnf-id>
- <vnf-name>STMTN5MMSC20</vnf-name>
- <vnf-type>pcrf-capacity</vnf-type>
- <service-id>SDN-MOBILITY</service-id>
- <equipment-role>vPCRF</equipment-role>
- <orchestration-status>pending-create</orchestration-status>
- <in-maint>false</in-maint>
- <is-closed-loop-disabled>false</is-closed-loop-disabled>
- <persona-model-id>introvert</persona-model-id>
- <persona-model-version>2.0</persona-model-version>
- <resource-version>0000020</resource-version>
- <vf-modules>
- <vf-module>
- <vf-module-id>lukewarm</vf-module-id>
- <vf-module-name>PCRF::module-0-0</vf-module-name>
- <persona-model-id>introvert</persona-model-id>
- <persona-model-version>2.0</persona-model-version>
- <is-base-vf-module>true</is-base-vf-module>
- <heat-stack-id>fastburn</heat-stack-id>
- <orchestration-status>pending-create</orchestration-status>
- <resource-version>0000074</resource-version>
- </vf-module>
- <vf-module>
- <vf-module-id>supercool</vf-module-id>
- <vf-module-name>PCRF::module-1-0</vf-module-name>
- <persona-model-id>extrovert</persona-model-id>
- <persona-model-version>2.0</persona-model-version>
- <is-base-vf-module>false</is-base-vf-module>
- <heat-stack-id>slowburn</heat-stack-id>
- <orchestration-status>pending-create</orchestration-status>
- <resource-version>0000075</resource-version>
- </vf-module>
- </vf-modules>
- <relationship-list/>
- <l-interfaces/>
- <lag-interfaces/>
-</generic-vnf>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/RollbackVfModuleVolumeCallbackResponse.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/RollbackVfModuleVolumeCallbackResponse.xml deleted file mode 100644 index 6ab9416617..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/RollbackVfModuleVolumeCallbackResponse.xml +++ /dev/null @@ -1,5 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<rollbackVolumeGroupResponse> - <messageId>{{MESSAGE-ID}}</messageId> - <volumeGroupRolledback>true</volumeGroupRolledback> -</rollbackVolumeGroupResponse> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request.json deleted file mode 100644 index 1af452143e..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "requestDetails": { - "modelInfo": { - "modelType": "volumeGroup", - "modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff", - "modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe", - "modelName": "vSAMP12::base::module-0", - "modelVersion": "1", - "modelCustomizationUuid": "ee6478e5-ea33-3346-ac12-ab121484a3fe" - }, - "cloudConfiguration": { - "lcpCloudRegionId": "mdt1", - "tenantId": "88a6ca3ee0394ade9403f075db23167e" - }, - "requestInfo": { - "instanceName": "MSOTESTVOL101a-vSAMP12_base_vol_module-0", - "source": "VID", - "suppressRollback": false - }, - "relatedInstanceList": [ - { - "relatedInstance": { - "instanceId": "{service-instance-id}", - "modelInfo": { - "modelType": "service", - "modelInvariantUuid": "ff3514e3-5a33-55df-13ab-12abad84e7ff", - "modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe", - "modelName": "Test", - "modelVersion": "2.0" - } - } - }, { - "relatedInstance": { - "instanceId": "{vnf-instance-id}", - "modelInfo": { - "modelType": "vnf", - "modelInvariantUuid": "ff5256d1-5a33-55df-13ab-12abad84e7ff", - "modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe", - "modelName": "vSAMP12", - "modelVersion": "1", - "modelInstanceName": "vSAMP12" - } - } - } - ], - "requestParameters": { - "serviceId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", - "userParams": [ - {"name": "vnfName", "value": "STMTN5MMSC20" }, - {"name": "vnfName2", "value": "US1117MTSNJVBR0246" }, - {"name": "vnfNmInformation", "value": "" }, - {"name": "vnfType", "value": "pcrf-capacity" }, - {"name": "vnfId", "value": "skask" }, - {"name": "vnfStackId", "value": "slowburn" }, - {"name": "vnfStatus", "value": "created" }, - {"name": "aicCloudRegion", "value": "MDTWNJ21" }, - {"name": "availabilityZone", "value": "slcp3-esx-az01" }, - {"name": "oamNetworkName", "value": "VLAN-OAM-1323" }, - {"name": "vmName", "value": "slcp34246vbc246ceb" }, - {"name": "ipagNetworkId", "value": "970cd2b9-7f09-4a12-af47-182ea38ba1f0" }, - {"name": "vpeNetworkId", "value": "545cc2c3-1930-4100-b534-5d82d0e12bb6" }, - { - "name": "vlc_sctp_b_route_prefixes", - "value": [ - { "interface_route_table_routes_route_prefix": "107.239.41.163/32" }, - { "interface_route_table_routes_route_prefix": "107.239.41.164/32" }, - { "interface_route_table_routes_route_prefix": "107.239.41.165/32" } - ]} - ] - } - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request_noreqparm.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request_noreqparm.json deleted file mode 100644 index de99a6da56..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request_noreqparm.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "requestDetails": { - "modelInfo": { - "modelType": "volumeGroup", - "modelId": "ff5256d2-5a33-55df-13ab-12abad84e7ff", - "modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe", - "modelName": "vSAMP12::base::module-0", - "modelVersion": "1" - }, - "cloudConfiguration": { - "lcpCloudRegionId": "mdt1", - "tenantId": "88a6ca3ee0394ade9403f075db23167e" - }, - "requestInfo": { - "instanceName": "MSOTESTVOL101a-vSAMP12_base_vol_module-0", - "source": "VID", - "suppressRollback": false - }, - "relatedInstanceList": [ - { - "relatedInstance": { - "instanceId": "{service-instance-id}", - "modelInfo": { - "modelType": "service", - "modelId": "ff3514e3-5a33-55df-13ab-12abad84e7ff", - "modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe", - "modelName": "{parent service model name}", - "modelVersion": "1" - } - } - }, { - "relatedInstance": { - "instanceId": "{vnf-instance-id}", - "modelInfo": { - "modelType": "vnf", - "modelId": "ff5256d1-5a33-55df-13ab-12abad84e7ff", - "modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe", - "modelName": "Test/vSAMP12", - "modelVersion": "1" - } - } - } - ] - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_createVolumeName_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_createVolumeName_AAIResponse_Success.xml deleted file mode 100644 index bff26fa78a..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_createVolumeName_AAIResponse_Success.xml +++ /dev/null @@ -1,49 +0,0 @@ -<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="X-CSI-Internal-WriteableRequest" value="true"/>
- <rest:header name="X-CSI-MethodName" value="UNKNOWN"/>
- <rest:header name="Content-Length" value="968"/>
- <rest:header name="breadcrumbId" value="ID-mtsnjv9aaas23-44965-1459957053425-0-211465"/>
- <rest:header name="X-CSI-UniqueTransactionId"
- value="AjscCsiRestful28795@mtsnjv9aaas237d4a4d21-e60a-495f-935f-cc225dc3c847"/>
- <rest:header name="User-Agent" value="Jakarta Commons-HttpClient/3.1"/>
- <rest:header name="X-TransactionID" value="3a19f95d-d63e-4a8e-8b9c-6563895628aa"/>
- <rest:header name="X-CSI-ServiceName" value="UNKNOWN"/>
- <rest:header name="Server" value="Jetty(9.2.z-SNAPSHOT)"/>
- <rest:header name="Cache-Control" value="no-cache,no-store"/>
- <rest:header name="X-FromAppId" value="MSO"/>
- <rest:header name="Date" value="Fri,08 Apr 2016 16:53:04 GMT"/>
- <rest:header name="X-CSI-ConversationId"
- value="ajscUser~CNG-CSI~c0a2bb44-2167-4e85-ad6a-483a24c0823a"/>
- <rest:header name="volume-group-name" value="simpleCinderVolume_201604071"/>
- <rest:header name="X-CSI-MessageId" value="f6d6eed4-456e-4033-be04-b17582902dc2"/>
- <rest:header name="X-AAI-TXID" value="mtsnjv9aaas23-20160408-16:53:04:592-73255"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Accept" value="application/xml"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <volume-group xmlns="http://org.openecomp.aai.inventory/v8">
- <volume-group-id>simpleCinderVolume_201604071</volume-group-id>
- <volume-group-name>simpleCinderVolume_201604071</volume-group-name>
- <heat-stack-id>simpleCinderVolume_201604071</heat-stack-id>
- <vnf-type>simple_cinder_master</vnf-type>
- <orchestration-status>Pending</orchestration-status>
- <resource-version>1460134360</resource-version>
- <relationship-list>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v6/cloud-infrastructure/tenants/tenant/897deadc2b954a6bac6d3c197fb3525e/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>897deadc2b954a6bac6d3c197fb3525e</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>tenant.tenant-name</property-key>
- <property-value>MSOTest1</property-value>
- </related-to-property>
- </relationship>
- </relationship-list>
- </volume-group>
- </rest:payload>
-</rest:RESTResponse>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_deleteVolumeName_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_deleteVolumeName_AAIResponse_Success.xml deleted file mode 100644 index 1574310474..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_deleteVolumeName_AAIResponse_Success.xml +++ /dev/null @@ -1,24 +0,0 @@ - <rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd" - statusCode="200"> - <rest:headers> - <rest:header name="X-CSI-Internal-WriteableRequest" value="true"/> - <rest:header name="X-CSI-MethodName" value="helloWorld-GetMethod(Logical)"/> - <rest:header name="Content-Length" value="0"/> - <rest:header name="breadcrumbId" value="ID-mtsnjv9aaas23-44965-1459957053425-0-211467"/> - <rest:header name="X-CSI-UniqueTransactionId" - value="AjscCsiRestful28795@mtsnjv9aaas23d44059bc-ef96-4af8-a28b-98044e08d7af"/> - <rest:header name="User-Agent" value="Jakarta Commons-HttpClient/3.1"/> - <rest:header name="X-TransactionID" value="3749995c-266b-4025-a0c4-4ce6983efc66"/> - <rest:header name="X-CSI-ServiceName" value="helloWorld"/> - <rest:header name="Server" value="Jetty(9.2.z-SNAPSHOT)"/> - <rest:header name="Cache-Control" value="no-cache,no-store"/> - <rest:header name="X-FromAppId" value="MSO"/> - <rest:header name="Date" value="Fri,08 Apr 2016 16:53:04 GMT"/> - <rest:header name="X-CSI-ConversationId" - value="ajscUser~CNG-CSI~bbd0e78f-d4e7-41be-b9ad-4a6767fa660a"/> - <rest:header name="X-CSI-MessageId" value="6ccfeb13-56da-4836-bfbd-5a42dee60939"/> - <rest:header name="X-AAI-TXID" value="mtsnjv9aaas23-20160408-16:53:04:629-73256"/> - <rest:header name="Content-Type" value="application/xml"/> - <rest:header name="Accept" value="application/xml"/> - </rest:headers> - </rest:RESTResponse>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_queryVolumeName_AAIResponse_404.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_queryVolumeName_AAIResponse_404.xml deleted file mode 100644 index 152bafc0eb..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_queryVolumeName_AAIResponse_404.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<volume-group xmlns="http://org.openecomp.aai.inventory/v7">
- <volume-group-id>94f0f72f-4be1-49ed-8410-702396797163</volume-group-id>
- <volume-group-name>MSOTESTVOL103H-vSAMP12_base_vol_module-0</volume-group-name>
- <heat-stack-id/>
- <vnf-type>Test/vSAMP12</vnf-type>
- <orchestration-status>Pending</orchestration-status>
- <resource-version>1469203133</resource-version>
- <relationship-list>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v7/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mtn6/tenants/tenant/e444c311b27a45dc9522f2370d70f90f/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>e444c311b27a45dc9522f2370d70f90f</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-owner</relationship-key>
- <relationship-value>att-aic</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-region-id</relationship-key>
- <relationship-value>mtn6</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>tenant.tenant-name</property-key>
- <property-value>MSOCustomer1</property-value>
- </related-to-property>
- </relationship>
- </relationship-list>
-</volume-group>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_queryVolumeName_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_queryVolumeName_AAIResponse_Success.xml deleted file mode 100644 index 8d9efb3b39..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_queryVolumeName_AAIResponse_Success.xml +++ /dev/null @@ -1,50 +0,0 @@ -<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="X-CSI-Internal-WriteableRequest" value="true"/>
- <rest:header name="X-CSI-MethodName" value="UNKNOWN"/>
- <rest:header name="Content-Length" value="968"/>
- <rest:header name="breadcrumbId" value="ID-mtsnjv9aaas23-44965-1459957053425-0-211465"/>
- <rest:header name="X-CSI-UniqueTransactionId"
- value="AjscCsiRestful28795@mtsnjv9aaas237d4a4d21-e60a-495f-935f-cc225dc3c847"/>
- <rest:header name="User-Agent" value="Jakarta Commons-HttpClient/3.1"/>
- <rest:header name="X-TransactionID" value="3a19f95d-d63e-4a8e-8b9c-6563895628aa"/>
- <rest:header name="X-CSI-ServiceName" value="UNKNOWN"/>
- <rest:header name="Server" value="Jetty(9.2.z-SNAPSHOT)"/>
- <rest:header name="Cache-Control" value="no-cache,no-store"/>
- <rest:header name="X-FromAppId" value="MSO"/>
- <rest:header name="Date" value="Fri,08 Apr 2016 16:53:04 GMT"/>
- <rest:header name="X-CSI-ConversationId"
- value="ajscUser~CNG-CSI~c0a2bb44-2167-4e85-ad6a-483a24c0823a"/>
- <rest:header name="volume-group-name" value="simpleCinderVolume_201604071"/>
- <rest:header name="X-CSI-MessageId" value="f6d6eed4-456e-4033-be04-b17582902dc2"/>
- <rest:header name="X-AAI-TXID" value="mtsnjv9aaas23-20160408-16:53:04:592-73255"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Accept" value="application/xml"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <volume-group xmlns="http://org.openecomp.aai.inventory/v8">
- <volume-group-id>8424bb3c-c3e7-4553-9662-469649ed9379</volume-group-id>
- <volume-group-name>MSOTESTVOL103W-vSAMP12_base_vol_module-0</volume-group-name>
- <heat-stack-id/>
- <vnf-type>simple_cinder_master</vnf-type>
- <orchestration-status>Pending</orchestration-status>
- <vf-module-model-customization-id>ee6478e5-ea33-3346-ac12-ab121484a3fe</vf-module-model-customization-id>
- <resource-version>1460134360</resource-version>
- <relationship-list>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v6/cloud-infrastructure/tenants/tenant/897deadc2b954a6bac6d3c197fb3525e/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>897deadc2b954a6bac6d3c197fb3525e</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>tenant.tenant-name</property-key>
- <property-value>MSOTest1</property-value>
- </related-to-property>
- </relationship>
- </relationship-list>
- </volume-group>
- </rest:payload>
-</rest:RESTResponse>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_updateVolumeName_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_updateVolumeName_AAIResponse_Success.xml deleted file mode 100644 index 1574310474..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_updateVolumeName_AAIResponse_Success.xml +++ /dev/null @@ -1,24 +0,0 @@ - <rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd" - statusCode="200"> - <rest:headers> - <rest:header name="X-CSI-Internal-WriteableRequest" value="true"/> - <rest:header name="X-CSI-MethodName" value="helloWorld-GetMethod(Logical)"/> - <rest:header name="Content-Length" value="0"/> - <rest:header name="breadcrumbId" value="ID-mtsnjv9aaas23-44965-1459957053425-0-211467"/> - <rest:header name="X-CSI-UniqueTransactionId" - value="AjscCsiRestful28795@mtsnjv9aaas23d44059bc-ef96-4af8-a28b-98044e08d7af"/> - <rest:header name="User-Agent" value="Jakarta Commons-HttpClient/3.1"/> - <rest:header name="X-TransactionID" value="3749995c-266b-4025-a0c4-4ce6983efc66"/> - <rest:header name="X-CSI-ServiceName" value="helloWorld"/> - <rest:header name="Server" value="Jetty(9.2.z-SNAPSHOT)"/> - <rest:header name="Cache-Control" value="no-cache,no-store"/> - <rest:header name="X-FromAppId" value="MSO"/> - <rest:header name="Date" value="Fri,08 Apr 2016 16:53:04 GMT"/> - <rest:header name="X-CSI-ConversationId" - value="ajscUser~CNG-CSI~bbd0e78f-d4e7-41be-b9ad-4a6767fa660a"/> - <rest:header name="X-CSI-MessageId" value="6ccfeb13-56da-4836-bfbd-5a42dee60939"/> - <rest:header name="X-AAI-TXID" value="mtsnjv9aaas23-20160408-16:53:04:629-73256"/> - <rest:header name="Content-Type" value="application/xml"/> - <rest:header name="Accept" value="application/xml"/> - </rest:headers> - </rest:RESTResponse>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/getSIUrlById.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/getSIUrlById.xml deleted file mode 100644 index 55fdedb66c..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/getSIUrlById.xml +++ /dev/null @@ -1,6 +0,0 @@ - <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%252F0026%252FSW_INTERNET</resource-link>
- </result-data>
- </search-results>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_HasVfModRelationship.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_HasVfModRelationship.xml deleted file mode 100644 index 8d9c5c0a43..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_HasVfModRelationship.xml +++ /dev/null @@ -1,62 +0,0 @@ -<volume-group xmlns="http://com.att.aai.inventory/v8">
- <volume-group-id>78987</volume-group-id>
- <volume-group-name>MSOTESTVOL102a-vSAMP12_base_vol_module-0</volume-group-name>
- <heat-stack-id/>
- <vnf-type>Test/vSAMP12</vnf-type>
- <orchestration-status>Pending</orchestration-status>
- <resource-version>0000020</resource-version>
- <relationship-list>
- <relationship>
- <related-to>generic-vnf</related-to>
- <related-link>https://aai-ext1.test.att.com:8443/aai/v8/network/generic-vnfs/generic-vnf/9e48f6ea-f786-46de-800a-d480e5ccc846/</related-link>
- <relationship-data>
- <relationship-key>generic-vnf.vnf-id</relationship-key>
- <relationship-value>9e48f6ea-f786-46de-800a-d480e5ccc846</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>generic-vnf.vnf-name</property-key>
- <property-value>MSOSTSAMP12-10601</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-ext1.test.att.com:8443/aai/v7/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mdt1/tenants/tenant/fba1bd1e195a404cacb9ce17a9b2b421/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>fba1bd1e195a404cacb9ce17a9b2b421</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-owner</relationship-key>
- <relationship-value>att-aic</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-region-id</relationship-key>
- <relationship-value>mdt1</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>tenant.tenant-name</property-key>
- <property-value>ECOMP_MDT1</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vf-module</related-to>
- <related-link>https://aai-ext1.test.att.com:8443/aai/v7/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mdt1/tenants/tenant/fba1bd1e195a404cacb9ce17a9b2b421/</related-link>
- <relationship-data>
- <relationship-key>vf-module.vf-module-id</relationship-key>
- <relationship-value>fba1bd1e195a404cacb9ce17a9b2b421</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-owner</relationship-key>
- <relationship-value>att-aic</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-region-id</relationship-key>
- <relationship-value>mdt1</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vf-module.vf-module-name</property-key>
- <property-value>ECOMP_MDT1</property-value>
- </related-to-property>
- </relationship>
- </relationship-list>
-</volume-group>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModule_VID_request.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModule_VID_request.json deleted file mode 100644 index 3b41ff359c..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModule_VID_request.json +++ /dev/null @@ -1,72 +0,0 @@ -{
- "requestDetails": {
- "modelInfo": {
- "modelType": "vfModule",
- "modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff",
- "modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
- "modelName": "STMTN5MMSC21-MMSC::model-1-0",
- "modelVersion": "1",
- "modelCustomizationUuid": "ee6478e5-ea33-3346-ac12-ab121484a3fe"
- },
- "subscriberInfo": {
- "globalSubscriberId": "MSO_1610_dev_id",
- "subscriberName": "MSO_1610_dev_name"
- },
- "cloudConfiguration": {
- "lcpCloudRegionId": "MDTWNJ21",
- "tenantId": "fba1bd1e195a404cacb9ce17a9b2b421"
- },
- "requestInfo": {
- "instanceName": "PCRF::module-0-2",
- "source": "VID",
- "suppressRollback": true
- },
- "relatedInstanceList": [
- {
- "relatedInstance": {
- "instanceId": "17ef4658-bd1f-4ef0-9ca0-ea76e2bf122c",
- "instanceName": "MSOTESTVOL103a-vSAMP12_base_module-0_vol",
- "modelInfo": {
- "modelType": "volumeGroup",
- "modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff",
- "modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
- "modelName": "vSAMP12..base..module-0",
- "modelVersion": "1"
- }
- }
- },
- {
- "relatedInstance": {
- "instanceId": "123456",
- "modelInfo": {
- "modelType": "service",
- "modelInvariantUuid": "ff3514e3-5a33-55df-13ab-12abad84e7ff",
- "modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
- "modelName": "SERVICE_MODEL_NAME",
- "modelVersion": "1.0"
- }
- }
- },
- {
- "relatedInstance": {
- "instanceId": "skask",
- "instanceName": "skask-test",
- "modelInfo": {
- "modelType": "vnf",
- "modelInvariantUuid": "skask",
- "modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
- "modelName": "vSAMP12",
- "modelVersion": "1.0",
- "modelInstanceName": "vSAMP12 1"
- }
- }
- }
- ],
- "requestParameters": {
- "usePreload": true,
- "aLaCarte": false,
- "userParams": {
- }
- }
- }
-}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModule_VID_request_noPreloads.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModule_VID_request_noPreloads.json deleted file mode 100644 index e6d126eca2..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModule_VID_request_noPreloads.json +++ /dev/null @@ -1,79 +0,0 @@ -{
- "requestDetails": {
- "modelInfo": {
- "modelType": "vfModule",
- "modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff",
- "modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
- "modelName": "STMTN5MMSC21-MMSC::model-1-0",
- "modelVersion": "1",
- "modelCustomizationUuid": "ee6478e5-ea33-3346-ac12-ab121484a3fe"
- },
- "subscriberInfo": {
- "globalSubscriberId": "MSO_1610_dev_id",
- "subscriberName": "MSO_1610_dev_name"
- },
- "cloudConfiguration": {
- "lcpCloudRegionId": "MDTWNJ21",
- "tenantId": "fba1bd1e195a404cacb9ce17a9b2b421"
- },
- "requestInfo": {
- "instanceName": "PCRF::module-0-2",
- "source": "VID",
- "suppressRollback": true
- },
- "relatedInstanceList": [
- {
- "relatedInstance": {
- "instanceId": "17ef4658-bd1f-4ef0-9ca0-ea76e2bf122c",
- "instanceName": "MSOTESTVOL103a-vSAMP12_base_module-0_vol",
- "modelInfo": {
- "modelType": "volumeGroup",
- "modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff",
- "modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
- "modelName": "vSAMP12..base..module-0",
- "modelVersion": "1"
- }
- }
- },
- {
- "relatedInstance": {
- "instanceId": "123456",
- "modelInfo": {
- "modelType": "service",
- "modelInvariantUuid": "ff3514e3-5a33-55df-13ab-12abad84e7ff",
- "modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
- "modelName": "SERVICE_MODEL_NAME",
- "modelVersion": "1.0"
- }
- }
- },
- {
- "relatedInstance": {
- "instanceId": "skask",
- "instanceName": "skask-test",
- "modelInfo": {
- "modelType": "vnf",
- "modelInvariantUuid": "skask",
- "modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
- "modelName": "vSAMP12",
- "modelVersion": "1.0",
- "modelInstanceName": "vSAMP12 1"
- }
- }
- }
- ],
- "requestParameters": {
- "usePreload": false,
- "userParams": [
- {
- "name": "someUserParam",
- "value": "someValue"
- },
- {
- "name": "sgi_protected_subnet_id",
- "value": "thisissomefakevalue"
- }
- ]
- }
- }
-}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModule_VID_request_userParam.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModule_VID_request_userParam.json deleted file mode 100644 index 68de099c16..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModule_VID_request_userParam.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "requestDetails": { - "modelInfo": { - "modelType": "vfModule", - "modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff", - "modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe", - "modelName": "STMTN5MMSC21-MMSC::model-1-0", - "modelVersion": "1", - "modelCustomizationUuid": "ee6478e5-ea33-3346-ac12-ab121484a3fe" - }, - "subscriberInfo": { - "globalSubscriberId": "MSO_1610_dev_id", - "subscriberName": "MSO_1610_dev_name" - }, - "cloudConfiguration": { - "lcpCloudRegionId": "MDTWNJ21", - "tenantId": "fba1bd1e195a404cacb9ce17a9b2b421" - }, - "requestInfo": { - "instanceName": "PCRF::module-0-2", - "source": "VID", - "suppressRollback": true - }, - "relatedInstanceList": [ - { - "relatedInstance": { - "instanceId": "17ef4658-bd1f-4ef0-9ca0-ea76e2bf122c", - "instanceName": "MSOTESTVOL103a-vSAMP12_base_module-0_vol", - "modelInfo": { - "modelType": "volumeGroup", - "modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff", - "modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe", - "modelName": "vSAMP12..base..module-0", - "modelVersion": "1" - } - } - }, - { - "relatedInstance": { - "instanceId": "123456", - "modelInfo": { - "modelType": "service", - "modelInvariantUuid": "ff3514e3-5a33-55df-13ab-12abad84e7ff", - "modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe", - "modelName": "SERVICE_MODEL_NAME", - "modelVersion": "1.0" - } - } - }, - { - "relatedInstance": { - "instanceId": "skask", - "instanceName": "skask-test", - "modelInfo": { - "modelType": "vnf", - "modelInvariantUuid": "skask", - "modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe", - "modelName": "vSAMP12", - "modelVersion": "1.0", - "modelInstanceName": "vSAMP12 1" - } - } - } - ], - "requestParameters": { - "usePreload": true, - "aLaCarte": false, - "userParams": [{ - "name": "vlc_sctp_b_route_prefixes", - "value": [ - { "interface_route_table_routes_route_prefix": "107.239.41.163/32" }, - { "interface_route_table_routes_route_prefix": "107.239.41.164/32" }, - { "interface_route_table_routes_route_prefix": "107.239.41.165/32" } - ]} - ]} - } -}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DBUpdateResponse.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DBUpdateResponse.xml deleted file mode 100644 index 40e2344f36..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DBUpdateResponse.xml +++ /dev/null @@ -1,4 +0,0 @@ - - -<ns2:updateRequestResponse xmlns:ns2="http://org.openecomp/requestsdb" - xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"/>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/Database/DBAdapter.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/Database/DBAdapter.xml deleted file mode 100644 index 5a36d741d0..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/Database/DBAdapter.xml +++ /dev/null @@ -1 +0,0 @@ -<DbTag>Notified</DbTag>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/Database/DBUpdateResponse.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/Database/DBUpdateResponse.xml deleted file mode 100644 index 7c30f75497..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/Database/DBUpdateResponse.xml +++ /dev/null @@ -1,4 +0,0 @@ - - -<ns2:updateRequestResponse xmlns:ns2="http://org.openecomp.mso/requestsdb" - xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"/>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteGenericVNFV1/sdncAdapterResponse.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteGenericVNFV1/sdncAdapterResponse.xml deleted file mode 100644 index 5e0b8c6c54..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteGenericVNFV1/sdncAdapterResponse.xml +++ /dev/null @@ -1,7 +0,0 @@ -<sdncadapterworkflow:SDNCAdapterWorkflowResponse xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1">
- <sdncadapterworkflow:response-data>
- <tag0:RequestData xmlns:tag0="http://org.openecomp/workflow/sdnc/adapter/schema/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">
- <output xmlns="org:onap:sdnctl:vnf"><svc-request-id>1660b8da-0a94-442d-8ed5-ea079e3c67c8</svc-request-id><response-code>200</response-code><ack-final-indicator>Y</ack-final-indicator><vnf-information><vnf-id>8925b50d-de67-44c1-b984-e7ce7b0f4dae</vnf-id></vnf-information><service-information><service-type>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-type><service-instance-id>8925b50d-de67-44c1-b984-e7ce7b0f4dae</service-instance-id><subscriber-name>notsurewecare</subscriber-name></service-information></output>
- </tag0:RequestData>
- </sdncadapterworkflow:response-data>
-</sdncadapterworkflow:SDNCAdapterWorkflowResponse> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2/cloudRegion25_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2/cloudRegion25_AAIResponse_Success.xml deleted file mode 100644 index 90c668c576..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2/cloudRegion25_AAIResponse_Success.xml +++ /dev/null @@ -1,20 +0,0 @@ -<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd" - statusCode="200"> - <rest:headers> - <rest:header name="Transfer-Encoding" value="chunked"/> - <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/> - <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/> - <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/> - <rest:header name="Content-Type" value="application/xml"/> - <rest:header name="Server" value="Apache-Coyote/1.1"/> - <rest:header name="Cache-Control" value="private"/> - </rest:headers> - <rest:payload contentType="text/xml"> - <l3-network xmlns="http://org.openecomp.aai.inventory/v8"> - <cloud-owner>att-aic</cloud-owner> - <cloud-region-id>RDM2WAGPLCP</cloud-region-id> - <cloud-region-version>2.5</cloud-region-version> - <complex-name>RDM2WAGPLCP</complex-name> - </l3-network> - </rest:payload> -</rest:RESTResponse> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2/cloudRegion30_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2/cloudRegion30_AAIResponse_Success.xml deleted file mode 100644 index 9b651f25e3..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2/cloudRegion30_AAIResponse_Success.xml +++ /dev/null @@ -1,20 +0,0 @@ -<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd" - statusCode="200"> - <rest:headers> - <rest:header name="Transfer-Encoding" value="chunked"/> - <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/> - <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/> - <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/> - <rest:header name="Content-Type" value="application/xml"/> - <rest:header name="Server" value="Apache-Coyote/1.1"/> - <rest:header name="Cache-Control" value="private"/> - </rest:headers> - <rest:payload contentType="text/xml"> - <l3-network xmlns="http://org.openecomp.aai.inventory/v8"> - <cloud-owner>att-aic</cloud-owner> - <cloud-region-id>RDM2WAGPLCP</cloud-region-id> - <cloud-region-version>3.0</cloud-region-version> - <complex-name>RDM2WAGPLCP</complex-name> - </l3-network> - </rest:payload> -</rest:RESTResponse> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2/deleteAAIResponse_Failure500_RESTFault.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2/deleteAAIResponse_Failure500_RESTFault.xml deleted file mode 100644 index 4ce7048950..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2/deleteAAIResponse_Failure500_RESTFault.xml +++ /dev/null @@ -1,19 +0,0 @@ -<rest:RESTFault xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd" - errorType="transport"> - <rest:errorCode>500</rest:errorCode> - <rest:message>HTTP method: GET Internal Server Error </rest:message> - <rest:messageDetails><Fault> - <requestError> - <serviceException> - <messageId>SVC3002</messageId> - <text>Error writing output performing %1 on %2 (msg=%3) (ec=%4)</text> - <variables> - <variable>PUT customer</variable> - <variable>SubName32</variable> - <variable>Unexpected error reading/updating database:Adding this property for key [service-instance-id] and value [12312442454112] violates a uniqueness constraint [service-instance-id]</variable> - <variable>ERR.5.4.5105</variable> - </variables> - </serviceException> - </requestError> -</Fault></rest:messageDetails> -</rest:RESTFault> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2/deleteNetworkAAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2/deleteNetworkAAIResponse_Success.xml deleted file mode 100644 index a740caacc4..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2/deleteNetworkAAIResponse_Success.xml +++ /dev/null @@ -1,61 +0,0 @@ -<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd" - statusCode="200"> - <rest:headers> - <rest:header name="Transfer-Encoding" value="chunked"/> - <rest:header name="Date" value="Sat,30 Jan 2016 20:09:24 GMT"/> - <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/> - <rest:header name="X-AAI-TXID" - value="mtcnjv9aaas01.mtcnj.aic.cip.com-20160130-20:09:24:814-165843"/> - <rest:header name="Content-Type" value="application/xml"/> - <rest:header name="Server" value="Apache-Coyote/1.1"/> - <rest:header name="Cache-Control" value="private"/> - </rest:headers> - <rest:payload contentType="text/xml"> - <l3-network xmlns="http://org.openecomp.aai.inventory/v8"> - <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id> - <network-name>HSL_direct_net_2</network-name> - <network-type>CONTRAIL_BASIC</network-type> - <network-role>HSL_direct</network-role> - <network-technology>contrail</network-technology> - <neutron-network-id>8bbd3edf-b835-4610-96a2-a5cafa029042</neutron-network-id> - <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id> - <orchestration-status>active</orchestration-status> - <heat-stack-id>HSL_direct_net_2/57594a56-1c92-4a38-9caa-641c1fa3d4b6</heat-stack-id> - <subnets> - <subnet> - <subnet-id>ea5f2a2c-604f-47ff-a9c5-253ee4f0ef0a</subnet-id> - <neutron-subnet-id>5a77fdc2-7789-4649-a1b9-6eaf1db1813a</neutron-subnet-id> - <gateway-address>172.16.34.1</gateway-address> - <network-start-address>172.16.34.0</network-start-address> - <cidr-mask>28</cidr-mask> - <ip-version>4</ip-version> - <orchestration-status>active</orchestration-status> - <dhcp-enabled>true</dhcp-enabled> - <relationship-list/> - </subnet> - </subnets> - <relationship-list> - <relationship> - <related-to>tenant</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/e81d842d3e8b45c5a59f57cd76af3aaf/</related-link> - <relationship-data> - <relationship-key>tenant.tenant-id</relationship-key> - <relationship-value>e81d842d3e8b45c5a59f57cd76af3aaf</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>cloud-region</related-to> - <related-link>cloud-infrastructure/cloud-regions/cloud-region/att-aic/RDM2WAGPLCP/</related-link> - <relationship-data> - <relationship-key>cloud-region.cloud-owner</relationship-key> - <relationship-value>att-aic</relationship-value> - </relationship-data> - <relationship-data> - <relationship-key>cloud-region.cloud-region-id</relationship-key> - <relationship-value>RDM2WAGPLCP</relationship-value> - </relationship-data> - </relationship> - </relationship-list> - </l3-network> - </rest:payload> -</rest:RESTResponse>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2/deleteNetworkAAIResponse_withRelationship_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2/deleteNetworkAAIResponse_withRelationship_Success.xml deleted file mode 100644 index 841cae0a2b..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2/deleteNetworkAAIResponse_withRelationship_Success.xml +++ /dev/null @@ -1,73 +0,0 @@ -<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd" - statusCode="200"> - <rest:headers> - <rest:header name="Transfer-Encoding" value="chunked"/> - <rest:header name="Date" value="Sat,30 Jan 2016 20:09:24 GMT"/> - <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/> - <rest:header name="X-AAI-TXID" - value="mtcnjv9aaas01.mtcnj.aic.cip.com-20160130-20:09:24:814-165843"/> - <rest:header name="Content-Type" value="application/xml"/> - <rest:header name="Server" value="Apache-Coyote/1.1"/> - <rest:header name="Cache-Control" value="private"/> - </rest:headers> - <rest:payload contentType="text/xml"> - <l3-network xmlns="http://org.openecomp.aai.inventory/v8"> - <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id> - <network-name>HSL_direct_net_2</network-name> - <network-type>CONTRAIL_BASIC</network-type> - <network-role>HSL_direct</network-role> - <network-technology>contrail</network-technology> - <neutron-network-id>8bbd3edf-b835-4610-96a2-a5cafa029042</neutron-network-id> - <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id> - <orchestration-status>active</orchestration-status> - <heat-stack-id>HSL_direct_net_2/57594a56-1c92-4a38-9caa-641c1fa3d4b6</heat-stack-id> - <subnets> - <subnet> - <subnet-id>ea5f2a2c-604f-47ff-a9c5-253ee4f0ef0a</subnet-id> - <neutron-subnet-id>5a77fdc2-7789-4649-a1b9-6eaf1db1813a</neutron-subnet-id> - <gateway-address>172.16.34.1</gateway-address> - <network-start-address>172.16.34.0</network-start-address> - <cidr-mask>28</cidr-mask> - <ip-version>4</ip-version> - <orchestration-status>active</orchestration-status> - <dhcp-enabled>true</dhcp-enabled> - <relationship-list/> - </subnet> - </subnets> - <relationship-list> - <relationship> - <related-to>tenant</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/e81d842d3e8b45c5a59f57cd76af3aaf/</related-link> - <relationship-data> - <relationship-key>tenant.tenant-id</relationship-key> - <relationship-value>e81d842d3e8b45c5a59f57cd76af3aaf</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>vf-module</related-to> - <related-link>https://aai-app-e2e.ecomp.cci.com:8443/aai/v8/network/generic-vnfs/generic-vnf/105df7e5-0b3b-49f7-a837-4864b62827c4/vf-modules/vf-module/d9217058-95a0-49ee-b9a9-949259e89349/</related-link> - <relationship-data> - <relationship-key>generic-vnf.vnf-id</relationship-key> - <relationship-value>105df7e5-0b3b-49f7-a837-4864b62827c4</relationship-value> - </relationship-data> - <relationship-data> - <relationship-key>vf-module.vf-module-id</relationship-key> - <relationship-value>d9217058-95a0-49ee-b9a9-949259e89349</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>generic-vnf</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/generic-vnfs/generic-vnf/45f822d9-73ca-4255-9844-7cef401bbf47/</related-link> - <relationship-data> - <relationship-key>generic-vnf.vnf-id</relationship-key> - <relationship-value>45f822d9-73ca-4255-9844-7cef401bbf47</relationship-value> - </relationship-data> - <related-to-property> - <property-key>generic-vnf.vnf-name</property-key> - <property-value>zrdm1scpx05</property-value> - </related-to-property> - </relationship> - </relationship-list> - </l3-network> - </rest:payload> -</rest:RESTResponse>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2mock/sdncDeleteNetworkTopologySimResponse.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2mock/sdncDeleteNetworkTopologySimResponse.xml deleted file mode 100644 index 8ec4f520c1..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2mock/sdncDeleteNetworkTopologySimResponse.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:v1="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
- <soapenv:Header />
- <soapenv:Body>
- <v1:SDNCAdapterCallback>
- <SDNCAdapterCallbackRequest xmlns="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
- <CallbackHeader>
- <RequestId>19174929-3809-49ca-89eb-17f84a035389</RequestId>
- <ResponseCode>200</ResponseCode>
- <ResponseMessage>OK</ResponseMessage>
- </CallbackHeader>
- <RequestData xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:type="xs:string"><?xml version="1.0" encoding="UTF-8"?><output xmlns="com:att:sdnctl:vnf"><svc-request-id>19174929-3809-49ca-89eb-17f84a035389</svc-request-id><response-code>200</response-code><ack-final-indicator>Y</ack-final-indicator><network-information><network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id></network-information><service-information><service-type>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-type><service-instance-id>HSL_direct_net_2</service-instance-id><subscriber-name>notsurewecare</subscriber-name></service-information></output></RequestData>
- </SDNCAdapterCallbackRequest>
- </v1:SDNCAdapterCallback>
- </soapenv:Body>
-</soapenv:Envelope>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2mock/sdncDeleteNetworkTopologySimResponse_noExtraTag.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2mock/sdncDeleteNetworkTopologySimResponse_noExtraTag.xml deleted file mode 100644 index f180e61366..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteNetworkV2mock/sdncDeleteNetworkTopologySimResponse_noExtraTag.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:v1="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
- <soapenv:Header />
- <soapenv:Body>
- <SDNCAdapterCallbackRequest xmlns="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
- <CallbackHeader>
- <RequestId>19174929-3809-49ca-89eb-17f84a035389</RequestId>
- <ResponseCode>200</ResponseCode>
- <ResponseMessage>OK</ResponseMessage>
- </CallbackHeader>
- <RequestData xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:type="xs:string"><?xml version="1.0" encoding="UTF-8"?><output xmlns="com:att:sdnctl:vnf"><svc-request-id>19174929-3809-49ca-89eb-17f84a035389</svc-request-id><response-code>200</response-code><ack-final-indicator>Y</ack-final-indicator><network-information><network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id></network-information><service-information><service-type>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-type><service-instance-id>HSL_direct_net_2</service-instance-id><subscriber-name>notsurewecare</subscriber-name></service-information></output></RequestData>
- </SDNCAdapterCallbackRequest>
- </soapenv:Body>
-</soapenv:Envelope>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteVfModuleCallbackResponse.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteVfModuleCallbackResponse.xml deleted file mode 100644 index 74a3beb221..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteVfModuleCallbackResponse.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<deleteVfModuleResponse> - <messageId>86651f79-057e-4245-8f5f-174db3cef553-1502888133261</messageId> - <vfModuleDeleted>true</vfModuleDeleted> - <vfModuleId>20928949-5230-495d-86a6-f3690b9b5d60</vfModuleId> - <vfModuleOutputs> - <entry> - <key>shared_private_network_id</key> - <value>bcd04543-b3d7-4c64-a910-1735b875ebb2</value> - </entry> - <entry> - <key>server1_port</key> - <value>d1605e82-50ba-4544-9f8d-a8a37b678046</value> - </entry> - <entry> - <key>vnf_id</key> - <value>7da56895-6be1-4bec-856b-525e0e573199</value> - </entry> - </vfModuleOutputs> - <vnfId>7da56895-6be1-4bec-856b-525e0e573199</vnfId> -</deleteVfModuleResponse> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteVfModuleVolumeInfraV1/DeleteVfModuleVolumeCallbackResponse.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteVfModuleVolumeInfraV1/DeleteVfModuleVolumeCallbackResponse.xml deleted file mode 100644 index 25aa45afd9..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteVfModuleVolumeInfraV1/DeleteVfModuleVolumeCallbackResponse.xml +++ /dev/null @@ -1,5 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<deleteVolumeGroupResponse> - <messageId>{{MESSAGE-ID}}</messageId> - <volumeGroupDeleted>true</volumeGroupDeleted> -</deleteVolumeGroupResponse> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteVfModuleVolumeInfraV1/deleteVfModuleVolume_VID_request_st.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteVfModuleVolumeInfraV1/deleteVfModuleVolume_VID_request_st.json deleted file mode 100644 index 52ead5f77f..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteVfModuleVolumeInfraV1/deleteVfModuleVolume_VID_request_st.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "requestDetails": { - "modelInfo": { - "modelType": "volumeGroup", - "modelInvariantUuid": "0b01b8c2-8416-11e6-ae22-56b6b6499611", - "modelName": "vSAMP12::base::module-0", - "modelVersion": "1.0" - }, - "cloudConfiguration": { - "lcpCloudRegionId": "cloudowner_MDTWNJ21", - "tenantId": "fba1bd1e195a404cacb9ce17a9b2b421" - }, - "requestInfo": { - "source": "VID" - } - } -}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_Success.xml deleted file mode 100644 index c02c35f9c9..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DeleteVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_Success.xml +++ /dev/null @@ -1,42 +0,0 @@ -<volume-group xmlns="http://org.openecomp.aai.inventory/v8">
- <volume-group-id>78987</volume-group-id>
- <volume-group-name>MSOTESTVOL102a-vSAMP12_base_vol_module-0</volume-group-name>
- <heat-stack-id/>
- <vnf-type>Test/vSAMP12</vnf-type>
- <orchestration-status>Pending</orchestration-status>
- <resource-version>0000020</resource-version>
- <relationship-list>
- <relationship>
- <related-to>generic-vnf</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/network/generic-vnfs/generic-vnf/9e48f6ea-f786-46de-800a-d480e5ccc846/</related-link>
- <relationship-data>
- <relationship-key>generic-vnf.vnf-id</relationship-key>
- <relationship-value>9e48f6ea-f786-46de-800a-d480e5ccc846</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>generic-vnf.vnf-name</property-key>
- <property-value>MSOSTSAMP12-10601</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v7/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mdt1/tenants/tenant/fba1bd1e195a404cacb9ce17a9b2b421/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>fba1bd1e195a404cacb9ce17a9b2b421</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-owner</relationship-key>
- <relationship-value>att-aic</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-region-id</relationship-key>
- <relationship-value>mdt1</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>tenant.tenant-name</property-key>
- <property-value>ECOMP_MDT1</property-value>
- </related-to-property>
- </relationship>
- </relationship-list>
-</volume-group>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleRollback/GenericVnf.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleRollback/GenericVnf.xml deleted file mode 100644 index 5e8a62b25b..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleRollback/GenericVnf.xml +++ /dev/null @@ -1,26 +0,0 @@ -<generic-vnf xmlns="http://org.openecomp.aai.inventory/v7">
- <vnf-id>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnf-id>
- <vnf-name>STMTN5MMSC21</vnf-name>
- <vnf-type>mmsc-capacity</vnf-type>
- <service-id>SDN-MOBILITY</service-id>
- <equipment-role>vMMSC</equipment-role>
- <orchestration-status>pending-create</orchestration-status>
- <in-maint>false</in-maint>
- <is-closed-loop-disabled>false</is-closed-loop-disabled>
- <resource-version>1508691</resource-version>
- <vf-modules>
- <vf-module>
- <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</vf-module-id>
- <vf-module-name>STMTN5MMSC21-MMSC::module-0-0</vf-module-name>
- <persona-model-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</persona-model-id>
- <persona-model-version>1.0</persona-model-version>
- <is-base-vf-module>true</is-base-vf-module>
- <heat-stack-id>FILLED-IN-BY-MSO</heat-stack-id>
- <orchestration-status>pending-create</orchestration-status>
- <resource-version>1508692</resource-version>
- </vf-module>
- </vf-modules>
- <relationship-list/>
- <l-interfaces/>
- <lag-interfaces/>
-</generic-vnf>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleRollback/GenericVnfVfModule.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleRollback/GenericVnfVfModule.xml deleted file mode 100644 index 586e0a620a..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleRollback/GenericVnfVfModule.xml +++ /dev/null @@ -1,26 +0,0 @@ -<generic-vnf xmlns="http://org.openecomp.aai.inventory/v7">
- <vnf-id>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnf-id>
- <vnf-name>STMTN5MMSC21</vnf-name>
- <vnf-type>mmsc-capacity</vnf-type>
- <service-id>SDN-MOBILITY</service-id>
- <equipment-role>vMMSC</equipment-role>
- <orchestration-status>pending-create</orchestration-status>
- <in-maint>false</in-maint>
- <is-closed-loop-disabled>false</is-closed-loop-disabled>
- <resource-version>0000021</resource-version>
- <vf-modules>
- <vf-module>
- <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</vf-module-id>
- <vf-module-name>STMTN5MMSC21-MMSC::module-0-0</vf-module-name>
- <persona-model-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</persona-model-id>
- <persona-model-version>1.0</persona-model-version>
- <is-base-vf-module>true</is-base-vf-module>
- <heat-stack-id>FILLED-IN-BY-MSO</heat-stack-id>
- <orchestration-status>pending-create</orchestration-status>
- <resource-version>0000073</resource-version>
- </vf-module>
- </vf-modules>
- <relationship-list/>
- <l-interfaces/>
- <lag-interfaces/>
-</generic-vnf>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeCallbackResponse.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeCallbackResponse.xml deleted file mode 100644 index a421355aba..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeCallbackResponse.xml +++ /dev/null @@ -1,53 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<createVolumeGroupResponse> - <messageId>{{MESSAGE-ID}}</messageId> - <volumeGroupCreated>true</volumeGroupCreated> - <volumeGroupId>d485ecee-957c-4a0a-8b95-27a22b90103f</volumeGroupId> - <volumeGroupOutputs> - <entry> - <key>mmsc_vol_1</key> - <value>a73e0fe9-1ce8-49c2-8fef-e2788605be29</value> - </entry> - <entry> - <key>mmsc_vol_2</key> - <value>37b6455a-5ea8-463a-89e3-0efeaf7b7c6d</value> - </entry> - <entry> - <key>nemsfe_vol_1</key> - <value>b7ff1c21-d138-49a3-bf13-4cfd91efaf48</value> - </entry> - <entry> - <key>nemsbe_vol_1</key> - <value>a5988471-cd42-44d8-b078-64f2f13d3d4c</value> - </entry> - <entry> - <key>mmsc_vol_5</key> - <value>f7b91c1e-ab8c-413a-a850-ba80a246c7e0</value> - </entry> - <entry> - <key>nemsfe_vol_2</key> - <value>957ea3f3-2d4a-4707-bfd2-ba66f42037c2</value> - </entry> - <entry> - <key>mmsc_vol_3</key> - <value>de6fccfe-d61a-48b0-b03b-87bf1bf749b3</value> - </entry> - <entry> - <key>mmsc_vol_4</key> - <value>76162310-2c38-4c32-981c-5c2880190077</value> - </entry> - </volumeGroupOutputs> - <volumeGroupRollback> - <cloudSiteId>RDM2WAGPLCP</cloudSiteId> - <messageId>e585e4f4-9452-437a-b294-45a2d6d3b7a3</messageId> - <msoRequest> - <requestId>c30b9453-4b68-4c2e-aacf-58a5ba648bf5</requestId> - <serviceInstanceId>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</serviceInstanceId> - </msoRequest> - <tenantId>1bbab536a19b4756926e7d0ec1eb543c</tenantId> - <volumeGroupCreated>true</volumeGroupCreated> - <volumeGroupId>78987</volumeGroupId> - <volumeGroupStackId>ZRDM1MMSC01_base_vol/7f74e5e1-5fc1-4593-ac7e-cc9899a106ef</volumeGroupStackId> - </volumeGroupRollback> - <volumeGroupStackId>ZRDM1MMSC01_base_vol/7f74e5e1-5fc1-4593-ac7e-cc9899a106ef</volumeGroupStackId> -</createVolumeGroupResponse> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeNoRollbackRequest.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeNoRollbackRequest.xml deleted file mode 100644 index 803a847bbc..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeNoRollbackRequest.xml +++ /dev/null @@ -1,24 +0,0 @@ -<volume-request xmlns="http://org.openecomp/mso/infra/vnf-request/v1" xmlns:xs="http://www.w3.org/2001/XMLSchema"> - <request-info> - <test-data-only>123abc</test-data-only> <!-- don't remove this tag. Its used for junit test --> - <request-id>d8d4fcfa-fd7e-4413-b19d-c95aa67291b8</request-id> - <action>CREATE_VF_MODULE_VOL</action> - <source>SoapUI-bns-create-base-vol-1001-1</source> - </request-info> - <volume-inputs> - <vnf-type>Test/vSAMP12</vnf-type> - <vf-module-model-name>vSAMP12::base::module-0</vf-module-model-name> - <backout-on-failure>false</backout-on-failure> - <asdc-service-model-version/> - <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id> - <aic-cloud-region>MDTWNJ21</aic-cloud-region> - <tenant-id>897deadc2b954a6bac6d3c197fb3525e</tenant-id> - <volume-group-name>MSOTESTVOL101a-vSAMP12_base_vol_module-0</volume-group-name> - <volume-group-id/> - </volume-inputs> - <volume-params> - <param name="param1">value1</param>" - <param name="param2">value2</param>" - <param name="param3">value3</param>" - </volume-params> -</volume-request> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeRequest.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeRequest.xml deleted file mode 100644 index e6ada9c826..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeRequest.xml +++ /dev/null @@ -1,24 +0,0 @@ -<volume-request xmlns="http://org.openecomp/mso/infra/vnf-request/v1" xmlns:xs="http://www.w3.org/2001/XMLSchema"> - <request-info> - <test-data-only>123abc</test-data-only> <!-- don't remove this tag. Its used for junit test --> - <request-id>d8d4fcfa-fd7e-4413-b19d-c95aa67291b8</request-id> - <action>CREATE_VF_MODULE_VOL</action> - <source>SoapUI-bns-create-base-vol-1001-1</source> - </request-info> - <volume-inputs> - <vnf-type>Test/vSAMP12</vnf-type> - <vf-module-model-name>vSAMP12::base::module-0</vf-module-model-name> - <backout-on-failure>true</backout-on-failure> - <asdc-service-model-version/> - <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id> - <aic-cloud-region>MDTWNJ21</aic-cloud-region> - <tenant-id>897deadc2b954a6bac6d3c197fb3525e</tenant-id> - <volume-group-name>MSOTESTVOL101a-vSAMP12_base_vol_module-0</volume-group-name> - <volume-group-id/> - </volume-inputs> - <volume-params> - <param name="param1">value1</param>" - <param name="param2">value2</param>" - <param name="param3">value3</param>" - </volume-params> -</volume-request> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/GenericVnf.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/GenericVnf.xml deleted file mode 100644 index 4c18356bf9..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/GenericVnf.xml +++ /dev/null @@ -1,38 +0,0 @@ -<generic-vnf xmlns="http://org.openecomp.aai.inventory/v8">
- <vnf-id>TEST-VNF-ID-0123</vnf-id>
- <vnf-name>STMTN5MMSC20</vnf-name>
- <vnf-type>pcrf-capacity</vnf-type>
- <service-id>SDN-MOBILITY</service-id>
- <equipment-role>vPCRF</equipment-role>
- <orchestration-status>pending-create</orchestration-status>
- <in-maint>false</in-maint>
- <is-closed-loop-disabled>false</is-closed-loop-disabled>
- <persona-model-id>introvert</persona-model-id>
- <persona-model-version>2.0</persona-model-version>
- <resource-version>0000020</resource-version>
- <vf-modules>
- <vf-module>
- <vf-module-id>lukewarm</vf-module-id>
- <vf-module-name>PCRF::module-0-0</vf-module-name>
- <persona-model-id>introvert</persona-model-id>
- <persona-model-version>2.0</persona-model-version>
- <is-base-vf-module>true</is-base-vf-module>
- <heat-stack-id>fastburn</heat-stack-id>
- <orchestration-status>pending-create</orchestration-status>
- <resource-version>0000074</resource-version>
- </vf-module>
- <vf-module>
- <vf-module-id>supercool</vf-module-id>
- <vf-module-name>PCRF::module-1-0</vf-module-name>
- <persona-model-id>extrovert</persona-model-id>
- <persona-model-version>2.0</persona-model-version>
- <is-base-vf-module>false</is-base-vf-module>
- <heat-stack-id>slowburn</heat-stack-id>
- <orchestration-status>pending-create</orchestration-status>
- <resource-version>0000075</resource-version>
- </vf-module>
- </vf-modules>
- <relationship-list/>
- <l-interfaces/>
- <lag-interfaces/>
-</generic-vnf>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/RollbackVfModuleVolumeCallbackResponse.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/RollbackVfModuleVolumeCallbackResponse.xml deleted file mode 100644 index 6ab9416617..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/RollbackVfModuleVolumeCallbackResponse.xml +++ /dev/null @@ -1,5 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<rollbackVolumeGroupResponse> - <messageId>{{MESSAGE-ID}}</messageId> - <volumeGroupRolledback>true</volumeGroupRolledback> -</rollbackVolumeGroupResponse> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/createVfModuleVolume_VID_request.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/createVfModuleVolume_VID_request.json deleted file mode 100644 index 6cc84c79b6..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/createVfModuleVolume_VID_request.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "requestDetails": { - "modelInfo": { - "modelType": "volumeGroup", - "modelId": "ff5256d2-5a33-55df-13ab-12abad84e7ff", - "modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe", - "modelName": "vSAMP12::base::module-0", - "modelVersion": "1" - }, - "cloudConfiguration": { - "lcpCloudRegionId": "mdt1", - "tenantId": "88a6ca3ee0394ade9403f075db23167e" - }, - "requestInfo": { - "instanceName": "MSOTESTVOL103W-vSAMP12_base_vol_module-0", - "source": "VID", - "callbackUrl": "{do we support this???}" - }, - "relatedInstanceList": [ - { - "relatedInstance": { - "instanceId": "{service-instance-id}", - "modelInfo": { - "modelType": "service", - "modelId": "ff3514e3-5a33-55df-13ab-12abad84e7ff", - "modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe", - "modelName": "{parent service model name}", - "modelVersion": "1" - } - } - }, - { - "relatedInstance": { - "instanceId": "{vnf-instance-id}", - "modelInfo": { - "modelType": "vnf", - "modelId": "ff5256d1-5a33-55df-13ab-12abad84e7ff", - "modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe", - "modelName": "Test/vSAMP12", - "modelVersion": "1" - } - } - } - ], - "requestParameters": { - "backoutOnFailure": true, - "serviceId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", - "userParams": [ - { - "name": "vnfName", - "value": "STMTN5MMSC20" - }, - { - "name": "vnfName2", - "value": "US1117MTSNJVBR0246" - }, - { - "name": "vnfNmInformation", - "value": "" - }, - { - "name": "vnfType", - "value": "pcrf-capacity" - }, - { - "name": "vnfId", - "value": "skask" - }, - { - "name": "vnfStackId", - "value": "slowburn" - }, - { - "name": "vnfStatus", - "value": "created" - }, - { - "name": "aicCloudRegion", - "value": "MDTWNJ21" - }, - { - "name": "availabilityZone", - "value": "slcp3-esx-az01" - }, - { - "name": "oamNetworkName", - "value": "VLAN-OAM-1323" - }, - { - "name": "vmName", - "value": "slcp34246vbc246ceb" - }, - { - "name": "ipagNetworkId", - "value": "970cd2b9-7f09-4a12-af47-182ea38ba1f0" - }, - { - "name": "vpeNetworkId", - "value": "545cc2c3-1930-4100-b534-5d82d0e12bb6" - } - ] - } - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/createVfModuleVolume_createVolumeName_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/createVfModuleVolume_createVolumeName_AAIResponse_Success.xml deleted file mode 100644 index bff26fa78a..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/createVfModuleVolume_createVolumeName_AAIResponse_Success.xml +++ /dev/null @@ -1,49 +0,0 @@ -<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="X-CSI-Internal-WriteableRequest" value="true"/>
- <rest:header name="X-CSI-MethodName" value="UNKNOWN"/>
- <rest:header name="Content-Length" value="968"/>
- <rest:header name="breadcrumbId" value="ID-mtsnjv9aaas23-44965-1459957053425-0-211465"/>
- <rest:header name="X-CSI-UniqueTransactionId"
- value="AjscCsiRestful28795@mtsnjv9aaas237d4a4d21-e60a-495f-935f-cc225dc3c847"/>
- <rest:header name="User-Agent" value="Jakarta Commons-HttpClient/3.1"/>
- <rest:header name="X-TransactionID" value="3a19f95d-d63e-4a8e-8b9c-6563895628aa"/>
- <rest:header name="X-CSI-ServiceName" value="UNKNOWN"/>
- <rest:header name="Server" value="Jetty(9.2.z-SNAPSHOT)"/>
- <rest:header name="Cache-Control" value="no-cache,no-store"/>
- <rest:header name="X-FromAppId" value="MSO"/>
- <rest:header name="Date" value="Fri,08 Apr 2016 16:53:04 GMT"/>
- <rest:header name="X-CSI-ConversationId"
- value="ajscUser~CNG-CSI~c0a2bb44-2167-4e85-ad6a-483a24c0823a"/>
- <rest:header name="volume-group-name" value="simpleCinderVolume_201604071"/>
- <rest:header name="X-CSI-MessageId" value="f6d6eed4-456e-4033-be04-b17582902dc2"/>
- <rest:header name="X-AAI-TXID" value="mtsnjv9aaas23-20160408-16:53:04:592-73255"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Accept" value="application/xml"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <volume-group xmlns="http://org.openecomp.aai.inventory/v8">
- <volume-group-id>simpleCinderVolume_201604071</volume-group-id>
- <volume-group-name>simpleCinderVolume_201604071</volume-group-name>
- <heat-stack-id>simpleCinderVolume_201604071</heat-stack-id>
- <vnf-type>simple_cinder_master</vnf-type>
- <orchestration-status>Pending</orchestration-status>
- <resource-version>1460134360</resource-version>
- <relationship-list>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v6/cloud-infrastructure/tenants/tenant/897deadc2b954a6bac6d3c197fb3525e/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>897deadc2b954a6bac6d3c197fb3525e</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>tenant.tenant-name</property-key>
- <property-value>MSOTest1</property-value>
- </related-to-property>
- </relationship>
- </relationship-list>
- </volume-group>
- </rest:payload>
-</rest:RESTResponse>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/createVfModuleVolume_deleteVolumeName_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/createVfModuleVolume_deleteVolumeName_AAIResponse_Success.xml deleted file mode 100644 index 1574310474..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/createVfModuleVolume_deleteVolumeName_AAIResponse_Success.xml +++ /dev/null @@ -1,24 +0,0 @@ - <rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd" - statusCode="200"> - <rest:headers> - <rest:header name="X-CSI-Internal-WriteableRequest" value="true"/> - <rest:header name="X-CSI-MethodName" value="helloWorld-GetMethod(Logical)"/> - <rest:header name="Content-Length" value="0"/> - <rest:header name="breadcrumbId" value="ID-mtsnjv9aaas23-44965-1459957053425-0-211467"/> - <rest:header name="X-CSI-UniqueTransactionId" - value="AjscCsiRestful28795@mtsnjv9aaas23d44059bc-ef96-4af8-a28b-98044e08d7af"/> - <rest:header name="User-Agent" value="Jakarta Commons-HttpClient/3.1"/> - <rest:header name="X-TransactionID" value="3749995c-266b-4025-a0c4-4ce6983efc66"/> - <rest:header name="X-CSI-ServiceName" value="helloWorld"/> - <rest:header name="Server" value="Jetty(9.2.z-SNAPSHOT)"/> - <rest:header name="Cache-Control" value="no-cache,no-store"/> - <rest:header name="X-FromAppId" value="MSO"/> - <rest:header name="Date" value="Fri,08 Apr 2016 16:53:04 GMT"/> - <rest:header name="X-CSI-ConversationId" - value="ajscUser~CNG-CSI~bbd0e78f-d4e7-41be-b9ad-4a6767fa660a"/> - <rest:header name="X-CSI-MessageId" value="6ccfeb13-56da-4836-bfbd-5a42dee60939"/> - <rest:header name="X-AAI-TXID" value="mtsnjv9aaas23-20160408-16:53:04:629-73256"/> - <rest:header name="Content-Type" value="application/xml"/> - <rest:header name="Accept" value="application/xml"/> - </rest:headers> - </rest:RESTResponse>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/createVfModuleVolume_queryVolumeName_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/createVfModuleVolume_queryVolumeName_AAIResponse_Success.xml deleted file mode 100644 index cb20a41ca0..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/createVfModuleVolume_queryVolumeName_AAIResponse_Success.xml +++ /dev/null @@ -1,49 +0,0 @@ -<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="X-CSI-Internal-WriteableRequest" value="true"/>
- <rest:header name="X-CSI-MethodName" value="UNKNOWN"/>
- <rest:header name="Content-Length" value="968"/>
- <rest:header name="breadcrumbId" value="ID-mtsnjv9aaas23-44965-1459957053425-0-211465"/>
- <rest:header name="X-CSI-UniqueTransactionId"
- value="AjscCsiRestful28795@mtsnjv9aaas237d4a4d21-e60a-495f-935f-cc225dc3c847"/>
- <rest:header name="User-Agent" value="Jakarta Commons-HttpClient/3.1"/>
- <rest:header name="X-TransactionID" value="3a19f95d-d63e-4a8e-8b9c-6563895628aa"/>
- <rest:header name="X-CSI-ServiceName" value="UNKNOWN"/>
- <rest:header name="Server" value="Jetty(9.2.z-SNAPSHOT)"/>
- <rest:header name="Cache-Control" value="no-cache,no-store"/>
- <rest:header name="X-FromAppId" value="MSO"/>
- <rest:header name="Date" value="Fri,08 Apr 2016 16:53:04 GMT"/>
- <rest:header name="X-CSI-ConversationId"
- value="ajscUser~CNG-CSI~c0a2bb44-2167-4e85-ad6a-483a24c0823a"/>
- <rest:header name="volume-group-name" value="simpleCinderVolume_201604071"/>
- <rest:header name="X-CSI-MessageId" value="f6d6eed4-456e-4033-be04-b17582902dc2"/>
- <rest:header name="X-AAI-TXID" value="mtsnjv9aaas23-20160408-16:53:04:592-73255"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Accept" value="application/xml"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <volume-group xmlns="http://org.openecomp.aai.inventory/v8">
- <volume-group-id>8424bb3c-c3e7-4553-9662-469649ed9379</volume-group-id>
- <volume-group-name>MSOTESTVOL103W-vSAMP12_base_vol_module-0</volume-group-name>
- <heat-stack-id/>
- <vnf-type>simple_cinder_master</vnf-type>
- <orchestration-status>Pending</orchestration-status>
- <resource-version>1460134360</resource-version>
- <relationship-list>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v6/cloud-infrastructure/tenants/tenant/897deadc2b954a6bac6d3c197fb3525e/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>897deadc2b954a6bac6d3c197fb3525e</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>tenant.tenant-name</property-key>
- <property-value>MSOTest1</property-value>
- </related-to-property>
- </relationship>
- </relationship-list>
- </volume-group>
- </rest:payload>
-</rest:RESTResponse>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/createVfModuleVolume_updateVolumeName_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/createVfModuleVolume_updateVolumeName_AAIResponse_Success.xml deleted file mode 100644 index 1574310474..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModuleVolumeV1/createVfModuleVolume_updateVolumeName_AAIResponse_Success.xml +++ /dev/null @@ -1,24 +0,0 @@ - <rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd" - statusCode="200"> - <rest:headers> - <rest:header name="X-CSI-Internal-WriteableRequest" value="true"/> - <rest:header name="X-CSI-MethodName" value="helloWorld-GetMethod(Logical)"/> - <rest:header name="Content-Length" value="0"/> - <rest:header name="breadcrumbId" value="ID-mtsnjv9aaas23-44965-1459957053425-0-211467"/> - <rest:header name="X-CSI-UniqueTransactionId" - value="AjscCsiRestful28795@mtsnjv9aaas23d44059bc-ef96-4af8-a28b-98044e08d7af"/> - <rest:header name="User-Agent" value="Jakarta Commons-HttpClient/3.1"/> - <rest:header name="X-TransactionID" value="3749995c-266b-4025-a0c4-4ce6983efc66"/> - <rest:header name="X-CSI-ServiceName" value="helloWorld"/> - <rest:header name="Server" value="Jetty(9.2.z-SNAPSHOT)"/> - <rest:header name="Cache-Control" value="no-cache,no-store"/> - <rest:header name="X-FromAppId" value="MSO"/> - <rest:header name="Date" value="Fri,08 Apr 2016 16:53:04 GMT"/> - <rest:header name="X-CSI-ConversationId" - value="ajscUser~CNG-CSI~bbd0e78f-d4e7-41be-b9ad-4a6767fa660a"/> - <rest:header name="X-CSI-MessageId" value="6ccfeb13-56da-4836-bfbd-5a42dee60939"/> - <rest:header name="X-AAI-TXID" value="mtsnjv9aaas23-20160408-16:53:04:629-73256"/> - <rest:header name="Content-Type" value="application/xml"/> - <rest:header name="Accept" value="application/xml"/> - </rest:headers> - </rest:RESTResponse>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModule_getVnfResponse.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModule_getVnfResponse.xml deleted file mode 100644 index 021a8a73d1..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/DoCreateVfModule_getVnfResponse.xml +++ /dev/null @@ -1,26 +0,0 @@ -<generic-vnf xmlns="http://org.openecomp.aai.inventory/v7">
- <vnf-id>a27ce5a9-29c4-4c22-a017-6615ac73c721</vnf-id>
- <vnf-name>STMTN5MMSC21</vnf-name>
- <vnf-type>mmsc-capacity</vnf-type>
- <service-id>SDN-MOBILITY</service-id>
- <equipment-role>vMMSC</equipment-role>
- <orchestration-status>pending-create</orchestration-status>
- <in-maint>false</in-maint>
- <is-closed-loop-disabled>false</is-closed-loop-disabled>
- <resource-version>1508691</resource-version>
- <vf-modules>
- <vf-module>
- <vf-module-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</vf-module-id>
- <vf-module-name>STMTN5MMSC21-MMSC::module-0-0</vf-module-name>
- <persona-model-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</persona-model-id>
- <persona-model-version>1.0</persona-model-version>
- <is-base-vf-module>true</is-base-vf-module>
- <heat-stack-id>FILLED-IN-BY-MSO</heat-stack-id>
- <orchestration-status>pending-create</orchestration-status>
- <resource-version>1508692</resource-version>
- </vf-module>
- </vf-modules>
- <relationship-list/>
- <l-interfaces/>
- <lag-interfaces/>
- </generic-vnf>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/MsoCompletionRequest.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/MsoCompletionRequest.xml deleted file mode 100644 index 37b17121ae..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/MsoCompletionRequest.xml +++ /dev/null @@ -1,11 +0,0 @@ -<aetgt:MsoCompletionRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1" - xmlns:ns="http://org.openecomp/mso/request/types/v1" - xmlns="http://org.openecomp/mso/infra/vnf-request/v1"> - <request-info> - <request-id>null</request-id> - <action>DELETE</action> - <source>null</source> - </request-info> - <aetgt:status-message>E2E Service Instance was deleted successfully.</aetgt:status-message> - <aetgt:mso-bpel-name>DeleteCustomE2EServiceInstance</aetgt:mso-bpel-name> -</aetgt:MsoCompletionRequest>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/SDNCDeleteResponse.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/SDNCDeleteResponse.xml deleted file mode 100644 index fd719ff443..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/SDNCDeleteResponse.xml +++ /dev/null @@ -1,212 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<sdncadapterworkflow:SDNCAdapterWorkflowResponse - xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"> - <sdncadapterworkflow:response-data> - <tag0:RequestData - xmlns:tag0="http://org.openecomp/workflow/sdnc/adapter/schema/v1" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string"> - <output xmlns="com:att:sdnctl:nbncapi"> - <ack-final-indicator>Y</ack-final-indicator> - <svc-request-id>SK-2016-10-22-001</svc-request-id> - <nbnc-response-information> - <response-info> - <result>SUCCESS</result> - <aai-status>ERROR</aai-status> - </response-info> - <virtual-datacenter-list> - <vdc-id>15001417</vdc-id> - <router-list> - <router-name>ALPRTR2</router-name> - <ipe-loopback-address>1.1.1.2</ipe-loopback-address> - <vlan-list> - <vlan-id>1255.ae81</vlan-id> - <border-element-type>VDBE</border-element-type> - <border-element-tangibility>VIRTUAL</border-element-tangibility> - <port-id></port-id> - <border-element-id>ALPVDBE1</border-element-id> - <border-element-v4-subnet>3.1.1.0/22</border-element-v4-subnet> - <lag-id>ae81</lag-id> - <border-element-v6-subnet>3:1:1::0/22</border-element-v6-subnet> - </vlan-list> - <vlan-list> - <vlan-id>1995.ae81</vlan-id> - <border-element-type>ASBG</border-element-type> - <border-element-tangibility>VIRTUAL</border-element-tangibility> - <port-id></port-id> - <border-element-id>ALPASBG1</border-element-id> - <border-element-v4-subnet>3.1.1.0/22</border-element-v4-subnet> - <lag-id>ae81</lag-id> - <border-element-v6-subnet>3:1:1::0/22</border-element-v6-subnet> - </vlan-list> - <vlan-list> - <vlan-id>85.xe-10/0/2</vlan-id> - <border-element-type>BGF2</border-element-type> - <border-element-tangibility>PHYSICAL</border-element-tangibility> - <port-id>xe-10/0/2</port-id> - <border-element-id>ALPBGF2</border-element-id> - <border-element-v4-subnet>3.1.2.0/22</border-element-v4-subnet> - <lag-id></lag-id> - <border-element-v6-subnet>3:1:2::0/22</border-element-v6-subnet> - </vlan-list> - <vlan-list> - <vlan-id>85.xe-10/0/1</vlan-id> - <border-element-type>BGF1</border-element-type> - <border-element-tangibility>PHYSICAL</border-element-tangibility> - <port-id>xe-10/0/1</port-id> - <border-element-id>ALPBGF1</border-element-id> - <border-element-v4-subnet>3.1.2.0/22</border-element-v4-subnet> - <lag-id></lag-id> - <border-element-v6-subnet>3:1:2::0/22</border-element-v6-subnet> - </vlan-list> - <ipe-id>2</ipe-id> - </router-list> - <router-list> - <router-name>ALPRTR1</router-name> - <ipe-loopback-address>1.1.1.1</ipe-loopback-address> - <vlan-list> - <vlan-id>1255.ae81</vlan-id> - <border-element-type>VDBE</border-element-type> - <border-element-tangibility>VIRTUAL</border-element-tangibility> - <port-id></port-id> - <border-element-id>ALPVDBE1</border-element-id> - <border-element-v4-subnet>3.1.1.0/22</border-element-v4-subnet> - <lag-id>ae81</lag-id> - <border-element-v6-subnet>3:1:1::0/22</border-element-v6-subnet> - </vlan-list> - <vlan-list> - <vlan-id>1995.ae81</vlan-id> - <border-element-type>ASBG</border-element-type> - <border-element-tangibility>VIRTUAL</border-element-tangibility> - <port-id></port-id> - <border-element-id>ALPASBG1</border-element-id> - <border-element-v4-subnet>3.1.1.0/22</border-element-v4-subnet> - <lag-id>ae81</lag-id> - <border-element-v6-subnet>3:1:1::0/22</border-element-v6-subnet> - </vlan-list> - <vlan-list> - <vlan-id>85.xe-10/0/2</vlan-id> - <border-element-type>BGF2</border-element-type> - <border-element-tangibility>PHYSICAL</border-element-tangibility> - <port-id>xe-10/0/2</port-id> - <border-element-id>ALPBGF2</border-element-id> - <border-element-v4-subnet>3.1.2.0/22</border-element-v4-subnet> - <lag-id></lag-id> - <border-element-v6-subnet>3:1:2::0/22</border-element-v6-subnet> - </vlan-list> - <vlan-list> - <vlan-id>85.xe-10/0/1</vlan-id> - <border-element-type>BGF1</border-element-type> - <border-element-tangibility>PHYSICAL</border-element-tangibility> - <port-id>xe-10/0/1</port-id> - <border-element-id>ALPBGF1</border-element-id> - <border-element-v4-subnet>3.1.2.0/22</border-element-v4-subnet> - <lag-id></lag-id> - <border-element-v6-subnet>3:1:2::0/22</border-element-v6-subnet> - </vlan-list> - <ipe-id>1</ipe-id> - </router-list> - </virtual-datacenter-list> - <virtual-datacenter-list> - <vdc-id>15001418</vdc-id> - <router-list> - <router-name>SANRTR1</router-name> - <ipe-loopback-address>2.1.1.1</ipe-loopback-address> - <vlan-list> - <vlan-id>1255.ae81</vlan-id> - <border-element-type>VDBE</border-element-type> - <border-element-tangibility>VIRTUAL</border-element-tangibility> - <port-id></port-id> - <border-element-id>SANVDBE1</border-element-id> - <border-element-v4-subnet>4.1.1.0/22</border-element-v4-subnet> - <lag-id>ae81</lag-id> - <border-element-v6-subnet>4:1:1::0/22</border-element-v6-subnet> - </vlan-list> - <vlan-list> - <vlan-id>1995.ae81</vlan-id> - <border-element-type>ASBG</border-element-type> - <border-element-tangibility>VIRTUAL</border-element-tangibility> - <port-id></port-id> - <border-element-id>SANASBG1</border-element-id> - <border-element-v4-subnet>4.1.1.0/22</border-element-v4-subnet> - <lag-id>ae81</lag-id> - <border-element-v6-subnet>4:1:1::0/22</border-element-v6-subnet> - </vlan-list> - <vlan-list> - <vlan-id>85.xe-10/0/2</vlan-id> - <border-element-type>BGF2</border-element-type> - <border-element-tangibility>PHYSICAL</border-element-tangibility> - <port-id>xe-10/0/2</port-id> - <border-element-id>SANBGF2</border-element-id> - <border-element-v4-subnet>4.1.2.0/22</border-element-v4-subnet> - <lag-id></lag-id> - <border-element-v6-subnet>4:1:2::0/22</border-element-v6-subnet> - </vlan-list> - <vlan-list> - <vlan-id>85.xe-10/0/1</vlan-id> - <border-element-type>BGF1</border-element-type> - <border-element-tangibility>PHYSICAL</border-element-tangibility> - <port-id>xe-10/0/1</port-id> - <border-element-id>SANBGF1</border-element-id> - <border-element-v4-subnet>4.1.2.0/22</border-element-v4-subnet> - <lag-id></lag-id> - <border-element-v6-subnet>4:1:2::0/22</border-element-v6-subnet> - </vlan-list> - <ipe-id>1</ipe-id> - </router-list> - <router-list> - <router-name>SANRTR2</router-name> - <ipe-loopback-address>2.1.1.2</ipe-loopback-address> - <vlan-list> - <vlan-id>1255.ae81</vlan-id> - <border-element-type>VDBE</border-element-type> - <border-element-tangibility>VIRTUAL</border-element-tangibility> - <port-id></port-id> - <border-element-id>SANVDBE1</border-element-id> - <border-element-v4-subnet>4.1.1.0/22</border-element-v4-subnet> - <lag-id>ae81</lag-id> - <border-element-v6-subnet>4:1:1::0/22</border-element-v6-subnet> - </vlan-list> - <vlan-list> - <vlan-id>1995.ae81</vlan-id> - <border-element-type>ASBG</border-element-type> - <border-element-tangibility>VIRTUAL</border-element-tangibility> - <port-id></port-id> - <border-element-id>SANASBG1</border-element-id> - <border-element-v4-subnet>4.1.1.0/22</border-element-v4-subnet> - <lag-id>ae81</lag-id> - <border-element-v6-subnet>4:1:1::0/22</border-element-v6-subnet> - </vlan-list> - <vlan-list> - <vlan-id>85.xe-10/0/2</vlan-id> - <border-element-type>BGF2</border-element-type> - <border-element-tangibility>PHYSICAL</border-element-tangibility> - <port-id>xe-10/0/2</port-id> - <border-element-id>SANBGF2</border-element-id> - <border-element-v4-subnet>4.1.2.0/22</border-element-v4-subnet> - <lag-id></lag-id> - <border-element-v6-subnet>4:1:2::0/22</border-element-v6-subnet> - </vlan-list> - <vlan-list> - <vlan-id>85.xe-10/0/1</vlan-id> - <border-element-type>BGF1</border-element-type> - <border-element-tangibility>PHYSICAL</border-element-tangibility> - <port-id>xe-10/0/1</port-id> - <border-element-id>SANBGF1</border-element-id> - <border-element-v4-subnet>4.1.2.0/22</border-element-v4-subnet> - <lag-id></lag-id> - <border-element-v6-subnet>4:1:2::0/22</border-element-v6-subnet> - </vlan-list> - <ipe-id>2</ipe-id> - </router-list> - </virtual-datacenter-list> - <service-type>COLLABORATE</service-type> - <interface-status>DISABLE</interface-status> - <customer-id>custid-888</customer-id> - <service-instance-id>SII-2016-10-22-001</service-instance-id> - <provision-type>CUSTOMER</provision-type> - <vni-id>100668</vni-id> - </nbnc-response-information> - </output> - </tag0:RequestData> - </sdncadapterworkflow:response-data> -</sdncadapterworkflow:SDNCAdapterWorkflowResponse>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/aaiGetResponse.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/aaiGetResponse.xml deleted file mode 100644 index c367b5c959..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/aaiGetResponse.xml +++ /dev/null @@ -1,33 +0,0 @@ -<service-instance xmlns="http://org.openecomp.aai.inventory/v11"> - <service-instance-id>1234</service-instance-id> - <service-instance-name>volte-service</service-instance-name> - <service-type>testservicetype</service-type> - <service-role>testservicerole</service-role> - <description>volte service</description> - <model-invariant-id>c1d4305f-cdbd-4bbe-9069-a2f4978fd89e</model-invariant-id> - <model-version-id>d4df5c27-98a1-4812-a8aa-c17f055b7a3f</model-version-id> - <resource-version>1508838121849</resource-version> - <orchestration-status>create</orchestration-status> - <relationship-list> - <relationship> - <related-to>service-instance</related-to> - <related-link>/aai/v11/business/customers/customer/test_customer/service-subscription/example-service-type/service-instance/1234_1</related-link> - <relationship-data> - <relationship-key>customer.global-customer-id</relationship-key> - <relationship-value>test_customer</relationship-value> - </relationship-data> - <relationship-data> - <relationship-key>service-subscription.service-type</relationship-key> - <relationship-value>test_customer</relationship-value> - </relationship-data> - <relationship-data> - <relationship-key>service-instance.service-instance-id</relationship-key> - <relationship-value>1234_1</relationship-value> - </relationship-data> - <related-to-property> - <property-key>service-instance.service-instance-name</property-key> - <property-value>volte-service_vEPC</property-value> - </related-to-property> - </relationship> - </relationship-list> -</service-instance>
\ 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 deleted file mode 100644 index e178583a34..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getARUrlById.xml +++ /dev/null @@ -1,6 +0,0 @@ -<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/getGenericVnfByNameResponse.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getGenericVnfByNameResponse.xml deleted file mode 100644 index a472996121..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getGenericVnfByNameResponse.xml +++ /dev/null @@ -1,23 +0,0 @@ -<generic-vnfs xmlns="http://org.openecomp.aai.inventory/v3"> - <generic-vnf> - <vnf-id>2f1cc940-455f-4ee2-9411-a7899cd4f124</vnf-id> - <vnf-name>testVnfName123</vnf-name> - <vnf-type>mmsc-capacity</vnf-type> - <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id> - <equipment-role>vMMSC</equipment-role> - <orchestration-status>pending-create</orchestration-status> - <resource-version>testReVer123</resource-version> - <relationship-list> - <relationship> - <related-to>nothing</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/c597ab81-fece-49f4-a4f5-710cebb13c29/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>c597ab81-fece-49f4-a4f5-710cebb13c29</relationship-value> - </relationship-data> - </relationship> - </relationship-list> - <l-interfaces/> - <lag-interfaces/> - </generic-vnf> - </generic-vnfs>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getGenericVnfResponse.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getGenericVnfResponse.xml deleted file mode 100644 index 8ba178cc1c..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getGenericVnfResponse.xml +++ /dev/null @@ -1,90 +0,0 @@ -<generic-vnfs xmlns="http://org.openecomp.aai.inventory/v3"> - <generic-vnf> - <vnf-id>2f1cc940-455f-4ee2-9411-a7899cd4f124</vnf-id> - <vnf-name>testVnfName123</vnf-name> - <vnf-type>mmsc-capacity</vnf-type> - <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id> - <equipment-role>vMMSC</equipment-role> - <orchestration-status>pending-create</orchestration-status> - <relationship-list> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/c597ab81-fece-49f4-a4f5-710cebb13c29/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>c597ab81-fece-49f4-a4f5-710cebb13c29</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/53956c91-6e5e-49aa-88dd-535f57e66e70/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>53956c91-6e5e-49aa-88dd-535f57e66e70</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/44e0d9e0-9334-4ec6-9344-07a96dac629f/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>44e0d9e0-9334-4ec6-9344-07a96dac629f</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/ac49d99b-5daf-4624-9f8e-188b126ea166/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>ac49d99b-5daf-4624-9f8e-188b126ea166</relationship-value> - </relationship-data> - </relationship> - </relationship-list> - <l-interfaces/> - <lag-interfaces/> - </generic-vnf> - <generic-vnf> - <vnf-id>802767b3-18a6-4432-96db-25522786aee0</vnf-id> - <vnf-name>ZRDM1MMSC03</vnf-name> - <vnf-type>mmsc-capacity</vnf-type> - <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id> - <equipment-role>vMMSC</equipment-role> - <orchestration-status>pending-create</orchestration-status> - <relationship-list> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/c597ab81-fece-49f4-a4f5-710cebb13c29/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>c597ab81-fece-49f4-a4f5-710cebb13c29</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/53956c91-6e5e-49aa-88dd-535f57e66e70/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>53956c91-6e5e-49aa-88dd-535f57e66e70</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/44e0d9e0-9334-4ec6-9344-07a96dac629f/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>44e0d9e0-9334-4ec6-9344-07a96dac629f</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/ac49d99b-5daf-4624-9f8e-188b126ea166/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>ac49d99b-5daf-4624-9f8e-188b126ea166</relationship-value> - </relationship-data> - </relationship> - </relationship-list> - <l-interfaces/> - <lag-interfaces/> - </generic-vnf> - </generic-vnfs>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getGenericVnfResponse_hasRelationships.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getGenericVnfResponse_hasRelationships.xml deleted file mode 100644 index 8ba178cc1c..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getGenericVnfResponse_hasRelationships.xml +++ /dev/null @@ -1,90 +0,0 @@ -<generic-vnfs xmlns="http://org.openecomp.aai.inventory/v3"> - <generic-vnf> - <vnf-id>2f1cc940-455f-4ee2-9411-a7899cd4f124</vnf-id> - <vnf-name>testVnfName123</vnf-name> - <vnf-type>mmsc-capacity</vnf-type> - <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id> - <equipment-role>vMMSC</equipment-role> - <orchestration-status>pending-create</orchestration-status> - <relationship-list> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/c597ab81-fece-49f4-a4f5-710cebb13c29/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>c597ab81-fece-49f4-a4f5-710cebb13c29</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/53956c91-6e5e-49aa-88dd-535f57e66e70/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>53956c91-6e5e-49aa-88dd-535f57e66e70</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/44e0d9e0-9334-4ec6-9344-07a96dac629f/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>44e0d9e0-9334-4ec6-9344-07a96dac629f</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/ac49d99b-5daf-4624-9f8e-188b126ea166/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>ac49d99b-5daf-4624-9f8e-188b126ea166</relationship-value> - </relationship-data> - </relationship> - </relationship-list> - <l-interfaces/> - <lag-interfaces/> - </generic-vnf> - <generic-vnf> - <vnf-id>802767b3-18a6-4432-96db-25522786aee0</vnf-id> - <vnf-name>ZRDM1MMSC03</vnf-name> - <vnf-type>mmsc-capacity</vnf-type> - <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id> - <equipment-role>vMMSC</equipment-role> - <orchestration-status>pending-create</orchestration-status> - <relationship-list> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/c597ab81-fece-49f4-a4f5-710cebb13c29/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>c597ab81-fece-49f4-a4f5-710cebb13c29</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/53956c91-6e5e-49aa-88dd-535f57e66e70/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>53956c91-6e5e-49aa-88dd-535f57e66e70</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/44e0d9e0-9334-4ec6-9344-07a96dac629f/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>44e0d9e0-9334-4ec6-9344-07a96dac629f</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/ac49d99b-5daf-4624-9f8e-188b126ea166/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>ac49d99b-5daf-4624-9f8e-188b126ea166</relationship-value> - </relationship-data> - </relationship> - </relationship-list> - <l-interfaces/> - <lag-interfaces/> - </generic-vnf> - </generic-vnfs>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getNotFound.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getNotFound.xml deleted file mode 100644 index f66c9c4fb8..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getNotFound.xml +++ /dev/null @@ -1,2 +0,0 @@ -<search-results xmlns="http://org.openecomp.aai.inventory"> -</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 deleted file mode 100644 index c29133e539..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getParentSIUrlById.xml +++ /dev/null @@ -1,6 +0,0 @@ -<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 deleted file mode 100644 index bc810c6014..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getParentServiceInstance.xml +++ /dev/null @@ -1,30 +0,0 @@ -<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/GenericFlows/getSINoRelations.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getSINoRelations.xml deleted file mode 100644 index adb7aab35f..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getSINoRelations.xml +++ /dev/null @@ -1,6 +0,0 @@ -<service-instance>
- <service-instance-id>MIS/1604/0026/SW_INTERNET</service-instance-id>
- <resource-version>123456789</resource-version>
- <relationship-list/>
- <metadata/>
-</service-instance>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getSIUrlById.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getSIUrlById.xml deleted file mode 100644 index 416689e10c..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getSIUrlById.xml +++ /dev/null @@ -1,6 +0,0 @@ - <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%252F0026%252FSW_INTERNET</resource-link> - </result-data> - </search-results>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getSIUrlByIdVipr.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getSIUrlByIdVipr.xml deleted file mode 100644 index 80b035979a..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getSIUrlByIdVipr.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<search-results xmlns="http://org.openecomp.aai.inventory/v8">
- <result-data>
- <resource-type>service-instance</resource-type>
- <resource-link>https://aai-int1.test.com:8443/aai/v8/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/aa8428ac-7dd2-441f-aa3e-e175802574fb</resource-link>
- </result-data>
-</search-results>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getServiceInstance.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getServiceInstance.xml deleted file mode 100644 index e377c70474..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/GenericFlows/getServiceInstance.xml +++ /dev/null @@ -1,30 +0,0 @@ -<service-instance> - <service-instance-id>MIS/1604/0026/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>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/ConfigVnf_VID_request.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/ConfigVnf_VID_request.json deleted file mode 100644 index 3fc25944f2..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/ConfigVnf_VID_request.json +++ /dev/null @@ -1,40 +0,0 @@ -{ -"requestDetails": { -"modelInfo": { -"modelType": "vnf", -"modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff", -"modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe", -"modelName": "vSAMP12", -"modelVersion": "1.0", -"modelCustomizationUuid": "MODEL-ID-1234" -}, -"cloudConfiguration": { -"lcpCloudRegionId": "mdt1", -"tenantId": "fba1bd1e195a404cacb9ce17a9b2b421" -}, -"requestInfo": { -"instanceName": "STMTN", -"instanceId": "skask", -"source": "VID", -"suppressRollback": true -}, -"relatedInstanceList": [ -{ -"relatedInstance": { -"instanceId": "MIS%2F1604%2F0026%2FSW_INTERNET", -"modelInfo": { -"modelType": "service", -"modelInvariantUuid": "995256d2-5a33-55df-13ab-12abad84e7ff", -"modelUuid": "ab6478e5-ea33-3346-ac12-ab121484a3fe", -"modelName": "ServicevSAMP12", -"modelVersion": "1.0" -} -} -} -], -"requestParameters": { -"controllerType" : "appc", -"payload": "{\"request-parameters\":{\"host-ip-address\":\"10.10.10.10\"},\"configuration- parameters\":{\"name1\":\"value1\",\"name2\":\"value2\"}}" -} -} -}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/CreateVnfInfraRequest.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/CreateVnfInfraRequest.json deleted file mode 100644 index c1491d128b..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/CreateVnfInfraRequest.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "requestDetails": { - "modelInfo": { - "modelType": "vnf", - "modelInvariantUuid": "ff5256d1-5a33-55df-13ab-12abad84e7ff", - "modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe", - "modelName": "vSAMP12", - "modelVersion": "1.0", - "modelInstanceName": "vSAMP12 1", - "modelCustomizationUuid": "customizationId123" - }, - "cloudConfiguration": { - "lcpCloudRegionId": "mdt1", - "tenantId": "88a6ca3ee0394ade9403f075db23167e" - }, - "requestInfo": { - "instanceName": "testVnfName123", - "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", - "source": "VID", - "suppressRollback": false - }, - "relatedInstanceList": [ - { - "relatedInstance": { - "instanceId": "{serviceInstanceId}", - "modelInfo": { - "modelType": "service", - "modelInvariantUuid": "ff3514e3-5a33-55df-13ab-12abad84e7ff", - "modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe", - "modelName": "{parent service model name}", - "modelVersion": "1.0" - } - } - } - ], - "requestParameters": { - }, - "platform": { - "platformName": "platform name" - }, - "lineOfBusiness": { - "lineOfBusinessName": "line of business names" - } - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/DeleteCustomE2EService.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/DeleteCustomE2EService.json deleted file mode 100644 index 00663fddc5..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/DeleteCustomE2EService.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "globalSubscriberId" : "38829939920000", - "operationId" : "59960003992", - "serviceType" : "VoLTE" -}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/DeleteVnfInfraRequestCascadeDelete.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/DeleteVnfInfraRequestCascadeDelete.json deleted file mode 100644 index e8d9fc29b1..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/DeleteVnfInfraRequestCascadeDelete.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "requestDetails": { - "modelInfo": { - "modelType": "vnf", - "modelInvariantUuid": "ff5256d1-5a33-55df-13ab-12abad84e7ff", - "modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe", - "modelName": "vSAMP12", - "modelVersion": "1.0", - "modelInstanceName": "vSAMP12 1" - }, - "cloudConfiguration": { - "lcpCloudRegionId": "mdt1", - "tenantId": "88a6ca3ee0394ade9403f075db23167e" - }, - "requestInfo": { - "instanceName": "testVnfName123", - "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", - "source": "VID", - "suppressRollback": false - }, - "relatedInstanceList": [ - { - "relatedInstance": { - "instanceId": "{serviceInstanceId}", - "modelInfo": { - "modelType": "service", - "modelInvariantUuid": "ff3514e3-5a33-55df-13ab-12abad84e7ff", - "modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe", - "modelName": "{parent service model name}", - "modelVersion": "1.0" - } - } - } - ], - "requestParameters": { - "cascadeDelete": true - } - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/DoCreateServiceInstance_request.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/DoCreateServiceInstance_request.json deleted file mode 100644 index 640e16b634..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/DoCreateServiceInstance_request.json +++ /dev/null @@ -1,186 +0,0 @@ -{ "serviceResources" : { - "modelInfo" : { - "modelName" : "MSOTADevInfra_vSAMP10a_Service", - "modelUuid" : "5df8b6de-2083-11e7-93ae-92361f002671", - "modelInvariantUuid" : "9647dfc4-2083-11e7-93ae-92361f002671", - "modelVersion" : "1.0" - }, - "serviceType" : "PortMirroring", - "serviceRole" : "InfraRole", - "environmentContext" : "Luna", - "workloadContext" : "Oxygen", - "serviceVnfs": [ - - { "modelInfo" : { - "modelName" : "vSAMP10a", - "modelUuid" : "ff2ae348-214a-11e7-93ae-92361f002671", - "modelInvariantUuid" : "2fff5b20-214b-11e7-93ae-92361f002671", - "modelVersion" : "1.0", - "modelCustomizationUuid" : "68dc9a92-214c-11e7-93ae-92361f002671", - "modelInstanceName" : "vSAMP10a 1" - }, - "toscaNodeType" : "VF", - "nfFunction" : null, - "nfType" : null, - "nfRole" : null, - "nfNamingCode" : null, - "multiStageDesign" : null, - "vfModules": [ - { - "modelInfo" : { - "modelName" : "NetworkFqdnTest4", - "modelUuid" : "025606c1-4223-11e7-9252-005056850d2e", - "modelInvariantUuid" : "06bd0a18-65c0-4418-83c7-5b0d13cba01a", - "modelVersion" : "2.0", - "modelCustomizationUuid" : "06bd0a18-65c0-4418-83c7-5b0d13cba01a" - }, "isBase" : true, - "vfModuleLabel" : "label", - "initialCount" : 0, - "hasVolumeGroup" : true - }, - { - "modelInfo" : { - "modelName" : "NetworkFqdnTest3", - "modelUuid" : "02560575-4223-11e7-9252-005056850d2e", - "modelInvariantUuid" : "06bd0a18-65c0-4418-83c7-5b0d13cba0bb", - "modelVersion" : "1.0", - "modelCustomizationUuid" : "06bd0a18-65c0-4418-83c7-5b0d13cba0bb" - }, "isBase" : true, - "vfModuleLabel" : "label", - "initialCount" : 0, - "hasVolumeGroup" : false - }, - { - "modelInfo" : { - "modelName" : "NetworkFqdnTest5", - "modelUuid" : "025607e4-4223-11e7-9252-005056850d2e", - "modelInvariantUuid" : "06bd0a18-65c0-4418-83c7-5b0d14cba01a", - "modelVersion" : "1.0", - "modelCustomizationUuid" : "06bd0a18-65c0-4418-83c7-5b0d14cba01a" - }, "isBase" : false, - "vfModuleLabel" : "label", - "initialCount" : 0, - "hasVolumeGroup" : false - }, - { - "modelInfo" : { - "modelName" : "vSAMP10aDEV::PCM::module-2", - "modelUuid" : "7774b4e4-7d37-11e7-bb31-be2e44b06b34", - "modelInvariantUuid" : "93e9c1d2-7d37-11e7-bb31-be2e44b06b34", - "modelVersion" : "2", - "modelCustomizationUuid" : "6728bee8-7d3a-11e7-bb31-be2e44b06b34" - }, "isBase" : false, - "vfModuleLabel" : "PCM", - "initialCount" : 0, - "hasVolumeGroup" : true - }, - { - "modelInfo" : { - "modelName" : "vSAMP10aDEV::PCM::module-1", - "modelUuid" : "066de97e-253e-11e7-93ae-92361f002671", - "modelInvariantUuid" : "64efd51a-2544-11e7-93ae-92361f002671", - "modelVersion" : "2", - "modelCustomizationUuid" : "b4ea86b4-253f-11e7-93ae-92361f002671" - }, "isBase" : false, - "vfModuleLabel" : "PCM", - "initialCount" : 0, - "hasVolumeGroup" : true - }, - { - "modelInfo" : { - "modelName" : "vSAMP10aDEV::base::module-0", - "modelUuid" : "20c4431c-246d-11e7-93ae-92361f002671", - "modelInvariantUuid" : "78ca26d0-246d-11e7-93ae-92361f002671", - "modelVersion" : "2", - "modelCustomizationUuid" : "cb82ffd8-252a-11e7-93ae-92361f002671" - }, "isBase" : true, - "vfModuleLabel" : "base", - "initialCount" : 1, - "hasVolumeGroup" : true - }, - { - "modelInfo" : { - "modelName" : "vSAMP10a::base::module-0", - "modelUuid" : "02560de2-4223-11e7-9252-005056850d2e", - "modelInvariantUuid" : null, - "modelVersion" : "2", - "modelCustomizationUuid" : "MIGRATED_36e76920-ef30-4793-9979-cbd7d4b2bfc4" - }, "isBase" : true, - "vfModuleLabel" : "base", - "initialCount" : 1, - "hasVolumeGroup" : true - }, - { - "modelInfo" : { - "modelName" : "base::module-0", - "modelUuid" : "02561381-4223-11e7-9252-005056850d2e", - "modelInvariantUuid" : null, - "modelVersion" : "1", - "modelCustomizationUuid" : "MIGRATED_51baae4c-b7c7-4f57-b77e-6e01acca89e5" - }, "isBase" : true, - "vfModuleLabel" : "module-0", - "initialCount" : 1, - "hasVolumeGroup" : false - }, - { - "modelInfo" : { - "modelName" : "vSAMP10a::PCM::module-1", - "modelUuid" : "02560f1b-4223-11e7-9252-005056850d2e", - "modelInvariantUuid" : null, - "modelVersion" : "1", - "modelCustomizationUuid" : "MIGRATED_e9be2ed7-45b6-479c-b06e-9093899f8ce8" - }, "isBase" : true, - "vfModuleLabel" : "PCM", - "initialCount" : 1, - "hasVolumeGroup" : true - } - ] - } - ], - "serviceNetworks": [], - "serviceAllottedResources": [ - { - "modelInfo" : { - "modelName" : "Tunnel_Xconn", - "modelUuid" : "f6b7d4c6-e8a4-46e2-81bc-31cad5072842", - "modelInvariantUuid" : "b7a1b78e-6b6b-4b36-9698-8c9530da14af", - "modelVersion" : "1.0", - "modelCustomizationUuid" : "5b9bee43-f537-4fb3-9e8b-4de9f714d28a", - "modelInstanceName" : "Pri_Tunnel_Xconn 9" - }, - "toscaNodeType" : null, - "allottedResourceType" : null, - "allottedResourceRole" : null, - "providingServiceModelInvariantUuid" : null, - "nfFunction" : null, - "nfType" : null, - "nfRole" : null, - "nfNamingCode" : null - } - ], - "serviceConfigs": [ - { - "modelInfo" : { - "modelName" : "Mulder", - "modelUuid" : "025606c1-4fff-11e7-9252-005056850d2e", - "modelInvariantUuid" : "025606c1-4eee-11e7-9252-005056850d2e", - "modelVersion" : "1.0", - "modelCustomizationUuid" : "025606c1-4ddd-11e7-9252-005056850d2e", - "modelInstanceName" : "X_FILES_001" - }, - "toscaNodeType" : "Scully" - }, - { - "modelInfo" : { - "modelName" : "Krychuk", - "modelUuid" : "025606c1-5fff-11e7-9252-005056850d2e", - "modelInvariantUuid" : "025606c1-5eee-11e7-9252-005056850d2e", - "modelVersion" : "1.0", - "modelCustomizationUuid" : "025606c1-5ddd-11e7-9252-005056850d2e", - "modelInstanceName" : "X_FILES_002" - }, - "toscaNodeType" : "Skinner" - } - ] - }} - diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/DoScaleE2EServiceInstance.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/DoScaleE2EServiceInstance.json deleted file mode 100644 index dd3ff6841e..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/DoScaleE2EServiceInstance.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "service": - { - "serviceType":"example-service-type", - "globalSubscriberId":"test_custormer", - "resources": - [ - { - "resourceInstanceId":"ns111", - "scaleType":"SCALE_NS", - "scaleNsData": - { - "scaleNsByStepsData": - { - "numberOfSteps":"4", - "aspectId":"TIC_EDGE_HW", - "scalingDirection":"UP" - } - } - }, - { - "resourceInstanceId":"ns333", - "scaleType":"SCALE_NS", - "scaleNsData": - { - "scaleNsByStepsData": - { - "numberOfSteps":"4", - "aspectId":"TIC_EDGE_HW", - "scalingDirection":"UP" - } - } - } - ], - "serviceInstanceName":"service1" - }, - "operationId":"15c01683-4f15-45e7-b213-dcbfe6f42a1b" - }
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/ReplaceVnf_VID_request.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/ReplaceVnf_VID_request.json deleted file mode 100644 index a018f50355..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/ReplaceVnf_VID_request.json +++ /dev/null @@ -1,50 +0,0 @@ -{ -"requestDetails": { -"modelInfo": { -"modelType": "vnf", -"modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff", -"modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe", -"modelName": "vSAMP12", -"modelVersion": "1.0", -"modelCustomizationUuid": "MODEL-ID-1234" -}, -"cloudConfiguration": { -"lcpCloudRegionId": "mdt1", -"tenantId": "88a6ca3ee0394ade9403f075db23167e" -}, -"requestInfo": { -"instanceName": "STMTN", -"instanceId": "a27ce5a9-29c4-4c22-a017-6615ac73c721", -"source": "VID", -"suppressRollback": true -}, -"relatedInstanceList": [ -{ -"relatedInstance": { -"instanceId": "MIS%2F1604%2F0026%2FSW_INTERNET", -"modelInfo": { -"modelType": "service", -"modelInvariantUuid": "995256d2-5a33-55df-13ab-12abad84e7ff", -"modelUuid": "ab6478e5-ea33-3346-ac12-ab121484a3fe", -"modelName": "ServicevSAMP12", -"modelVersion": "1.0" -} -} -} -], -"requestParameters": { -"usePreload": false, -"controllerType" : "appc", -"userParams" : [ - { - "name" : "someUserParam", - "value" : "someValue" - }, - { - "name": "sgi_protected_subnet_id", - "value": "thisissomefakevalue" - } -] -} -} -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/UpdateVfModule_VID_request.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/UpdateVfModule_VID_request.json deleted file mode 100644 index 9564f705ae..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/UpdateVfModule_VID_request.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "requestDetails": { - "modelInfo": { - "modelType": "vfModule", - "modelInvariantUuid": "introvert", - "modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe", - "modelName": "STMTN5MMSC21-MMSC::model-1-0", - "modelVersion": "1", - "modelCustomizationUuid": "MODEL12345" - }, - "cloudConfiguration": { - "lcpCloudRegionId": "MDTWNJ21", - "tenantId": "fba1bd1e195a404cacb9ce17a9b2b421" - }, - "requestInfo": { - "instanceName": "PCRF::module-0", - "instanceId": "supercool", - "source": "VID", - "suppressRollback": true - }, - "relatedInstanceList": [ - { - "relatedInstance": { - "instanceId": "123456", - "modelInfo": { - "modelType": "service", - "modelInvariantUuid": "ff3514e3-5a33-55df-13ab-12abad84e7ff", - "modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe", - "modelName": "SERVICE_MODEL_NAME", - "modelVersion": "1.0" - } - } - }, - { - "relatedInstance": { - "instanceId": "skask", - "modelInfo": { - "modelType": "vnf", - "modelInvariantUuid": "skask", - "modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe", - "modelName": "vSAMP12", - "modelVersion": "1.0", - "modelInstanceName": "vSAMP12 1" - } - } - } - ], - "requestParameters": { - "usePreload": false, - "userParams": [ - { - "name": "someUserParam", - "value": "someValue" - }, - { - "name": "sgi_protected_subnet_id", - "value": "thisissomefakevalue" - } - ] - } - } -}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/UpdateVnf_VID_request.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/UpdateVnf_VID_request.json deleted file mode 100644 index e6d3e97a5c..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/UpdateVnf_VID_request.json +++ /dev/null @@ -1,58 +0,0 @@ -{ -"requestDetails": { -"modelInfo": { -"modelType": "vnf", -"modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff", -"modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe", -"modelName": "vSAMP12", -"modelVersion": "1.0", -"modelCustomizationUuid": "MODEL-ID-1234" -}, -"cloudConfiguration": { -"lcpCloudRegionId": "mdt1", -"tenantId": "fba1bd1e195a404cacb9ce17a9b2b421" -}, -"requestInfo": { -"instanceName": "STMTN", -"instanceId": "skask", -"source": "VID", -"suppressRollback": true -}, -"relatedInstanceList": [ -{ -"relatedInstance": { -"instanceId": "MIS%2F1604%2F0026%2FSW_INTERNET", -"modelInfo": { -"modelType": "service", -"modelInvariantUuid": "995256d2-5a33-55df-13ab-12abad84e7ff", -"modelUuid": "ab6478e5-ea33-3346-ac12-ab121484a3fe", -"modelName": "ServicevSAMP12", -"modelVersion": "1.0" -} -} -} -], -"requestParameters": { -"usePreload": false, -"controllerType" : "appc", -"userParams" : [ - { - "name" : "someUserParam", - "value" : "someValue" - }, - { - "name": "sgi_protected_subnet_id", - "value": "thisissomefakevalue" - }, - { - "name": "vlc_sctp_b_route_prefixes", - "value": [ - { "interface_route_table_routes_route_prefix": "107.239.41.163/32" }, - { "interface_route_table_routes_route_prefix": "107.239.41.164/32" }, - { "interface_route_table_routes_route_prefix": "107.239.41.165/32" } - ] - } -] -} -} -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/VnfInPlaceUpdate_VID_request.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/VnfInPlaceUpdate_VID_request.json deleted file mode 100644 index 588ef1cbec..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/VnfInPlaceUpdate_VID_request.json +++ /dev/null @@ -1,17 +0,0 @@ -{ -"requestDetails": { -"cloudConfiguration": { -"lcpCloudRegionId": "mdt1", -"tenantId": "fba1bd1e195a404cacb9ce17a9b2b421" -}, -"requestInfo": { -"source": "VID", -"requestorId": "ab1234" -}, -"requestParameters": { -"controllerType": "", -"payload": -"{\"existing-software-version\": \"3.1\",\"new-software-version\": \"3.2\", \"operations-timeout\": \"3600\"}" -} -} -}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/Policy/policyAbortResponse.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/Policy/policyAbortResponse.json deleted file mode 100644 index c315b1ed1d..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/Policy/policyAbortResponse.json +++ /dev/null @@ -1 +0,0 @@ -{"decision":"PERMIT","details":"Abort"}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/Policy/policySkipResponse.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/Policy/policySkipResponse.json deleted file mode 100644 index 7cbdebb6b3..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/Policy/policySkipResponse.json +++ /dev/null @@ -1 +0,0 @@ -{"decision":"PERMIT","details":"Skip"}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetworkResponse_400.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetworkResponse_400.xml deleted file mode 100644 index a5640b2b26..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetworkResponse_400.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<createNetworkError> -<messageId>680bd458-5ec1-4a16-b77c-509022e53450</messageId><category>INTERNAL</category> -<message>400 Bad Request: The server could not comply with the request since it is either malformed or otherwise incorrect., error.type=StackValidationFailed, error.message=Property error: : resources.network.properties: : Unknown Property network_ipam_refs_data</message> -<rolledBack>true</rolledBack> -</createNetworkError> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetworkResponse_500.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetworkResponse_500.xml deleted file mode 100644 index 07730e2df9..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetworkResponse_500.xml +++ /dev/null @@ -1,80 +0,0 @@ -<html> - <head> - <title>JBoss Web/7.2.2.Final-redhat-1 - JBWEB000064: Error report - </title> - <style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} - H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} - H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} - BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} - B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} - P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A - {color : black;}A.name {color : black;}HR {color : #525D76;} --> - </style> - </head> - <body> - <h1>JBWEB000065: HTTP Status 500 - java.lang.NullPointerException</h1> - <HR size="1" noshade="noshade" /> - <p> - <b>JBWEB000309: type</b> - JBWEB000066: Exception report - </p> - <p> - <b>JBWEB000068: message</b> - <u>java.lang.NullPointerException</u> - </p> - <p> - <b>JBWEB000069: description</b> - <u>JBWEB000145: The server encountered an internal error that - prevented it from fulfilling this request. - </u> - </p> - <p> - <b>JBWEB000070: exception</b> - <pre>org.jboss.resteasy.spi.UnhandledException: - java.lang.NullPointerException - org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:365) - org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:233) - org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:209) - org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:557) - org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524) - org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126) - org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) - org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) - org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) - javax.servlet.http.HttpServlet.service(HttpServlet.java:847) - org.openecomp.mso.logger.LogFilter.doFilter(LogFilter.java:35) - </pre> - </p> - <p> - <b>JBWEB000071: root cause</b> - <pre>java.lang.NullPointerException - org.openecomp.mso.adapters.network.NetworkAdapterRest$CreateNetworkVolumesTask.run(NetworkAdapterRest.java:128) - org.openecomp.mso.adapters.network.NetworkAdapterRest.createNetwork(NetworkAdapterRest.java:64) - sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - java.lang.reflect.Method.invoke(Method.java:606) - org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:167) - org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:269) - org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:227) - org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:216) - org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:542) - org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524) - org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126) - org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) - org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) - org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) - javax.servlet.http.HttpServlet.service(HttpServlet.java:847) - org.openecomp.mso.logger.LogFilter.doFilter(LogFilter.java:35) - </pre> - </p> - <p> - <b>JBWEB000072: note</b> - <u>JBWEB000073: The full stack trace of the root cause is available - in the JBoss Web/7.2.2.Final-redhat-1 logs. - </u> - </p> - <HR size="1" noshade="noshade" /> - <h3>JBoss Web/7.2.2.Final-redhat-1</h3> - </body> -</html>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetworkResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetworkResponse_Success.xml deleted file mode 100644 index 7a00744103..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetworkResponse_Success.xml +++ /dev/null @@ -1,24 +0,0 @@ -<ns2:updateNetworkContrailResponse xmlns:ns2="http://org.openecomp.mso/network" - xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> - <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId> - <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId> - <subnetIdMap> - <entry> - <key>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</key> - <value>bd8e87c6-f4e2-41b8-b0bc-9596aa00cd73</value> - </entry> - </subnetIdMap> - <rollback> - <cloudId>RDM2WAGPLCP</cloudId> - <msoRequest> - <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId> - <serviceInstanceId/> - </msoRequest> - <networkCreated>true</networkCreated> - <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId> - <networkType>CONTRAIL_EXTERNAL</networkType> - <networkUpdated>false</networkUpdated> - <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId> - <tenantId>7dd5365547234ee8937416c65507d266</tenantId> - </rollback> -</ns2:updateNetworkContrailResponse> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryInstance_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryInstance_Success.xml deleted file mode 100644 index ca5145c226..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryInstance_Success.xml +++ /dev/null @@ -1,4 +0,0 @@ -<result-data> - <resource-type>service-instance</resource-type> - <resource-link>https://aai-conexus-e2e.test.com:8443/aai/v8/business/customers/customer/8310000058863/service-subscriptions/service-subscription/vMOG/service-instances/service-instance/f70e927b-6087-4974-9ef8-c5e4d5847ca4</resource-link> -</result-data>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryNetworkId_AAIResponse_NoPayload_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryNetworkId_AAIResponse_NoPayload_Success.xml deleted file mode 100644 index e06d27ea88..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryNetworkId_AAIResponse_NoPayload_Success.xml +++ /dev/null @@ -1,73 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<l3-network xmlns="http://org.openecomp.aai.inventory/v8"> - <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id> - <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name> - <network-type>CONTRAIL_EXTERNAL</network-type> - <network-role>dmz_direct</network-role> - <network-technology>contrail</network-technology> - <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id> - <network-role-instance>0</network-role-instance> - <orchestration-status>pending-create</orchestration-status> - <physical-network-name>networkName</physical-network-name> - <is-provider-network>false</is-provider-network> - <is-shared-network>true</is-shared-network> - <is-external-network>false</is-external-network> - <subnets> - <subnet> - <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id> - <gateway-address>107.239.52.1</gateway-address> - <network-start-address>107.239.52.0</network-start-address> - <cidr-mask>24</cidr-mask> - <ip-version>4</ip-version> - <orchestration-status>pending-create</orchestration-status> - <dhcp-enabled>true</dhcp-enabled> - <subnet-name>subnetName</subnet-name> - <relationship-list/> - </subnet> - </subnets> - <segmentation-assignments> - <segmentation-id>413</segmentation-id> - <resource-version>4132176</resource-version> - </segmentation-assignments> - <relationship-list> - <relationship> - <related-to>vpn-binding</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link> - <relationship-data> - <relationship-key>vpn-binding.vpn-id</relationship-key> - <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>vpn-binding</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link> - <relationship-data> - <relationship-key>vpn-binding.vpn-id</relationship-key> - <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>tenant</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link> - <relationship-data> - <relationship-key>tenant.tenant-id</relationship-key> - <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>network-policy</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg</related-link> - <relationship-data> - <relationship-key>network-policy.network-policy-id</relationship-key> - <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0cg</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>route-table-reference</related-to> - <relationship-data> - <relationship-key>route-table-reference.route-table-reference-id</relationship-key> - <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value> - </relationship-data> - </relationship> - </relationship-list> -</l3-network> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryNetworkId_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryNetworkId_AAIResponse_Success.xml deleted file mode 100644 index 24ee1df9c8..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryNetworkId_AAIResponse_Success.xml +++ /dev/null @@ -1,95 +0,0 @@ -<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd" - statusCode="200"> - <rest:headers> - <rest:header name="Transfer-Encoding" value="chunked"/> - <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/> - <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/> - <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/> - <rest:header name="Content-Type" value="application/xml"/> - <rest:header name="Server" value="Apache-Coyote/1.1"/> - <rest:header name="Cache-Control" value="private"/> - </rest:headers> - <rest:payload contentType="text/xml"> - <l3-network xmlns="http://org.openecomp.aai.inventory/v8"> - <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id> - <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name> - <network-type>CONTRAIL_EXTERNAL</network-type> - <network-role>dmz_direct</network-role> - <network-technology>contrail</network-technology> - <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id> - <network-role-instance>0</network-role-instance> - <orchestration-status>pending-create</orchestration-status> - <physical-network-name>networkName</physical-network-name> - <is-provider-network>false</is-provider-network> - <is-shared-network>true</is-shared-network> - <is-external-network>false</is-external-network> - <subnets> - <subnet> - <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id> - <gateway-address>107.239.52.1</gateway-address> - <network-start-address>107.239.52.0</network-start-address> - <cidr-mask>24</cidr-mask> - <ip-version>4</ip-version> - <orchestration-status>pending-create</orchestration-status> - <dhcp-enabled>true</dhcp-enabled> - <subnet-name>subnetName</subnet-name> - <relationship-list/> - </subnet> - </subnets> - <segmentation-assignments> - <segmentation-id>413</segmentation-id> - <resource-version>4132176</resource-version> - </segmentation-assignments> - <relationship-list> - <relationship> - <related-to>vpn-binding</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link> - <relationship-data> - <relationship-key>vpn-binding.vpn-id</relationship-key> - <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>vpn-binding</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link> - <relationship-data> - <relationship-key>vpn-binding.vpn-id</relationship-key> - <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>tenant</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link> - <relationship-data> - <relationship-key>tenant.tenant-id</relationship-key> - <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>network-policy</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg</related-link> - <relationship-data> - <relationship-key>network-policy.network-policy-id</relationship-key> - <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0cg</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>route-table-reference</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN1</related-link> - <relationship-data> - <relationship-key>route-table-reference.route-table-reference-id</relationship-key> - <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>route-table-reference</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN2</related-link> - <relationship-data> - <relationship-key>route-table-reference.route-table-reference-id</relationship-key> - <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value> - </relationship-data> - </relationship> - </relationship-list> - </l3-network> - </rest:payload> -</rest:RESTResponse>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryNetworkPolicy_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryNetworkPolicy_AAIResponse_Success.xml deleted file mode 100644 index 686ac1667f..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryNetworkPolicy_AAIResponse_Success.xml +++ /dev/null @@ -1,21 +0,0 @@ -<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd" - statusCode="200"> - <rest:headers> - <rest:header name="Transfer-Encoding" value="chunked"/> - <rest:header name="Date" value="Mon,14 Mar 2016 20:53:33 GMT"/> - <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/> - <rest:header name="X-AAI-TXID" - value="mtcnjv9aaas01.mtcnj.aic.cip.com-20160314-20:53:33:487-134392"/> - <rest:header name="Content-Type" value="application/xml"/> - <rest:header name="Server" value="Apache-Coyote/1.1"/> - <rest:header name="Cache-Control" value="private"/> - </rest:headers> - <rest:payload contentType="text/xml"> - <network-policy xmlns="http://org.openecomp.aai.inventory/v8"> - <network-policy-id>9a7b327d9-287aa00-82c4b0-105757</network-policy-id> - <network-policy-fqdn>GN_EVPN_Test</network-policy-fqdn> - <heat-stack-id>13979:105757</heat-stack-id> - <resource-version>13979:105757</resource-version> - </network-policy> - </rest:payload> -</rest:RESTResponse>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryNetworkTableRef1_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryNetworkTableRef1_AAIResponse_Success.xml deleted file mode 100644 index b01e469cbf..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryNetworkTableRef1_AAIResponse_Success.xml +++ /dev/null @@ -1,20 +0,0 @@ -<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd" - statusCode="200"> - <rest:headers> - <rest:header name="Transfer-Encoding" value="chunked"/> - <rest:header name="Date" value="Mon,14 Mar 2016 20:53:33 GMT"/> - <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/> - <rest:header name="X-AAI-TXID" - value="mtcnjv9aaas01.mtcnj.aic.cip.com-20160314-20:53:33:487-134392"/> - <rest:header name="Content-Type" value="application/xml"/> - <rest:header name="Server" value="Apache-Coyote/1.1"/> - <rest:header name="Cache-Control" value="private"/> - </rest:headers> - <rest:payload contentType="text/xml"> - <route-table-references xmlns="http://org.openecomp.aai.inventory/v8"> - <route-table-reference-id>5938baec-03ca-2bd5-a3f1-d54x123e253a</route-table-reference-id> - <route-table-reference-fqdn>refFQDN1</route-table-reference-fqdn> - <resource-version>12345</resource-version> - </route-table-references> - </rest:payload> -</rest:RESTResponse>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryNetworkTableRef2_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryNetworkTableRef2_AAIResponse_Success.xml deleted file mode 100644 index a19f9412c8..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryNetworkTableRef2_AAIResponse_Success.xml +++ /dev/null @@ -1,20 +0,0 @@ -<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd" - statusCode="200"> - <rest:headers> - <rest:header name="Transfer-Encoding" value="chunked"/> - <rest:header name="Date" value="Mon,14 Mar 2016 20:53:33 GMT"/> - <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/> - <rest:header name="X-AAI-TXID" - value="mtcnjv9aaas01.mtcnj.aic.cip.com-20160314-20:53:33:487-134392"/> - <rest:header name="Content-Type" value="application/xml"/> - <rest:header name="Server" value="Apache-Coyote/1.1"/> - <rest:header name="Cache-Control" value="private"/> - </rest:headers> - <rest:payload contentType="text/xml"> - <route-table-references xmlns="http://org.openecomp.aai.inventory/v8"> - <route-table-reference-id>5938baec-03ca-2bd5-a3f1-d54x123e253a</route-table-reference-id> - <route-table-reference-fqdn>refFQDN2</route-table-reference-fqdn> - <resource-version>12345</resource-version> - </route-table-references> - </rest:payload> -</rest:RESTResponse>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryVpnBindingList_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryVpnBindingList_AAIResponse_Success.xml deleted file mode 100644 index 671da0c9e2..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryVpnBindingList_AAIResponse_Success.xml +++ /dev/null @@ -1,57 +0,0 @@ -<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd" - statusCode="200"> - <rest:headers> - <rest:header name="Transfer-Encoding" value="chunked"/> - <rest:header name="Date" value="Mon,14 Mar 2016 20:53:33 GMT"/> - <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/> - <rest:header name="X-AAI-TXID" - value="mtcnjv9aaas01.mtcnj.aic.cip.com-20160314-20:53:33:487-134392"/> - <rest:header name="Content-Type" value="application/xml"/> - <rest:header name="Server" value="Apache-Coyote/1.1"/> - <rest:header name="Cache-Control" value="private"/> - </rest:headers> - <rest:payload contentType="text/xml"> - <vpn-binding xmlns="http://org.openecomp.aai.inventory/v8"> - <vpn-id>9a7b327d9-287aa00-82c4b0-105757</vpn-id> - <vpn-name>GN_EVPN_Test</vpn-name> - <route-targets> - <route-target> - <global-route-target>13979:105708</global-route-target> - <route-target-role>EXPORT</route-target-role> - <resource-version>1504025599510</resource-version> - </route-target> - <route-target> - <global-route-target>13979:105707</global-route-target> - <route-target-role>IMPORT</route-target-role> - <resource-version>1504025599519</resource-version> - </route-target> - </route-targets> - <relationship-list> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/l3-networks/l3-network/689ec39e-c5fc-4462-8db2-4f760763ad28/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>689ec39e-c5fc-4462-8db2-4f760763ad28</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/l3-networks/l3-network/1a49396b-19b3-40a4-8792-aa2fbd0f0704/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>1a49396b-19b3-40a4-8792-aa2fbd0f0704</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/l3-networks/l3-network/774f3329-3c83-4771-86c7-9e6207cd50fd/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>774f3329-3c83-4771-86c7-9e6207cd50fd</relationship-value> - </relationship-data> - </relationship> - </relationship-list> - </vpn-binding> - </rest:payload> -</rest:RESTResponse>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml deleted file mode 100644 index c35faef27f..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml +++ /dev/null @@ -1,46 +0,0 @@ -<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd" - statusCode="200"> - <rest:headers> - <rest:header name="Transfer-Encoding" value="chunked"/> - <rest:header name="Date" value="Mon,14 Mar 2016 20:53:33 GMT"/> - <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/> - <rest:header name="X-AAI-TXID" - value="mtcnjv9aaas01.mtcnj.aic.cip.com-20160314-20:53:33:487-134392"/> - <rest:header name="Content-Type" value="application/xml"/> - <rest:header name="Server" value="Apache-Coyote/1.1"/> - <rest:header name="Cache-Control" value="private"/> - </rest:headers> - <rest:payload contentType="text/xml"> - <vpn-binding xmlns="http://org.openecomp.aai.inventory/v8"> - <vpn-id>9a7b327d9-287aa00-82c4b0-105757</vpn-id> - <vpn-name>GN_EVPN_Test</vpn-name> - <global-route-target>13979:105757</global-route-target> - <relationship-list> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/l3-networks/l3-network/689ec39e-c5fc-4462-8db2-4f760763ad28/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>689ec39e-c5fc-4462-8db2-4f760763ad28</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/l3-networks/l3-network/1a49396b-19b3-40a4-8792-aa2fbd0f0704/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>1a49396b-19b3-40a4-8792-aa2fbd0f0704</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/l3-networks/l3-network/774f3329-3c83-4771-86c7-9e6207cd50fd/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>774f3329-3c83-4771-86c7-9e6207cd50fd</relationship-value> - </relationship-data> - </relationship> - </relationship-list> - </vpn-binding> - </rest:payload> -</rest:RESTResponse>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetwork_updateContrail_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetwork_updateContrail_AAIResponse_Success.xml deleted file mode 100644 index eedbda9343..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetwork_updateContrail_AAIResponse_Success.xml +++ /dev/null @@ -1,11 +0,0 @@ -<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/UpdateVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_Success.xml deleted file mode 100644 index c48c6a661f..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_Success.xml +++ /dev/null @@ -1,44 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<volume-group xmlns="http://org.openecomp.aai.inventory/v8">
- <volume-group-id>78987</volume-group-id>
- <volume-group-name>MSOTESTVOL102a-vSAMP12_base_vol_module-0</volume-group-name>
- <heat-stack-id/>
- <vnf-type>Test/vSAMP12</vnf-type>
- <orchestration-status>Pending</orchestration-status>
- <resource-version>0000020</resource-version>
- <relationship-list>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>/aai/v7/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mdt1/tenants/tenant/fba1bd1e195a404cacb9ce17a9b2b421/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>fba1bd1e195a404cacb9ce17a9b2b421</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-owner</relationship-key>
- <relationship-value>att-aic</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-region-id</relationship-key>
- <relationship-value>mdt1</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>tenant.tenant-name</property-key>
- <property-value>ECOMP_MDT1</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vf-module</related-to>
- <related-link>/aai/v8/network/generic-vnfs/generic-vnf/9e48f6ea-f786-46de-800a-d480e5ccc846/vf-modules/vf-module/6a1dc898-b590-47b9-bbf0-34424a7a2ec3/</related-link>
- <relationship-data>
- <relationship-key>generic-vnf.vnf-id</relationship-key>
- <relationship-value>9e48f6ea-f786-46de-800a-d480e5ccc846</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>vf-module.vf-module-id</relationship-key>
- <relationship-value>6a1dc898-b590-47b9-bbf0-34424a7a2ec3</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
-</volume-group>
-
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/updateVfModuleVolume_VID_request.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/updateVfModuleVolume_VID_request.json deleted file mode 100644 index 603c1f452f..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/updateVfModuleVolume_VID_request.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "requestDetails": { - "modelInfo": { - "modelType": "volumeGroup", - "modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff", - "modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe", - "modelName": "vSAMP12::base::module-0", - "modelVersion": "1" - }, - "cloudConfiguration": { - "lcpCloudRegionId": "mdt1", - "tenantId": "fba1bd1e195a404cacb9ce17a9b2b421" - }, - "requestInfo": { - "instanceName": "MSOTESTVOL101a-vSAMP12_base_vol_module-0", - "source": "VID", - "suppressRollback": false - }, - "relatedInstanceList": [ - { - "relatedInstance": { - "instanceId": "{service-instance-id}", - "modelInfo": { - "modelType": "service", - "modelInvariantUuid": "ff3514e3-5a33-55df-13ab-12abad84e7ff", - "modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe", - "modelName": "Test", - "modelVersion": "2.0" - } - } - }, { - "relatedInstance": { - "instanceId": "{vnf-instance-id}", - "modelInfo": { - "modelType": "vnf", - "modelInvariantUuid": "ff5256d1-5a33-55df-13ab-12abad84e7ff", - "modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe", - "modelName": "Test/vSAMP12", - "modelVersion": "1", - "modelInstanceName": "vSAMP12" - } - } - } - ], - "requestParameters": { - "serviceId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", - "userParams": [ - {"name": "vnfName", "value": "STMTN5MMSC20" }, - {"name": "vnfName2", "value": "US1117MTSNJVBR0246" }, - {"name": "vnfNmInformation", "value": "" }, - {"name": "vnfType", "value": "pcrf-capacity" }, - {"name": "vnfId", "value": "skask" }, - {"name": "vnfStackId", "value": "slowburn" }, - {"name": "vnfStatus", "value": "created" }, - {"name": "aicCloudRegion", "value": "MDTWNJ21" }, - {"name": "availabilityZone", "value": "slcp3-esx-az01" }, - {"name": "oamNetworkName", "value": "VLAN-OAM-1323" }, - {"name": "vmName", "value": "slcp34246vbc246ceb" }, - {"name": "ipagNetworkId", "value": "970cd2b9-7f09-4a12-af47-182ea38ba1f0" }, - {"name": "vpeNetworkId", "value": "545cc2c3-1930-4100-b534-5d82d0e12bb6" } - ] - } - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/updateVfModuleVolume_VID_request_2.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/updateVfModuleVolume_VID_request_2.json deleted file mode 100644 index f32ba2994b..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/updateVfModuleVolume_VID_request_2.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "requestDetails": { - "modelInfo": { - "modelType": "volumeGroup", - "modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff", - "modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe", - "modelName": "vSAMP12::base::module-0", - "modelVersion": "1" - }, - "cloudConfiguration": { - "lcpCloudRegionId": "mdt1", - "tenantId": "fba1bd1e195a404cacb9ce17a9b2b421" - }, - "requestInfo": { - "instanceName": "MSOTESTVOL101a-vSAMP12_base_vol_module-0", - "source": "VID", - "suppressRollback": false - }, - "relatedInstanceList": [ - { - "relatedInstance": { - "instanceId": "{service-instance-id}", - "modelInfo": { - "modelType": "service", - "modelInvariantUuid": "ff3514e3-5a33-55df-13ab-12abad84e7ff-x", - "modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe", - "modelName": "Test", - "modelVersion": "2.0" - } - } - }, { - "relatedInstance": { - "instanceId": "{vnf-instance-id}", - "modelInfo": { - "modelType": "vnf", - "modelInvariantUuid": "ff5256d1-5a33-55df-13ab-12abad84e7ff", - "modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe", - "modelName": "Test/vSAMP12", - "modelVersion": "1", - "modelInstanceName": "vSAMP12" - } - } - } - ], - "requestParameters": { - "serviceId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", - "userParams": [ - {"name": "vnfName", "value": "STMTN5MMSC20" }, - {"name": "vnfName2", "value": "US1117MTSNJVBR0246" }, - {"name": "vnfNmInformation", "value": "" }, - {"name": "vnfType", "value": "pcrf-capacity" }, - {"name": "vnfId", "value": "skask" }, - {"name": "vnfStackId", "value": "slowburn" }, - {"name": "vnfStatus", "value": "created" }, - {"name": "aicCloudRegion", "value": "MDTWNJ21" }, - {"name": "availabilityZone", "value": "slcp3-esx-az01" }, - {"name": "oamNetworkName", "value": "VLAN-OAM-1323" }, - {"name": "vmName", "value": "slcp34246vbc246ceb" }, - {"name": "ipagNetworkId", "value": "970cd2b9-7f09-4a12-af47-182ea38ba1f0" }, - {"name": "vpeNetworkId", "value": "545cc2c3-1930-4100-b534-5d82d0e12bb6" } - ] - } - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/vf_module_aai_response.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/vf_module_aai_response.xml deleted file mode 100644 index 85773cdb07..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/vf_module_aai_response.xml +++ /dev/null @@ -1,29 +0,0 @@ -<vf-module xmlns="http://org.openecomp.aai.inventory/v8">
- <vf-module-id>6a1dc898-b590-47b9-bbf0-34424a7a2ec3</vf-module-id>
- <vf-module-name>MSOST10606-vSAMP12_MTN6_base_module-0</vf-module-name>
- <heat-stack-id>MSOST10606-vSAMP12_MTN6_base_module-0/81b01583-690c-4ec3-9c58-0eafa7a90be7</heat-stack-id>
- <orchestration-status>active</orchestration-status>
- <is-base-vf-module>true</is-base-vf-module>
- <resource-version>1475077639</resource-version>
- <model-invariant-id>ff5256d2-5a33-55df-13ab-12abad84e7ff</model-invariant-id>
- <model-version-id>1.0</model-version-id>
- <relationship-list>
- <relationship>
- <related-to>volume-group</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mtn6/volume-groups/volume-group/064bd1c6-e377-4009-a744-e958eec6e727/</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>volume-group.volume-group-id</relationship-key>
- <relationship-value>064bd1c6-e377-4009-a744-e958eec6e727</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
-
-</vf-module>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryBRGCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryBRGCallback.xml deleted file mode 100644 index d81b7e8f50..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryBRGCallback.xml +++ /dev/null @@ -1,37 +0,0 @@ -<output xmlns="org:onap:sdnctl:vnf">
-<brg-topology xmlns="org:onap: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/CreateVcpeResCustService/SDNCTopologyQueryTXCCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryTXCCallback.xml deleted file mode 100644 index f74e51e9d5..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryTXCCallback.xml +++ /dev/null @@ -1,24 +0,0 @@ -<output xmlns="org:onap:sdnctl:vnf">
-<tunnelxconn-topology xmlns="org:onap: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/CreateVcpeResCustService/arGetById.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/arGetById.xml deleted file mode 100644 index f2063442d6..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/arGetById.xml +++ /dev/null @@ -1,31 +0,0 @@ -<allotted-resource xmlns="http://org.openecomp.aai.inventory/v9"> - <id>ar-1</id> - <orchestration-status>Active</orchestration-status> - <role>Tunnel XConn</role> - <type>Tunnel XConn</type> - <description>Tunnel XConn</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>SDN-ETHERNET-INTERNET</relationship-value> - </relationship-data> - <relationship-data> - <relationship-key>service-subscription.service-type</relationship-key> - <relationship-value>123456789</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/CreateVcpeResCustService/getCatalogServiceResourcesData.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json deleted file mode 100644 index e99dd9ccda..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json +++ /dev/null @@ -1,127 +0,0 @@ -{ "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" : "Tunnel XConn", - "allottedResourceRole" : "Tunnel XConn", - "providingServiceModelInvariantUuid" : null, - "nfFunction" : null, - "nfType" : null, - "nfRole" : null, - "nfNamingCode" : null, - "homingSolution": { - "inventoryType": "service", - "serviceInstanceId": "MIS%252F1604%252F0027%252FSW_INTERNET", - "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" : "BRG", - "allottedResourceRole" : "BRG", - "providingServiceModelInvariantUuid" : null, - "nfFunction" : null, - "nfType" : null, - "nfRole" : null, - "nfNamingCode" : null, - "homingSolution": { - "inventoryType": "service", - "serviceInstanceId": "MIS%252F1604%252F0027%252FSW_INTERNET", - "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/CreateVcpeResCustService/getCatalogServiceResourcesNoData.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/getCatalogServiceResourcesNoData.json deleted file mode 100644 index 80692b27f5..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/getCatalogServiceResourcesNoData.json +++ /dev/null @@ -1,11 +0,0 @@ -{ "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/CreateVcpeResCustService/getCustomer.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/getCustomer.xml deleted file mode 100644 index b9d88d15db..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/getCustomer.xml +++ /dev/null @@ -1,7 +0,0 @@ -<customer xmlns="http://org.openecomp.aai.inventory/v8"> - <global-customer-id>SDN-ETHERNET-INTERNET</global-customer-id> - <subscriber-name>SDN-ETHERNET-INTERNET</subscriber-name> - <resource-version>1490627351232</resource-version> - <service-subscriptions/> - <relationship-list/> -</customer> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/request.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/request.json deleted file mode 100644 index bc0a1ef491..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/request.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "requestDetails": - { - "modelInfo": - { - "modelType":"service", - "modelInvariantUuid":"uuid-miu-svc-011-abcdef", - "modelVersionId":"ASDC_TOSCA_UUID", - "modelName":"SIModelName1", - "modelVersion":"2" - }, - "subscriberInfo": - { - "globalSubscriberId":"SDN-ETHERNET-INTERNET", - "subscriberName":"Kaneohe" - }, - "requestInfo": - { - "instanceName":"VCPE1", - "source":"VID", - "suppressRollback":"false", - "productFamilyId":"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb" - }, - "cloudConfiguration": - { - "lcpCloudRegionId":"cloudowner_mdt1", - "tenantId":"8b1df54faa3b49078e3416e21370a3ba" - }, - "requestParameters": - { - "subscriptionServiceType":"123456789", - "aLaCarte":"false", - "userParams": - [ - { - "name":"BRG_WAN_MAC_Address", - "value":"brgmac" - }, - { - "name": "Customer_Location", - "value": { - "customerLatitude": "32.897480", - "customerLongitude": "-97.040443", - "customerName": "some_company" - } - }, - { - "name":"Homing_Solution", - "value":"sniro" - } - ] - } - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/requestNoSIName.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/requestNoSIName.json deleted file mode 100644 index 4100ec76de..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/requestNoSIName.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "requestDetails": - { - "modelInfo": - { - "modelType":"service", - "modelInvariantUuid":"uuid-miu-svc-011-abcdef", - "modelVersionId":"ASDC_TOSCA_UUID", - "modelName":"SIModelName1", - "modelVersion":"2" - }, - "subscriberInfo": - { - "globalSubscriberId":"SDN-ETHERNET-INTERNET", - "subscriberName":"Kaneohe" - }, - "requestInfo": - { - "source":"VID", - "suppressRollback":"false", - "productFamilyId":"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb" - }, - "cloudConfiguration": - { - "lcpCloudRegionId":"cloudowner_mdt1", - "tenantId":"8b1df54faa3b49078e3416e21370a3ba" - }, - "requestParameters": - { - "subscriptionServiceType":"123456789", - "aLaCarte":"false", - "userParams": - [ - { - "name":"BRG_WAN_MAC_Address", - "value":"brgmac" - }, - { - "name": "Customer_Location", - "value": { - "customerLatitude": "32.897480", - "customerLongitude": "-97.040443", - "customerName": "some_company" - } - }, - { - "name":"Homing_Solution", - "value":"sniro" - } - ] - } - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/requestNoSINameNoRollback.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/requestNoSINameNoRollback.json deleted file mode 100644 index 5fc0b04180..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/requestNoSINameNoRollback.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "requestDetails": - { - "modelInfo": - { - "modelType":"service", - "modelInvariantUuid":"uuid-miu-svc-011-abcdef", - "modelVersionId":"ASDC_TOSCA_UUID", - "modelName":"SIModelName1", - "modelVersion":"2" - }, - "subscriberInfo": - { - "globalSubscriberId":"SDN-ETHERNET-INTERNET", - "subscriberName":"Kaneohe" - }, - "requestInfo": - { - "source":"VID", - "suppressRollback":"true", - "productFamilyId":"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb" - }, - "cloudConfiguration": - { - "lcpCloudRegionId":"cloudowner_mdt1", - "tenantId":"8b1df54faa3b49078e3416e21370a3ba" - }, - "requestParameters": - { - "subscriptionServiceType":"123456789", - "aLaCarte":"false", - "userParams": - [ - { - "name":"BRG_WAN_MAC_Address", - "value":"brgmac" - }, - { - "name": "Customer_Location", - "value": { - "customerLatitude": "32.897480", - "customerLongitude": "-97.040443", - "customerName": "some_company" - } - }, - { - "name":"Homing_Solution", - "value":"sniro" - } - ] - } - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DeleteVcpeResCustService/arGetBRGById.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DeleteVcpeResCustService/arGetBRGById.xml deleted file mode 100644 index 3cb31464d5..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DeleteVcpeResCustService/arGetBRGById.xml +++ /dev/null @@ -1,31 +0,0 @@ -<allotted-resource xmlns="http://org.openecomp.aai.inventory/v9"> - <id>ar-brgB</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>SDN-ETHERNET-INTERNET</relationship-value> - </relationship-data> - <relationship-data> - <relationship-key>service-subscription.service-type</relationship-key> - <relationship-value>123456789</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/DeleteVcpeResCustService/arGetTXCById.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DeleteVcpeResCustService/arGetTXCById.xml deleted file mode 100644 index 97992fc00b..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DeleteVcpeResCustService/arGetTXCById.xml +++ /dev/null @@ -1,31 +0,0 @@ -<allotted-resource xmlns="http://org.openecomp.aai.inventory/v9"> - <id>ar-txcA</id> - <orchestration-status>Active</orchestration-status> - <role>Tunnel XConn</role> - <type>Tunnel XConn</type> - <description>Tunnel XConn</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>SDN-ETHERNET-INTERNET</relationship-value> - </relationship-data> - <relationship-data> - <relationship-key>service-subscription.service-type</relationship-key> - <relationship-value>123456789</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/DeleteVcpeResCustService/getBRGArUrlById.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DeleteVcpeResCustService/getBRGArUrlById.xml deleted file mode 100644 index 932dbfb2ca..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DeleteVcpeResCustService/getBRGArUrlById.xml +++ /dev/null @@ -1,6 +0,0 @@ -<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/ar-brgB</resource-link> - </result-data> -</search-results>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DeleteVcpeResCustService/getSI.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DeleteVcpeResCustService/getSI.xml deleted file mode 100644 index e0511873b6..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DeleteVcpeResCustService/getSI.xml +++ /dev/null @@ -1,35 +0,0 @@ -<service-instance> - - <service-instance-id>MIS/1604/0026/SW_INTERNET</service-instance-id> - <resource-version>123456789</resource-version> - <relationship-list> - <relationship> - <related-to>generic-vnf</related-to> - <related-link>/aai/v7/generic-vnf/vnfX</related-link> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>/aai/v7/l3-network/netA</related-link> - </relationship> - <relationship> - <related-to>generic-vnf</related-to> - <related-link>/aai/v7/generic-vnf/vnfY</related-link> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>/aai/v7/l3-network/netB</related-link> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>/aai/v7/l3-network/netC</related-link> - </relationship> - <relationship> - <related-to>allotted-resource</related-to> - <related-link>/aai/v11/business/customers/customer/SDN-ETHERNET-INTERNET/service-subscriptions/service-subscription/123456789/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET/allotted-resources/allotted-resource/ar-txcA</related-link> - </relationship> - <relationship> - <related-to>allotted-resource</related-to> - <related-link>/aai/v11/business/customers/customer/SDN-ETHERNET-INTERNET/service-subscriptions/service-subscription/123456789/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET/allotted-resources/allotted-resource/ar-brgB</related-link> - </relationship> - </relationship-list> -</service-instance> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DeleteVcpeResCustService/getSIAfterDelArs.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DeleteVcpeResCustService/getSIAfterDelArs.xml deleted file mode 100644 index feb535c238..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DeleteVcpeResCustService/getSIAfterDelArs.xml +++ /dev/null @@ -1,8 +0,0 @@ -<service-instance> - <service-instance-id>MIS/1604/0026/SW_INTERNET</service-instance-id> - <service-type>SDN-MOBILITY</service-type> - <resource-version>123456789</resource-version> - - <relationship-list> - </relationship-list> -</service-instance> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DeleteVcpeResCustService/getTXCArUrlById.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DeleteVcpeResCustService/getTXCArUrlById.xml deleted file mode 100644 index 1c4f13d642..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DeleteVcpeResCustService/getTXCArUrlById.xml +++ /dev/null @@ -1,6 +0,0 @@ -<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/ar-txcA</resource-link> - </result-data> -</search-results>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DeleteVcpeResCustService/request.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DeleteVcpeResCustService/request.json deleted file mode 100644 index dc4669e8d9..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DeleteVcpeResCustService/request.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "requestDetails": - { - "modelInfo": - { - "modelType":"service", - "modelInvariantUuid":"uuid-miu-svc-011-abcdef", - "modelVersionId":"ASDC_TOSCA_UUID", - "modelName":"SIModelName1", - "modelVersion":"2" - }, - "subscriberInfo": - { - "globalSubscriberId":"SDN-ETHERNET-INTERNET", - "subscriberName":"Kaneohe" - }, - "requestInfo": - { - "instanceName":"VCPE1", - "source":"VID", - "suppressRollback":"false", - "productFamilyId":"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb" - }, - "cloudConfiguration": - { - "lcpCloudRegionId":"mdt1", - "tenantId":"8b1df54faa3b49078e3416e21370a3ba" - }, - "requestParameters": - { - "subscriptionServiceType":"123456789", - "aLaCarte":"false", - "userParams": - { - "BRG_WAN_MAC_Address" : "brgmac" - } - } - - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DeleteVcpeResCustService/serviceToDelete.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DeleteVcpeResCustService/serviceToDelete.xml deleted file mode 100644 index 8b8863e29c..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DeleteVcpeResCustService/serviceToDelete.xml +++ /dev/null @@ -1,36 +0,0 @@ -<service xmlns="http://org.openecomp.aai.inventory/v9"> - <relationship-list> - <relationship> - <related-to>generic-vnf</related-to> - <related-link>/aai/v7/generic-vnf/vnfX</related-link> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>/aai/v7/l3-network/netA</related-link> - </relationship> - <relationship> - <related-to>generic-vnf</related-to> - <related-link>/aai/v7/generic-vnf/vnfY/</related-link> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>/aai/v7/l3-network/netB</related-link> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>/aai/v7/l3-network/netC</related-link> - </relationship> - <relationship> - <related-to>allotted-resource</related-to> - <related-link>/aai/v11/anytxc</related-link> - </relationship> - <relationship> - <related-to>allotted-resource</related-to> - <related-link>/aai/v11/anybrg</related-link> - </relationship> - <relationship> - <related-to>allotted-resource</related-to> - <related-link>/aai/v11/other</related-link> - </relationship> - </relationship-list> -</service> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/SDNCTopologyQueryCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/SDNCTopologyQueryCallback.xml deleted file mode 100644 index d81b7e8f50..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/SDNCTopologyQueryCallback.xml +++ /dev/null @@ -1,37 +0,0 @@ -<output xmlns="org:onap:sdnctl:vnf">
-<brg-topology xmlns="org:onap: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 deleted file mode 100644 index e352ff8f1f..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/getAR.xml +++ /dev/null @@ -1,8 +0,0 @@ -<allotted-resource xmlns="http://org.openecomp.aai.inventory/v9"> - <relationship-list> - <relationship> - <related-to>allotted-resource</related-to> - <related-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</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 deleted file mode 100644 index 8c3976b828..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/getArBrg.xml +++ /dev/null @@ -1,31 +0,0 @@ -<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>SDN-ETHERNET-INTERNET</relationship-value> - </relationship-data> - <relationship-data> - <relationship-key>service-subscription.service-type</relationship-key> - <relationship-value>123456789</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/DoCreateAllottedResourceBRG/getArBrg2.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/getArBrg2.xml deleted file mode 100644 index 650d608fb0..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/getArBrg2.xml +++ /dev/null @@ -1,31 +0,0 @@ -<allotted-resource xmlns="http://org.openecomp.aai.inventory/v9"> - <id>ar-1</id> - <orchestration-status>Active</orchestration-status> - <role>txc</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>SDN-ETHERNET-INTERNET</relationship-value> - </relationship-data> - <relationship-data> - <relationship-key>service-subscription.service-type</relationship-key> - <relationship-value>123456789</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/DoCreateAllottedResourceBRG/getSIandAR.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/getSIandAR.xml deleted file mode 100644 index 14c7410995..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/getSIandAR.xml +++ /dev/null @@ -1,38 +0,0 @@ -<service-instance> - <service-instance-id>MIS/1604/0026/SW_INTERNET</service-instance-id> - <resource-version>123456789</resource-version> - - <orchestration-status>Active</orchestration-status> - - <relationship-list> - <relationship> - <related-to>allotted-resource</related-to> - <related-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</related-link> - </relationship> - - <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/DoCreateAllottedResourceBRGRollback/arGetById.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml deleted file mode 100644 index 8ed991608a..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml +++ /dev/null @@ -1,31 +0,0 @@ -<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>SDN-ETHERNET-INTERNET</relationship-value> - </relationship-data> - <relationship-data> - <relationship-key>service-subscription.service-type</relationship-key> - <relationship-value>123456789</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 deleted file mode 100644 index 6f86e0fb86..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncActivateRollbackReq.xml +++ /dev/null @@ -1,51 +0,0 @@ -<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 deleted file mode 100644 index 30d4c7ae49..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncAssignRollbackReq.xml +++ /dev/null @@ -1,51 +0,0 @@ -<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 deleted file mode 100644 index e20850a7b9..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncCreateRollbackReq.xml +++ /dev/null @@ -1,51 +0,0 @@ -<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 deleted file mode 100644 index f74e51e9d5..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/SDNCTopologyQueryCallback.xml +++ /dev/null @@ -1,24 +0,0 @@ -<output xmlns="org:onap:sdnctl:vnf">
-<tunnelxconn-topology xmlns="org:onap: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/DoCreateAllottedResourceTXC/getAR.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/getAR.xml deleted file mode 100644 index e352ff8f1f..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/getAR.xml +++ /dev/null @@ -1,8 +0,0 @@ -<allotted-resource xmlns="http://org.openecomp.aai.inventory/v9"> - <relationship-list> - <relationship> - <related-to>allotted-resource</related-to> - <related-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</related-link> - </relationship> - </relationship-list> -</allotted-resource> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/getArTxc.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/getArTxc.xml deleted file mode 100644 index dfb7d46a68..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/getArTxc.xml +++ /dev/null @@ -1,31 +0,0 @@ -<allotted-resource xmlns="http://org.openecomp.aai.inventory/v9"> - <id>ar-1</id> - <orchestration-status>Active</orchestration-status> - <role>TXCr</role> - <type>TXCt</type> - <description>TXC</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>SDN-ETHERNET-INTERNET</relationship-value> - </relationship-data> - <relationship-data> - <relationship-key>service-subscription.service-type</relationship-key> - <relationship-value>123456789</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/DoCreateAllottedResourceTXC/getArTxc2.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/getArTxc2.xml deleted file mode 100644 index 59c503036a..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/getArTxc2.xml +++ /dev/null @@ -1,31 +0,0 @@ -<allotted-resource xmlns="http://org.openecomp.aai.inventory/v9"> - <id>ar-1</id> - <orchestration-status>Active</orchestration-status> - <role>brg</role> - <type>TXC</type> - <description>TXC</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>SDN-ETHERNET-INTERNET</relationship-value> - </relationship-data> - <relationship-data> - <relationship-key>service-subscription.service-type</relationship-key> - <relationship-value>123456789</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/DoCreateAllottedResourceTXC/getSIandAR.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/getSIandAR.xml deleted file mode 100644 index 14c7410995..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/getSIandAR.xml +++ /dev/null @@ -1,38 +0,0 @@ -<service-instance> - <service-instance-id>MIS/1604/0026/SW_INTERNET</service-instance-id> - <resource-version>123456789</resource-version> - - <orchestration-status>Active</orchestration-status> - - <relationship-list> - <relationship> - <related-to>allotted-resource</related-to> - <related-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</related-link> - </relationship> - - <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/DoCreateAllottedResourceTXCRollback/arGetById.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml deleted file mode 100644 index f2063442d6..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml +++ /dev/null @@ -1,31 +0,0 @@ -<allotted-resource xmlns="http://org.openecomp.aai.inventory/v9"> - <id>ar-1</id> - <orchestration-status>Active</orchestration-status> - <role>Tunnel XConn</role> - <type>Tunnel XConn</type> - <description>Tunnel XConn</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>SDN-ETHERNET-INTERNET</relationship-value> - </relationship-data> - <relationship-data> - <relationship-key>service-subscription.service-type</relationship-key> - <relationship-value>123456789</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 deleted file mode 100644 index efec7eb001..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncActivateRollbackReq.xml +++ /dev/null @@ -1,51 +0,0 @@ -<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 deleted file mode 100644 index 9f52758750..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncAssignRollbackReq.xml +++ /dev/null @@ -1,51 +0,0 @@ -<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 deleted file mode 100644 index 025195e326..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncCreateRollbackReq.xml +++ /dev/null @@ -1,51 +0,0 @@ -<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 deleted file mode 100644 index 8ed991608a..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoDeleteAllottedResourceBRG/arGetById.xml +++ /dev/null @@ -1,31 +0,0 @@ -<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>SDN-ETHERNET-INTERNET</relationship-value> - </relationship-data> - <relationship-data> - <relationship-key>service-subscription.service-type</relationship-key> - <relationship-value>123456789</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 deleted file mode 100644 index f2063442d6..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoDeleteAllottedResourceTXC/arGetById.xml +++ /dev/null @@ -1,31 +0,0 @@ -<allotted-resource xmlns="http://org.openecomp.aai.inventory/v9"> - <id>ar-1</id> - <orchestration-status>Active</orchestration-status> - <role>Tunnel XConn</role> - <type>Tunnel XConn</type> - <description>Tunnel XConn</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>SDN-ETHERNET-INTERNET</relationship-value> - </relationship-data> - <relationship-data> - <relationship-key>service-subscription.service-type</relationship-key> - <relationship-value>123456789</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/VIPR/getCatalogServiceResourcesData.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/getCatalogServiceResourcesData.json deleted file mode 100644 index d05fccf98a..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/getCatalogServiceResourcesData.json +++ /dev/null @@ -1,94 +0,0 @@ -{ "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, - "multiStageDesign" : 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/VIPR/getCatalogServiceResourcesDataForReplaceVnfInfra.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/getCatalogServiceResourcesDataForReplaceVnfInfra.json deleted file mode 100644 index b6e8a94888..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/getCatalogServiceResourcesDataForReplaceVnfInfra.json +++ /dev/null @@ -1,98 +0,0 @@ -{ "serviceResources" : { - "serviceType" : "PortMirroring", - "serviceRole" : "InfraRole", - "environmentContext" : "Luna", - "workloadContext" : "Oxygen", - "modelInfo" : { - "modelName" : "MSO Test Network", - "modelUuid" : "aed5a5b7-20d3-44f7-90a3-ddbd16f14d1e", - "modelInvariantUuid" : "52b49b5d-3086-4ffd-b5e6-1b1e5e7e062f", - "modelVersion" : null - }, - "serviceVnfs": [ - { "modelInfo" : { - "modelName" : "vHNF for DHV Test", - "modelUuid" : "fe6478e5-ea33-3346-ac12-ab121484a3fe", - "modelInvariantUuid" : "ff5256d2-5a33-55df-13ab-12abad84e7ff", - "modelVersion" : "1.0", - "modelCustomizationUuid" : "MODEL-ID-1234", - "modelInstanceName" : "vHNF for DHV Test 17" - }, - "toscaNodeType" : null, - "nfFunction" : null, - "nfType" : null, - "nfRole" : "vSCP", - "nfNamingCode" : null, - "multiStageDesign" : null, - "vfModules": [ - { - "modelInfo" : { - "modelName" : "VhnfForDhvTest..base_TEST..module-0", - "modelUuid" : "ebc3d18c-3e62-4c24-bcd6-961e98701a0a", - "modelInvariantUuid" : "introvert", - "modelVersion" : "1", - "modelCustomizationUuid" : "1740536a-742e-40f5-b9c8-83918849a787" - }, "isBase" : true, - "vfModuleLabel" : "base_TEST", - "initialCount" : 1, - "hasVolumeGroup" : true - } - ] - } - ], - "serviceNetworks": [ - { - "modelInfo" : { - "modelName" : "CONTRAIL_BASIC", - "modelUuid" : "fe5be3a6-dbe0-46d6-bcac-44dc841a7edc", - "modelInvariantUuid" : "ab07fbd8-185a-45ac-be45-db3eb02e98d5", - "modelVersion" : null, - "modelCustomizationUuid" : "0cb9b26a-9820-48a7-86e5-16c510e993d9", - "modelInstanceName" : "CONTRAIL_BASIC 5" - }, - "toscaNodeType" : null, - "networkType" : null, - "networkTechnology" : null, - "networkRole" : null, - "networkScope" : null - } - ], - "serviceAllottedResources": [ - { - "modelInfo" : { - "modelName" : "IP_MUX_Demux", - "modelUuid" : "64a1a718-556b-48ce-b3b7-ed3237ccc94f", - "modelInvariantUuid" : "f110ef53-a0a6-4d72-ab91-fd88a835e8c4", - "modelVersion" : "2.0", - "modelCustomizationUuid" : "4bab0880-2f06-4aeb-87cb-3734c8e8bf93", - "modelInstanceName" : "Pri_IP_MUX_Demux 1" - }, - "toscaNodeType" : null, - "allottedResourceType" : "ContrailRoute", - "allottedResourceRole" : null, - "providingServiceModelInvariantUuid" : null, - "nfFunction" : null, - "nfType" : null, - "nfRole" : null, - "nfNamingCode" : null - }, - { - "modelInfo" : { - "modelName" : "Service_Admin", - "modelUuid" : "73501e03-ee76-4509-a8ce-96d2a9f33ee9", - "modelInvariantUuid" : "462edf71-1a3c-487b-bf55-497460ab7de3", - "modelVersion" : "2.0", - "modelCustomizationUuid" : "a896ffad-c8f9-404e-a527-7a8d0cc99ce6", - "modelInstanceName" : "Pri_Service_Admin 5" - }, - "toscaNodeType" : null, - "allottedResourceType" : "SecurityZone", - "allottedResourceRole" : null, - "providingServiceModelInvariantUuid" : null, - "nfFunction" : null, - "nfType" : null, - "nfRole" : null, - "nfNamingCode" : null - } - ] - }}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/getCatalogServiceResourcesDataForUpdateVnfInfra.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/getCatalogServiceResourcesDataForUpdateVnfInfra.json deleted file mode 100644 index 5597abbc78..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/getCatalogServiceResourcesDataForUpdateVnfInfra.json +++ /dev/null @@ -1,110 +0,0 @@ -{ "serviceResources" : {
- "serviceType" : "PortMirroring",
- "serviceRole" : "InfraRole",
- "environmentContext" : "Luna",
- "workloadContext" : "Oxygen",
- "modelInfo" : {
- "modelName" : "MSO Test Network",
- "modelUuid" : "aed5a5b7-20d3-44f7-90a3-ddbd16f14d1e",
- "modelInvariantUuid" : "52b49b5d-3086-4ffd-b5e6-1b1e5e7e062f",
- "modelVersion" : null
- },
- "serviceVnfs": [
- { "modelInfo" : {
- "modelName" : "vHNF for DHV Test",
- "modelUuid" : "7097d8bb-f6ad-4cf7-866e-6a04c8f1b332",
- "modelInvariantUuid" : "ff5256d2-5a33-55df-13ab-12abad84e7ff",
- "modelVersion" : "2.0",
- "modelCustomizationUuid" : "da86dd87-43c5-458c-b226-5315b7be9ad5",
- "modelInstanceName" : "vHNF for DHV Test 17"
- },
- "toscaNodeType" : null,
- "nfFunction" : null,
- "nfType" : null,
- "nfRole" : "vSCP",
- "nfNamingCode" : null,
- "multiStageDesign" : null,
- "vfModules": [
- {
- "modelInfo" : {
- "modelName" : "VhnfForDhvTest..base_TEST..module-0",
- "modelUuid" : "ebc3d18c-3e62-4c24-bcd6-961e98701a0a",
- "modelInvariantUuid" : "introvert",
- "modelVersion" : "1",
- "modelCustomizationUuid" : "1740536a-742e-40f5-b9c8-83918849a787"
- }, "isBase" : true,
- "vfModuleLabel" : "base_TEST",
- "initialCount" : 1,
- "hasVolumeGroup" : true
- },
- {
- "modelInfo" : {
- "modelName" : "VhnfForDhvTest..base_TEST..module-1",
- "modelUuid" : "ebc3d18c-3e62-4c24-bcd6-961e98701a0b",
- "modelInvariantUuid" : "extrovert",
- "modelVersion" : "1",
- "modelCustomizationUuid" : "1740536a-742e-40f5-b9c8-83918849a788"
- }, "isBase" : false,
- "vfModuleLabel" : "addon_TEST",
- "initialCount" : 1,
- "hasVolumeGroup" : true
- }
- ]
- }
- ],
- "serviceNetworks": [
- {
- "modelInfo" : {
- "modelName" : "CONTRAIL_BASIC",
- "modelUuid" : "fe5be3a6-dbe0-46d6-bcac-44dc841a7edc",
- "modelInvariantUuid" : "ab07fbd8-185a-45ac-be45-db3eb02e98d5",
- "modelVersion" : null,
- "modelCustomizationUuid" : "0cb9b26a-9820-48a7-86e5-16c510e993d9",
- "modelInstanceName" : "CONTRAIL_BASIC 5"
- },
- "toscaNodeType" : null,
- "networkType" : null,
- "networkTechnology" : null,
- "networkRole" : null,
- "networkScope" : null
- }
- ],
- "serviceAllottedResources": [
- {
- "modelInfo" : {
- "modelName" : "IP_MUX_Demux",
- "modelUuid" : "64a1a718-556b-48ce-b3b7-ed3237ccc94f",
- "modelInvariantUuid" : "f110ef53-a0a6-4d72-ab91-fd88a835e8c4",
- "modelVersion" : "2.0",
- "modelCustomizationUuid" : "4bab0880-2f06-4aeb-87cb-3734c8e8bf93",
- "modelInstanceName" : "Pri_IP_MUX_Demux 1"
- },
- "toscaNodeType" : null,
- "allottedResourceType" : "ContrailRoute",
- "allottedResourceRole" : null,
- "providingServiceModelInvariantUuid" : null,
- "nfFunction" : null,
- "nfType" : null,
- "nfRole" : null,
- "nfNamingCode" : null
- },
- {
- "modelInfo" : {
- "modelName" : "Service_Admin",
- "modelUuid" : "73501e03-ee76-4509-a8ce-96d2a9f33ee9",
- "modelInvariantUuid" : "462edf71-1a3c-487b-bf55-497460ab7de3",
- "modelVersion" : "2.0",
- "modelCustomizationUuid" : "a896ffad-c8f9-404e-a527-7a8d0cc99ce6",
- "modelInstanceName" : "Pri_Service_Admin 5"
- },
- "toscaNodeType" : null,
- "allottedResourceType" : "SecurityZone",
- "allottedResourceRole" : null,
- "providingServiceModelInvariantUuid" : null,
- "nfFunction" : null,
- "nfType" : null,
- "nfRole" : null,
- "nfNamingCode" : null
- }
- ]
- }}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/getCatalogVnfData.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/getCatalogVnfData.json deleted file mode 100644 index c7938d1af6..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/getCatalogVnfData.json +++ /dev/null @@ -1,44 +0,0 @@ -{"serviceVnfs": [ - { "modelInfo" : { - "modelName" : "vHNF for DHV Test", - "modelUuid" : "7097d8bb-f6ad-4cf7-866e-6a04c8f1b332", - "modelInvariantUuid" : "ff5256d2-5a33-55df-13ab-12abad84e7ff", - "modelVersion" : "2.0", - "modelCustomizationUuid" : "da86dd87-43c5-458c-b226-5315b7be9ad5", - "modelInstanceName" : "vHNF for DHV Test 17" - }, - "toscaNodeType" : null, - "nfFunction" : null, - "nfType" : null, - "nfRole" : "vSCP", - "nfNamingCode" : null, - "multiStageDesign" : null, - "vfModules": [ - { - "modelInfo" : { - "modelName" : "VhnfForDhvTest..base_TEST..module-0", - "modelUuid" : "ebc3d18c-3e62-4c24-bcd6-961e98701a0a", - "modelInvariantUuid" : "introvert", - "modelVersion" : "1", - "modelCustomizationUuid" : "1740536a-742e-40f5-b9c8-83918849a787" - }, "isBase" : true, - "vfModuleLabel" : "base_TEST", - "initialCount" : 1, - "hasVolumeGroup" : true - }, - { - "modelInfo" : { - "modelName" : "VhnfForDhvTest..base_TEST..module-1", - "modelUuid" : "ebc3d18c-3e62-4c24-bcd6-961e98701a0b", - "modelInvariantUuid" : "extrovert", - "modelVersion" : "1", - "modelCustomizationUuid" : "1740536a-742e-40f5-b9c8-83918849a788" - }, "isBase" : false, - "vfModuleLabel" : "addon_TEST", - "initialCount" : 1, - "hasVolumeGroup" : true - } - ] - } - ] -}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/getCatalogVnfNoTwoPhasedForVfModule.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/getCatalogVnfNoTwoPhasedForVfModule.json deleted file mode 100644 index 3067d124c3..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/getCatalogVnfNoTwoPhasedForVfModule.json +++ /dev/null @@ -1,44 +0,0 @@ -{"serviceVnfs": [ - { "modelInfo" : { - "modelName" : "vSAMP12", - "modelUuid" : "7097d8bb-f6ad-4cf7-866e-6a04c8f1b332", - "modelInvariantUuid" : "ff5256d2-5a33-55df-13ab-12abad84e7ff", - "modelVersion" : "2.0", - "modelCustomizationUuid" : "MODEL-123", - "modelInstanceName" : "VNF for VF Module Create Test Two Phased" - }, - "toscaNodeType" : null, - "nfFunction" : null, - "nfType" : null, - "nfRole" : "vSCP", - "nfNamingCode" : null, - "multiStageDesign" : null, - "vfModules": [ - { - "modelInfo" : { - "modelName" : "STMTN5MMSC21-MMSC::model-1-0", - "modelUuid" : "ebc3d18c-3e62-4c24-bcd6-961e98701a0a", - "modelInvariantUuid" : "introvert", - "modelVersion" : "1", - "modelCustomizationUuid" : "1740536a-742e-40f5-b9c8-83918849a787" - }, "isBase" : true, - "vfModuleLabel" : "base_TEST", - "initialCount" : 1, - "hasVolumeGroup" : true - }, - { - "modelInfo" : { - "modelName" : "VhnfForDhvTest..base_TEST..module-1", - "modelUuid" : "ebc3d18c-3e62-4c24-bcd6-961e98701a0b", - "modelInvariantUuid" : "extrovert", - "modelVersion" : "1", - "modelCustomizationUuid" : "1740536a-742e-40f5-b9c8-83918849a788" - }, "isBase" : false, - "vfModuleLabel" : "addon_TEST", - "initialCount" : 1, - "hasVolumeGroup" : true - } - ] - } - ] -}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/getCatalogVnfYesTwoPhasedForVfModule.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/getCatalogVnfYesTwoPhasedForVfModule.json deleted file mode 100644 index a9b3226483..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/getCatalogVnfYesTwoPhasedForVfModule.json +++ /dev/null @@ -1,44 +0,0 @@ -{"serviceVnfs": [ - { "modelInfo" : { - "modelName" : "vSAMP12", - "modelUuid" : "7097d8bb-f6ad-4cf7-866e-6a04c8f1b332", - "modelInvariantUuid" : "ff5256d2-5a33-55df-13ab-12abad84e7ff", - "modelVersion" : "2.0", - "modelCustomizationUuid" : "MODEL-123", - "modelInstanceName" : "VNF for VF Module Create Test Two Phased" - }, - "toscaNodeType" : null, - "nfFunction" : null, - "nfType" : null, - "nfRole" : "vSCP", - "nfNamingCode" : null, - "multiStageDesign" : "true", - "vfModules": [ - { - "modelInfo" : { - "modelName" : "STMTN5MMSC21-MMSC::model-1-0", - "modelUuid" : "ebc3d18c-3e62-4c24-bcd6-961e98701a0a", - "modelInvariantUuid" : "introvert", - "modelVersion" : "1", - "modelCustomizationUuid" : "1740536a-742e-40f5-b9c8-83918849a787" - }, "isBase" : true, - "vfModuleLabel" : "base_TEST", - "initialCount" : 1, - "hasVolumeGroup" : true - }, - { - "modelInfo" : { - "modelName" : "VhnfForDhvTest..base_TEST..module-1", - "modelUuid" : "ebc3d18c-3e62-4c24-bcd6-961e98701a0b", - "modelInvariantUuid" : "extrovert", - "modelVersion" : "1", - "modelCustomizationUuid" : "1740536a-742e-40f5-b9c8-83918849a788" - }, "isBase" : false, - "vfModuleLabel" : "addon_TEST", - "initialCount" : 1, - "hasVolumeGroup" : true - } - ] - } - ] -}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/serviceDecompositionATMFW.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/serviceDecompositionATMFW.json deleted file mode 100644 index 94c1152204..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/serviceDecompositionATMFW.json +++ /dev/null @@ -1,110 +0,0 @@ -{
-"serviceResources" : {
- "modelInfo" : {
- "modelName" : "CMW_Service",
- "modelUuid" : "",
- "modelInvariantId" : "cmw-123-456-789",
- "modelVersion" : "",
- "modelCustomizationUuid" : "",
- "modelInstanceName" : "",
- "modelCustomizationName" : "",
- "modelVersionId" : "Cmw_123",
- "modelType" : ""
- },
- "serviceInstanceData" : {
- "instanceId" : "ff5256d2-5a33-55df-13ab-12abad84e7ff"
- },
- "serviceNetworks" : [ {
- "modelInfo" : {
- "modelName" : "CONTRAIL30_BASIC",
- "modelUuid" : "",
- "modelInvariantId" : "not yet implemented",
- "modelVersion" : "1.0",
- "modelCustomizationUuid" : "z_network_123",
- "modelInstanceName" : "",
- "modelCustomizationName" : "",
- "modelVersionId" : "mod-inst-uuid-123",
- "modelType" : "network"
- },
- "instanceData" : { },
- "networkType" : "CONTRAIL30_BASIC"
- } ],
- "serviceVnfs" : [ {
- "modelInfo" : {
- "modelName" : "vSAMP12",
- "modelUuid" : "",
- "modelInvariantId" : "ff5256d2-5a33-55df-13ab-12abad84e7ff",
- "modelVersion" : "1.0",
- "modelCustomizationUuid" : "ff5256d2-5a33-55df-13ab-12abad84e7ff",
- "modelInstanceName" : "",
- "modelCustomizationName" : "",
- "modelVersionId" : "fe6478e5-ea33-3346-ac12-ab121484a3fe",
- "modelType" : "vnf"
- },
- "instanceData" : { },
- "vfModules" : [ {
- "modelInfo" : {
- "modelName" : "vSAMP12::base::module-0",
- "modelUuid" : "",
- "modelInvariantId" : "miu-1001",
- "modelVersion" : "1",
- "modelCustomizationUuid" : "1001",
- "modelInstanceName" : "",
- "modelCustomizationName" : "",
- "modelVersionId" : "",
- "modelType" : "vfModule"
- },
- "instanceData" : { },
- "hasVolumeGroup" : false,
- "isBase" : true,
- "initialCount" : 1
- }, {
- "modelInfo" : {
- "modelName" : "base::module-0",
- "modelUuid" : "",
- "modelInvariantId" : "miu-1002",
- "modelVersion" : "1",
- "modelCustomizationUuid" : "1002",
- "modelInstanceName" : "",
- "modelCustomizationName" : "",
- "modelVersionId" : "",
- "modelType" : "vfModule"
- },
- "instanceData" : { },
- "hasVolumeGroup" : false,
- "isBase" : true,
- "initialCount" : 1
- }, {
- "modelInfo" : {
- "modelName" : "vSAMP12DEV::base::module-0",
- "modelUuid" : "",
- "modelInvariantId" : "miu-1003",
- "modelVersion" : "1",
- "modelCustomizationUuid" : "f86e8800-7629-427f-b284-3dbfd04db01f",
- "modelInstanceName" : "",
- "modelCustomizationName" : "",
- "modelVersionId" : "",
- "modelType" : "vfModule"
- },
- "instanceData" : { },
- "hasVolumeGroup" : false,
- "isBase" : true,
- "initialCount" : 0
- } ]
- } ],
- "serviceAllottedResources" : [ {
- "modelInfo" : {
- "modelName" : "Bruce Wayne",
- "modelUuid" : "",
- "modelInvariantId" : "not yet implemented",
- "modelVersion" : "1.0",
- "modelCustomizationUuid" : "ar-mod-custid-456-456",
- "modelInstanceName" : "Clark Kent",
- "modelCustomizationName" : "",
- "modelVersionId" : "123-123",
- "modelType" : "allottedResource"
- },
- "instanceData" : { }
- } ]
- }
-}
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/AddNetworkPolicy_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/AddNetworkPolicy_AAIResponse_Success.xml deleted file mode 100644 index 0ec1e30022..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/AddNetworkPolicy_AAIResponse_Success.xml +++ /dev/null @@ -1,21 +0,0 @@ -<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd" - statusCode="200"> - <rest:headers> - <rest:header name="Transfer-Encoding" value="chunked"/> - <rest:header name="Date" value="Mon,14 Mar 2016 20:53:33 GMT"/> - <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/> - <rest:header name="X-AAI-TXID" - value="mtcnjv9aaas01.mtcnj.aic.cip.com-20160314-20:53:33:487-134392"/> - <rest:header name="Content-Type" value="application/xml"/> - <rest:header name="Server" value="Apache-Coyote/1.1"/> - <rest:header name="Cache-Control" value="private"/> - </rest:headers> - <rest:payload contentType="text/xml"> - <network-policy xmlns="http://org.openecomp.aai.inventory/v8"> - <network-policy-id>9a7b327d9-287aa00-82c4b0-105757</network-policy-id> - <network-policy-fqdn>fqdn123</network-policy-fqdn> - <heat-stack-id>slowburn</heat-stack-id> - <resource-version>145878989</resource-version> - </network-policy> - </rest:payload> -</rest:RESTResponse>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/DBUpdateResponse.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/DBUpdateResponse.xml deleted file mode 100644 index 7c30f75497..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/DBUpdateResponse.xml +++ /dev/null @@ -1,4 +0,0 @@ - - -<ns2:updateRequestResponse xmlns:ns2="http://org.openecomp.mso/requestsdb" - xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"/>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/DoUpdateVfModuleRequest.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/DoUpdateVfModuleRequest.xml deleted file mode 100644 index d041565ac7..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/DoUpdateVfModuleRequest.xml +++ /dev/null @@ -1,29 +0,0 @@ -<vnf-request xmlns="http://org.openecomp/mso/infra/vnf-request/v1"> - <request-info> - <request-id>DEV-VF-0011</request-id> - <action>UPDATE_VF_MODULE</action> - <source>PORTAL</source> - </request-info> - <vnf-inputs> - <vnf-id>skask</vnf-id> <!-- Required --> - <vf-module-id>supercool</vf-module-id> <!-- Required --> - <vnf-type>pcrf-capacity</vnf-type> <!-- Optional --> - <vf-module-model-name>PCRF::module-0</vf-module-model-name> <!-- Required --> - <asdc-service-model-version></asdc-service-model-version> <!-- Optional --> - <service-id>serviceIdUUID</service-id> <!-- Required --> - <aic-cloud-region>MDTWNJ21</aic-cloud-region> <!-- Required --> - <tenant-id>fba1bd1e195a404cacb9ce17a9b2b421</tenant-id> <!-- Required --> - <volume-group-id>78987</volume-group-id> <!-- Optional --> - <persona-model-id>introvert</persona-model-id> <!-- Optional --> - <persona-model-version>3.14</persona-model-version> <!-- Optional --> - <contrail-service-instance-fqdn>myhost.appl.edu</contrail-service-instance-fqdn> <!-- Optional --> - <vnf-persona-model-id>introvert</vnf-persona-model-id> <!-- Optional --> - <vnf-persona-model-version>3.14</vnf-persona-model-version> <!-- Optional --> - </vnf-inputs> - <vnf-params> - <param name="oam_network_name">VLAN-OAM-1323</param> - <param name="vm_name">slcp34246vbc246ceb</param> - <param name="ipag_network">970cd2b9-7f09-4a12-af47-182ea38ba1f0</param> - <param name="vpe_network">545cc2c3-1930-4100-b534-5d82d0e12bb6</param> - </vnf-params> -</vnf-request> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/GenerateVfModuleName_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/GenerateVfModuleName_AAIResponse_Success.xml deleted file mode 100644 index fe874717a8..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/GenerateVfModuleName_AAIResponse_Success.xml +++ /dev/null @@ -1,51 +0,0 @@ -<generic-vnf xmlns="http://org.openecomp.aai.inventory/v7">
- <vnf-id>12345678-f41f-4822-9323-b75962763d74</vnf-id>
- <vnf-name>STMTN5MMSC20</vnf-name>
- <vnf-type>pcrf-capacity</vnf-type>
- <service-id>SDN-MOBILITY</service-id>
- <equipment-role>vPCRF</equipment-role>
- <orchestration-status>pending-create</orchestration-status>
- <in-maint>false</in-maint>
- <is-closed-loop-disabled>false</is-closed-loop-disabled>
- <model-invariant-id>introvert</model-invariant-id>
- <model-version-id>2.0</model-version-id>
- <resource-version>0000020</resource-version>
- <vf-modules>
- <vf-module>
- <vf-module-id>lukewarm</vf-module-id>
- <vf-module-name>PCRF::module-0-0</vf-module-name>
- <model-invariant-id>extrovert</model-invariant-id>
- <model-version-id>2.0</model-version-id>
- <is-base-vf-module>true</is-base-vf-module>
- <heat-stack-id>fastburn</heat-stack-id>
- <module-index>2</module-index>
- <orchestration-status>pending-create</orchestration-status>
- <resource-version>0000074</resource-version>
- </vf-module>
- <vf-module>
- <vf-module-id>supercool</vf-module-id>
- <vf-module-name>PCRF::module-1-0</vf-module-name>
- <model-invariant-id>extrovert</model-invariant-id>
- <model-version-id>2.0</model-version-id>
- <is-base-vf-module>false</is-base-vf-module>
- <heat-stack-id>slowburn</heat-stack-id>
- <module-index>0</module-index>
- <orchestration-status>pending-create</orchestration-status>
- <resource-version>0000075</resource-version>
- </vf-module>
- <vf-module>
- <vf-module-id>supercool</vf-module-id>
- <vf-module-name>PCRF::module-1-0</vf-module-name>
- <model-invariant-id>introvert</model-invariant-id>
- <model-version-id>2.0</model-version-id>
- <is-base-vf-module>false</is-base-vf-module>
- <heat-stack-id>slowburn</heat-stack-id>
- <module-index>1</module-index>
- <orchestration-status>pending-create</orchestration-status>
- <resource-version>0000075</resource-version>
- </vf-module>
- </vf-modules>
- <relationship-list/>
- <l-interfaces/>
- <lag-interfaces/>
-</generic-vnf>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/GenericVnf.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/GenericVnf.xml deleted file mode 100644 index 4712a5a464..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/GenericVnf.xml +++ /dev/null @@ -1,38 +0,0 @@ -<generic-vnf xmlns="http://org.openecomp.aai.inventory/v7">
- <vnf-id>skask</vnf-id>
- <vnf-name>STMTN5MMSC20</vnf-name>
- <vnf-type>pcrf-capacity</vnf-type>
- <service-id>SDN-MOBILITY</service-id>
- <equipment-role>vPCRF</equipment-role>
- <orchestration-status>pending-create</orchestration-status>
- <in-maint>false</in-maint>
- <is-closed-loop-disabled>false</is-closed-loop-disabled>
- <model-invariant-id>introvert</model-invariant-id>
- <model-version-id>2.0</model-version-id>
- <resource-version>0000020</resource-version>
- <vf-modules>
- <vf-module>
- <vf-module-id>lukewarm</vf-module-id>
- <vf-module-name>PCRF::module-0-0</vf-module-name>
- <model-invariant-id>introvert</model-invariant-id>
- <model-version-id>2.0</model-version-id>
- <is-base-vf-module>true</is-base-vf-module>
- <heat-stack-id>fastburn</heat-stack-id>
- <orchestration-status>pending-create</orchestration-status>
- <resource-version>0000074</resource-version>
- </vf-module>
- <vf-module>
- <vf-module-id>supercool</vf-module-id>
- <vf-module-name>PCRF::module-1-0</vf-module-name>
- <model-invariant-id>extrovert</model-invariant-id>
- <model-version-id>2.0</model-version-id>
- <is-base-vf-module>false</is-base-vf-module>
- <heat-stack-id>slowburn</heat-stack-id>
- <orchestration-status>pending-create</orchestration-status>
- <resource-version>0000075</resource-version>
- </vf-module>
- </vf-modules>
- <relationship-list/>
- <l-interfaces/>
- <lag-interfaces/>
-</generic-vnf>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/QueryNetworkPolicy_AAIResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/QueryNetworkPolicy_AAIResponse_Success.xml deleted file mode 100644 index d7bbb15b8c..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/QueryNetworkPolicy_AAIResponse_Success.xml +++ /dev/null @@ -1,21 +0,0 @@ -<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd" - statusCode="200"> - <rest:headers> - <rest:header name="Transfer-Encoding" value="chunked"/> - <rest:header name="Date" value="Mon,14 Mar 2016 20:53:33 GMT"/> - <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/> - <rest:header name="X-AAI-TXID" - value="mtcnjv9aaas01.mtcnj.aic.cip.com-20160314-20:53:33:487-134392"/> - <rest:header name="Content-Type" value="application/xml"/> - <rest:header name="Server" value="Apache-Coyote/1.1"/> - <rest:header name="Cache-Control" value="private"/> - </rest:headers> - <rest:payload contentType="text/xml"> - <network-policy xmlns="http://org.openecomp.aai.inventory/v8"> - <network-policy-id>9a7b327d9-287aa00-82c4b0-105757</network-policy-id> - <network-policy-fqdn>GN_EVPN_Test</network-policy-fqdn> - <heat-stack-id>195159195</heat-stack-id> - <resource-version>14567890</resource-version> - </network-policy> - </rest:payload> -</rest:RESTResponse>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCSITopologyAssignCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCSITopologyAssignCallback.xml deleted file mode 100644 index f6314e55b3..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCSITopologyAssignCallback.xml +++ /dev/null @@ -1,11 +0,0 @@ -<output - xmlns="com:att:sdnctl:generic-resource"> - <svc-request-id>094d311c-40bc-4ff1-9617-37c4226efcc3</svc-request-id> - <response-code>200</response-code> - <response-message></response-message> - <ack-final-indicator>Y</ack-final-indicator> - <service-response-information> - <instance-id>8462db9b-3e91-4e90-a2c8-6471313f87bf</instance-id> - <object-path>restconf/config/GENERIC-RESOURCE-API:services/service/8462db9b-3e91-4e90-a2c8-6471313f87bf/service-data/service-topology/</object-path> - </service-response-information> -</output>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyActivateCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyActivateCallback.xml deleted file mode 100644 index 5fa58e9c03..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyActivateCallback.xml +++ /dev/null @@ -1,13 +0,0 @@ -<output xmlns="com:att: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/VfModularity/SDNCTopologyAssignCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyAssignCallback.xml deleted file mode 100644 index 2b732f952d..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyAssignCallback.xml +++ /dev/null @@ -1,16 +0,0 @@ - <output xmlns="com:att: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/VfModularity/SDNCTopologyChangeAssignCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyChangeAssignCallback.xml deleted file mode 100644 index 3e138775d4..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyChangeAssignCallback.xml +++ /dev/null @@ -1,13 +0,0 @@ - <output xmlns="com:att: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/VfModularity/SDNCTopologyCreateCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyCreateCallback.xml deleted file mode 100644 index b579f232b1..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyCreateCallback.xml +++ /dev/null @@ -1,16 +0,0 @@ - <output xmlns="org:onap: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> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyDeactivateCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyDeactivateCallback.xml deleted file mode 100644 index 3cf0c81c72..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyDeactivateCallback.xml +++ /dev/null @@ -1,13 +0,0 @@ -<output xmlns="org:onap: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> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyDeactivateCallbackNotFound.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyDeactivateCallbackNotFound.xml deleted file mode 100644 index df5004edf5..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyDeactivateCallbackNotFound.xml +++ /dev/null @@ -1,8 +0,0 @@ -<output xmlns="org:onap:sdnctl:vnf">
- <vnf-information>
- <vnf-id>skask</vnf-id>
- </vnf-information>
- <response-code>404</response-code>
- <svc-request-id>{{REQUEST-ID}}</svc-request-id>
- <ack-final-indicator>Y</ack-final-indicator>
-</output>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyDeleteCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyDeleteCallback.xml deleted file mode 100644 index b579f232b1..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyDeleteCallback.xml +++ /dev/null @@ -1,16 +0,0 @@ - <output xmlns="org:onap: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> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallback.xml deleted file mode 100644 index 10af29a210..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallback.xml +++ /dev/null @@ -1,315 +0,0 @@ -<output xmlns="com:att:sdnctl:vnf">
-<vnf-list xmlns="com:att:sdnctl:vnf">
- <vnf-id>bd1b3789-6474-4935-94b2-90b656e035d0</vnf-id>
- <service-data>
- <vnf-id>bd1b3789-6474-4935-94b2-90b656e035d0</vnf-id>
- <sdnc-request-header>
- <svc-request-id>9ddf628a-9eca-430e-8974-22d520a31be1</svc-request-id>
- <svc-action>assign</svc-action>
- <svc-notification-url>https://msojra.infra.aic.net:8443/adapters/rest/SDNCNotify</svc-notification-url>
- </sdnc-request-header>
- <service-information>
- <subscriber-name>notsurewecare</subscriber-name>
- <service-instance-id>bd1b3789-6474-4935-94b2-90b656e035d0</service-instance-id>
- <service-type>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-type>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- </service-information>
- <oper-status>
- <order-status>PendingCreate</order-status>
- </oper-status>
- <vnf-request-information>
- <aic-cloud-region>VNN1CA52LCP</aic-cloud-region>
- <vnf-name>skask</vnf-name>
- <generic-vnf-id>afd0f02a-1ddb-43bb-aded-5113e46e82ae</generic-vnf-id>
- <generic-vnf-type>ZVNN1MOGX01-SVC/ZVNN1MOGX01 - VF AUG 1 1</generic-vnf-type>
- <generic-vnf-name>ZVNN1MOGX01</generic-vnf-name>
- <tenant>33d209df14ac4c08ad60747185d2f3e0</tenant>
- <vnf-id>bd1b3789-6474-4935-94b2-90b656e035d0</vnf-id>
- <vnf-type>ZVNN1MOGX01 - VF AUG 1::module-0</vnf-type>
- </vnf-request-information>
- <vnf-topology-information>
- <vnf-assignments>
- <vnf-networks>
- <network-role>mog_exn</network-role>
- <network-id>03dbd833-785c-40c0-bf32-37594b5334bc</network-id>
- <network-name>MNS-25180-P-VNNYCA01_exn_protected_net_1</network-name>
- <contrail-network-fqdn/>
- <subnet-id/>
- <neutron-id>6f82d234-41a4-48e9-a9e8-415667a72929</neutron-id>
- <sriov-vlan-filter-list>
- <sriov-vlan-filter>filter1</sriov-vlan-filter>
- </sriov-vlan-filter-list>
- <sriov-vlan-filter-list>
- <sriov-vlan-filter>filter2</sriov-vlan-filter>
- </sriov-vlan-filter-list>
- </vnf-networks>
- <vnf-networks>
- <network-role>mog_oam</network-role>
- <network-id>3f181cde-9380-4c20-9d3a-e1a4ee74f994</network-id>
- <network-name>MNS-25180-P-VNNYCA01_oam_protected_net_1</network-name>
- <contrail-network-fqdn/>
- <subnet-id/>
- <neutron-id>713b6770-13fa-4949-8dbb-a1288c5e5932</neutron-id>
- </vnf-networks>
- <vnf-networks>
- <network-role>mog_cor_B</network-role>
- <network-id>821a550a-3f50-4725-995b-f212d5caec7c</network-id>
- <network-name>MNS-25180-P-VNNYCA01_cor_direct_net_1</network-name>
- <contrail-network-fqdn/>
- <subnet-id/>
- <neutron-id>18926e56-12b6-4a4d-98b6-37e0c05626ee</neutron-id>
- </vnf-networks>
- <vnf-networks>
- <network-role>mog_cor_A</network-role>
- <network-id>3dabf5c0-cffb-420c-8960-8499c74eb25f</network-id>
- <network-name>MNS-25180-P-VNNYCA01_cor_direct_net_2</network-name>
- <contrail-network-fqdn/>
- <subnet-id/>
- <neutron-id>35530b29-a4de-48ff-a014-111110ccc652</neutron-id>
- </vnf-networks>
- <vnf-networks>
- <network-role>mog_gn</network-role>
- <network-id>3ce97321-6e7f-49af-bd12-f833e377c310</network-id>
- <network-name>MNS-25180-P-VNNYCA01_gn_direct_net_1</network-name>
- <contrail-network-fqdn/>
- <subnet-id/>
- <neutron-id>32bfdd2c-28e1-4895-87a6-373bf12c3129</neutron-id>
- </vnf-networks>
- <vnf-networks>
- <network-role>mog_dmz</network-role>
- <network-id>d43ca910-02a5-47dc-8510-100a68a3c9e0</network-id>
- <network-name>MNS-25180-P-VNNYCA01_dmz_protected_net_1</network-name>
- <contrail-network-fqdn/>
- <subnet-id/>
- <neutron-id>cb9500fb-943f-412e-aea6-458711564a75</neutron-id>
- </vnf-networks>
- <availability-zones>
- <availability-zone>nova</availability-zone>
- </availability-zones>
- <vnf-vms>
- <vm-type>ps</vm-type>
- <vm-names>
- <vm-name>ZVNN1MOGX01MPS001</vm-name>
- </vm-names>
- <vm-names>
- <vm-name>ZVNN1MOGX01MPS002</vm-name>
- </vm-names>
- <vm-names>
- <vm-name>ZVNN1MOGX01MPS003</vm-name>
- </vm-names>
- <vm-names>
- <vm-name>ZVNN1MOGX01MPS004</vm-name>
- </vm-names>
- <vm-count>4</vm-count>
- <vm-networks>
- <network-role>mog_cor_B</network-role>
- <network-ips>
- <ip-address>107.224.36.251</ip-address>
- </network-ips>
- <network-ips>
- <ip-address>107.224.36.252</ip-address>
- </network-ips>
- <network-ips>
- <ip-address>107.224.36.253</ip-address>
- </network-ips>
- <network-ips>
- <ip-address>107.224.36.254</ip-address>
- </network-ips>
- <use-dhcp>N</use-dhcp>
- </vm-networks>
- </vnf-vms>
- <vnf-vms>
- <vm-type>cm</vm-type>
- <vm-names>
- <vm-name>ZVNN1MOGX01MCM001</vm-name>
- </vm-names>
- <vm-names>
- <vm-name>ZVNN1MOGX01OAM002</vm-name>
- </vm-names>
- <vm-count>1</vm-count>
- <vm-networks>
- <network-role>mog_cor_B</network-role>
- <network-ips>
- <ip-address>107.224.36.249</ip-address>
- </network-ips>
- <network-ips>
- <ip-address>107.224.36.250</ip-address>
- </network-ips>
- <use-dhcp>N</use-dhcp>
- </vm-networks>
- <vm-networks>
- <network-role>mog_oam</network-role>
- <network-ips>
- <ip-address>107.239.167.250</ip-address>
- </network-ips>
- <network-ips>
- <ip-address>107.239.167.251</ip-address>
- </network-ips>
- <use-dhcp>N</use-dhcp>
- </vm-networks>
- </vnf-vms>
- <vnf-vms>
- <vm-type>oam</vm-type>
- <vm-names>
- <vm-name>ZVNN1MOGX01OAM001</vm-name>
- </vm-names>
- <vm-names>
- <vm-name>ZVNN1MOGX01OAM002</vm-name>
- </vm-names>
- <vm-count>2</vm-count>
- <vm-networks>
- <network-role>mog_oam</network-role>
- <network-ips>
- <ip-address>107.239.167.252</ip-address>
- </network-ips>
- <network-ips>
- <ip-address>107.239.167.251</ip-address>
- </network-ips>
- <use-dhcp>N</use-dhcp>
- </vm-networks>
- <vm-networks>
- <network-role>mog_cor_B</network-role>
- <network-ips>
- <ip-address>107.224.36.249</ip-address>
- </network-ips>
- <network-ips>
- <ip-address>107.224.36.250</ip-address>
- </network-ips>
- <use-dhcp>N</use-dhcp>
- </vm-networks>
- </vnf-vms>
- <vnf-vms>
- <vm-type>pd</vm-type>
- <vm-names>
- <vm-name>ZVNN1MOGX01MPD001</vm-name>
- </vm-names>
- <vm-names>
- <vm-name>ZVNN1MOGX01MPD002</vm-name>
- </vm-names>
- <vm-count>2</vm-count>
- <vm-networks>
- <network-role>mog_dmz</network-role>
- <network-ips>
- <ip-address>107.225.25.253</ip-address>
- </network-ips>
- <network-ips>
- <ip-address>107.225.25.254</ip-address>
- </network-ips>
- <use-dhcp>N</use-dhcp>
- <floating-ip>107.225.254.253</floating-ip>
- </vm-networks>
- <vm-networks>
- <network-role>mog_oam</network-role>
- <network-ips>
- <ip-address>107.239.167.254</ip-address>
- </network-ips>
- <network-ips>
- <ip-address>107.239.167.253</ip-address>
- </network-ips>
- <use-dhcp>N</use-dhcp>
- <floating-ip>107.239.167.249</floating-ip>
- </vm-networks>
- <vm-networks>
- <network-role>mog_exn</network-role>
- <network-ips>
- <ip-address>107.224.46.253</ip-address>
- </network-ips>
- <network-ips>
- <ip-address>107.224.46.254</ip-address>
- </network-ips>
- <use-dhcp>N</use-dhcp>
- <floating-ip>107.224.46.252</floating-ip>
- </vm-networks>
- <vm-networks>
- <network-role>mog_cor_B</network-role>
- <network-ips>
- <ip-address>107.224.36.247</ip-address>
- </network-ips>
- <network-ips>
- <ip-address>107.224.36.248</ip-address>
- </network-ips>
- <use-dhcp>N</use-dhcp>
- <floating-ip>107.224.41.252</floating-ip>
- </vm-networks>
- <vm-networks>
- <network-role>mog_gn</network-role>
- <network-ips>
- <ip-address>107.224.41.253</ip-address>
- </network-ips>
- <network-ips>
- <ip-address>107.224.41.254</ip-address>
- </network-ips>
- <use-dhcp>N</use-dhcp>
- <floating-ip>107.224.41.252</floating-ip>
- </vm-networks>
- <vm-networks>
- <network-role>mog_cor_A</network-role>
- <network-ips>
- <ip-address>107.224.38.253</ip-address>
- </network-ips>
- <network-ips>
- <ip-address>107.224.38.254</ip-address>
- </network-ips>
- <use-dhcp>N</use-dhcp>
- </vm-networks>
- </vnf-vms>
- <vnf-vms>
- <vm-type>sm</vm-type>
- <vm-names>
- <vm-name>ZVNN1MOGX01MSM001</vm-name>
- </vm-names>
- <vm-names>
- <vm-name>ZVNN1MOGX01MSM002</vm-name>
- </vm-names>
- <vm-names>
- <vm-name>ZVNN1MOGX01MSM003</vm-name>
- </vm-names>
- <vm-names>
- <vm-name>ZVNN1MOGX01MSM004</vm-name>
- </vm-names>
- <vm-count>4</vm-count>
- <vm-networks>
- <network-role>mog_cor_B</network-role>
- <network-ips>
- <ip-address>107.224.36.243</ip-address>
- </network-ips>
- <network-ips>
- <ip-address>107.224.36.244</ip-address>
- </network-ips>
- <network-ips>
- <ip-address>107.224.36.245</ip-address>
- </network-ips>
- <network-ips>
- <ip-address>107.224.36.246</ip-address>
- </network-ips>
- <use-dhcp>N</use-dhcp>
- </vm-networks>
- </vnf-vms>
- </vnf-assignments>
- <vnf-topology-identifier>
- <vnf-name>ZVNNMOGX01_base</vnf-name>
- <service-type>SDN-MOBILITY</service-type>
- <vnf-type>ZVNN1MOGX01 - VF AUG 1::module-0</vnf-type>
- <generic-vnf-type>ZVNN1MOGX01-SVC/ZVNN1MOGX01 - VF AUG 1 1</generic-vnf-type>
- <generic-vnf-name>ZVNN1MOGX01</generic-vnf-name>
- </vnf-topology-identifier>
- </vnf-topology-information>
- <request-information>
- <request-id>9ddf628a-9eca-430e-8974-22d520a31be1</request-id>
- <notification-url/>
- <source>PORTAL</source>
- <request-action>VNFActivateRequest</request-action>
- </request-information>
- </service-data>
- <service-status>
- <response-code>200</response-code>
- <final-indicator>Y</final-indicator>
- <request-status>synccomplete</request-status>
- <response-timestamp>2016-08-05T16:15:19.398Z</response-timestamp>
- <rpc-name>vnf-topology-operation</rpc-name>
- <vnfsdn-action>VNFActivateRequest</vnfsdn-action>
- <rpc-action>assign</rpc-action>
- </service-status>
-</vnf-list>
-
-</output>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallbackVfModule.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallbackVfModule.xml deleted file mode 100644 index f96a073ef6..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallbackVfModule.xml +++ /dev/null @@ -1,141 +0,0 @@ -<output xmlns="com:att:sdnctl:vnf">
- <vnf-list xmlns="com:att:sdnctl:vnf">
- <vnf-id>28455973-1ee5-4ad1-8d35-c4732679743a</vnf-id>
- <service-status>
- <response-code>200</response-code>
- <final-indicator>Y</final-indicator>
- <request-status>synccomplete</request-status>
- <response-timestamp>2016-06-08T19:44:59.138Z</response-timestamp>
- <rpc-name>vnf-topology-operation</rpc-name>
- <vnfsdn-action>VNFActivateRequest</vnfsdn-action>
- <rpc-action>assign</rpc-action>
- </service-status>
- <service-data>
- <vnf-id>28455973-1ee5-4ad1-8d35-c4732679743</vnf-id>
- <service-information>
- <subscriber-name>notsurewecare</subscriber-name>
- <service-instance-id>28455973-1ee5-4ad1-8d35-c4732679743a</service-instance-id>
- <service-type>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-type>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- </service-information>
- <sdnc-request-header>
- <svc-request-id>5e168556-a5c6-4813-bff3-cc03007afbbc</svc-request-id>
- <svc-notification-url>http://mtanjv9moja01-eth1-0.aic.cip.com:8080/adapters/rest/SDNCNotify</svc-notification-url>
- <svc-action>assign</svc-action>
- </sdnc-request-header>
- <vnf-request-information>
- <aic-cloud-region>AAIAIC25</aic-cloud-region>
- <vnf-name>MSOTEST06-vSAMP3::base::module-0</vnf-name>
- <generic-vnf-id>91ad7ab0-9ffd-471d-971c-3eb913a2cc75</generic-vnf-id>
- <generic-vnf-type>Test/vSAMP3 1</generic-vnf-type>
- <generic-vnf-name>MSOTEST06</generic-vnf-name>
- <tenant>4ae1d3446a4c48b2bec44b6cfba06d68</tenant>
- <vnf-id>28455973-1ee5-4ad1-8d35-c4732679743a</vnf-id>
- <vnf-type>vSAMP3::base::module-0</vnf-type>
- </vnf-request-information>
- <oper-status>
- <order-status>PendingCreate</order-status>
- </oper-status>
- <vnf-topology-information>
- <vnf-parameters>
- <vnf-parameter-name>image</vnf-parameter-name>
- <vnf-parameter-value>Ubuntu_Perf</vnf-parameter-value>
- </vnf-parameters>
- <vnf-parameters>
- <vnf-parameter-name>flavor</vnf-parameter-name>
- <vnf-parameter-value>m1.small</vnf-parameter-value>
- </vnf-parameters>
- <vnf-assignments>
- <vnf-networks>
- <network-role>int_imbl</network-role>
- <network-id>680b7453-0ec4-4d96-b355-280d981d418f</network-id>
- <network-name>Nimbus-25193-T-Willows2_int_imbl_net_1</network-name>
- <contrail-network-fqdn>default-domain:Nimbus-25193-T-Willows2:Nimbus-25193-T-Willows2_int_imbl_net_1</contrail-network-fqdn>
- <subnet-id></subnet-id>
- <ipv6-subnet-id>775607fb-e16a-45ef-94a7-82fba0d16eec</ipv6-subnet-id>
- <neutron-id>640d07fb-e16a-45ef-94a7-82fba0d169bf</neutron-id>
- <sriov-vlan-filter-list>
- <sriov-vlan-filter>filter1</sriov-vlan-filter>
- </sriov-vlan-filter-list>
- <sriov-vlan-filter-list>
- <sriov-vlan-filter>filter2</sriov-vlan-filter>
- </sriov-vlan-filter-list>
- </vnf-networks>
- <vnf-networks>
- <network-role>sgi_protected</network-role>
- <network-id>f9039ce9-e3cf-4716-b2d1-ec7912178ea4</network-id>
- <network-name>Nimbus-25193-T-Willows2_sgi_protected_net_1</network-name>
- <contrail-network-fqdn>default-domain:Nimbus-25193-T-Willows2:Nimbus-25193-T-Willows2_sgi_protected_net_1</contrail-network-fqdn>
- <subnet-id>b9999ce9-e3cf-4716-b2d1-ec791217678c</subnet-id>
- <ipv6-subnet-id></ipv6-subnet-id>
- <neutron-id>bf11bba8-b971-4ab5-8281-215b3fedcd3c</neutron-id>
- </vnf-networks>
- <vnf-vms>
- <vm-type>cm</vm-type>
- <vm-names>
- <vm-name>ZVNN1MOGX01MCM001</vm-name>
- </vm-names>
- <vm-names>
- <vm-name>ZVNN1MOGX01OAM002</vm-name>
- </vm-names>
- <vm-count>1</vm-count>
- <vm-networks>
- <network-role>mog_cor_B</network-role>
- <network-ips>
- <ip-address>107.224.36.249</ip-address>
- </network-ips>
- <network-ips>
- <ip-address>107.224.36.250</ip-address>
- </network-ips>
- <network-ips-v6>
- <ip-address-ipv6>2606:ae00:2e01:800::67</ip-address-ipv6>
- </network-ips-v6>
- <use-dhcp>N</use-dhcp>
- <floating-ip>107.224.41.252</floating-ip>
- <floating-ip-v6>2001:1890:1001:2B32::29:C</floating-ip-v6>
- </vm-networks>
- <vm-networks>
- <network-role>mog_oam</network-role>
- <network-ips>
- <ip-address>107.239.167.250</ip-address>
- </network-ips>
- <network-ips>
- <ip-address>107.239.167.251</ip-address>
- </network-ips>
- <network-ips-v6>
- <ip-address-ipv6>aa::aa::aa::aa::aa::aa</ip-address-ipv6>
- </network-ips-v6>
- <network-ips-v6>
- <ip-address-ipv6>bb::bb::bb::bb::bb::bb</ip-address-ipv6>
- </network-ips-v6>
- <interface-route-prefixes>
- <interface-route-prefix-cidr>1.2.3.4/26</interface-route-prefix-cidr>
- </interface-route-prefixes>
- <interface-route-prefixes>
- <interface-route-prefix-cidr>2002::/64</interface-route-prefix-cidr>
- </interface-route-prefixes>
- <use-dhcp>N</use-dhcp>
- <floating-ip-v6>1111:1890:1001:2B32::29:D</floating-ip-v6>
- </vm-networks>
- </vnf-vms>
- <availability-zones>
- <availability-zone>nova</availability-zone>
- </availability-zones>
- </vnf-assignments>
- <vnf-topology-identifier>
- <vnf-name>MSOTEST06-vSAMP3::base::module-0</vnf-name>
- <service-type>SDN-MOBILITY</service-type>
- <vnf-type>vSAMP3::base::module-0</vnf-type>
- <generic-vnf-type>Test/vSAMP3 1</generic-vnf-type>
- <generic-vnf-name>MSOTEST06</generic-vnf-name>
- </vnf-topology-identifier>
- </vnf-topology-information>
- <request-information>
- <request-id>5e168556-a5c6-4813-bff3-cc03007afbbc</request-id>
- <notification-url></notification-url>
- <source>SoapUI-bns-vf-base-vSAMP3-9001</source>
- <request-action>VNFActivateRequest</request-action>
- </request-information>
- </service-data>
-</vnf-list>
-</output>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallbackVfModuleNoVnf.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallbackVfModuleNoVnf.xml deleted file mode 100644 index 689c214cba..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallbackVfModuleNoVnf.xml +++ /dev/null @@ -1,82 +0,0 @@ -<output xmlns="com:att:sdnctl:vnf">
-<vf-module-topology xmlns="com:att:sdnctl:generic-resource">
- <vf-module-topology-identifier>
- <vf-module-id>0725b072-b854-4705-bf8e-c1a1eb08651e</vf-module-id>
- <vf-module-type>vSAMP10aDEV::base::module-0</vf-module-type>
- <vf-module-name>zmtn6nf-code-111_base_0</vf-module-name>
- </vf-module-topology-identifier>
- <ecomp-model-information>
- <model-name>vSAMP10aDEV::base::module-0</model-name>
- <model-customization-uuid>819ef122-ca19-4141-a61e-62922f8fc279</model-customization-uuid>
- <model-version>ff2ae348-214a-11e7-93ae-92361f002673</model-version>
- <model-invariant-uuid>3a97db99-c4bb-498a-a13a-38f65f1ced3d</model-invariant-uuid>
- <model-uuid>ff2ae348-214a-11e7-93ae-92361f002673</model-uuid>
- </ecomp-model-information>
- <tenant>19123c2924c648eb8e42a3c1f14b7682</tenant>
- <aic-cloud-region>mtn6</aic-cloud-region>
- <aic-clli>AUSTTXGR</aic-clli>
- <vf-module-parameters>
- <param>
- <name>image</name>
- <value>Ubuntu_Perf</value>
- </param>
- <param>
- <name>flavor</name>
- <value>m1.small</value>
- </param>
- </vf-module-parameters>
- <vf-module-assignments>
- <vms>
- <vm>
- <vm-type>cm</vm-type>
- <vm-names>
- <vm-name>ZVNN1MOGX01MCM001</vm-name>
- </vm-names>
- <vm-names>
- <vm-name>ZVNN1MOGX01OAM002</vm-name>
- </vm-names>
- <vm-count>1</vm-count>
- <vm-networks>
- <network-role-tag>mog_cor_B</network-role-tag>
- <network-role>hhh</network-role>
- <network-ips>
- <ip-address>107.224.36.249</ip-address>
- </network-ips>
- <network-ips>
- <ip-address>107.224.36.250</ip-address>
- </network-ips>
- <network-ips-v6>
- <ip-address-ipv6>2606:ae00:2e01:800::67</ip-address-ipv6>
- </network-ips-v6>
- <use-dhcp>N</use-dhcp>
- <floating-ip>107.224.41.252</floating-ip>
- <floating-ip-v6>2001:1890:1001:2B32::29:C</floating-ip-v6>
- </vm-networks>
- <vm-networks>
- <network-role>mog_oam</network-role>
- <network-ips>
- <ip-address>107.239.167.250</ip-address>
- </network-ips>
- <network-ips>
- <ip-address>107.239.167.251</ip-address>
- </network-ips>
- <network-ips-v6>
- <ip-address-ipv6>aa::aa::aa::aa::aa::aa</ip-address-ipv6>
- </network-ips-v6>
- <network-ips-v6>
- <ip-address-ipv6>bb::bb::bb::bb::bb::bb</ip-address-ipv6>
- </network-ips-v6>
- <interface-route-prefixes>
- <interface-route-prefix-cidr>1.2.3.4/26</interface-route-prefix-cidr>
- </interface-route-prefixes>
- <interface-route-prefixes>
- <interface-route-prefix-cidr>2002::/64</interface-route-prefix-cidr>
- </interface-route-prefixes>
- <use-dhcp>N</use-dhcp>
- <floating-ip-v6>1111:1890:1001:2B32::29:D</floating-ip-v6>
- </vm-networks>
- </vm>
- </vms>
- </vf-module-assignments>
-</vf-module-topology>
-</output>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallbackVnf.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallbackVnf.xml deleted file mode 100644 index bc2c7b9e63..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallbackVnf.xml +++ /dev/null @@ -1,82 +0,0 @@ -<output xmlns="com:att:sdnctl:vnf">
-<vnf-topology xmlns="com:att:sdnctl:generic-resource">
- <vnf-topology-identifier-structure>
- <nf-type>nf-type-1</nf-type>
- <vnf-name>zmtn6nf-code-111</vnf-name>
- <nf-role>nf-role-1</nf-role>
- <nf-function>nf-function-1</nf-function>
- <nf-code>nf-code-1</nf-code>
- <vnf-id>eac30f85-f61f-4c5f-862e-2c62f9e135de</vnf-id>
- <vnf-type>null</vnf-type>
- </vnf-topology-identifier-structure>
- <ecomp-model-information>
- <model-name>vSAMP10a_macro</model-name>
- <model-customization-uuid>819ef122-ca19-4141-a61e-62922f8fc279</model-customization-uuid>
- <model-version>1.0</model-version>
- <model-invariant-uuid>ef176121-f02c-4dd3-927c-22131d48446b</model-invariant-uuid>
- <model-uuid>ff2ae348-214a-11e7-93ae-92361f002672</model-uuid>
- </ecomp-model-information>
- <vnf-resource-assignments>
- <vnf-networks>
- <network-role>mog_exn</network-role>
- <network-id>03dbd833-785c-40c0-bf32-37594b5334bc</network-id>
- <network-name>MNS-25180-P-VNNYCA01_exn_protected_net_1</network-name>
- <contrail-network-fqdn/>
- <subnet-id/>
- <neutron-id>6f82d234-41a4-48e9-a9e8-415667a72929</neutron-id>
- <sriov-vlan-filter-list>
- <sriov-vlan-filter>filter1</sriov-vlan-filter>
- </sriov-vlan-filter-list>
- <sriov-vlan-filter-list>
- <sriov-vlan-filter>filter2</sriov-vlan-filter>
- </sriov-vlan-filter-list>
- </vnf-networks>
- <vnf-networks>
- <network-role>mog_oam</network-role>
- <network-id>3f181cde-9380-4c20-9d3a-e1a4ee74f994</network-id>
- <network-name>MNS-25180-P-VNNYCA01_oam_protected_net_1</network-name>
- <contrail-network-fqdn/>
- <subnet-id/>
- <neutron-id>713b6770-13fa-4949-8dbb-a1288c5e5932</neutron-id>
- </vnf-networks>
- <vnf-networks>
- <network-role>mog_cor_B</network-role>
- <network-id>821a550a-3f50-4725-995b-f212d5caec7c</network-id>
- <network-name>MNS-25180-P-VNNYCA01_cor_direct_net_1</network-name>
- <contrail-network-fqdn/>
- <subnet-id/>
- <neutron-id>18926e56-12b6-4a4d-98b6-37e0c05626ee</neutron-id>
- </vnf-networks>
- <vnf-networks>
- <network-role>mog_cor_A</network-role>
- <network-id>3dabf5c0-cffb-420c-8960-8499c74eb25f</network-id>
- <network-name>MNS-25180-P-VNNYCA01_cor_direct_net_2</network-name>
- <contrail-network-fqdn/>
- <subnet-id/>
- <neutron-id>35530b29-a4de-48ff-a014-111110ccc652</neutron-id>
- </vnf-networks>
- <vnf-networks>
- <network-role>mog_gn</network-role>
- <network-id>3ce97321-6e7f-49af-bd12-f833e377c310</network-id>
- <network-name>MNS-25180-P-VNNYCA01_gn_direct_net_1</network-name>
- <contrail-network-fqdn/>
- <subnet-id/>
- <neutron-id>32bfdd2c-28e1-4895-87a6-373bf12c3129</neutron-id>
- </vnf-networks>
- <vnf-networks>
- <network-role>mog_dmz</network-role>
- <network-id>d43ca910-02a5-47dc-8510-100a68a3c9e0</network-id>
- <network-name>MNS-25180-P-VNNYCA01_dmz_protected_net_1</network-name>
- <contrail-network-fqdn/>
- <subnet-id/>
- <neutron-id>cb9500fb-943f-412e-aea6-458711564a75</neutron-id>
- </vnf-networks>
- <availability-zones>
- <availability-zone>nova</availability-zone>
- </availability-zones>
- </vnf-resource-assignments>
- <tenant>19123c2924c648eb8e42a3c1f14b7682</tenant>
- <aic-cloud-region>mtn6</aic-cloud-region>
- <aic-clli>AUSTTXGR</aic-clli>
-</vnf-topology>
-</output>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyUnassignCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyUnassignCallback.xml deleted file mode 100644 index b579f232b1..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/SDNCTopologyUnassignCallback.xml +++ /dev/null @@ -1,16 +0,0 @@ - <output xmlns="org:onap: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> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/StandardSDNCSynchResponse.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/StandardSDNCSynchResponse.xml deleted file mode 100644 index 919ff2c36b..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/StandardSDNCSynchResponse.xml +++ /dev/null @@ -1,5 +0,0 @@ -<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> - <soap:Body> - <SDNCAdapterResponse xmlns="http://org.openecomp/workflow/sdnc/adapter/schema/v1"/> - </soap:Body> -</soap:Envelope>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VNFAdapterRestCreateCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VNFAdapterRestCreateCallback.xml deleted file mode 100644 index 3afcb3f21c..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VNFAdapterRestCreateCallback.xml +++ /dev/null @@ -1,55 +0,0 @@ -<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/VfModularity/VNFAdapterRestUpdateCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VNFAdapterRestUpdateCallback.xml deleted file mode 100644 index 2d3ebebccd..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VNFAdapterRestUpdateCallback.xml +++ /dev/null @@ -1,16 +0,0 @@ -<updateVfModuleResponse>
- <vnfId>skask</vnfId>
- <vfModuleId>supercool</vfModuleId>
- <vfModuleStackId>slowburn</vfModuleStackId>
- <vfModuleOutputs>
- <entry>
- <key>key1</key>
- <value>value1</value>
- </entry>
- <entry>
- <key>key2</key>
- <value>value2</value>
- </entry>
- </vfModuleOutputs>
- <messageId>{{MESSAGE-ID}}</messageId>
-</updateVfModuleResponse>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VNFAdapterRestVolumeGroupCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VNFAdapterRestVolumeGroupCallback.xml deleted file mode 100644 index af2bd7abfd..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VNFAdapterRestVolumeGroupCallback.xml +++ /dev/null @@ -1,15 +0,0 @@ -<updateVolumeGroupResponse>
- <volumeGroupId>78987</volumeGroupId>
- <volumeGroupStackId>slowburn</volumeGroupStackId>
- <vfModuleOutputs>
- <entry>
- <key>key1</key>
- <value>value1</value>
- </entry>
- <entry>
- <key>key2</key>
- <value>value2</value>
- </entry>
- </vfModuleOutputs>
- <messageId>{{MESSAGE-ID}}</messageId>
-</updateVolumeGroupResponse>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VfModule-lukewarm.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VfModule-lukewarm.xml deleted file mode 100644 index 8db8610501..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VfModule-lukewarm.xml +++ /dev/null @@ -1,10 +0,0 @@ -<vf-module xmlns="http://org.openecomp.aai.inventory/v7">
- <vf-module-id>lukewarm</vf-module-id>
- <vf-module-name>PCRF::module-1</vf-module-name>
- <heat-stack-id>slowburn</heat-stack-id>
- <orchestration-status>pending-create</orchestration-status>
- <is-base-vf-module>true</is-base-vf-module>
- <resource-version>330-90</resource-version>
- <model-invariant-id>introvert</model-invariant-id>
- <model-version-id>2.0</model-version-id>
-</vf-module>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VfModule-new-PendingActivation.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VfModule-new-PendingActivation.xml deleted file mode 100644 index 2ccba7d056..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VfModule-new-PendingActivation.xml +++ /dev/null @@ -1,9 +0,0 @@ -<vf-module xmlns="http://org.openecomp.aai.inventory/v7"> - <vf-module-id>b37d96db-7d2c-47ce-bf61-a6c7b82fe161</vf-module-id> - <vf-module-name>PCRF::module-0-2</vf-module-name> - <model-invariant-id>00000000-0000-0000-0000-000000000000</model-invariant-id> - <model-version-id>1.0</model-version-id> - <is-base-vf-module>false</is-base-vf-module> - <orchestration-status>PendingActivation</orchestration-status> - <resource-version>330-90</resource-version> -</vf-module>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VfModule-new.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VfModule-new.xml deleted file mode 100644 index 10e85c0568..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VfModule-new.xml +++ /dev/null @@ -1,9 +0,0 @@ -<vf-module xmlns="http://org.openecomp.aai.inventory/v7">
- <vf-module-id>b37d96db-7d2c-47ce-bf61-a6c7b82fe161</vf-module-id>
- <vf-module-name>PCRF::module-0-2</vf-module-name>
- <model-invariant-id>00000000-0000-0000-0000-000000000000</model-invariant-id>
- <model-version-id>1.0</model-version-id>
- <is-base-vf-module>false</is-base-vf-module>
- <orchestration-status>pending-create</orchestration-status>
- <resource-version>330-90</resource-version>
-</vf-module>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VfModule-supercool.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VfModule-supercool.xml deleted file mode 100644 index 4e7d567564..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VfModule-supercool.xml +++ /dev/null @@ -1,27 +0,0 @@ -<vf-module xmlns="http://org.openecomp.aai.inventory/v7">
- <vf-module-id>supercool</vf-module-id>
- <vf-module-name>PCRF::module-2</vf-module-name>
- <heat-stack-id>fastburn</heat-stack-id>
- <orchestration-status>pending-create</orchestration-status>
- <is-base-vf-module>false</is-base-vf-module>
- <resource-version>330-89</resource-version>
- <model-invariant-id>introvert</model-invariant-id>
- <model-version-id>2.0</model-version-id>
- <relationship-list>
- <relationship>
- <related-to>volume-group</related-to>
- <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>pdk1</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>volume-group.volume-group-id</relationship-key>
- <relationship-value>78987</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
-</vf-module>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VolumeGroup.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VolumeGroup.xml deleted file mode 100644 index 354ebb7160..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VolumeGroup.xml +++ /dev/null @@ -1,25 +0,0 @@ - <volume-group xmlns="http://org.openecomp.aai.inventory/v7">
- <volume-group-id>78987</volume-group-id>
- <volume-group-name>Volume_2</volume-group-name>
- <heat-stack-id>slowburn</heat-stack-id>
- <vnf-type>pcrf-capacity</vnf-type>
- <orchestration-status>Active</orchestration-status>
- <resource-version>0000020</resource-version>
- <relationship-list>
- <relationship>
- <related-to>tenant</related-to>
- <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>MDTWNJ21</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>fba1bd1e195a404cacb9ce17a9b2b421</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </volume-group>
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/deleteNetworkResponse_Success.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/deleteNetworkResponse_Success.xml deleted file mode 100644 index 902c0837d9..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/deleteNetworkResponse_Success.xml +++ /dev/null @@ -1,3 +0,0 @@ -<ns2:deleteNetworkResponse xmlns:ns2="http://org.openecomp.mso/network"> - <networkDeleted>true</networkDeleted> -</ns2:deleteNetworkResponse> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/applicationContext_forPnfTesting.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/applicationContext_forPnfTesting.xml deleted file mode 100644 index 980a0b1186..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/applicationContext_forPnfTesting.xml +++ /dev/null @@ -1,70 +0,0 @@ -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:context="http://www.springframework.org/schema/context" - xsi:schemaLocation="http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans.xsd - http://www.springframework.org/schema/context - http://www.springframework.org/schema/context/spring-context-2.5.xsd" > - - <bean id="dataSource" class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy"> - <property name="targetDataSource"> - <bean class="org.springframework.jdbc.datasource.SimpleDriverDataSource"> - <property name="driverClass" value="org.h2.Driver" /> - <property name="url" - value="jdbc:h2:mem:process-engine;DB_CLOSE_DELAY=1000" /> - <property name="username" value="sa" /> - <property name="password" value="" /> - </bean> - </property> - </bean> - - <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> - <property name="dataSource" ref="dataSource" /> - </bean> - - <bean id="processEngineConfiguration" class="org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration"> - <property name="processEngineName" value="engine" /> - <property name="dataSource" ref="dataSource" /> - <property name="transactionManager" ref="transactionManager" /> - <property name="databaseSchemaUpdate" value="true" /> - <property name="jobExecutorActivate" value="false" /> - <!--<property name="deploymentResources" value="classpath*:*.bpmn" />--> - </bean> - - <bean id="processEngine" class="org.camunda.bpm.engine.spring.ProcessEngineFactoryBean"> - <property name="processEngineConfiguration" ref="processEngineConfiguration" /> - </bean> - - <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" /> - <bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" /> - <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" /> - <bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" /> - <bean id="managementService" factory-bean="processEngine" factory-method="getManagementService" /> - - <context:annotation-config /> - - <bean id="processEngineRule" class="org.camunda.bpm.engine.test.ProcessEngineRule"> - <property name="processEngine" ref="processEngine" /> - </bean> - - <bean id="aaiConnection" class="org.openecomp.mso.bpmn.infrastructure.pnf.delegate.AaiConnectionTestImpl"/> - - <bean id="checkAaiForCorrelationIdDelegate" class="org.openecomp.mso.bpmn.infrastructure.pnf.delegate.CheckAaiForCorrelationIdDelegate"> - <property name="aaiConnection" ref="aaiConnection"/> - </bean> - - <bean id="createAaiEntryWithPnfIdDelegate" class="org.openecomp.mso.bpmn.infrastructure.pnf.delegate.CreateAaiEntryWithPnfIdDelegate"> - <property name="aaiConnection" ref="aaiConnection"/> - </bean> - - <bean id="informDmaapClient" class="org.openecomp.mso.bpmn.infrastructure.pnf.delegate.InformDmaapClient"> - <property name="dmaapClient" ref="dmaapClient"/> - </bean> - - <bean id="dmaapClient" class="org.openecomp.mso.bpmn.infrastructure.pnf.delegate.DmaapClientTestImpl"/> - - - <bean id="pnfCheckInputs" class="org.openecomp.mso.bpmn.infrastructure.pnf.delegate.PnfCheckInputs"> - <property name="defaultTimeout" value="PT1S"/> - </bean> -</beans> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/camunda.cfg.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/camunda.cfg.xml deleted file mode 100644 index e4e8ae5176..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/camunda.cfg.xml +++ /dev/null @@ -1,46 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
-
- <bean id="processEngineConfiguration" class="org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration">
-
- <property name="jdbcUrl" value="jdbc:h2:mem:camunda;DB_CLOSE_DELAY=1000" />
- <property name="jdbcDriver" value="org.h2.Driver" />
- <property name="jdbcUsername" value="sa" />
- <property name="jdbcPassword" value="" />
-
- <!-- Database configurations -->
- <property name="databaseSchemaUpdate" value="true" />
-
- <!-- job executor configurations -->
- <property name="jobExecutorActivate" value="true" />
-
- <property name="history" value="full" />
-
- <!--<property name="idGenerator" ref="uuidGenerator" />-->
-
- <!-- engine plugins -->
- <property name="processEnginePlugins">
- <list>
- <ref bean="connectProcessEnginePlugin" />
- <ref bean="spinProcessEnginePlugin" />
- <ref bean="loggingPlugin" />
- <ref bean="workflowExceptionPlugin" />
- </list>
- </property>
- </bean>
-
- <bean id="loggingPlugin" class="org.openecomp.mso.bpmn.core.plugins.LoggingAndURNMappingPlugin" />
-
- <!-- Needed until all subflows generate MSOWorkflowException events -->
- <bean id="workflowExceptionPlugin" class="org.openecomp.mso.bpmn.core.plugins.WorkflowExceptionPlugin" />
-
- <!--<bean id="uuidGenerator" class="org.camunda.bpm.engine.impl.persistence.StrongUuidGenerator" />-->
-
- <!-- engine plugin beans -->
- <bean id="connectProcessEnginePlugin" class="org.camunda.connect.plugin.impl.ConnectProcessEnginePlugin" />
- <bean id="spinProcessEnginePlugin" class="org.camunda.spin.plugin.impl.SpinProcessEnginePlugin" />
-
-</beans>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/log4j.properties b/bpmn/MSOInfrastructureBPMN/src/test/resources/log4j.properties deleted file mode 100644 index 393e0877ec..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/log4j.properties +++ /dev/null @@ -1,8 +0,0 @@ -# Root logger option -log4j.rootLogger=INFO, stdout - -# Direct log messages to stdout -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.Target=System.out -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/logging.properties b/bpmn/MSOInfrastructureBPMN/src/test/resources/logging.properties deleted file mode 100644 index 4941c55971..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/logging.properties +++ /dev/null @@ -1,2 +0,0 @@ -#register SLF4JBridgeHandler as handler for the j.u.l. root logger -handlers = org.slf4j.bridge.SLF4JBridgeHandler diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/mso.bpmn.properties b/bpmn/MSOInfrastructureBPMN/src/test/resources/mso.bpmn.properties deleted file mode 100644 index f800d00245..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/mso.bpmn.properties +++ /dev/null @@ -1,3 +0,0 @@ -# Default BPMN properties for unit tests - -URNMapping.FileSystemLoading.Enabled=true
\ No newline at end of file diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/mso.bpmn.urn.properties b/bpmn/MSOInfrastructureBPMN/src/test/resources/mso.bpmn.urn.properties deleted file mode 100644 index 6dac08dc56..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/mso.bpmn.urn.properties +++ /dev/null @@ -1,130 +0,0 @@ -# Default URN Mappings for unit tests
-
-mso.rollback=true
-
-canopi.auth=757A94191D685FD2092AC1490730A4FC
-csi.aots.addincidentmanagement.endpoint=http://localhost:28090/AddIncidentManagementTicketRequest
-csi.networkstatus.endpoint=http://localhost:28090/SendManagedNetworkStatusNotification
-mso.csi.pwd=4EA237303511EFBBC37F17A351562131
-mso.csi.usrname=mso
-mso.msoKey=07a7159d3bf51a0e53be7a8f89699be7
-
-mso.healthcheck.log.debug=false
-
-mso.adapters.completemsoprocess.endpoint=http://localhost:28090/CompleteMsoProcess
-mso.workflow.message.endpoint=http://localhost:8080/mso/WorkflowMessage
-mso.adapters.db.endpoint=http://localhost:28090/dbadapters/MsoRequestsDbAdapter
-mso.openecomp.adapters.db.endpoint=http://localhost:28090/dbadapters/RequestsDbAdapter
-mso.adapters.openecomp.db.endpoint=http://localhost:28090/dbadapters/RequestsDbAdapter
-mso.adapters.db.auth=757A94191D685FD2092AC1490730A4FC
-
-mso.adapters.network.endpoint=http://localhost:28090/networks/NetworkAdapter
-mso.adapters.network.rest.endpoint=http://localhost:28090/networks/NetworkAdapter
-
-mso.adapters.po.auth=757A94191D685FD2092AC1490730A4FC
-mso.adapters.po.password=3141634BF7E070AA289CF2892C986C0B
-mso.po.timeout=PT60S
-
-aai.auth=757A94191D685FD2092AC1490730A4FC
-
-mso.default.adapter.namespace=http://org.openecomp.mso
-mso.adapters.sdnc.endpoint=http://localhost:28090/SDNCAdapter
-mso.adapters.sdnc.rest.endpoint=http://localhost:28090/SDNCAdapter/v1/sdnc
-mso.adapters.sdnc.timeout=PT60S
-mso.sdnc.firewall.yang.model=http://com/openecomp/svc/mis/firewall-lite-gui
-mso.sdnc.firewall.yang.model.version=2015-05-15
-mso.sdnc.password=3141634BF7E070AA289CF2892C986C0B
-mso.sdnc.timeout.firewall.minutes=20
-mso.callbackRetryAttempts=5
-mso.sdnc.timeout=PT10S
-mso.sdnc.timeout.ucpe.async.hours=120
-mso.sdnc.timeout.ucpe.async.minutes=5
-mso.workflow.message.endpoint=http://localhost:28080/mso/WorkflowMesssage
-mso.workflow.sdncadapter.callback=http://localhost:28080/mso/SDNCAdapterCallbackService
-mso.workflow.sdnc.replication.delay=PT0.01S
-mso.workflow.aai.distribution.delay=PT0.01S
-
-mso.catalog.db.endpoint=http://localhost:28090
-
-mso.adapters.tenant.endpoint=http://localhost:28090/tenantAdapterMock
-mso.adapters.vnf-async.endpoint=http://localhost:28090/vnfs/VnfAdapterAsync
-mso.adapters.vnf.endpoint=http://localhost:28090/vnfs/VnfAdapter
-mso.adapters.vnf.rest.endpoint=http://localhost:28090/vnfs/v1/vnfs
-mso.workflow.vnfadapter.create.callback=http://localhost:28080/mso/vnfAdapterNotify
-mso.workflow.vnfadapter.delete.callback=http://localhost:28080/mso/vnfAdapterNotify
-mso.workflow.vnfadapter.query.callback=http://localhost:28080/mso/services/VNFAdapterQuerCallbackV1
-mso.workflow.vnfadapter.rollback.callback=http://localhost:28080/mso/vnfAdapterNotify
-mso.workflow.createvce.delay.seconds=1
-mso.infra.customer.id=testCustIdInfra
-
-aai.endpoint=http://localhost:28090
-
-# AAI version mappings
-
-# Example to override default version for a resource:
-#mso.workflow.default.aai.vce.version=6
-#mso.workflow.default.aai.v6.vce.uri=/aai/v6/network/vces/vce
-mso.workflow.global.default.aai.namespace=http://org.openecomp.aai.inventory/
-mso.workflow.global.default.aai.version=8
-mso.workflow.default.aai.cloud-region.version=9
-mso.workflow.default.aai.generic-vnf.version=9
-
-mso.workflow.default.aai.v9.cloud-region.uri=/aai/v9/cloud-infrastructure/cloud-regions/cloud-region/att-aic
-mso.workflow.default.aai.v8.customer.uri=/aai/v8/business/customers/customer
-mso.workflow.default.aai.v8.generic-query.uri=/aai/v8/search/generic-query
-mso.workflow.default.aai.v9.generic-vnf.uri=/aai/v9/network/generic-vnfs/generic-vnf
-mso.workflow.default.aai.v8.l3-network.uri=/aai/v8/network/l3-networks/l3-network
-mso.workflow.default.aai.v8.network-policy.uri=/aai/v8/network/network-policies/network-policy
-mso.workflow.default.aai.v8.nodes-query.uri=/aai/v8/search/nodes-query
-mso.workflow.default.aai.v8.route-table-reference.uri=/aai/v8/network/route-table-references/route-table-reference
-mso.workflow.default.aai.v8.tenant.uri=/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/tenants/tenant
-mso.workflow.default.aai.v8.vce.uri=/aai/v8/network/vces/vce
-mso.workflow.default.aai.v8.vpn-binding.uri=/aai/v8/network/vpn-bindings/vpn-binding
-mso.workflow.notification.name=GenericNotificationService
-
-log.debug.CompleteMsoProcess=true
-log.debug.CreateNetworkInstanceInfra=true
-log.debug.CreateServiceInstanceInfra=true
-log.debug.DeleteNetworkInstanceInfra=true
-log.debug.FalloutHandler=true
-log.debug.GenericGetService=true
-log.debug.sdncAdapter=true
-log.debug.UpdateNetworkInstanceInfra=true
-log.debug.VnfAdapterRestV1=true
-log.debug.CreateNetworkInstance=true
-log.debug.DoCreateNetworkInstance=true
-log.debug.DoCreateNetworkInstanceRollback=true
-log.debug.DeleteNetworkInstance=true
-log.debug.DoDeleteNetworkInstance=true
-log.debug.DoDeleteNetworkInstanceRollback=true
-log.debug.UpdateNetworkInstance=true
-log.debug.DoUpdateNetworkInstance=true
-log.debug.DoUpdateNetworkInstanceRollback=true
-log.debug.CreateVnfInfra=true
-log.debug.DoCreateVnf=true
-log.debug.CreateGenericALaCarteServiceInstance=true
-log.debug.DecomposeService=true
-log.debug.DoCreateServiceInstance=true
-log.debug.DoDeleteServiceInstance=true
-log.debug.VnfInPlaceUpdate=true
-
-policy.client.auth=Basic bTAzNzQzOnBvbGljeVIwY2sk
-policy.auth=Basic dGVzdHBkcDphbHBoYTEyMw==
-policy.environment=TEST
-policy.endpoint=http://localhost:28090/pdp/api/
-policy.default.disposition=Skip
-
-appc.client.topic.read=APPC-LCM-WRITE
-appc.client.topic.write=APPC-LCM-READ
-appc.client.topic.sdnc.read=SDNC-LCM-WRITE
-appc.client.topic.sdnc.write=SDNC-LCM-READ
-appc.client.topic.read.timeout=100
-appc.client.response.timeout=300
-appc.client.poolMembers=localhost:28090
-appc.client.key=iaEMAfjsVsZnraBP
-appc.client.secret=wcivUjsjXzmGFBfxMmyJu9dz
-#appc.client.service=ueb
-
-sdnc.si.sv.types=PORT-MIRROR,PPROBES
-mso.bpmn.optimisticlockingexception.retrycount=3
-
|