summaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2018-07-30 15:56:09 -0400
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2018-07-31 11:09:25 -0400
commit5a6a6de6f1a26a1897e4917a0df613e25a24eb70 (patch)
tree59a968f27b4b603aacc9d5e7b51fb598aeec5321 /bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp
parentb6dc38501f3b746426b42d9de4cc883d894149e8 (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/MSOCommonBPMN/src/test/groovy/org/openecomp')
-rw-r--r--bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/AaiUtilTest.groovy385
-rw-r--r--bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/CompleteMsoProcessTest.groovy170
-rw-r--r--bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/ExceptionUtilTest.groovy66
-rw-r--r--bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/FalloutHandlerTest.groovy312
-rw-r--r--bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/GenericPutServiceTest.groovy214
-rw-r--r--bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/MsoGroovyTest.groovy72
-rw-r--r--bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/MsoUtilsTest.groovy233
-rw-r--r--bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/NetworkUtilsTest.groovy97
-rw-r--r--bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/SDNCAdapterTest.groovy948
-rw-r--r--bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/SDNCAdapterUtilsTest.groovy213
-rw-r--r--bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/TrinityExceptionUtilTest.groovy201
-rw-r--r--bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/VidUtilsTest.groovy972
-rw-r--r--bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/VnfAdapterRestV1Test.groovy44
13 files changed, 0 insertions, 3927 deletions
diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/AaiUtilTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/AaiUtilTest.groovy
deleted file mode 100644
index b4b2b951b2..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/AaiUtilTest.groovy
+++ /dev/null
@@ -1,385 +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.common.scripts;
-
-import static org.junit.Assert.*;
-import static org.mockito.Mockito.*
-
-import org.openecomp.mso.rest.HttpHeader
-import org.mockito.MockitoAnnotations
-import org.mockito.runners.MockitoJUnitRunner
-import org.mockito.internal.debugging.MockitoDebuggerImpl
-import org.junit.Before
-import org.openecomp.mso.bpmn.common.scripts.AaiUtil;
-import org.junit.Rule;
-import org.junit.Test
-import org.junit.Ignore
-import org.junit.runner.RunWith
-import org.junit.Before;
-import org.junit.Test;
-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
-
-@RunWith(MockitoJUnitRunner.class)
-class AaiUtilTest extends MsoGroovyTest {
-
- @Test
- public void testGetVersionDefault() {
- ExecutionEntity mockExecution = setupMock('CreateAAIVfModule')
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn('8')
- CreateAAIVfModule myproc = new CreateAAIVfModule()
- AaiUtil aaiUtil = new AaiUtil(myproc)
- def version = aaiUtil.getVersion(mockExecution, 'l3-network', 'CreateAAIVfModule')
- assertEquals('8', version)
- }
-
- @Test
- public void testGetVersionResourceSpecific() {
- ExecutionEntity mockExecution = setupMock('CreateAAIVfModule')
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_l3_network_version")).thenReturn('7')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn('8')
- CreateAAIVfModule myproc = new CreateAAIVfModule()
- AaiUtil aaiUtil = new AaiUtil(myproc)
- def version = aaiUtil.getVersion(mockExecution, 'l3-network', 'CreateAAIVfModule')
- assertEquals('7', version)
- }
-
- @Test
- public void testGetVersionFlowSpecific() {
- ExecutionEntity mockExecution = setupMock('CreateAAIVfModule')
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- when(mockExecution.getVariable("URN_mso_workflow_custom_CreateAAIVfModule_aai_version")).thenReturn('6')
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_l3_network_version")).thenReturn('7')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn('8')
- CreateAAIVfModule myproc = new CreateAAIVfModule()
- AaiUtil aaiUtil = new AaiUtil(myproc)
- def version = aaiUtil.getVersion(mockExecution, 'l3-network', 'CreateAAIVfModule')
- assertEquals('6', version)
- }
-
- @Test(expected=java.lang.Exception.class)
- public void testGetVersionNotDefined() {
- ExecutionEntity mockExecution = setupMock('CreateAAIVfModule')
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- CreateAAIVfModule myproc = new CreateAAIVfModule()
- AaiUtil aaiUtil = new AaiUtil(myproc)
- def version = aaiUtil.getVersion(mockExecution, 'l3-network', 'CreateAAIVfModule')
- }
-
- @Test
- public void testGetUriDefaultVersion() {
- ExecutionEntity mockExecution = setupMock('CreateAAIVfModule')
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_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_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
-
- CreateAAIVfModule myproc = new CreateAAIVfModule()
- AaiUtil aaiUtil = new AaiUtil(myproc)
- def uri = aaiUtil.getUri(mockExecution, 'l3-network')
- assertEquals('/aai/v8/network/l3-networks/l3-network', uri)
- }
-
- @Test
- public void testGetUriFlowAndResourceSpecific() {
- ExecutionEntity mockExecution = setupMock('CreateAAIVfModule')
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- when(mockExecution.getVariable("URN_mso_workflow_CreateAAIVfModule_aai_l3_network_uri")).thenReturn('/aai/v6/network/l3-networks/l3-network')
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_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_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
-
- CreateAAIVfModule myproc = new CreateAAIVfModule()
- AaiUtil aaiUtil = new AaiUtil(myproc)
- def uri = aaiUtil.getUri(mockExecution, 'l3-network')
- assertEquals('/aai/v6/network/l3-networks/l3-network', uri)
- }
-
- @Test
- public void testGetNetworkGenericVnfEndpoint() {
- ExecutionEntity mockExecution = setupMock('CreateAAIVfModule')
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn('8')
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_generic_vnf_uri")).thenReturn('/aai/v8/network/generic-vnfs/generic-vnf')
- when(mockExecution.getVariable('URN_aai_endpoint')).thenReturn('http://localhost:28090')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
-
- CreateAAIVfModule myproc = new CreateAAIVfModule()
- AaiUtil aaiUtil = new AaiUtil(myproc)
- def endpoint = aaiUtil.getNetworkGenericVnfEndpoint(mockExecution)
- assertEquals('http://localhost:28090/aai/v8/network/generic-vnfs/generic-vnf', endpoint)
- }
-
- @Test
- public void testGetNetworkGenericVnfUri() {
- ExecutionEntity mockExecution = setupMock('CreateAAIVfModule')
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn('8')
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_generic_vnf_uri")).thenReturn('/aai/v8/network/generic-vnfs/generic-vnf')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
-
- CreateAAIVfModule myproc = new CreateAAIVfModule()
- AaiUtil aaiUtil = new AaiUtil(myproc)
- def uri = aaiUtil.getNetworkGenericVnfUri(mockExecution)
- assertEquals('/aai/v8/network/generic-vnfs/generic-vnf', uri)
- }
-
- @Test
- public void testGetNetworkVpnBindingUri() {
- ExecutionEntity mockExecution = setupMock('CreateAAIVfModule')
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- 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("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
-
- CreateAAIVfModule myproc = new CreateAAIVfModule()
- AaiUtil aaiUtil = new AaiUtil(myproc)
- def uri = aaiUtil.getNetworkVpnBindingUri(mockExecution)
- assertEquals('/aai/v8/network/vpn-bindings/vpn-binding', uri)
- }
-
- @Test
- public void testGetNetworkPolicyUri() {
- ExecutionEntity mockExecution = setupMock('CreateAAIVfModule')
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- 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("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
-
- CreateAAIVfModule myproc = new CreateAAIVfModule()
- AaiUtil aaiUtil = new AaiUtil(myproc)
- def uri = aaiUtil.getNetworkPolicyUri(mockExecution)
- assertEquals('/aai/v8/network/network-policies/network-policy', uri)
- }
-
- @Test
- public void testGetNetworkTableReferencesUri() {
- ExecutionEntity mockExecution = setupMock('CreateAAIVfModule')
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn('8')
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_route_table_reference_uri")).thenReturn('/aai/v8/network/route-table-references/route-table-reference')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
-
- CreateAAIVfModule myproc = new CreateAAIVfModule()
- AaiUtil aaiUtil = new AaiUtil(myproc)
- def uri = aaiUtil.getNetworkTableReferencesUri(mockExecution)
- assertEquals('/aai/v8/network/route-table-references/route-table-reference', uri)
- }
-
- @Test
- public void testGetNetworkVceUri() {
- ExecutionEntity mockExecution = setupMock('CreateAAIVfModule')
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn('8')
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_vce_uri")).thenReturn('/aai/v8/network/vces/vce')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
-
- CreateAAIVfModule myproc = new CreateAAIVfModule()
- AaiUtil aaiUtil = new AaiUtil(myproc)
- def uri = aaiUtil.getNetworkVceUri(mockExecution)
- assertEquals('/aai/v8/network/vces/vce', uri)
- }
-
- @Test
- public void testGetNetworkL3NetworkUri() {
- ExecutionEntity mockExecution = setupMock('CreateAAIVfModule')
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- 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("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
-
- CreateAAIVfModule myproc = new CreateAAIVfModule()
- AaiUtil aaiUtil = new AaiUtil(myproc)
- def uri = aaiUtil.getNetworkL3NetworkUri(mockExecution)
- assertEquals('/aai/v8/network/l3-networks/l3-network', uri)
- }
-
- @Test
- public void testGetBusinessCustomerUri() {
- ExecutionEntity mockExecution = setupMock('CreateAAIVfModule')
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn('8')
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_customer_uri")).thenReturn('/aai/v8/business/customers/customer')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
-
- CreateAAIVfModule myproc = new CreateAAIVfModule()
- AaiUtil aaiUtil = new AaiUtil(myproc)
- def uri = aaiUtil.getBusinessCustomerUri(mockExecution)
- assertEquals('/aai/v8/business/customers/customer', uri)
- }
-
- @Test
- public void testGetCloudInfrastructureCloudRegionEndpoint() {
- ExecutionEntity mockExecution = setupMock('CreateAAIVfModule')
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- 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_aai_endpoint')).thenReturn('http://localhost:28090')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
-
- CreateAAIVfModule myproc = new CreateAAIVfModule()
- AaiUtil aaiUtil = new AaiUtil(myproc)
- def uri = aaiUtil.getCloudInfrastructureCloudRegionEndpoint(mockExecution)
- assertEquals('http://localhost:28090/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic', uri)
- }
-
- @Test
- public void testGetCloudInfrastructureCloudRegionUri() {
- ExecutionEntity mockExecution = setupMock('CreateAAIVfModule')
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- 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/')
-
- CreateAAIVfModule myproc = new CreateAAIVfModule()
- AaiUtil aaiUtil = new AaiUtil(myproc)
- def uri = aaiUtil.getCloudInfrastructureCloudRegionUri(mockExecution)
- assertEquals('/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic', uri)
- }
-
- @Test
- public void testGetCloudInfrastructureTenantUri() {
- ExecutionEntity mockExecution = setupMock('CreateAAIVfModule')
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn('8')
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_tenant_uri")).thenReturn('/aai/v8/cloud-infrastructure/tenants/tenant')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
-
- CreateAAIVfModule myproc = new CreateAAIVfModule()
- AaiUtil aaiUtil = new AaiUtil(myproc)
- def uri = aaiUtil.getCloudInfrastructureTenantUri(mockExecution)
- assertEquals('/aai/v8/cloud-infrastructure/tenants/tenant', uri)
- }
-
- @Test
- public void testGetSearchNodesQueryUri() {
- ExecutionEntity mockExecution = setupMock('CreateAAIVfModule')
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn('8')
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_nodes_query_uri")).thenReturn('/aai/v8/search/nodes-query')
- when(mockExecution.getVariable('URN_aai_endpoint')).thenReturn('http://localhost:28090')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
-
- CreateAAIVfModule myproc = new CreateAAIVfModule()
- AaiUtil aaiUtil = new AaiUtil(myproc)
- def uri = aaiUtil.getSearchNodesQueryUri(mockExecution)
- assertEquals('/aai/v8/search/nodes-query', uri)
- }
-
- @Test
- public void testGetSearchNodesQueryEndpoint() {
- ExecutionEntity mockExecution = setupMock('CreateAAIVfModule')
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn('8')
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_nodes_query_uri")).thenReturn('/aai/v8/search/nodes-query')
- when(mockExecution.getVariable('URN_aai_endpoint')).thenReturn('http://localhost:28090')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
-
- CreateAAIVfModule myproc = new CreateAAIVfModule()
- AaiUtil aaiUtil = new AaiUtil(myproc)
- def uri = aaiUtil.getSearchNodesQueryEndpoint(mockExecution)
- assertEquals('http://localhost:28090/aai/v8/search/nodes-query', uri)
- }
-
- @Test
- public void testGetSearchGenericQueryUri() {
- ExecutionEntity mockExecution = setupMock('CreateAAIVfModule')
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn('8')
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v8_generic_query_uri")).thenReturn('/aai/v8/search/generic-query')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
-
- CreateAAIVfModule myproc = new CreateAAIVfModule()
- AaiUtil aaiUtil = new AaiUtil(myproc)
- def uri = aaiUtil.getSearchGenericQueryUri(mockExecution)
- assertEquals('/aai/v8/search/generic-query', uri)
- }
-
- @Test
- public void testGetNamespaceFromUri() {
- ExecutionEntity mockExecution = setupMock('CreateAAIVfModule')
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn('6')
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v6_l3_network_uri")).thenReturn('/aai/v6/network/l3-networks/l3-network')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- CreateAAIVfModule myproc = new CreateAAIVfModule()
- AaiUtil aaiUtil = new AaiUtil(myproc)
- def uri = aaiUtil.getNetworkL3NetworkUri(mockExecution) // Required to populate the namespace in the class
- def ns = aaiUtil.getNamespaceFromUri('/aai/v6/search/generic-query')
- assertEquals('http://org.openecomp.aai.inventory/v6', ns)
- }
-
- @Test
- public void testGetNamespaceFromUri2() {
- ExecutionEntity mockExecution = setupMock('DeleteVfModuleVolumeInfraV1')
- //
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn('10')
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v10_l3_network_uri")).thenReturn('/aai/v10/network/l3-networks/l3-network')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- //
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- CreateAAIVfModule myproc = new CreateAAIVfModule()
- AaiUtil aaiUtil = new AaiUtil(myproc)
- def uri = aaiUtil.getNetworkL3NetworkUri(mockExecution) // Required to populate the namespace in the class
- def ns = aaiUtil.getNamespaceFromUri('/aai/v10/search/generic-query')
- assertEquals('http://org.openecomp.aai.inventory/v10', ns)
- }
-
- @Test
- public void testGetNamespaceFromUri3() {
- ExecutionEntity mockExecution = setupMock('DeleteVfModuleVolumeInfraV1')
- //
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn('100')
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v100_l3_network_uri")).thenReturn('/aai/v100/network/l3-networks/l3-network')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- //
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- CreateAAIVfModule myproc = new CreateAAIVfModule()
- AaiUtil aaiUtil = new AaiUtil(myproc)
- def uri = aaiUtil.getNetworkL3NetworkUri(mockExecution) // Required to populate the namespace in the class
- def ns = aaiUtil.getNamespaceFromUri('/aai/v100/search/generic-query')
- assertEquals('http://org.openecomp.aai.inventory/v100', ns)
- }
-
- @Test
- public void testGetNamespaceFromUri_twoArguments() { // (execution, uri)
- ExecutionEntity mockExecution = setupMock('DeleteVfModuleVolumeInfraV1')
- //
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn('10')
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v10_l3_network_uri")).thenReturn('/aai/v10/network/l3-networks/l3-network')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- //
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- CreateAAIVfModule myproc = new CreateAAIVfModule()
- AaiUtil aaiUtil = new AaiUtil(myproc)
- def ns = aaiUtil.getNamespaceFromUri(mockExecution,'/aai/v10/search/generic-query')
- assertEquals('http://org.openecomp.aai.inventory/v10', ns)
- }
-}
diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/CompleteMsoProcessTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/CompleteMsoProcessTest.groovy
deleted file mode 100644
index 5949c3af53..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/CompleteMsoProcessTest.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.common.scripts
-
-import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.mockito.ArgumentCaptor
-import org.mockito.MockitoAnnotations
-import org.mockito.runners.MockitoJUnitRunner
-import org.openecomp.mso.bpmn.core.WorkflowException
-
-import static org.assertj.core.api.Assertions.assertThat
-import static org.assertj.core.api.Assertions.assertThatThrownBy
-import static org.mockito.Matchers.eq
-import static org.mockito.Mockito.*
-
-@RunWith(MockitoJUnitRunner.class)
-class CompleteMsoProcessTest {
- @Before
- public void init() {
- MockitoAnnotations.initMocks(this)
- }
-
- private String completeMsoProcessRequest = """
- <sdncadapterworkflow:MsoCompletionRequest xmlns:ns="http://org.openecomp/mso/request/types/v1" xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1">
- <ns:request-information>
- <ns:request-id>uCPE1020_STUW105_5002</ns:request-id>
- <ns:request-action>Layer3ServiceActivateRequest</ns:request-action>
- <ns:request-sub-action>COMPLETE</ns:request-sub-action>
- <ns:source>OMX</ns:source>
- <ns:notification-url>http://localhost:28090/CCD/StatusNotification</ns:notification-url>
- <ns:order-number>10205000</ns:order-number>
- <ns:order-version>1</ns:order-version>
- </ns:request-information>
- <sdncadapterworkflow:mso-bpel-name>UCPELayer3ServiceActivateV1</sdncadapterworkflow:mso-bpel-name>
- </sdncadapterworkflow:MsoCompletionRequest>
- """
-
- @Test
- public void testPreProcessRequest() {
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getVariable("CompleteMsoProcessRequest")).thenReturn(completeMsoProcessRequest)
- when(mockExecution.getVariable("URN_mso_adapters_db_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC");
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7");
-
- CompleteMsoProcess completeMsoProcess = new CompleteMsoProcess()
- completeMsoProcess.preProcessRequest(mockExecution)
-
- /* Initialize all the process request variables in this block */
- verify(mockExecution).setVariable("prefix","CMSO_")
- //verify(mockExecution).setVariable("getLayer3ServiceDetailsV1Response","")
- verify(mockExecution).setVariable("CMSO_request_id","")
- verify(mockExecution).setVariable("CMSO_notification-url","")
- verify(mockExecution).setVariable("CMSO_mso-bpel-name","")
- verify(mockExecution).setVariable("CMSO_request_action","")
-
- verify(mockExecution).setVariable("CMSO_notification-url-Ok", false)
- verify(mockExecution).setVariable("CMSO_request_id-Ok", false)
-
- //updateRequest Adapter process variables
- verify(mockExecution).setVariable("CMSO_updateRequestResponse", "")
- verify(mockExecution).setVariable("CMSO_updateRequestResponseCode", "")
- verify(mockExecution).setVariable("CMSO_updateFinalNotifyAckStatusFailedPayload", "")
-
- //Set DB adapter variables here
- verify(mockExecution).setVariable("CMSO_updateDBStatusToSuccessPayload", "")
- verify(mockExecution).setVariable("CMSO_updateInfraRequestDBPayload", "")
- verify(mockExecution).setVariable("CMSO_setUpdateDBstatustoSuccessPayload", "")
-
- //Auth variables
- verify(mockExecution).setVariable("BasicAuthHeaderValue","")
-
- //Response variables
- verify(mockExecution).setVariable("CompletionHandlerResponse","")
- verify(mockExecution).setVariable("CMSO_ErrorResponse", null)
- verify(mockExecution).setVariable("CMSO_ResponseCode", "")
-
- verify(mockExecution).setVariable("CMSO_notification-url-Ok",true)
- verify(mockExecution).setVariable("CMSO_request_id-Ok",true)
- verify(mockExecution).setVariable("CMSO_notification-url","http://localhost:28090/CCD/StatusNotification")
- verify(mockExecution).setVariable("CMSO_request_id","uCPE1020_STUW105_5002")
- verify(mockExecution).setVariable("CMSO_request_action","Layer3ServiceActivateRequest")
- verify(mockExecution).setVariable("CMSO_source","OMX")
-
- }
-
- private String setUpdateDBstatustoSuccessPayload = """
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:req="http://org.openecomp.mso/requestsdb">
- <soapenv:Header/>
- <soapenv:Body>
- <req:updateInfraRequest>
- <requestId>testReqId</requestId>
- <lastModifiedBy>BPEL</lastModifiedBy>
- <statusMessage>Resource Completed Successfully</statusMessage>
- <requestStatus>COMPLETE</requestStatus>
- <progress>100</progress>
-
- </req:updateInfraRequest>
- </soapenv:Body>
- </soapenv:Envelope>"""
-
- @Test
- public void testsetUpdateDBstatustoSuccessPayload(){
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getVariable("CMSO_request_id")).thenReturn("testReqId")
- when(mockExecution.getVariable("CMSO_mso-bpel-name")).thenReturn("BPEL")
- when(mockExecution.getVariable("URN_mso_adapters_db_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC");
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7");
-
- CompleteMsoProcess completeMsoProcess = new CompleteMsoProcess()
- completeMsoProcess.setUpdateDBstatustoSuccessPayload(mockExecution)
-
- verify(mockExecution).setVariable("CMSO_setUpdateDBstatustoSuccessPayload",setUpdateDBstatustoSuccessPayload)
- }
-
- private String msoCompletionResponse = """onse xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1">
- <sdncadapterworkflow:out>BPEL BPEL-NAME FAILED</sdncadapterworkflow:out>
-</sdncadapterworkflow:MsoCompletionResponse>"""
-
-/*
- private String msoCompletionResponse = """<sdncadapterworkflow:MsoCompletionResponse xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1">
- <sdncadapterworkflow:out>BPEL BPEL-NAME FAILED</sdncadapterworkflow:out>
-</sdncadapterworkflow:MsoCompletionResponse>"""
-*/
- @Test
- void testBuildDataError() {
- // given
- def message = "Some-Message"
-
- def mockExecution = mock ExecutionEntity.class
- when mockExecution.getVariable("CMSO_mso-bpel-name") thenReturn "BPEL-NAME"
- when mockExecution.getVariable("testProcessKey") thenReturn "CompleteMsoProcess"
-
- def completeMsoProcess = new CompleteMsoProcess()
- // when
- assertThatThrownBy { completeMsoProcess.buildDataError(mockExecution, message) } isInstanceOf BpmnError
- // then
- verify mockExecution setVariable("CompleteMsoProcessResponse", msoCompletionResponse)
- def argumentCaptor = ArgumentCaptor.forClass WorkflowException.class
- verify mockExecution setVariable(eq("WorkflowException"), argumentCaptor.capture())
- def capturedException = argumentCaptor.value
-
- assertThat capturedException.processKey isEqualTo "CompleteMsoProcess"
- assertThat capturedException.errorCode isEqualTo 500
- assertThat capturedException.errorMessage isEqualTo message
- }
-} \ No newline at end of file
diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/ExceptionUtilTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/ExceptionUtilTest.groovy
deleted file mode 100644
index 95272c22af..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/ExceptionUtilTest.groovy
+++ /dev/null
@@ -1,66 +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.common.scripts
-
-import org.junit.Assert
-import org.junit.runner.RunWith;
-import org.mockito.runners.MockitoJUnitRunner;
-
-
-import org.junit.Ignore;
-
-import static org.mockito.Mockito.*
-
-import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
-import org.junit.Before
-import org.junit.runner.RunWith
-import org.mockito.MockitoAnnotations
-import org.mockito.internal.debugging.MockitoDebuggerImpl
-import org.mockito.runners.MockitoJUnitRunner
-import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil;
-@RunWith(MockitoJUnitRunner.class)
-import org.junit.Test
-
-
-
-class ExceptionUtilTest {
-
-
- @Before
- public void init()
- {
- MockitoAnnotations.initMocks(this)
- }
-
- @Test
- public void testMapErrorCode5010(){
- String msg = "Connect to njcdtl20ew2988:8070 failed: Connection refused: connect"
- ExceptionUtil util = new ExceptionUtil()
- Assert.assertEquals("5010",util.MapErrorCode(msg))
- }
-
- @Test
- public void testMapErrorCode5020(){
- String msg = "Connection timed out"
- ExceptionUtil util = new ExceptionUtil()
- Assert.assertEquals("5020",util.MapErrorCode(msg))
- }
-}
diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/FalloutHandlerTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/FalloutHandlerTest.groovy
deleted file mode 100644
index 730b44065d..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/FalloutHandlerTest.groovy
+++ /dev/null
@@ -1,312 +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.common.scripts
-
-import org.junit.runner.RunWith;
-import static org.mockito.Mockito.*
-import static org.junit.Assert.*;
-
-import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.mockito.ArgumentCaptor;
-import org.mockito.MockitoAnnotations
-import org.mockito.runners.MockitoJUnitRunner
-import org.openecomp.mso.bpmn.common.scripts.MsoUtils;
-import org.openecomp.mso.bpmn.common.scripts.FalloutHandler;
-
-@RunWith(MockitoJUnitRunner.class)
-class FalloutHandlerTest {
-
- public MsoUtils utils = new MsoUtils()
-
- @Before
- public void init() {
- MockitoAnnotations.initMocks(this)
- }
-
- private String falloutHandlerRequest = """
- <sdncadapterworkflow:FalloutHandlerRequest xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1" xmlns:ns7="http://org.openecomp/mso/request/types/v1">
- <ns7:request-information>
- <ns7:request-id>uCPE1020_STUW105_5002</ns7:request-id>
- <ns7:request-action>Layer3ServiceActivateRequest</ns7:request-action>
- <ns7:request-sub-action>CANCEL</ns7:request-sub-action>
- <ns7:source>OMX</ns7:source>
- <ns7:order-number>10205000</ns7:order-number>
- <ns7:order-version>1</ns7:order-version>
- </ns7:request-information>
- <sdncadapterworkflow:WorkflowException>
- <sdncadapterworkflow:ErrorMessage>Some Error Message - Fallout Handler</sdncadapterworkflow:ErrorMessage>
- <sdncadapterworkflow:ErrorCode>Some Error Code - Fallout Handler</sdncadapterworkflow:ErrorCode>
- <sdncadapterworkflow:SourceSystemErrorCode>Some Source System Error Code- Fallout Handler</sdncadapterworkflow:SourceSystemErrorCode>
- </sdncadapterworkflow:WorkflowException>
- </sdncadapterworkflow:FalloutHandlerRequest>
- """
-
- private String falloutHandlerResponse = """<workflow:FalloutHandlerResponse xmlns:workflow="http://org.openecomp/mso/workflow/schema/v1">
- <workflow:out>Fallout Handler Failed</workflow:out>
-</workflow:FalloutHandlerResponse>"""
-
- @Test
- public void testPreProcessRequest() {
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
-
- when(mockExecution.getVariable("FalloutHandlerRequest")).thenReturn(falloutHandlerRequest)
- when(mockExecution.getVariable("URN_mso_adapters_db_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC");
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7");
-
- FalloutHandler falloutHandler = new FalloutHandler()
- falloutHandler.preProcessRequest(mockExecution)
-
- /* Initialize all the process request variables in this block */
- verify(mockExecution).setVariable("prefix","FH_")
- //verify(mockExecution).setVariable("getLayer3ServiceDetailsV1Response","")
-
- //These variables are form the input Message to the BPMN
- verify(mockExecution).setVariable("FH_request_id","")
- verify(mockExecution).setVariable("FH_request_action","")
- verify(mockExecution).setVariable("FH_notification-url","")
- verify(mockExecution).setVariable("FH_mso-bpel-name","")
- verify(mockExecution).setVariable("FH_ErrorCode", "")
- verify(mockExecution).setVariable("FH_ErrorMessage", "")
-
- verify(mockExecution).setVariable("FH_notification-url-Ok", false)
- verify(mockExecution).setVariable("FH_request_id-Ok", false)
-
- //These variables are for Get Mso Aai Password Adapter
- verify(mockExecution).setVariable("FH_deliveryStatus", true)
-
- //update Response Status to pending ...Adapter variables
- verify(mockExecution).setVariable("FH_updateResponseStatusPayload", null)
- verify(mockExecution).setVariable("FH_updateResponseStatusResponse", null)
-
- //update Request Gamma ...Adapter variables
- verify(mockExecution).setVariable("FH_updateRequestGammaPayload", "")
- verify(mockExecution).setVariable("FH_updateRequestGammaResponse", null)
- verify(mockExecution).setVariable("FH_updateRequestGammaResponseCode", null)
-
- //update Request Infra ...Adapter variables
- verify(mockExecution).setVariable("FH_updateRequestInfraPayload", "")
- verify(mockExecution).setVariable("FH_updateRequestInfraResponse", null)
- verify(mockExecution).setVariable("FH_updateRequestInfraResponseCode", null)
-
- //assign False to success variable
- verify(mockExecution).setVariable("FH_success", true)
-
- //Set notify status to Failed variable
- verify(mockExecution).setVariable("FH_NOTIFY_STATUS", "SUCCESS")
-
- //Set DB update variable
- verify(mockExecution).setVariable("FH_updateRequestPayload", "")
- verify(mockExecution).setVariable("FH_updateRequestResponse", null)
- verify(mockExecution).setVariable("FH_updateRequestResponseCode", null)
-
- //Auth variables
- verify(mockExecution).setVariable("BasicAuthHeaderValue","")
-
- //Response variables
- verify(mockExecution).setVariable("FalloutHandlerResponse","")
- verify(mockExecution).setVariable("FH_ErrorResponse", null)
- verify(mockExecution).setVariable("FH_ResponseCode", "")
-
- verify(mockExecution).setVariable("FH_request_id-Ok",true)
- verify(mockExecution).setVariable("FH_request_id","uCPE1020_STUW105_5002")
- verify(mockExecution).setVariable("FH_request_action","Layer3ServiceActivateRequest")
- verify(mockExecution).setVariable("FH_source","OMX")
- verify(mockExecution).setVariable("FH_ErrorCode","Some Error Code - Fallout Handler")
- verify(mockExecution).setVariable("FH_ErrorMessage","Some Error Message - Fallout Handler")
-
- }
-
- @Test
- public void testpostProcessResponse(){
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
-
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("FH_success")).thenReturn(false)
-
- FalloutHandler falloutHandler = new FalloutHandler()
- falloutHandler.postProcessResponse(mockExecution)
-
- // Capture the arguments to setVariable
- ArgumentCaptor<String> captor1 = ArgumentCaptor.forClass(String.class);
- ArgumentCaptor<String> captor2 = ArgumentCaptor.forClass(String.class);
-
- verify(mockExecution, times(4)).setVariable(captor1.capture(), captor2.capture())
- List<String> arg2List = captor2.getAllValues()
- String payloadResponseActual = arg2List.get(1)
-
- assertEquals(falloutHandlerResponse.replaceAll("\\s+", ""), payloadResponseActual.replaceAll("\\s+", ""))
-
- verify(mockExecution).setVariable("FH_ResponseCode","500")
- }
-
- private String updateRequestPayload = """
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:req="http://org.openecomp.mso/requestsdb">
- <soapenv:Header/>
- <soapenv:Body>
- <req:updateRequest>
- <requestId>testReqId</requestId>
- <lastModifiedBy>BPEL</lastModifiedBy>
- <finalErrorMessage>ErrorMessage</finalErrorMessage>
- <finalErrorCode>ErrorCode</finalErrorCode>
- <status>FAILED</status>
- <responseStatus>NotifyStatus</responseStatus>
- </req:updateRequest>
- </soapenv:Body>
- </soapenv:Envelope>
- """
-
- @Test
- public void testupdateRequestPayload(){
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getVariable("FH_request_id")).thenReturn("testReqId")
- when(mockExecution.getVariable("FH_ErrorMessage")).thenReturn("ErrorMessage")
- when(mockExecution.getVariable("FH_ErrorCode")).thenReturn("ErrorCode")
- when(mockExecution.getVariable("FH_NOTIFY_STATUS")).thenReturn("NotifyStatus")
-
- FalloutHandler falloutHandler = new FalloutHandler()
- falloutHandler.updateRequestPayload(mockExecution)
-
- // Capture the arguments to setVariable
- ArgumentCaptor<String> captor1 = ArgumentCaptor.forClass(String.class);
- ArgumentCaptor<String> captor2 = ArgumentCaptor.forClass(String.class);
-
- verify(mockExecution, times(1)).setVariable(captor1.capture(), captor2.capture())
- List<String> arg2List = captor2.getAllValues()
- String payloadRequestActual = arg2List.get(0)
-
- assertEquals(updateRequestPayload.replaceAll("\\s+", ""), payloadRequestActual.replaceAll("\\s+", ""))
- }
-
- private String updateRequestInfraPayload = """
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:req="http://org.openecomp.mso/requestsdb">
- <soapenv:Header/>
- <soapenv:Body>
- <req:updateInfraRequest>
- <requestId>testReqId</requestId>
- <lastModifiedBy>BPEL</lastModifiedBy>
- <statusMessage>ErrorMessage</statusMessage>
- <requestStatus>FAILED</requestStatus>
- <progress>100</progress>
- </req:updateInfraRequest>
- </soapenv:Body>
- </soapenv:Envelope>
- """
-
- @Test
- public void testupdateRequestInfraPayload(){
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getVariable("FH_request_id")).thenReturn("testReqId")
- when(mockExecution.getVariable("FH_ErrorMessage")).thenReturn("ErrorMessage")
-
- FalloutHandler falloutHandler = new FalloutHandler()
- falloutHandler.updateRequestInfraPayload(mockExecution)
-
- // Capture the arguments to setVariable
- ArgumentCaptor<String> captor1 = ArgumentCaptor.forClass(String.class);
- ArgumentCaptor<String> captor2 = ArgumentCaptor.forClass(String.class);
-
- verify(mockExecution, times(1)).setVariable(captor1.capture(), captor2.capture())
- List<String> arg2List = captor2.getAllValues()
- String payloadRequestActual = arg2List.get(0)
-
- assertEquals(updateRequestInfraPayload.replaceAll("\\s+", ""), payloadRequestActual.replaceAll("\\s+", ""))
- }
-
- private String updateRequestGammaPayload = """
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:req="http://org.openecomp.mso/requestsdb">
- <soapenv:Header/>
- <soapenv:Body>
- <req:updateRequest>
- <requestId>testReqId</requestId>
- <lastModifiedBy>BPEL</lastModifiedBy>
- <finalErrorMessage>ErrorMessage</finalErrorMessage>
- <finalErrorCode>ErrorCode</finalErrorCode>
- <status>FAILED</status>
- </req:updateRequest>
- </soapenv:Body>
- </soapenv:Envelope>
- """
-
- @Test
- public void testupdateRequestGammaPayload(){
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getVariable("FH_request_id")).thenReturn("testReqId")
- when(mockExecution.getVariable("FH_ErrorMessage")).thenReturn("ErrorMessage")
- when(mockExecution.getVariable("FH_ErrorCode")).thenReturn("ErrorCode")
- when(mockExecution.getVariable("URN_mso_default_adapter_namespace")).thenReturn("http://org.openecomp.mso");
-
- FalloutHandler falloutHandler = new FalloutHandler()
- falloutHandler.updateRequestGammaPayload(mockExecution)
-
- // Capture the arguments to setVariable
- ArgumentCaptor<String> captor1 = ArgumentCaptor.forClass(String.class);
- ArgumentCaptor<String> captor2 = ArgumentCaptor.forClass(String.class);
-
- verify(mockExecution, times(1)).setVariable(captor1.capture(), captor2.capture())
- List<String> arg2List = captor2.getAllValues()
- String payloadRequestActual = arg2List.get(0)
-
- assertEquals(updateRequestGammaPayload.replaceAll("\\s+", ""), payloadRequestActual.replaceAll("\\s+", ""))
- }
-
-
- String updateResponseStatusPayload = """
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:req="http://org.openecomp.mso/requestsdb">
- <soapenv:Header/>
- <soapenv:Body>
- <req:updateResponseStatus>
- <requestId>testReqId</requestId>
- <lastModifiedBy>BPEL</lastModifiedBy>
- <responseStatus>SENDING_FINAL_NOTIFY</responseStatus>
- </req:updateResponseStatus>
- </soapenv:Body>
- </soapenv:Envelope>
- """
-
- @Test
- public void testupdateResponseStatusPayload(){
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getVariable("FH_request_id")).thenReturn("testReqId")
-
- FalloutHandler falloutHandler = new FalloutHandler()
- falloutHandler.updateResponseStatusPayload(mockExecution)
-
- // Capture the arguments to setVariable
- ArgumentCaptor<String> captor1 = ArgumentCaptor.forClass(String.class);
- ArgumentCaptor<String> captor2 = ArgumentCaptor.forClass(String.class);
-
- verify(mockExecution, times(1)).setVariable(captor1.capture(), captor2.capture())
- List<String> arg2List = captor2.getAllValues()
- String payloadResponseActual = arg2List.get(0)
-
- assertEquals(updateResponseStatusPayload.replaceAll("\\s+", ""), payloadResponseActual.replaceAll("\\s+", ""))
- }
-
-} \ No newline at end of file
diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/GenericPutServiceTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/GenericPutServiceTest.groovy
deleted file mode 100644
index 1e7342de68..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/GenericPutServiceTest.groovy
+++ /dev/null
@@ -1,214 +0,0 @@
-package org.openecomp.mso.bpmn.common.scripts
-
-import static org.mockito.Mockito.*
-import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutServiceInstance;
-
-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.Ignore
-import org.junit.Rule
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.mockito.MockitoAnnotations
-import org.mockito.internal.debugging.MockitoDebuggerImpl
-import org.mockito.runners.MockitoJUnitRunner
-
-import com.github.tomakehurst.wiremock.client.WireMock
-import com.github.tomakehurst.wiremock.junit.WireMockRule
-import org.apache.commons.lang3.*
-
-@RunWith(MockitoJUnitRunner.class)
-class GenericPutServiceTest {
-
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(8090);
-
- @Before
- public void init()
- {
- MockitoAnnotations.initMocks(this)
-
- }
-
- @Test
- public void preProcessRequest() {
-
-
- println "************ preProcessRequest ************* "
-
- ExecutionEntity mockExecution = setupMock()
-
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("GENPS_globalSubscriberId")).thenReturn("1604-MVM-26")
- when(mockExecution.getVariable("GENPS_serviceInstanceId")).thenReturn("MIS%2F1604%2F0026%2FSW_INTERNET")
- when(mockExecution.getVariable("GENPS_serviceType")).thenReturn("SDN-ETHERNET-INTERNET")
- when(mockExecution.getVariable("GENPS_serviceInstanceData")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable("GENPS_type")).thenReturn("service-instance")
-
- GenericPutService putServiceInstance= new GenericPutService()
- putServiceInstance.preProcessRequest(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution, atLeast(1)).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", "GENPS_")
-
- // execution.getVariable("isDebugLogEnabled")
-
- verify(mockExecution).setVariable("GENPS_SuccessIndicator", false)
- // verify(mockExecution).setVariable("globalSubscriberId", "1604-MVM-26")
- // verify(mockExecution).setVariable("serviceInstanceId", "MIS%2F1604%2F0026%2FSW_INTERNET")
- // verify(mockExecution).setVariable("serviceType", "SDN-ETHERNET-INTERNET")
- // verify(mockExecution).setVariable("ServiceInstanceData", "f70e927b-6087-4974-9ef8-c5e4d5847ca4")
-
-
- }
-
-
- @Test
- @Ignore
- public void putServiceInstance() {
- println "************ putServiceInstance ************* "
-
- WireMock.reset();
-
- MockPutServiceInstance("1604-MVM-26", "SDN-ETHERNET-INTERNET", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericPutServiceInstance/GenericPutServiceInstance_PutServiceInstance_AAIResponse_Success.xml");
- ExecutionEntity mockExecution = setupMock()
-
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("GENPS_globalSubscriberId")).thenReturn("1604-MVM-26")
- when(mockExecution.getVariable("GENPS_serviceInstanceId")).thenReturn("MIS%2F1604%2F0026%2FSW_INTERNET")
- when(mockExecution.getVariable("GENPS_serviceType")).thenReturn("SDN-ETHERNET-INTERNET")
- when(mockExecution.getVariable("GENPS_serviceInstanceData")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("URN_mso_workflow_PutServiceInstance_aai_business_customer_uri")).thenReturn("/aai/v7/business/customers/customer")
- when(mockExecution.getVariable("GENPS_serviceInstanceData")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable("GENPS_type")).thenReturn("service-instance")
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("7")
- when(mockExecution.getVariable("URN_mso_workflow_default_aai_v7_customer_uri")).thenReturn("/aai/v7/business/customers/customer")
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- GenericPutService serviceInstance= new GenericPutService()
- serviceInstance.putServiceInstance(mockExecution)
-
- // check the sequence of variable invocation
- MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution, atLeast(1)).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", "GENPS_")
-
- // execution.getVariable("isDebugLogEnabled")
- // verify(mockExecution).setVariable("GENPSI_serviceInstanceData","f70e927b-6087-4974-9ef8-c5e4d5847ca4")
-
- String servicePayload = """<service-instance xmlns="http://org.openecomp.aai.inventory/v7">f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance>""" as String
- verify(mockExecution).setVariable("GENPS_serviceInstancePayload",servicePayload)
-
- String serviceAaiPath = "http://localhost:28090/aai/v7/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET"
- verify(mockExecution).setVariable("GENPS_putServiceInstanceAaiPath", serviceAaiPath)
-
- int responseCode = 200
- verify(mockExecution).setVariable("GENPS_putServiceInstanceResponseCode", responseCode)
-
- String aaiResponse = """<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>"""
-
- verify(mockExecution).setVariable("GENPS_putServiceInstanceResponse", aaiResponse)
-
- verify(mockExecution).setVariable("GENPS_SuccessIndicator", true)
- }
-
- @Test
- @Ignore
- public void putServiceInstance_404() {
-
-
- println "************ putServiceInstance ************* "
-
- WireMock.reset();
-
- ExecutionEntity mockExecution = setupMock()
-
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("GENPS_globalSubscriberId")).thenReturn("1604-MVM-26")
- when(mockExecution.getVariable("GENPS_serviceInstanceId")).thenReturn("MIS%2F1604%2F0026%2FSW_INTERNET")
- when(mockExecution.getVariable("GENPS_serviceType")).thenReturn("SDN-ETHERNET-INTERNET")
- when(mockExecution.getVariable("GENPS_ServiceInstanceData")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("URN_mso_workflow_PutServiceInstance_aai_business_customer_uri")).thenReturn("/aai/v7/business/customers/customer")
- when(mockExecution.getVariable("GENPS_ServiceInstanceData")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
-
- GenericPutService serviceInstance= new GenericPutService()
- serviceInstance.putServiceInstance(mockExecution)
-
- // check the sequence of variable invocation
- MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution, atLeast(1)).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", "GENPS_")
-
- // execution.getVariable("isDebugLogEnabled")
-
-
- verify(mockExecution).setVariable("GENPS_serviceInstanceData","f70e927b-6087-4974-9ef8-c5e4d5847ca4")
-
- String serviceInstancepayload = """<service-instance xmlns="http://org.openecomp.mso.aai.inventory/v7">f70e927b-6087-4974-9ef8-c5e4d5847ca4
- </service-instance>""" as String
- verify(mockExecution).setVariable("GENPS_serviceInstancePayload",serviceInstancepayload)
-
- String serviceInstanceAaiPath = "http://localhost:8090/aai/v7/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET"
- verify(mockExecution).setVariable("GENPS_putServiceInstanceAaiPath", serviceInstanceAaiPath)
-
- int responseCode = 404
- verify(mockExecution).setVariable("GENPS_putServiceInstanceResponseCode", responseCode)
-
- String aaiResponse = ""
- verify(mockExecution).setVariable("GENPS_putServiceInstanceResponse", aaiResponse)
-
- verify(mockExecution).setVariable("GENPS_SuccessIndicator", false)
-
-
- }
-
-
- private ExecutionEntity setupMock() {
-
- ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class)
- when(mockProcessDefinition.getKey()).thenReturn("PutServiceInstance")
- RepositoryService mockRepositoryService = mock(RepositoryService.class)
- when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition)
- when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("PutServiceInstance")
- 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("PutServiceInstance")
- when(mockExecution.getProcessInstanceId()).thenReturn("PutServiceInstance")
- 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/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/MsoGroovyTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/MsoGroovyTest.groovy
deleted file mode 100644
index 57055401f3..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/MsoGroovyTest.groovy
+++ /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.common.scripts
-
-import static org.mockito.Mockito.*
-
-import org.mockito.MockitoAnnotations
-import org.mockito.runners.MockitoJUnitRunner
-import org.mockito.internal.debugging.MockitoDebuggerImpl
-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
-
-abstract class MsoGroovyTest {
-
- protected ExecutionEntity setupMock(String procName) {
- ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class)
- when(mockProcessDefinition.getKey()).thenReturn(procName)
-
- RepositoryService mockRepositoryService = mock(RepositoryService.class)
- when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition)
- when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn(procName)
- when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100")
-
- ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class)
- when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService)
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices)
-
- return mockExecution
- }
-
- protected ExecutionEntity setupMockWithPrefix(String procName, String prefix) {
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
-
- when(mockExecution.getVariable("prefix")).thenReturn(prefix)
-
- ProcessEngineServices processEngineServices = mock(ProcessEngineServices.class)
- RepositoryService repositoryService = mock(RepositoryService.class)
- ProcessDefinition processDefinition = mock(ProcessDefinition.class)
-
- when(mockExecution.getProcessEngineServices()).thenReturn(processEngineServices)
- when(processEngineServices.getRepositoryService()).thenReturn(repositoryService)
- when(repositoryService.getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(processDefinition)
- when(processDefinition.getKey()).thenReturn(procName)
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- return mockExecution
- }
-
-
-}
diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/MsoUtilsTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/MsoUtilsTest.groovy
deleted file mode 100644
index 12e7855808..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/MsoUtilsTest.groovy
+++ /dev/null
@@ -1,233 +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.common.scripts
-
-// JUnit 4
-import org.junit.Test
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Rule;
-
-import static groovy.test.GroovyAssert.shouldFail
-import static groovy.test.GroovyAssert.assertTrue
-import static groovy.test.GroovyAssert.assertEquals
-
-import org.openecomp.mso.bpmn.common.scripts.MsoUtils;
-import org.apache.commons.lang3.*
-
-
-class MsoUtilsTest {
-
- def utils = new MsoUtils()
- def origXmlResponse = null
- // Expected rebuilds
- def expected_buildElements = "<tns2:internet-service-change-details><tns2:internet-evc-speed-value>10</tns2:internet-evc-speed-value><tns2:internet-evc-speed-units>Kbps</tns2:internet-evc-speed-units><tns2:t-provided-v4-lan-public-prefixes><tns2:request-index>1</tns2:request-index><tns2:v4-next-hop-address>192.168.1.15</tns2:v4-next-hop-address><tns2:v4-lan-public-prefix>192.168.1.15</tns2:v4-lan-public-prefix><tns2:v4-lan-public-prefix-length>28</tns2:v4-lan-public-prefix-length></tns2:t-provided-v4-lan-public-prefixes><tns2:t-provided-v4-lan-public-prefixes><tns2:request-index>2</tns2:request-index><tns2:v4-next-hop-address>192.168.1.16</tns2:v4-next-hop-address><tns2:v4-lan-public-prefix>192.168.1.16</tns2:v4-lan-public-prefix><tns2:v4-lan-public-prefix-length>28</tns2:v4-lan-public-prefix-length></tns2:t-provided-v4-lan-public-prefixes></tns2:internet-service-change-details>"
- def expected_rebuildDhcp = "<tns2:dhcp><tns2:v4-dhcp-server-enabled>Y</tns2:v4-dhcp-server-enabled><tns2:v6-dhcp-server-enabled>N</tns2:v6-dhcp-server-enabled><tns2:use-v4-default-pool>Y</tns2:use-v4-default-pool><tns2:excluded-v4-dhcp-addresses-from-default-pool><tns2:excluded-v4-address>192.168.1.7</tns2:excluded-v4-address></tns2:excluded-v4-dhcp-addresses-from-default-pool><tns2:excluded-v4-dhcp-addresses-from-default-pool><tns2:excluded-v4-address>192.168.1.8</tns2:excluded-v4-address></tns2:excluded-v4-dhcp-addresses-from-default-pool><tns2:v4-dhcp-pools><tns2:v4-dhcp-pool-prefix>192.155.2.3</tns2:v4-dhcp-pool-prefix><tns2:v4-dhcp-pool-prefix-length>28</tns2:v4-dhcp-pool-prefix-length><tns2:excluded-v4-addresses><tns2:excluded-v4-address>192.168.1.5</tns2:excluded-v4-address></tns2:excluded-v4-addresses><tns2:excluded-v4-addresses><tns2:excluded-v4-address>192.168.1.6</tns2:excluded-v4-address></tns2:excluded-v4-addresses><tns2:v4-dhcp-relay-gateway-address>2.2.2.1</tns2:v4-dhcp-relay-gateway-address><tns2:v4-dhcp-relay-next-hop-address>1.1.1.1</tns2:v4-dhcp-relay-next-hop-address></tns2:v4-dhcp-pools><tns2:v4-dhcp-pools><tns2:v4-dhcp-pool-prefix>192.155.2.4</tns2:v4-dhcp-pool-prefix><tns2:v4-dhcp-pool-prefix-length>28</tns2:v4-dhcp-pool-prefix-length><tns2:excluded-v4-addresses><tns2:excluded-v4-address>192.168.1.6</tns2:excluded-v4-address></tns2:excluded-v4-addresses><tns2:excluded-v4-addresses><tns2:excluded-v4-address>192.168.1.7</tns2:excluded-v4-address></tns2:excluded-v4-addresses><tns2:v4-dhcp-relay-gateway-address>2.2.2.2</tns2:v4-dhcp-relay-gateway-address><tns2:v4-dhcp-relay-next-hop-address>1.1.1.2</tns2:v4-dhcp-relay-next-hop-address></tns2:v4-dhcp-pools><tns2:use-v6-default-pool>N</tns2:use-v6-default-pool><tns2:excluded-v6-dhcp-addresses-from-default-pool><tns2:excluded-v6-address>1:5</tns2:excluded-v6-address></tns2:excluded-v6-dhcp-addresses-from-default-pool><tns2:excluded-v6-dhcp-addresses-from-default-pool><tns2:excluded-v6-address>1:6</tns2:excluded-v6-address></tns2:excluded-v6-dhcp-addresses-from-default-pool><tns2:v6-dhcp-pools><tns2:v6-dhcp-pool-prefix>0:0</tns2:v6-dhcp-pool-prefix><tns2:v6-dhcp-pool-prefix-length>28</tns2:v6-dhcp-pool-prefix-length><tns2:excluded-v6-addresses><tns2:excluded-v6-address>1:1</tns2:excluded-v6-address></tns2:excluded-v6-addresses><tns2:excluded-v6-addresses><tns2:excluded-v6-address>2:2</tns2:excluded-v6-address></tns2:excluded-v6-addresses><tns2:v6-dhcp-relay-gateway-address>3:3</tns2:v6-dhcp-relay-gateway-address><tns2:v6-dhcp-relay-next-hop-address>4:4</tns2:v6-dhcp-relay-next-hop-address></tns2:v6-dhcp-pools><tns2:v6-dhcp-pools><tns2:v6-dhcp-pool-prefix>0:0</tns2:v6-dhcp-pool-prefix><tns2:v6-dhcp-pool-prefix-length>28</tns2:v6-dhcp-pool-prefix-length><tns2:excluded-v6-addresses><tns2:excluded-v6-address>1:1</tns2:excluded-v6-address></tns2:excluded-v6-addresses><tns2:excluded-v6-addresses><tns2:excluded-v6-address>2:2</tns2:excluded-v6-address></tns2:excluded-v6-addresses><tns2:v6-dhcp-relay-gateway-address>3:3</tns2:v6-dhcp-relay-gateway-address><tns2:v6-dhcp-relay-next-hop-address>4:4</tns2:v6-dhcp-relay-next-hop-address></tns2:v6-dhcp-pools></tns2:dhcp>"
- def expected_rebuildFirewallLite = "<tns2:firewall-lite><tns2:stateful-firewall-lite-v4-enabled>Y</tns2:stateful-firewall-lite-v4-enabled><tns2:stateful-firewall-lite-v6-enabled>N</tns2:stateful-firewall-lite-v6-enabled><tns2:v4-firewall-packet-filters><tns2:v4-firewall-prefix>0.0.0.1</tns2:v4-firewall-prefix><tns2:v4-firewall-prefix-length>1</tns2:v4-firewall-prefix-length><tns2:allow-icmp-ping>Y</tns2:allow-icmp-ping><tns2:udp-ports><tns2:port-number>1</tns2:port-number></tns2:udp-ports><tns2:tcp-ports><tns2:port-number>1</tns2:port-number></tns2:tcp-ports></tns2:v4-firewall-packet-filters><tns2:v4-firewall-packet-filters><tns2:v4-firewall-prefix>0.0.0.2</tns2:v4-firewall-prefix><tns2:v4-firewall-prefix-length>2</tns2:v4-firewall-prefix-length><tns2:allow-icmp-ping>Y</tns2:allow-icmp-ping><tns2:udp-ports><tns2:port-number>2</tns2:port-number></tns2:udp-ports><tns2:tcp-ports><tns2:port-number>2</tns2:port-number></tns2:tcp-ports></tns2:v4-firewall-packet-filters><tns2:v6-firewall-packet-filters><tns2:v6-firewall-prefix>:</tns2:v6-firewall-prefix><tns2:v6-firewall-prefix-length>0</tns2:v6-firewall-prefix-length><tns2:allow-icmp-ping>Y</tns2:allow-icmp-ping><tns2:udp-ports><tns2:port-number>3</tns2:port-number></tns2:udp-ports><tns2:tcp-ports><tns2:port-number>3</tns2:port-number></tns2:tcp-ports></tns2:v6-firewall-packet-filters><tns2:v6-firewall-packet-filters><tns2:v6-firewall-prefix>:</tns2:v6-firewall-prefix><tns2:v6-firewall-prefix-length>1</tns2:v6-firewall-prefix-length><tns2:allow-icmp-ping>Y</tns2:allow-icmp-ping><tns2:udp-ports><tns2:port-number>4</tns2:port-number></tns2:udp-ports><tns2:tcp-ports><tns2:port-number>4</tns2:port-number></tns2:tcp-ports></tns2:v6-firewall-packet-filters></tns2:firewall-lite>"
- def expected_rebuildInternetEvcAccess = "<tns2:internet-evc-access-information><tns2:internet-evc-speed-value>8</tns2:internet-evc-speed-value><tns2:internet-evc-speed-units>Mbps</tns2:internet-evc-speed-units><tns2:ip-version>ds</tns2:ip-version></tns2:internet-evc-access-information>"
- def expected_rebuildInternetServiceChangeDetails = "<tns:internet-service-change-details><tns2:internet-evc-speed-value>10</tns2:internet-evc-speed-value><tns2:internet-evc-speed-units>Kbps</tns2:internet-evc-speed-units><tns2:t-provided-v4-lan-public-prefixes><tns2:request-index>1</tns2:request-index><tns2:v4-next-hop-address>192.168.1.15</tns2:v4-next-hop-address><tns2:v4-lan-public-prefix>192.168.1.15</tns2:v4-lan-public-prefix><tns2:v4-lan-public-prefix-length>28</tns2:v4-lan-public-prefix-length></tns2:t-provided-v4-lan-public-prefixes><tns2:t-provided-v4-lan-public-prefixes><tns2:request-index>2</tns2:request-index><tns2:v4-next-hop-address>192.168.1.16</tns2:v4-next-hop-address><tns2:v4-lan-public-prefix>192.168.1.16</tns2:v4-lan-public-prefix><tns2:v4-lan-public-prefix-length>28</tns2:v4-lan-public-prefix-length></tns2:t-provided-v4-lan-public-prefixes><tns2:t-provided-v6-lan-public-prefixes><tns2:request-index>1</tns2:request-index><tns2:v6-next-hop-address>2001:1890:12e3:2da::</tns2:v6-next-hop-address><tns2:v6-lan-public-prefix>2001:1890:12e3:2da::</tns2:v6-lan-public-prefix><tns2:v6-lan-public-prefix-length>28</tns2:v6-lan-public-prefix-length></tns2:t-provided-v6-lan-public-prefixes><tns2:t-provided-v6-lan-public-prefixes><tns2:request-index>1</tns2:request-index><tns2:v6-next-hop-address>2001:1890:12e3:2da::</tns2:v6-next-hop-address><tns2:v6-lan-public-prefix>2001:1890:12e3:2da::</tns2:v6-lan-public-prefix><tns2:v6-lan-public-prefix-length>28</tns2:v6-lan-public-prefix-length></tns2:t-provided-v6-lan-public-prefixes></tns:internet-service-change-details>"
- def expected_rebuildL2Home = "<tns2:l2-homing-information><tns2:evc-name>AS/VLXM/003717//SW</tns2:evc-name><tns2:topology>MultiPoint</tns2:topology><tns2:preferred-aic-clli>MTSNJA4LCP1</tns2:preferred-aic-clli></tns2:l2-homing-information>"
- def expected_rebuildNat = "<tns2:nat><tns2:v4-nat-enabled>Y</tns2:v4-nat-enabled><tns2:v4-nat-mapping-entries><tns2:v4-nat-internal>0.0.0.0</tns2:v4-nat-internal><tns2:v4-nat-next-hop-address>0.0.0.0</tns2:v4-nat-next-hop-address><tns2:v4-nat-external>0.0.0.0</tns2:v4-nat-external></tns2:v4-nat-mapping-entries><tns2:v4-nat-mapping-entries><tns2:v4-nat-internal>0.0.0.1</tns2:v4-nat-internal><tns2:v4-nat-next-hop-address>0.0.0.1</tns2:v4-nat-next-hop-address><tns2:v4-nat-external>0.0.0.1</tns2:v4-nat-external></tns2:v4-nat-mapping-entries></tns2:nat>"
- def expected_rebuildPat = "<tns2:pat><tns2:v4-pat-enabled>N</tns2:v4-pat-enabled><tns2:use-v4-default-pool>Y</tns2:use-v4-default-pool><tns2:v4-pat-pools><tns2:v4-pat-pool-prefix>192.168.1.44</tns2:v4-pat-pool-prefix><tns2:v4-pat-pool-prefix-length>0</tns2:v4-pat-pool-prefix-length><tns2:v4-pat-pool-next-hop-address>192.168.1.5</tns2:v4-pat-pool-next-hop-address></tns2:v4-pat-pools><tns2:v4-pat-pools><tns2:v4-pat-pool-prefix>192.168.1.45</tns2:v4-pat-pool-prefix><tns2:v4-pat-pool-prefix-length>28</tns2:v4-pat-pool-prefix-length><tns2:v4-pat-pool-next-hop-address>192.168.1.6</tns2:v4-pat-pool-next-hop-address></tns2:v4-pat-pools></tns2:pat>"
- def expected_rebuildStaticRoutes = "<tns2:static-routes><tns2:v4-static-routes><tns2:v4-static-route-prefix>255.255.252.1</tns2:v4-static-route-prefix><tns2:v4-static-route-prefix-length>28</tns2:v4-static-route-prefix-length><tns2:v4-next-hop-address>192.168.1.15</tns2:v4-next-hop-address></tns2:v4-static-routes><tns2:v4-static-routes><tns2:v4-static-route-prefix>255.255.252.2</tns2:v4-static-route-prefix><tns2:v4-static-route-prefix-length>28</tns2:v4-static-route-prefix-length><tns2:v4-next-hop-address>192.168.1.15</tns2:v4-next-hop-address></tns2:v4-static-routes><tns2:v4-static-routes><tns2:v4-static-route-prefix>255.255.252.3</tns2:v4-static-route-prefix><tns2:v4-static-route-prefix-length>28</tns2:v4-static-route-prefix-length><tns2:v4-next-hop-address>192.168.1.15</tns2:v4-next-hop-address></tns2:v4-static-routes><tns2:v6-static-routes><tns2:v6-static-route-prefix>2001:1890:12e3:2da::</tns2:v6-static-route-prefix><tns2:v6-static-route-prefix-length>28</tns2:v6-static-route-prefix-length><tns2:v6-next-hop-address>2001:1890:12e3:2da::</tns2:v6-next-hop-address></tns2:v6-static-routes><tns2:v6-static-routes><tns2:v6-static-route-prefix>2001:1890:12e3:2da::</tns2:v6-static-route-prefix><tns2:v6-static-route-prefix-length>28</tns2:v6-static-route-prefix-length><tns2:v6-next-hop-address>2001:1890:12e3:2da::</tns2:v6-next-hop-address></tns2:v6-static-routes></tns2:static-routes>"
- def expected_rebuildUcpeVmsServiceInformation = "<tns2:ucpe-vms-service-information><tns2:transport-service-information><tns2:transport-service-type>AVPN</tns2:transport-service-type><tns2:access-circuit-info><tns2:access-circuit-id>1</tns2:access-circuit-id><tns2:dual-mode>Active</tns2:dual-mode></tns2:access-circuit-info><tns2:access-circuit-info><tns2:access-circuit-id>2</tns2:access-circuit-id><tns2:dual-mode>Standby</tns2:dual-mode></tns2:access-circuit-info></tns2:transport-service-information><tns2:ucpe-information><tns2:ucpe-host-name>hostname</tns2:ucpe-host-name><tns2:ucpe-activation-code>activecode</tns2:ucpe-activation-code><tns2:out-of-band-management-modem>OOB</tns2:out-of-band-management-modem></tns2:ucpe-information><tns2:vnf-list><tns2:vnf-information><tns2:vnf-instance-id>1</tns2:vnf-instance-id><tns2:vnf-sequence-number>1</tns2:vnf-sequence-number><tns2:vnf-type>ZZ</tns2:vnf-type><tns2:vnf-vendor>JUNIPER</tns2:vnf-vendor><tns2:vnf-model>MODEL1</tns2:vnf-model><tns2:vnf-id>1</tns2:vnf-id><tns2:prov-status>1</tns2:prov-status><tns2:operational-state>1</tns2:operational-state><tns2:orchestration-status>1</tns2:orchestration-status><tns2:equipment-role>1</tns2:equipment-role></tns2:vnf-information><tns2:vnf-information><tns2:vnf-instance-id>2</tns2:vnf-instance-id><tns2:vnf-sequence-number>2</tns2:vnf-sequence-number><tns2:vnf-type>HY</tns2:vnf-type><tns2:vnf-vendor>JUNIPER</tns2:vnf-vendor><tns2:vnf-model>MODEL2</tns2:vnf-model><tns2:vnf-id>2</tns2:vnf-id><tns2:prov-status>2</tns2:prov-status><tns2:operational-state>2</tns2:operational-state><tns2:orchestration-status>2</tns2:orchestration-status><tns2:equipment-role>2</tns2:equipment-role></tns2:vnf-information></tns2:vnf-list></tns2:ucpe-vms-service-information>"
- def expected_rebuildVrLan = "<tns2:vr-lan><tns2:routing-protocol>none</tns2:routing-protocol><tns2:vr-lan-interface><tns2:vr-designation>primary</tns2:vr-designation><tns2:v4-vr-lan-prefix>10.192.27.254</tns2:v4-vr-lan-prefix><tns2:v4-vr-lan-prefix-length>24</tns2:v4-vr-lan-prefix-length><tns2:v6-vr-lan-prefix>2620:0:10d0:f:ffff:ffff:ffff:fffe</tns2:v6-vr-lan-prefix><tns2:v6-vr-lan-prefix-length>64</tns2:v6-vr-lan-prefix-length><tns2:v4-vce-loopback-address>162.200.3.144</tns2:v4-vce-loopback-address><tns2:v6-vce-wan-address>2001:1890:12e3:2da::</tns2:v6-vce-wan-address><tns2:v4-public-lan-prefixes><tns2:t-provided-v4-lan-public-prefixes><tns2:request-index>1</tns2:request-index><tns2:v4-next-hop-address>192.168.1.2</tns2:v4-next-hop-address><tns2:v4-lan-public-prefix>192.168.1.1</tns2:v4-lan-public-prefix><tns2:v4-lan-public-prefix-length>28</tns2:v4-lan-public-prefix-length></tns2:t-provided-v4-lan-public-prefixes><tns2:t-provided-v4-lan-public-prefixes><tns2:request-index>1</tns2:request-index><tns2:v4-next-hop-address>192.168.1.72</tns2:v4-next-hop-address><tns2:v4-lan-public-prefix>192.168.1.71</tns2:v4-lan-public-prefix><tns2:v4-lan-public-prefix-length>28</tns2:v4-lan-public-prefix-length></tns2:t-provided-v4-lan-public-prefixes><tns2:t-provided-v4-lan-public-prefixes><tns2:request-index>1</tns2:request-index><tns2:v4-next-hop-address>192.168.1.68</tns2:v4-next-hop-address><tns2:v4-lan-public-prefix>192.168.1.67</tns2:v4-lan-public-prefix><tns2:v4-lan-public-prefix-length>28</tns2:v4-lan-public-prefix-length></tns2:t-provided-v4-lan-public-prefixes></tns2:v4-public-lan-prefixes><tns2:v6-public-lan-prefixes><tns2:t-provided-v6-lan-public-prefixes><tns2:request-index>1</tns2:request-index><tns2:v6-next-hop-address>2001:1890:12e3:2da::</tns2:v6-next-hop-address><tns2:v6-lan-public-prefix>2001:1890:12e3:2da::</tns2:v6-lan-public-prefix><tns2:v6-lan-public-prefix-length>28</tns2:v6-lan-public-prefix-length></tns2:t-provided-v6-lan-public-prefixes><tns2:t-provided-v6-lan-public-prefixes><tns2:request-index>1</tns2:request-index><tns2:v6-next-hop-address>2001:1890:12e3:2da::</tns2:v6-next-hop-address><tns2:v6-lan-public-prefix>2001:1890:12e3:3da::</tns2:v6-lan-public-prefix><tns2:v6-lan-public-prefix-length>28</tns2:v6-lan-public-prefix-length></tns2:t-provided-v6-lan-public-prefixes><tns2:t-provided-v6-lan-public-prefixes><tns2:request-index>1</tns2:request-index><tns2:v6-next-hop-address>2001:1890:12e3:2da::</tns2:v6-next-hop-address><tns2:v6-lan-public-prefix>2001:1890:12e3:4da::</tns2:v6-lan-public-prefix><tns2:v6-lan-public-prefix-length>28</tns2:v6-lan-public-prefix-length></tns2:t-provided-v6-lan-public-prefixes></tns2:v6-public-lan-prefixes><tns2:dhcp><tns2:v4-dhcp-server-enabled>Y</tns2:v4-dhcp-server-enabled><tns2:v6-dhcp-server-enabled>N</tns2:v6-dhcp-server-enabled><tns2:use-v4-default-pool>Y</tns2:use-v4-default-pool><tns2:excluded-v4-dhcp-addresses-from-default-pool><tns2:excluded-v4-address>192.168.1.7</tns2:excluded-v4-address></tns2:excluded-v4-dhcp-addresses-from-default-pool><tns2:excluded-v4-dhcp-addresses-from-default-pool><tns2:excluded-v4-address>192.168.1.8</tns2:excluded-v4-address></tns2:excluded-v4-dhcp-addresses-from-default-pool><tns2:v4-dhcp-pools><tns2:v4-dhcp-pool-prefix>192.155.2.3</tns2:v4-dhcp-pool-prefix><tns2:v4-dhcp-pool-prefix-length>28</tns2:v4-dhcp-pool-prefix-length><tns2:excluded-v4-addresses><tns2:excluded-v4-address>192.168.1.5</tns2:excluded-v4-address></tns2:excluded-v4-addresses><tns2:excluded-v4-addresses><tns2:excluded-v4-address>192.168.1.6</tns2:excluded-v4-address></tns2:excluded-v4-addresses><tns2:v4-dhcp-relay-gateway-address>2.2.2.1</tns2:v4-dhcp-relay-gateway-address><tns2:v4-dhcp-relay-next-hop-address>1.1.1.1</tns2:v4-dhcp-relay-next-hop-address></tns2:v4-dhcp-pools><tns2:v4-dhcp-pools><tns2:v4-dhcp-pool-prefix>192.155.2.4</tns2:v4-dhcp-pool-prefix><tns2:v4-dhcp-pool-prefix-length>28</tns2:v4-dhcp-pool-prefix-length><tns2:excluded-v4-addresses><tns2:excluded-v4-address>192.168.1.6</tns2:excluded-v4-address></tns2:excluded-v4-addresses><tns2:excluded-v4-addresses><tns2:excluded-v4-address>192.168.1.7</tns2:excluded-v4-address></tns2:excluded-v4-addresses><tns2:v4-dhcp-relay-gateway-address>2.2.2.2</tns2:v4-dhcp-relay-gateway-address><tns2:v4-dhcp-relay-next-hop-address>1.1.1.2</tns2:v4-dhcp-relay-next-hop-address></tns2:v4-dhcp-pools><tns2:use-v6-default-pool>N</tns2:use-v6-default-pool><tns2:excluded-v6-dhcp-addresses-from-default-pool><tns2:excluded-v6-address>1:5</tns2:excluded-v6-address></tns2:excluded-v6-dhcp-addresses-from-default-pool><tns2:excluded-v6-dhcp-addresses-from-default-pool><tns2:excluded-v6-address>1:6</tns2:excluded-v6-address></tns2:excluded-v6-dhcp-addresses-from-default-pool><tns2:v6-dhcp-pools><tns2:v6-dhcp-pool-prefix>0:0</tns2:v6-dhcp-pool-prefix><tns2:v6-dhcp-pool-prefix-length>28</tns2:v6-dhcp-pool-prefix-length><tns2:excluded-v6-addresses><tns2:excluded-v6-address>1:1</tns2:excluded-v6-address></tns2:excluded-v6-addresses><tns2:excluded-v6-addresses><tns2:excluded-v6-address>2:2</tns2:excluded-v6-address></tns2:excluded-v6-addresses><tns2:v6-dhcp-relay-gateway-address>3:3</tns2:v6-dhcp-relay-gateway-address><tns2:v6-dhcp-relay-next-hop-address>4:4</tns2:v6-dhcp-relay-next-hop-address></tns2:v6-dhcp-pools><tns2:v6-dhcp-pools><tns2:v6-dhcp-pool-prefix>0:0</tns2:v6-dhcp-pool-prefix><tns2:v6-dhcp-pool-prefix-length>28</tns2:v6-dhcp-pool-prefix-length><tns2:excluded-v6-addresses><tns2:excluded-v6-address>1:1</tns2:excluded-v6-address></tns2:excluded-v6-addresses><tns2:excluded-v6-addresses><tns2:excluded-v6-address>2:2</tns2:excluded-v6-address></tns2:excluded-v6-addresses><tns2:v6-dhcp-relay-gateway-address>3:3</tns2:v6-dhcp-relay-gateway-address><tns2:v6-dhcp-relay-next-hop-address>4:4</tns2:v6-dhcp-relay-next-hop-address></tns2:v6-dhcp-pools></tns2:dhcp><tns2:pat><tns2:v4-pat-enabled>N</tns2:v4-pat-enabled><tns2:use-v4-default-pool>Y</tns2:use-v4-default-pool><tns2:v4-pat-pools><tns2:v4-pat-pool-prefix>192.168.1.44</tns2:v4-pat-pool-prefix><tns2:v4-pat-pool-prefix-length>0</tns2:v4-pat-pool-prefix-length><tns2:v4-pat-pool-next-hop-address>192.168.1.5</tns2:v4-pat-pool-next-hop-address></tns2:v4-pat-pools><tns2:v4-pat-pools><tns2:v4-pat-pool-prefix>192.168.1.45</tns2:v4-pat-pool-prefix><tns2:v4-pat-pool-prefix-length>28</tns2:v4-pat-pool-prefix-length><tns2:v4-pat-pool-next-hop-address>192.168.1.6</tns2:v4-pat-pool-next-hop-address></tns2:v4-pat-pools></tns2:pat><tns2:nat><tns2:v4-nat-enabled>Y</tns2:v4-nat-enabled><tns2:v4-nat-mapping-entries><tns2:v4-nat-internal>0.0.0.0</tns2:v4-nat-internal><tns2:v4-nat-next-hop-address>0.0.0.0</tns2:v4-nat-next-hop-address><tns2:v4-nat-external>0.0.0.0</tns2:v4-nat-external></tns2:v4-nat-mapping-entries><tns2:v4-nat-mapping-entries><tns2:v4-nat-internal>0.0.0.1</tns2:v4-nat-internal><tns2:v4-nat-next-hop-address>0.0.0.1</tns2:v4-nat-next-hop-address><tns2:v4-nat-external>0.0.0.1</tns2:v4-nat-external></tns2:v4-nat-mapping-entries></tns2:nat><tns2:firewall-lite><tns2:stateful-firewall-lite-v4-enabled>Y</tns2:stateful-firewall-lite-v4-enabled><tns2:stateful-firewall-lite-v6-enabled>N</tns2:stateful-firewall-lite-v6-enabled><tns2:v4-firewall-packet-filters><tns2:v4-firewall-prefix>0.0.0.1</tns2:v4-firewall-prefix><tns2:v4-firewall-prefix-length>1</tns2:v4-firewall-prefix-length><tns2:allow-icmp-ping>Y</tns2:allow-icmp-ping><tns2:udp-ports><tns2:port-number>1</tns2:port-number></tns2:udp-ports><tns2:tcp-ports><tns2:port-number>1</tns2:port-number></tns2:tcp-ports></tns2:v4-firewall-packet-filters><tns2:v4-firewall-packet-filters><tns2:v4-firewall-prefix>0.0.0.2</tns2:v4-firewall-prefix><tns2:v4-firewall-prefix-length>2</tns2:v4-firewall-prefix-length><tns2:allow-icmp-ping>Y</tns2:allow-icmp-ping><tns2:udp-ports><tns2:port-number>2</tns2:port-number></tns2:udp-ports><tns2:tcp-ports><tns2:port-number>2</tns2:port-number></tns2:tcp-ports></tns2:v4-firewall-packet-filters><tns2:v6-firewall-packet-filters><tns2:v6-firewall-prefix>:</tns2:v6-firewall-prefix><tns2:v6-firewall-prefix-length>0</tns2:v6-firewall-prefix-length><tns2:allow-icmp-ping>Y</tns2:allow-icmp-ping><tns2:udp-ports><tns2:port-number>3</tns2:port-number></tns2:udp-ports><tns2:tcp-ports><tns2:port-number>3</tns2:port-number></tns2:tcp-ports></tns2:v6-firewall-packet-filters><tns2:v6-firewall-packet-filters><tns2:v6-firewall-prefix>:</tns2:v6-firewall-prefix><tns2:v6-firewall-prefix-length>1</tns2:v6-firewall-prefix-length><tns2:allow-icmp-ping>Y</tns2:allow-icmp-ping><tns2:udp-ports><tns2:port-number>4</tns2:port-number></tns2:udp-ports><tns2:tcp-ports><tns2:port-number>4</tns2:port-number></tns2:tcp-ports></tns2:v6-firewall-packet-filters></tns2:firewall-lite><tns2:static-routes><tns2:v4-static-routes><tns2:v4-static-route-prefix>255.255.252.1</tns2:v4-static-route-prefix><tns2:v4-static-route-prefix-length>28</tns2:v4-static-route-prefix-length><tns2:v4-next-hop-address>192.168.1.15</tns2:v4-next-hop-address></tns2:v4-static-routes><tns2:v4-static-routes><tns2:v4-static-route-prefix>255.255.252.2</tns2:v4-static-route-prefix><tns2:v4-static-route-prefix-length>28</tns2:v4-static-route-prefix-length><tns2:v4-next-hop-address>192.168.1.15</tns2:v4-next-hop-address></tns2:v4-static-routes><tns2:v4-static-routes><tns2:v4-static-route-prefix>255.255.252.3</tns2:v4-static-route-prefix><tns2:v4-static-route-prefix-length>28</tns2:v4-static-route-prefix-length><tns2:v4-next-hop-address>192.168.1.15</tns2:v4-next-hop-address></tns2:v4-static-routes><tns2:v6-static-routes><tns2:v6-static-route-prefix>2001:1890:12e3:2da::</tns2:v6-static-route-prefix><tns2:v6-static-route-prefix-length>28</tns2:v6-static-route-prefix-length><tns2:v6-next-hop-address>2001:1890:12e3:2da::</tns2:v6-next-hop-address></tns2:v6-static-routes><tns2:v6-static-routes><tns2:v6-static-route-prefix>2001:1890:12e3:2da::</tns2:v6-static-route-prefix><tns2:v6-static-route-prefix-length>28</tns2:v6-static-route-prefix-length><tns2:v6-next-hop-address>2001:1890:12e3:2da::</tns2:v6-next-hop-address></tns2:v6-static-routes></tns2:static-routes></tns2:vr-lan-interface></tns2:vr-lan>"
- def expected_rebuildVrLanInterfacePartial = "<tns2:vr-designation>primary</tns2:vr-designation><tns2:v4-vr-lan-prefix>10.192.27.254</tns2:v4-vr-lan-prefix><tns2:v4-vr-lan-prefix-length>24</tns2:v4-vr-lan-prefix-length><tns2:v6-vr-lan-prefix>2620:0:10d0:f:ffff:ffff:ffff:fffe</tns2:v6-vr-lan-prefix><tns2:v6-vr-lan-prefix-length>64</tns2:v6-vr-lan-prefix-length><tns2:v4-vce-loopback-address>162.200.3.144</tns2:v4-vce-loopback-address><tns2:v6-vce-wan-address>2001:1890:12e3:2da::</tns2:v6-vce-wan-address><tns2:v4-public-lan-prefixes><tns2:t-provided-v4-lan-public-prefixes><tns2:request-index>1</tns2:request-index><tns2:v4-next-hop-address>192.168.1.2</tns2:v4-next-hop-address><tns2:v4-lan-public-prefix>192.168.1.1</tns2:v4-lan-public-prefix><tns2:v4-lan-public-prefix-length>28</tns2:v4-lan-public-prefix-length></tns2:t-provided-v4-lan-public-prefixes><tns2:t-provided-v4-lan-public-prefixes><tns2:request-index>1</tns2:request-index><tns2:v4-next-hop-address>192.168.1.72</tns2:v4-next-hop-address><tns2:v4-lan-public-prefix>192.168.1.71</tns2:v4-lan-public-prefix><tns2:v4-lan-public-prefix-length>28</tns2:v4-lan-public-prefix-length></tns2:t-provided-v4-lan-public-prefixes><tns2:t-provided-v4-lan-public-prefixes><tns2:request-index>1</tns2:request-index><tns2:v4-next-hop-address>192.168.1.68</tns2:v4-next-hop-address><tns2:v4-lan-public-prefix>192.168.1.67</tns2:v4-lan-public-prefix><tns2:v4-lan-public-prefix-length>28</tns2:v4-lan-public-prefix-length></tns2:t-provided-v4-lan-public-prefixes><tns2:t-provided-v4-lan-public-prefixes><tns2:request-index>1</tns2:request-index><tns2:v4-next-hop-address>192.168.1.15</tns2:v4-next-hop-address><tns2:v4-lan-public-prefix>192.168.1.15</tns2:v4-lan-public-prefix><tns2:v4-lan-public-prefix-length>28</tns2:v4-lan-public-prefix-length></tns2:t-provided-v4-lan-public-prefixes><tns2:t-provided-v4-lan-public-prefixes><tns2:request-index>2</tns2:request-index><tns2:v4-next-hop-address>192.168.1.16</tns2:v4-next-hop-address><tns2:v4-lan-public-prefix>192.168.1.16</tns2:v4-lan-public-prefix><tns2:v4-lan-public-prefix-length>28</tns2:v4-lan-public-prefix-length></tns2:t-provided-v4-lan-public-prefixes></tns2:v4-public-lan-prefixes><tns2:v6-public-lan-prefixes><tns2:t-provided-v6-lan-public-prefixes><tns2:request-index>1</tns2:request-index><tns2:v6-next-hop-address>2001:1890:12e3:2da::</tns2:v6-next-hop-address><tns2:v6-lan-public-prefix>2001:1890:12e3:2da::</tns2:v6-lan-public-prefix><tns2:v6-lan-public-prefix-length>28</tns2:v6-lan-public-prefix-length></tns2:t-provided-v6-lan-public-prefixes><tns2:t-provided-v6-lan-public-prefixes><tns2:request-index>1</tns2:request-index><tns2:v6-next-hop-address>2001:1890:12e3:2da::</tns2:v6-next-hop-address><tns2:v6-lan-public-prefix>2001:1890:12e3:3da::</tns2:v6-lan-public-prefix><tns2:v6-lan-public-prefix-length>28</tns2:v6-lan-public-prefix-length></tns2:t-provided-v6-lan-public-prefixes><tns2:t-provided-v6-lan-public-prefixes><tns2:request-index>1</tns2:request-index><tns2:v6-next-hop-address>2001:1890:12e3:2da::</tns2:v6-next-hop-address><tns2:v6-lan-public-prefix>2001:1890:12e3:4da::</tns2:v6-lan-public-prefix><tns2:v6-lan-public-prefix-length>28</tns2:v6-lan-public-prefix-length></tns2:t-provided-v6-lan-public-prefixes><tns2:t-provided-v6-lan-public-prefixes><tns2:request-index>1</tns2:request-index><tns2:v6-next-hop-address>2001:1890:12e3:2da::</tns2:v6-next-hop-address><tns2:v6-lan-public-prefix>2001:1890:12e3:2da::</tns2:v6-lan-public-prefix><tns2:v6-lan-public-prefix-length>28</tns2:v6-lan-public-prefix-length></tns2:t-provided-v6-lan-public-prefixes><tns2:t-provided-v6-lan-public-prefixes><tns2:request-index>1</tns2:request-index><tns2:v6-next-hop-address>2001:1890:12e3:2da::</tns2:v6-next-hop-address><tns2:v6-lan-public-prefix>2001:1890:12e3:2da::</tns2:v6-lan-public-prefix><tns2:v6-lan-public-prefix-length>28</tns2:v6-lan-public-prefix-length></tns2:t-provided-v6-lan-public-prefixes></tns2:v6-public-lan-prefixes>"
-
- @Before
- public void setUp() {
- def responseAsString = getFile("sdncadaptercallbackrequest.xml")
- def varrequestData=utils.getNodeText(responseAsString,"RequestData")
- //def varResponseListData = StringEscapeUtils.unescapeXml(varrequestData)
- def varResponseListData = varrequestData.replace("&", "&amp;")
- origXmlResponse = utils.getNodeXml(varResponseListData, "layer3-service-list").drop(38).trim()
-
- }
-
- @Test
- public void testBuildL2Home() {
- def rebuildL2Home = utils.buildL2HomingInformation(origXmlResponse)
- println " rebuildL2Home: "
- println " actual - " + rebuildL2Home
- println " expected - " + expected_rebuildL2Home
- assertEquals("rebuildL2Home - expected vs actual", expected_rebuildL2Home, rebuildL2Home)
- }
-
- @Test
- public void testBuildInternetEvcAccess() {
- def rebuildInternetEvcAccess = utils.buildInternetEvcAccessInformation(origXmlResponse)
- println " rebuildInternetEvcAccess: "
- println " actual - " + rebuildInternetEvcAccess
- println " expected - " + expected_rebuildInternetEvcAccess
- assertEquals("rebuildInternetEvcAccess - expected vs actual", expected_rebuildInternetEvcAccess, rebuildInternetEvcAccess)
- }
-
- @Test
- public void testBuildInternetServiceChangeDetails() {
- def rebuildInternetServiceChangeDetails = utils.buildInternetServiceChangeDetails(origXmlResponse)
- println " rebuildInternetServiceChangeDetails: "
- println " actual - " + rebuildInternetServiceChangeDetails
- println " expected - " + expected_rebuildInternetServiceChangeDetails
- assertEquals("rebuildInternetServiceChangeDetails - expected vs actual", expected_rebuildInternetServiceChangeDetails, rebuildInternetServiceChangeDetails)
- }
-
- // Coming v100
- @Test
- @Ignore
- public void testBuildUcpeVmsServiceInformation() {
- def rebuildUcpeVmsServiceInformation = utils.buildUcpeVmsServiceInformation(origXmlResponse)
- println " rebuildUcpeVmsServiceInformation: "
- println " actual - " + rebuildUcpeVmsServiceInformation
- println " expected - " + expected_rebuildUcpeVmsServiceInformation
- assertEquals("rebuildUcpeVmsServiceInformation - expected vs actual", expected_rebuildUcpeVmsServiceInformation, rebuildUcpeVmsServiceInformation)
- }
-
- @Test
- public void testBuildElements() {
- // testing utility codes: buildElements() & buildElementsUnblunded()
- def internetServiceChangeDetails = utils.getNodeXml(origXmlResponse, "internet-service-change-details").drop(38).trim()
- def buildElements = ''
- buildElements = "<tns2:internet-service-change-details>"
- buildElements += utils.buildElements(internetServiceChangeDetails, ["internet-evc-speed-value"], "")
- buildElements += utils.buildElements(internetServiceChangeDetails, ["internet-evc-speed-units"], "")
- def tProvidedV4LanPublicPrefixesChangesList = ["request-index", "v4-next-hop-address", "v4-lan-public-prefix", "v4-lan-public-prefix-length"]
- buildElements += utils.buildElementsUnbounded(internetServiceChangeDetails, tProvidedV4LanPublicPrefixesChangesList, "t-provided-v4-lan-public-prefixes")
- buildElements += "</tns2:internet-service-change-details>"
- println " buildElements: "
- println " actual - " + buildElements
- println " expected - " + expected_buildElements
- assertEquals("buildElements - expected vs actual", expected_buildElements, buildElements)
- }
-
- @Test
- public void testBuildVrLan() {
- def rebuildVrLan = utils.buildVrLan(origXmlResponse)
- println " rebuildVrLans: "
- println " actual - " + rebuildVrLan
- println " expected - " + expected_rebuildVrLan
- assertEquals("rebuildVrLan - expected vs actual", expected_rebuildVrLan, rebuildVrLan)
- }
-
- @Test
- public void testBuildVrLanInterfacePartial() {
- def rebuildVrLanInterfacePartial = utils.buildVrLanInterfacePartial(origXmlResponse)
- println " rebuildVrLanInterfacePartial: "
- println " actual - " + rebuildVrLanInterfacePartial
- println " expected - " + expected_rebuildVrLanInterfacePartial
- assertEquals("rebuildVrLanInterfacePartial - expected vs actual", expected_rebuildVrLanInterfacePartial, rebuildVrLanInterfacePartial)
- }
-
- @Test
- public void testBuildDhcp() {
- def rebuildDhcp = utils.buildDhcp(origXmlResponse)
- println " rebuildDhcp: "
- println " actual - " + rebuildDhcp
- println " expected - " + expected_rebuildDhcp
- assertEquals("rebuildDhcp - expected vs actual", expected_rebuildDhcp, rebuildDhcp)
- }
-
- @Test
- public void testBuildPat() {
- def rebuildPat = utils.buildPat(origXmlResponse)
- println " rebuildPat: "
- println " actual - " + rebuildPat
- println " expected - " + expected_rebuildPat
- assertEquals("rebuildPat - expected vs actual", expected_rebuildPat, rebuildPat)
- }
-
- @Test
- public void testBuildNat() {
- def rebuildNat = utils.buildNat(origXmlResponse)
- println " rebuildNat: "
- println " actual - " + rebuildNat
- println " expected - " + expected_rebuildNat
- assertEquals("rebuildNat - expected vs actual", expected_rebuildNat, rebuildNat)
- }
-
- @Test
- public void testBuildFirewallLite() {
- def rebuildFirewallLite = utils.buildFirewallLite(origXmlResponse)
- println " rebuildFirewallLite: "
- println " actual - " + rebuildFirewallLite
- println " expected - " + expected_rebuildFirewallLite
- assertEquals("rebuildFirewallLite - expected vs actual", expected_rebuildFirewallLite, rebuildFirewallLite)
- }
-
- @Test
- public void testBuildStaticRoutes() {
- def rebuildStaticRoutes = utils.buildStaticRoutes(origXmlResponse)
- println " rebuildStaticRoutes: "
- println " actual - " + rebuildStaticRoutes
- println " expected - " + expected_rebuildStaticRoutes
- assertEquals("rebuildStaticRoutes - expected vs actual", expected_rebuildStaticRoutes, rebuildStaticRoutes)
- }
-
- @Test
- public void testGetBasicAuth(){
- def encodedAuth = utils.getBasicAuth("3E3CFA7BE2F6107AAD4AAA65F8976690","07a7159d3bf51a0e53be7a8f89699be7")
- assertEquals("Basic bXlTdHJpbmc=", encodedAuth)
- }
-
- @Test
- public void testEncrypt(){
- def encrypted = utils.encrypt("myString","07a7159d3bf51a0e53be7a8f89699be7")
- assertEquals("3E3CFA7BE2F6107AAD4AAA65F8976690", encrypted)
-
- //use to get value for urn properties
- //println(utils.encrypt("password"))
- }
-
- @Test
- public void testDecrypt(){
- def decrypted = utils.decrypt("3E3CFA7BE2F6107AAD4AAA65F8976690", "07a7159d3bf51a0e53be7a8f89699be7")
- assertEquals("myString", decrypted)
- }
-
- @Test
- public void testGetPBGFList(){
- def responseAsString = getFile("sdncDeleteResponse.xml")
- def nodes = utils.getPBGFList("true", responseAsString)
- //assertEquals(2, nodes.size())
- while(!nodes.empty){
- def myBGFXML = nodes.remove(0)
- def myBGF= new XmlSlurper().parseText(myBGFXML)
- println "borderElmtId: " + myBGF.'border-element-id'
- println "vlanid: " + myBGF.'vlan-id' +"\n"
- }
- }
-
- public String getFile(String fileName) {
- def SLASH = File.separator
- def pathBase = ' '
- def fileAsString = ''
- try {
- pathBase = new File(".").getCanonicalPath()
- //println "pathBase " + pathBase + "${SLASH}src${SLASH}test${SLASH}resources${SLASH}${fileName}"
- fileAsString = new File(pathBase, "${SLASH}src${SLASH}test${SLASH}resources${SLASH}${fileName}").getText()
- } catch (Exception ex) {
- println " *** getFile error: " + ex.getStackTrace()
- } finally {
- return fileAsString
- }
- }
-
-
-} \ No newline at end of file
diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/NetworkUtilsTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/NetworkUtilsTest.groovy
deleted file mode 100644
index 63d88f5c3a..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/NetworkUtilsTest.groovy
+++ /dev/null
@@ -1,97 +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.common.scripts
-
-import static org.mockito.Mockito.*
-import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
-import static org.junit.Assert.*;
-import org.junit.Test;
-
-class NetworkUtilsTest {
-
- 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></backout-on-failure>
- </volume-inputs>
- <volume-params>
- <param name="vnf_name">STMTN5MMSC20</param>
- <param name="vnf_name2">US1117MTSNJVBR0246</param>
- </volume-params>
-</volume-request>"""
-
- @Test
- public void testIsRollbackEnabled() {
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- when(mockExecution.getVariable("URN_mso_rollback")).thenReturn(true)
-
- NetworkUtils networkUtils = new NetworkUtils()
- def rollbackEnabled = networkUtils.isRollbackEnabled(mockExecution, volumeRequestXml)
-
- assertEquals(true, rollbackEnabled)
-
- }
-
- @Test
- public void testIsRollbackEnabled2() {
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true')
- when(mockExecution.getVariable("URN_mso_rollback")).thenReturn(false)
-
- NetworkUtils networkUtils = new NetworkUtils()
- def rollbackEnabled = networkUtils.isRollbackEnabled(mockExecution, volumeRequestXml)
-
- assertEquals(false, rollbackEnabled)
-
- }
-
- @Test
- public void testGetIpvVersion() {
-
- NetworkUtils networkUtils = new NetworkUtils()
- println "test: ipv4"
- String version4 = networkUtils.getIpvVersion("ipv4")
- assertEquals("4", version4)
- println "test: ipv6"
- String version6 = networkUtils.getIpvVersion("ipv6")
- assertEquals("6", version6)
- println "test: 4"
- String versionDigit4 = networkUtils.getIpvVersion("4")
- assertEquals("4", versionDigit4)
-
- }
-
-}
diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/SDNCAdapterTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/SDNCAdapterTest.groovy
deleted file mode 100644
index 2ecb108b4e..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/SDNCAdapterTest.groovy
+++ /dev/null
@@ -1,948 +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.common.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.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.mockito.MockitoAnnotations
-import org.mockito.runners.MockitoJUnitRunner
-import org.mockito.internal.debugging.MockitoDebuggerImpl
-import org.openecomp.mso.bpmn.common.scripts.SDNCAdapter;
-
-import org.openecomp.mso.bpmn.mock.FileUtil
-
-@RunWith(MockitoJUnitRunner.class)
-public class SDNCAdapterTest {
-
- @Before
- public void init()
- {
- MockitoAnnotations.initMocks(this)
- System.setProperty("jboss.qualified.host.name","myhost.com")
- }
-
-
- def workflowResponse = """<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>testRequestId</tag0:RequestId>
- <tag0:ResponseCode>200</tag0:ResponseCode>
- <tag0:ResponseMessage>OK</tag0:ResponseMessage>
- </tag0:CallbackHeader>
- <tag0:RequestData xsi:type="xs:string"> &lt;layer3-service-list xmlns="com:att:sdnctl:l3api"&gt;
- &lt;service-instance-id&gt;FK/VLXM/003717//SW_INTERNET&lt;/service-instance-id&gt;
- &lt;service-status&gt;
- &lt;rpc-name&gt;service-configuration-operation&lt;/rpc-name&gt;
- &lt;rpc-action&gt;activate&lt;/rpc-action&gt;
- &lt;request-status&gt;synccomplete&lt;/request-status&gt;
- &lt;final-indicator&gt;N&lt;/final-indicator&gt;
- &lt;l3sdn-action&gt;Layer3ServiceActivateRequest&lt;/l3sdn-action&gt;
- &lt;l3sdn-subaction&gt;SUPP&lt;/l3sdn-subaction&gt;
- &lt;response-timestamp&gt;2015-04-28T21:32:11.386Z&lt;/response-timestamp&gt;
- &lt;/service-status&gt;
- &lt;service-data&gt;
- &lt;internet-evc-access-information&gt;
- &lt;ip-version&gt;ds&lt;/ip-version&gt;
- &lt;internet-evc-speed-value&gt;8&lt;/internet-evc-speed-value&gt;
- &lt;internet-evc-speed-units&gt;Mbps&lt;/internet-evc-speed-units&gt;
- &lt;/internet-evc-access-information&gt;
- &lt;vr-lan xmlns="com:att:sdnctl:l3api"&gt;
- &lt;vr-lan-interface&gt;
- &lt;static-routes&gt;
- &lt;v6-static-routes&gt;
- &lt;v6-next-hop-address&gt;2001:1890:12e3:2da::&lt;/v6-next-hop-address&gt;
- &lt;v6-static-route-prefix&gt;2001:1890:12e3:2da::&lt;/v6-static-route-prefix&gt;
- &lt;v6-static-route-prefix-length&gt;28&lt;/v6-static-route-prefix-length&gt;
- &lt;/v6-static-routes&gt;
- &lt;v4-static-routes&gt;
- &lt;v4-static-route-prefix&gt;255.255.252.1&lt;/v4-static-route-prefix&gt;
- &lt;v4-next-hop-address&gt;192.168.1.15&lt;/v4-next-hop-address&gt;
- &lt;v4-static-route-prefix-length&gt;28&lt;/v4-static-route-prefix-length&gt;
- &lt;/v4-static-routes&gt;
- &lt;v6-static-routes&gt;
- &lt;v6-next-hop-address&gt;2001:1890:12e3:2da::&lt;/v6-next-hop-address&gt;
- &lt;v6-static-route-prefix&gt;2001:1890:12e3:2da::&lt;/v6-static-route-prefix&gt;
- &lt;v6-static-route-prefix-length&gt;28&lt;/v6-static-route-prefix-length&gt;
- &lt;/v6-static-routes&gt;
- &lt;v4-static-routes&gt;
- &lt;v4-static-route-prefix&gt;255.255.252.2&lt;/v4-static-route-prefix&gt;
- &lt;v4-next-hop-address&gt;192.168.1.15&lt;/v4-next-hop-address&gt;
- &lt;v4-static-route-prefix-length&gt;28&lt;/v4-static-route-prefix-length&gt;
- &lt;/v4-static-routes&gt;
- &lt;v4-static-routes&gt;
- &lt;v4-static-route-prefix&gt;255.255.252.3&lt;/v4-static-route-prefix&gt;
- &lt;v4-next-hop-address&gt;192.168.1.15&lt;/v4-next-hop-address&gt;
- &lt;v4-static-route-prefix-length&gt;28&lt;/v4-static-route-prefix-length&gt;
- &lt;/v4-static-routes&gt;
- &lt;/static-routes&gt;
- &lt;dhcp&gt;
- &lt;v6-dhcp-server-enabled&gt;N&lt;/v6-dhcp-server-enabled&gt;
- &lt;v4-dhcp-server-enabled&gt;Y&lt;/v4-dhcp-server-enabled&gt;
- &lt;use-v6-default-pool&gt;N&lt;/use-v6-default-pool&gt;
- &lt;excluded-v4-dhcp-addresses-from-default-pool&gt;
- &lt;excluded-v4-address&gt;192.168.1.7&lt;/excluded-v4-address&gt;
- &lt;/excluded-v4-dhcp-addresses-from-default-pool&gt;
- &lt;excluded-v4-dhcp-addresses-from-default-pool&gt;
- &lt;excluded-v4-address&gt;192.168.1.8&lt;/excluded-v4-address&gt;
- &lt;/excluded-v4-dhcp-addresses-from-default-pool&gt;
- &lt;v4-dhcp-pools&gt;
- &lt;v4-dhcp-relay-next-hop-address&gt;1.1.1.1&lt;/v4-dhcp-relay-next-hop-address&gt;
- &lt;v4-dhcp-pool-prefix-length&gt;28&lt;/v4-dhcp-pool-prefix-length&gt;
- &lt;excluded-v4-addresses&gt;
- &lt;excluded-v4-address&gt;192.168.1.5&lt;/excluded-v4-address&gt;
- &lt;/excluded-v4-addresses&gt;
- &lt;v4-dhcp-relay-gateway-address&gt;2.2.2.1&lt;/v4-dhcp-relay-gateway-address&gt;
- &lt;excluded-v4-addresses&gt;
- &lt;excluded-v4-address&gt;192.168.1.6&lt;/excluded-v4-address&gt;
- &lt;/excluded-v4-addresses&gt;
- &lt;v4-dhcp-pool-prefix&gt;192.155.2.3&lt;/v4-dhcp-pool-prefix&gt;
- &lt;/v4-dhcp-pools&gt;
- &lt;v4-dhcp-pools&gt;
- &lt;v4-dhcp-relay-next-hop-address&gt;1.1.1.2&lt;/v4-dhcp-relay-next-hop-address&gt;
- &lt;v4-dhcp-pool-prefix-length&gt;28&lt;/v4-dhcp-pool-prefix-length&gt;
- &lt;excluded-v4-addresses&gt;
- &lt;excluded-v4-address&gt;192.168.1.6&lt;/excluded-v4-address&gt;
- &lt;/excluded-v4-addresses&gt;
- &lt;v4-dhcp-relay-gateway-address&gt;2.2.2.2&lt;/v4-dhcp-relay-gateway-address&gt;
- &lt;excluded-v4-addresses&gt;
- &lt;excluded-v4-address&gt;192.168.1.7&lt;/excluded-v4-address&gt;
- &lt;/excluded-v4-addresses&gt;
- &lt;v4-dhcp-pool-prefix&gt;192.155.2.4&lt;/v4-dhcp-pool-prefix&gt;
- &lt;/v4-dhcp-pools&gt;
- &lt;use-v4-default-pool&gt;Y&lt;/use-v4-default-pool&gt;
- &lt;excluded-v6-dhcp-addresses-from-default-pool&gt;
- &lt;excluded-v6-address&gt;1:5&lt;/excluded-v6-address&gt;
- &lt;/excluded-v6-dhcp-addresses-from-default-pool&gt;
- &lt;excluded-v6-dhcp-addresses-from-default-pool&gt;
- &lt;excluded-v6-address&gt;1:6&lt;/excluded-v6-address&gt;
- &lt;/excluded-v6-dhcp-addresses-from-default-pool&gt;
- &lt;v6-dhcp-pools&gt;
- &lt;v6-dhcp-relay-next-hop-address&gt;4:4&lt;/v6-dhcp-relay-next-hop-address&gt;
- &lt;v6-dhcp-pool-prefix-length&gt;28&lt;/v6-dhcp-pool-prefix-length&gt;
- &lt;excluded-v6-addresses&gt;
- &lt;excluded-v6-address&gt;1:1&lt;/excluded-v6-address&gt;
- &lt;/excluded-v6-addresses&gt;
- &lt;v6-dhcp-relay-gateway-address&gt;3:3&lt;/v6-dhcp-relay-gateway-address&gt;
- &lt;excluded-v6-addresses&gt;
- &lt;excluded-v6-address&gt;2:2&lt;/excluded-v6-address&gt;
- &lt;/excluded-v6-addresses&gt;
- &lt;v6-dhcp-pool-prefix&gt;0:0&lt;/v6-dhcp-pool-prefix&gt;
- &lt;/v6-dhcp-pools&gt;
- &lt;v6-dhcp-pools&gt;
- &lt;v6-dhcp-relay-next-hop-address&gt;4:4&lt;/v6-dhcp-relay-next-hop-address&gt;
- &lt;v6-dhcp-pool-prefix-length&gt;28&lt;/v6-dhcp-pool-prefix-length&gt;
- &lt;excluded-v6-addresses&gt;
- &lt;excluded-v6-address&gt;1:1&lt;/excluded-v6-address&gt;
- &lt;/excluded-v6-addresses&gt;
- &lt;v6-dhcp-relay-gateway-address&gt;3:3&lt;/v6-dhcp-relay-gateway-address&gt;
- &lt;excluded-v6-addresses&gt;
- &lt;excluded-v6-address&gt;2:2&lt;/excluded-v6-address&gt;
- &lt;/excluded-v6-addresses&gt;
- &lt;v6-dhcp-pool-prefix&gt;0:0&lt;/v6-dhcp-pool-prefix&gt;
- &lt;/v6-dhcp-pools&gt;
- &lt;/dhcp&gt;
- &lt;firewall-lite&gt;
- &lt;stateful-firewall-lite-v6-enabled&gt;N&lt;/stateful-firewall-lite-v6-enabled&gt;
- &lt;stateful-firewall-lite-v4-enabled&gt;Y&lt;/stateful-firewall-lite-v4-enabled&gt;
- &lt;v4-firewall-packet-filters&gt;
- &lt;v4-firewall-prefix&gt;0.0.0.1&lt;/v4-firewall-prefix&gt;
- &lt;v4-firewall-prefix-length&gt;1&lt;/v4-firewall-prefix-length&gt;
- &lt;allow-icmp-ping&gt;Y&lt;/allow-icmp-ping&gt;
- &lt;udp-ports&gt;
- &lt;port-number&gt;1&lt;/port-number&gt;
- &lt;/udp-ports&gt;
- &lt;tcp-ports&gt;
- &lt;port-number&gt;1&lt;/port-number&gt;
- &lt;/tcp-ports&gt;
- &lt;/v4-firewall-packet-filters&gt;
- &lt;v4-firewall-packet-filters&gt;
- &lt;v4-firewall-prefix&gt;0.0.0.2&lt;/v4-firewall-prefix&gt;
- &lt;v4-firewall-prefix-length&gt;2&lt;/v4-firewall-prefix-length&gt;
- &lt;allow-icmp-ping&gt;Y&lt;/allow-icmp-ping&gt;
- &lt;udp-ports&gt;
- &lt;port-number&gt;2&lt;/port-number&gt;
- &lt;/udp-ports&gt;
- &lt;tcp-ports&gt;
- &lt;port-number&gt;2&lt;/port-number&gt;
- &lt;/tcp-ports&gt;
- &lt;/v4-firewall-packet-filters&gt;
- &lt;v6-firewall-packet-filters&gt;
- &lt;v6-firewall-prefix&gt;:&lt;/v6-firewall-prefix&gt;
- &lt;v6-firewall-prefix-length&gt;0&lt;/v6-firewall-prefix-length&gt;
- &lt;allow-icmp-ping&gt;Y&lt;/allow-icmp-ping&gt;
- &lt;udp-ports&gt;
- &lt;port-number&gt;3&lt;/port-number&gt;
- &lt;/udp-ports&gt;
- &lt;tcp-ports&gt;
- &lt;port-number&gt;3&lt;/port-number&gt;
- &lt;/tcp-ports&gt;
- &lt;/v6-firewall-packet-filters&gt;
- &lt;v6-firewall-packet-filters&gt;
- &lt;v6-firewall-prefix&gt;:&lt;/v6-firewall-prefix&gt;
- &lt;v6-firewall-prefix-length&gt;1&lt;/v6-firewall-prefix-length&gt;
- &lt;allow-icmp-ping&gt;Y&lt;/allow-icmp-ping&gt;
- &lt;udp-ports&gt;
- &lt;port-number&gt;4&lt;/port-number&gt;
- &lt;/udp-ports&gt;
- &lt;tcp-ports&gt;
- &lt;port-number&gt;4&lt;/port-number&gt;
- &lt;/tcp-ports&gt;
- &lt;/v6-firewall-packet-filters&gt;
- &lt;/firewall-lite&gt;
- &lt;pat&gt;
- &lt;v4-pat-pools&gt;
- &lt;v4-pat-pool-prefix&gt;192.168.1.44&lt;/v4-pat-pool-prefix&gt;
- &lt;v4-pat-pool-next-hop-address&gt;192.168.1.5&lt;/v4-pat-pool-next-hop-address&gt;
- &lt;v4-pat-pool-prefix-length&gt;0&lt;/v4-pat-pool-prefix-length&gt;
- &lt;/v4-pat-pools&gt;
- &lt;use-v4-default-pool&gt;Y&lt;/use-v4-default-pool&gt;
- &lt;v4-pat-enabled&gt;N&lt;/v4-pat-enabled&gt;
- &lt;v4-pat-pools&gt;
- &lt;v4-pat-pool-prefix&gt;192.168.1.45&lt;/v4-pat-pool-prefix&gt;
- &lt;v4-pat-pool-next-hop-address&gt;192.168.1.6&lt;/v4-pat-pool-next-hop-address&gt;
- &lt;v4-pat-pool-prefix-length&gt;28&lt;/v4-pat-pool-prefix-length&gt;
- &lt;/v4-pat-pools&gt;
- &lt;/pat&gt;
- &lt;nat&gt;
- &lt;v4-nat-enabled&gt;Y&lt;/v4-nat-enabled&gt;
- &lt;v4-nat-mapping-entries&gt;
- &lt;v4-nat-internal&gt;0.0.0.0&lt;/v4-nat-internal&gt;
- &lt;v4-nat-next-hop-address&gt;0.0.0.0&lt;/v4-nat-next-hop-address&gt;
- &lt;v4-nat-external&gt;0.0.0.0&lt;/v4-nat-external&gt;
- &lt;/v4-nat-mapping-entries&gt;
- &lt;v4-nat-mapping-entries&gt;
- &lt;v4-nat-internal&gt;0.0.0.1&lt;/v4-nat-internal&gt;
- &lt;v4-nat-next-hop-address&gt;0.0.0.1&lt;/v4-nat-next-hop-address&gt;
- &lt;v4-nat-external&gt;0.0.0.1&lt;/v4-nat-external&gt;
- &lt;/v4-nat-mapping-entries&gt;
- &lt;/nat&gt;
- &lt;vr-designation&gt;primary&lt;/vr-designation&gt;
- &lt;v4-vce-loopback-address&gt;162.200.3.144&lt;/v4-vce-loopback-address&gt;
- &lt;v6-vr-lan-prefix-length&gt;64&lt;/v6-vr-lan-prefix-length&gt;
- &lt;v6-vce-wan-address&gt;2001:1890:12e3:2da::&lt;/v6-vce-wan-address&gt;
- &lt;v6-vr-lan-prefix&gt;2620:0:10d0:f:ffff:ffff:ffff:fffe&lt;/v6-vr-lan-prefix&gt;
- &lt;v4-vr-lan-prefix-length&gt;24&lt;/v4-vr-lan-prefix-length&gt;
- &lt;v4-vr-lan-prefix&gt;10.192.27.254&lt;/v4-vr-lan-prefix&gt;
- &lt;v4-public-lan-prefixes&gt;
- &lt;t-provided-v4-lan-public-prefixes&gt;
- &lt;request-index&gt;1&lt;/request-index&gt;
- &lt;v4-next-hop-address&gt;192.168.1.2&lt;/v4-next-hop-address&gt;
- &lt;v4-lan-public-prefix&gt;192.168.1.1&lt;/v4-lan-public-prefix&gt;
- &lt;v4-lan-public-prefix-length&gt;28&lt;/v4-lan-public-prefix-length&gt;
- &lt;/t-provided-v4-lan-public-prefixes&gt;
- &lt;t-provided-v4-lan-public-prefixes&gt;
- &lt;request-index&gt;1&lt;/request-index&gt;
- &lt;v4-next-hop-address&gt;192.168.1.72&lt;/v4-next-hop-address&gt;
- &lt;v4-lan-public-prefix&gt;192.168.1.71&lt;/v4-lan-public-prefix&gt;
- &lt;v4-lan-public-prefix-length&gt;28&lt;/v4-lan-public-prefix-length&gt;
- &lt;/t-provided-v4-lan-public-prefixes&gt;
- &lt;t-provided-v4-lan-public-prefixes&gt;
- &lt;request-index&gt;1&lt;/request-index&gt;
- &lt;v4-next-hop-address&gt;192.168.1.68&lt;/v4-next-hop-address&gt;
- &lt;v4-lan-public-prefix&gt;192.168.1.67&lt;/v4-lan-public-prefix&gt;
- &lt;v4-lan-public-prefix-length&gt;28&lt;/v4-lan-public-prefix-length&gt;
- &lt;/t-provided-v4-lan-public-prefixes&gt;
- &lt;/v4-public-lan-prefixes&gt;
- &lt;v6-public-lan-prefixes&gt;
- &lt;t-provided-v6-lan-public-prefixes&gt;
- &lt;request-index&gt;1&lt;/request-index&gt;
- &lt;v6-next-hop-address&gt;2001:1890:12e3:2da::&lt;/v6-next-hop-address&gt;
- &lt;v6-lan-public-prefix&gt;2001:1890:12e3:2da::&lt;/v6-lan-public-prefix&gt;
- &lt;v6-lan-public-prefix-length&gt;28&lt;/v6-lan-public-prefix-length&gt;
- &lt;/t-provided-v6-lan-public-prefixes&gt;
- &lt;t-provided-v6-lan-public-prefixes&gt;
- &lt;request-index&gt;1&lt;/request-index&gt;
- &lt;v6-next-hop-address&gt;2001:1890:12e3:2da::&lt;/v6-next-hop-address&gt;
- &lt;v6-lan-public-prefix&gt;2001:1890:12e3:3da::&lt;/v6-lan-public-prefix&gt;
- &lt;v6-lan-public-prefix-length&gt;28&lt;/v6-lan-public-prefix-length&gt;
- &lt;/t-provided-v6-lan-public-prefixes&gt;
- &lt;t-provided-v6-lan-public-prefixes&gt;
- &lt;request-index&gt;1&lt;/request-index&gt;
- &lt;v6-next-hop-address&gt;2001:1890:12e3:2da::&lt;/v6-next-hop-address&gt;
- &lt;v6-lan-public-prefix&gt;2001:1890:12e3:4da::&lt;/v6-lan-public-prefix&gt;
- &lt;v6-lan-public-prefix-length&gt;28&lt;/v6-lan-public-prefix-length&gt;
- &lt;/t-provided-v6-lan-public-prefixes&gt;
- &lt;/v6-public-lan-prefixes&gt;
- &lt;/vr-lan-interface&gt;
- &lt;routing-protocol&gt;none&lt;/routing-protocol&gt;
- &lt;/vr-lan&gt;
-&lt;ucpe-vms-service-information&gt;
- &lt;transport-service-information&gt;
- &lt;transport-service-type&gt;AVPN&lt;/transport-service-type&gt;
- &lt;access-circuit-info&gt;
- &lt;access-circuit-id&gt;1&lt;/access-circuit-id&gt;
- &lt;dual-mode&gt;Active&lt;/dual-mode&gt;
- &lt;/access-circuit-info&gt;
- &lt;access-circuit-info&gt;
- &lt;access-circuit-id&gt;2&lt;/access-circuit-id&gt;
- &lt;dual-mode&gt;Standby&lt;/dual-mode&gt;
- &lt;/access-circuit-info&gt;
- &lt;/transport-service-information&gt;
- &lt;ucpe-information&gt;
- &lt;ucpe-host-name&gt;hostname&lt;/ucpe-host-name&gt;
- &lt;ucpe-activation-code&gt;activecode&lt;/ucpe-activation-code&gt;
- &lt;out-of-band-management-modem&gt;OOB&lt;/out-of-band-management-modem&gt;
- &lt;/ucpe-information&gt;
- &lt;vnf-list&gt;
- &lt;vnf-information&gt;
- &lt;vnf-instance-id&gt;1&lt;/vnf-instance-id&gt;
- &lt;vnf-sequence-number&gt;1&lt;/vnf-sequence-number&gt;
- &lt;vnf-type&gt;ZZ&lt;/vnf-type&gt;
- &lt;vnf-vendor&gt;JUNIPER&lt;/vnf-vendor&gt;
- &lt;vnf-model&gt;MODEL1&lt;/vnf-model&gt;
- &lt;vnf-id&gt;1&lt;/vnf-id&gt;
- &lt;prov-status&gt;1&lt;/prov-status&gt;
- &lt;operational-state&gt;1&lt;/operational-state&gt;
- &lt;orchestration-status&gt;1&lt;/orchestration-status&gt;
- &lt;equipment-role&gt;1&lt;/equipment-role&gt;
- &lt;/vnf-information&gt;
- &lt;vnf-information&gt;
- &lt;vnf-instance-id&gt;2&lt;/vnf-instance-id&gt;
- &lt;vnf-sequence-number&gt;2&lt;/vnf-sequence-number&gt;
- &lt;vnf-type&gt;HY&lt;/vnf-type&gt;
- &lt;vnf-vendor&gt;JUNIPER&lt;/vnf-vendor&gt;
- &lt;vnf-model&gt;MODEL2&lt;/vnf-model&gt;
- &lt;vnf-id&gt;2&lt;/vnf-id&gt;
- &lt;prov-status&gt;2&lt;/prov-status&gt;
- &lt;operational-state&gt;2&lt;/operational-state&gt;
- &lt;orchestration-status&gt;2&lt;/orchestration-status&gt;
- &lt;equipment-role&gt;2&lt;/equipment-role&gt;
- &lt;/vnf-information&gt;
- &lt;/vnf-list&gt;
- &lt;/ucpe-vms-service-information&gt;
- &lt;request-information&gt;
- &lt;request-action&gt;Layer3ServiceActivateRequest&lt;/request-action&gt;
- &lt;order-number&gt;4281555&lt;/order-number&gt;
- &lt;request-id&gt;155415ab-b4a7-4382-b4c6-d17d9sm42855&lt;/request-id&gt;
- &lt;notification-url&gt;https://csi-tst-q22.it.com:22443/Services/com/cingular/csi/sdn/SendManagedNetworkStatusNotification.jws&lt;/notification-url&gt;
- &lt;source&gt;OMX&lt;/source&gt;
- &lt;order-version&gt;1&lt;/order-version&gt;
- &lt;/request-information&gt;
- &lt;sdnc-request-header&gt;
- &lt;svc-action&gt;activate&lt;/svc-action&gt;
- &lt;svc-notification-url&gt;https://msojra.mtsnjdcp1.aic.cip.com:8443/adapters/rest/SDNCNotify&lt;/svc-notification-url&gt;
- &lt;svc-request-id&gt;5b1f3c5d-cdf9-488d-8a4b-d3f1229d7760&lt;/svc-request-id&gt;
- &lt;/sdnc-request-header&gt;
- &lt;l2-homing-information&gt;
- &lt;topology&gt;MultiPoint&lt;/topology&gt;
- &lt;preferred-aic-clli&gt;MTSNJA4LCP1&lt;/preferred-aic-clli&gt;
- &lt;evc-name&gt;AS/VLXM/003717//SW&lt;/evc-name&gt;
- &lt;/l2-homing-information&gt;
- &lt;service-information&gt;
- &lt;service-instance-id&gt;FK/VLXM/003717//SW_INTERNET&lt;/service-instance-id&gt;
- &lt;subscriber-name&gt;ST E2E Test42855_1300004281555&lt;/subscriber-name&gt;
- &lt;service-type&gt;SDN-ETHERNET-INTERNET&lt;/service-type&gt;
- &lt;/service-information&gt;
- &lt;internet-service-change-details&gt;
- &lt;internet-evc-speed-value&gt;10&lt;/internet-evc-speed-value&gt;
- &lt;internet-evc-speed-units&gt;Kbps&lt;/internet-evc-speed-units&gt;
- &lt;t-provided-v4-lan-public-prefixes&gt;
- &lt;request-index&gt;1&lt;/request-index&gt;
- &lt;v4-next-hop-address&gt;192.168.1.15&lt;/v4-next-hop-address&gt;
- &lt;v4-lan-public-prefix&gt;192.168.1.15&lt;/v4-lan-public-prefix&gt;
- &lt;v4-lan-public-prefix-length&gt;28&lt;/v4-lan-public-prefix-length&gt;
- &lt;/t-provided-v4-lan-public-prefixes&gt;
- &lt;t-provided-v4-lan-public-prefixes&gt;
- &lt;request-index&gt;2&lt;/request-index&gt;
- &lt;v4-next-hop-address&gt;192.168.1.16&lt;/v4-next-hop-address&gt;
- &lt;v4-lan-public-prefix&gt;192.168.1.16&lt;/v4-lan-public-prefix&gt;
- &lt;v4-lan-public-prefix-length&gt;28&lt;/v4-lan-public-prefix-length&gt;
- &lt;/t-provided-v4-lan-public-prefixes&gt;
- &lt;t-provided-v6-lan-public-prefixes&gt;
- &lt;request-index&gt;1&lt;/request-index&gt;
- &lt;v6-next-hop-address&gt;2001:1890:12e3:2da::&lt;/v6-next-hop-address&gt;
- &lt;v6-lan-public-prefix&gt;2001:1890:12e3:2da::&lt;/v6-lan-public-prefix&gt;
- &lt;v6-lan-public-prefix-length&gt;28&lt;/v6-lan-public-prefix-length&gt;
- &lt;/t-provided-v6-lan-public-prefixes&gt;
- &lt;t-provided-v6-lan-public-prefixes&gt;
- &lt;request-index&gt;1&lt;/request-index&gt;
- &lt;v6-next-hop-address&gt;2001:1890:12e3:2da::&lt;/v6-next-hop-address&gt;
- &lt;v6-lan-public-prefix&gt;2001:1890:12e3:2da::&lt;/v6-lan-public-prefix&gt;
- &lt;v6-lan-public-prefix-length&gt;28&lt;/v6-lan-public-prefix-length&gt;
- &lt;/t-provided-v6-lan-public-prefixes&gt;
- &lt;/internet-service-change-details&gt;
- &lt;/service-data&gt;
- &lt;/layer3-service-list&gt;
-</tag0:RequestData>
- </sdncadapterworkflow:response-data>
-</sdncadapterworkflow:SDNCAdapterWorkflowResponse>"""
-
- String sdncAdapterRequest = """
- <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
- <SOAP-ENV:Body>
- <aetgt:SDNCAdapterRequest xmlns:aetgt="http://org.openecomp/workflow/sdnc/adapter/schema/v1" xmlns:sdncadaptersc="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
- <sdncadapter:RequestHeader xmlns:sdncadapter="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
- <sdncadapter:RequestId>745b1b50-e39e-4685-9cc8-c71f0bde8bf0</sdncadapter:RequestId>
- <sdncadapter:SvcAction>query</sdncadapter:SvcAction>
- <sdncadapter:SvcOperation>services/layer3-service-list/AS%2FVLXM%2F000199%2F%2FSB_INTERNET</sdncadapter:SvcOperation>
- <sdncadapter:CallbackUrl>http://myhost.com:28080/mso/sdncAdapterCallbackServiceImpl</sdncadapter:CallbackUrl>
- </sdncadapter:RequestHeader>
- <sdncadaptersc:RequestData><rest:payload xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- contentType="text/xml">
- <service-request xmlns="http://org.openecomp/mso/request/details/schema/v1">
- <request-information>
- <request-id>12570a36-7388-4c0a-bec4-189ce3kg9956</request-id>
- <request-action>GetLayer3ServiceDetailsRequest</request-action>
- <source>OMX</source>
- </request-information>
- <service-information>
- <service-type>SDN-ETHERNET-INTERNET</service-type>
- <service-instance-id>PD/VLXM/003717//SW_INTERNET</service-instance-id>
- </service-information>
- </service-request>
-</rest:payload></sdncadaptersc:RequestData></aetgt:SDNCAdapterRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>"""
-
-def sdncAdapterResponse = """<sdncadapterworkflow:SDNCAdapterWorkflowResponse xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1">
-<sdncadapterworkflow:response-data>
-<tag0:CallbackHeader xmlns:tag0="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
- <tag0:RequestId>39542e39-ccc3-4d1a-8b79-04ce88526613</tag0:RequestId>
- <tag0:ResponseCode>404</tag0:ResponseCode>
- <tag0:ResponseMessage>Error processing request to SDNC. Not Found.
- https://sdncodl.us.aic.cip.com:8443/restconf/config/L3SDN-API:services/layer3-service-list/MVM%2FVLXP%2F000855%2F%2FShakeout.
- SDNC Returned-[error-type:application, error-tag:data-missing,
- error-message:Request could not be completed because the relevant
- data model content does not exist.]</tag0:ResponseMessage>
-</tag0:CallbackHeader>
-</sdncadapterworkflow:response-data>
-</sdncadapterworkflow:SDNCAdapterWorkflowResponse>
-"""
-
-def workflowErrorResponse = """<aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">
- <aetgt:ErrorMessage>Received error from SDN-C: Error processing request to SDNC. Not Found.
- https://sdncodl.us.aic.cip.com:8443/restconf/config/L3SDN-API:services/layer3-service-list/MVM%2FVLXP%2F000855%2F%2FShakeout.
- SDNC Returned-[error-type:application, error-tag:data-missing,
- error-message:Request could not be completed because the relevant
- data model content does not exist.]</aetgt:ErrorMessage>
- <aetgt:ErrorCode>5300</aetgt:ErrorCode>
- <aetgt:SourceSystemErrorCode>404</aetgt:SourceSystemErrorCode>
- </aetgt:WorkflowException>"""
-
-def workflowErrorResponse1 = """<aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">
- <aetgt:ErrorMessage>Invalid Callback Response from SDNC Adapter</aetgt:ErrorMessage>
- <aetgt:ErrorCode>5300</aetgt:ErrorCode>
- </aetgt:WorkflowException>"""
-
-def enhancedCallbackRequestData =
- """<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"> <layer3-service-list xmlns="com:att:sdnctl:l3api">
- <service-instance-id>FK/VLXM/003717//SW_INTERNET</service-instance-id>
- <service-status>
- <rpc-name>service-configuration-operation</rpc-name>
- <rpc-action>activate</rpc-action>
- <request-status>synccomplete</request-status>
- <final-indicator>N</final-indicator>
- <l3sdn-action>Layer3ServiceActivateRequest</l3sdn-action>
- <l3sdn-subaction>SUPP</l3sdn-subaction>
- <response-timestamp>2015-04-28T21:32:11.386Z</response-timestamp>
- </service-status>
- <service-data>
- <internet-evc-access-information>
- <ip-version>ds</ip-version>
- <internet-evc-speed-value>8</internet-evc-speed-value>
- <internet-evc-speed-units>Mbps</internet-evc-speed-units>
- </internet-evc-access-information>
- <vr-lan xmlns="com:att:sdnctl:l3api">
- <vr-lan-interface>
- <static-routes>
- <v6-static-routes>
- <v6-next-hop-address>2001:1890:12e3:2da::</v6-next-hop-address>
- <v6-static-route-prefix>2001:1890:12e3:2da::</v6-static-route-prefix>
- <v6-static-route-prefix-length>28</v6-static-route-prefix-length>
- </v6-static-routes>
- <v4-static-routes>
- <v4-static-route-prefix>255.255.252.1</v4-static-route-prefix>
- <v4-next-hop-address>192.168.1.15</v4-next-hop-address>
- <v4-static-route-prefix-length>28</v4-static-route-prefix-length>
- </v4-static-routes>
- <v6-static-routes>
- <v6-next-hop-address>2001:1890:12e3:2da::</v6-next-hop-address>
- <v6-static-route-prefix>2001:1890:12e3:2da::</v6-static-route-prefix>
- <v6-static-route-prefix-length>28</v6-static-route-prefix-length>
- </v6-static-routes>
- <v4-static-routes>
- <v4-static-route-prefix>255.255.252.2</v4-static-route-prefix>
- <v4-next-hop-address>192.168.1.15</v4-next-hop-address>
- <v4-static-route-prefix-length>28</v4-static-route-prefix-length>
- </v4-static-routes>
- <v4-static-routes>
- <v4-static-route-prefix>255.255.252.3</v4-static-route-prefix>
- <v4-next-hop-address>192.168.1.15</v4-next-hop-address>
- <v4-static-route-prefix-length>28</v4-static-route-prefix-length>
- </v4-static-routes>
- </static-routes>
- <dhcp>
- <v6-dhcp-server-enabled>N</v6-dhcp-server-enabled>
- <v4-dhcp-server-enabled>Y</v4-dhcp-server-enabled>
- <use-v6-default-pool>N</use-v6-default-pool>
- <excluded-v4-dhcp-addresses-from-default-pool>
- <excluded-v4-address>192.168.1.7</excluded-v4-address>
- </excluded-v4-dhcp-addresses-from-default-pool>
- <excluded-v4-dhcp-addresses-from-default-pool>
- <excluded-v4-address>192.168.1.8</excluded-v4-address>
- </excluded-v4-dhcp-addresses-from-default-pool>
- <v4-dhcp-pools>
- <v4-dhcp-relay-next-hop-address>1.1.1.1</v4-dhcp-relay-next-hop-address>
- <v4-dhcp-pool-prefix-length>28</v4-dhcp-pool-prefix-length>
- <excluded-v4-addresses>
- <excluded-v4-address>192.168.1.5</excluded-v4-address>
- </excluded-v4-addresses>
- <v4-dhcp-relay-gateway-address>2.2.2.1</v4-dhcp-relay-gateway-address>
- <excluded-v4-addresses>
- <excluded-v4-address>192.168.1.6</excluded-v4-address>
- </excluded-v4-addresses>
- <v4-dhcp-pool-prefix>192.155.2.3</v4-dhcp-pool-prefix>
- </v4-dhcp-pools>
- <v4-dhcp-pools>
- <v4-dhcp-relay-next-hop-address>1.1.1.2</v4-dhcp-relay-next-hop-address>
- <v4-dhcp-pool-prefix-length>28</v4-dhcp-pool-prefix-length>
- <excluded-v4-addresses>
- <excluded-v4-address>192.168.1.6</excluded-v4-address>
- </excluded-v4-addresses>
- <v4-dhcp-relay-gateway-address>2.2.2.2</v4-dhcp-relay-gateway-address>
- <excluded-v4-addresses>
- <excluded-v4-address>192.168.1.7</excluded-v4-address>
- </excluded-v4-addresses>
- <v4-dhcp-pool-prefix>192.155.2.4</v4-dhcp-pool-prefix>
- </v4-dhcp-pools>
- <use-v4-default-pool>Y</use-v4-default-pool>
- <excluded-v6-dhcp-addresses-from-default-pool>
- <excluded-v6-address>1:5</excluded-v6-address>
- </excluded-v6-dhcp-addresses-from-default-pool>
- <excluded-v6-dhcp-addresses-from-default-pool>
- <excluded-v6-address>1:6</excluded-v6-address>
- </excluded-v6-dhcp-addresses-from-default-pool>
- <v6-dhcp-pools>
- <v6-dhcp-relay-next-hop-address>4:4</v6-dhcp-relay-next-hop-address>
- <v6-dhcp-pool-prefix-length>28</v6-dhcp-pool-prefix-length>
- <excluded-v6-addresses>
- <excluded-v6-address>1:1</excluded-v6-address>
- </excluded-v6-addresses>
- <v6-dhcp-relay-gateway-address>3:3</v6-dhcp-relay-gateway-address>
- <excluded-v6-addresses>
- <excluded-v6-address>2:2</excluded-v6-address>
- </excluded-v6-addresses>
- <v6-dhcp-pool-prefix>0:0</v6-dhcp-pool-prefix>
- </v6-dhcp-pools>
- <v6-dhcp-pools>
- <v6-dhcp-relay-next-hop-address>4:4</v6-dhcp-relay-next-hop-address>
- <v6-dhcp-pool-prefix-length>28</v6-dhcp-pool-prefix-length>
- <excluded-v6-addresses>
- <excluded-v6-address>1:1</excluded-v6-address>
- </excluded-v6-addresses>
- <v6-dhcp-relay-gateway-address>3:3</v6-dhcp-relay-gateway-address>
- <excluded-v6-addresses>
- <excluded-v6-address>2:2</excluded-v6-address>
- </excluded-v6-addresses>
- <v6-dhcp-pool-prefix>0:0</v6-dhcp-pool-prefix>
- </v6-dhcp-pools>
- </dhcp>
- <firewall-lite>
- <stateful-firewall-lite-v6-enabled>N</stateful-firewall-lite-v6-enabled>
- <stateful-firewall-lite-v4-enabled>Y</stateful-firewall-lite-v4-enabled>
- <v4-firewall-packet-filters>
- <v4-firewall-prefix>0.0.0.1</v4-firewall-prefix>
- <v4-firewall-prefix-length>1</v4-firewall-prefix-length>
- <allow-icmp-ping>Y</allow-icmp-ping>
- <udp-ports>
- <port-number>1</port-number>
- </udp-ports>
- <tcp-ports>
- <port-number>1</port-number>
- </tcp-ports>
- </v4-firewall-packet-filters>
- <v4-firewall-packet-filters>
- <v4-firewall-prefix>0.0.0.2</v4-firewall-prefix>
- <v4-firewall-prefix-length>2</v4-firewall-prefix-length>
- <allow-icmp-ping>Y</allow-icmp-ping>
- <udp-ports>
- <port-number>2</port-number>
- </udp-ports>
- <tcp-ports>
- <port-number>2</port-number>
- </tcp-ports>
- </v4-firewall-packet-filters>
- <v6-firewall-packet-filters>
- <v6-firewall-prefix>:</v6-firewall-prefix>
- <v6-firewall-prefix-length>0</v6-firewall-prefix-length>
- <allow-icmp-ping>Y</allow-icmp-ping>
- <udp-ports>
- <port-number>3</port-number>
- </udp-ports>
- <tcp-ports>
- <port-number>3</port-number>
- </tcp-ports>
- </v6-firewall-packet-filters>
- <v6-firewall-packet-filters>
- <v6-firewall-prefix>:</v6-firewall-prefix>
- <v6-firewall-prefix-length>1</v6-firewall-prefix-length>
- <allow-icmp-ping>Y</allow-icmp-ping>
- <udp-ports>
- <port-number>4</port-number>
- </udp-ports>
- <tcp-ports>
- <port-number>4</port-number>
- </tcp-ports>
- </v6-firewall-packet-filters>
- </firewall-lite>
- <pat>
- <v4-pat-pools>
- <v4-pat-pool-prefix>192.168.1.44</v4-pat-pool-prefix>
- <v4-pat-pool-next-hop-address>192.168.1.5</v4-pat-pool-next-hop-address>
- <v4-pat-pool-prefix-length>0</v4-pat-pool-prefix-length>
- </v4-pat-pools>
- <use-v4-default-pool>Y</use-v4-default-pool>
- <v4-pat-enabled>N</v4-pat-enabled>
- <v4-pat-pools>
- <v4-pat-pool-prefix>192.168.1.45</v4-pat-pool-prefix>
- <v4-pat-pool-next-hop-address>192.168.1.6</v4-pat-pool-next-hop-address>
- <v4-pat-pool-prefix-length>28</v4-pat-pool-prefix-length>
- </v4-pat-pools>
- </pat>
- <nat>
- <v4-nat-enabled>Y</v4-nat-enabled>
- <v4-nat-mapping-entries>
- <v4-nat-internal>0.0.0.0</v4-nat-internal>
- <v4-nat-next-hop-address>0.0.0.0</v4-nat-next-hop-address>
- <v4-nat-external>0.0.0.0</v4-nat-external>
- </v4-nat-mapping-entries>
- <v4-nat-mapping-entries>
- <v4-nat-internal>0.0.0.1</v4-nat-internal>
- <v4-nat-next-hop-address>0.0.0.1</v4-nat-next-hop-address>
- <v4-nat-external>0.0.0.1</v4-nat-external>
- </v4-nat-mapping-entries>
- </nat>
- <vr-designation>primary</vr-designation>
- <v4-vce-loopback-address>162.200.3.144</v4-vce-loopback-address>
- <v6-vr-lan-prefix-length>64</v6-vr-lan-prefix-length>
- <v6-vce-wan-address>2001:1890:12e3:2da::</v6-vce-wan-address>
- <v6-vr-lan-prefix>2620:0:10d0:f:ffff:ffff:ffff:fffe</v6-vr-lan-prefix>
- <v4-vr-lan-prefix-length>24</v4-vr-lan-prefix-length>
- <v4-vr-lan-prefix>10.192.27.254</v4-vr-lan-prefix>
- <v4-public-lan-prefixes>
- <t-provided-v4-lan-public-prefixes>
- <request-index>1</request-index>
- <v4-next-hop-address>192.168.1.2</v4-next-hop-address>
- <v4-lan-public-prefix>192.168.1.1</v4-lan-public-prefix>
- <v4-lan-public-prefix-length>28</v4-lan-public-prefix-length>
- </t-provided-v4-lan-public-prefixes>
- <t-provided-v4-lan-public-prefixes>
- <request-index>1</request-index>
- <v4-next-hop-address>192.168.1.72</v4-next-hop-address>
- <v4-lan-public-prefix>192.168.1.71</v4-lan-public-prefix>
- <v4-lan-public-prefix-length>28</v4-lan-public-prefix-length>
- </t-provided-v4-lan-public-prefixes>
- <t-provided-v4-lan-public-prefixes>
- <request-index>1</request-index>
- <v4-next-hop-address>192.168.1.68</v4-next-hop-address>
- <v4-lan-public-prefix>192.168.1.67</v4-lan-public-prefix>
- <v4-lan-public-prefix-length>28</v4-lan-public-prefix-length>
- </t-provided-v4-lan-public-prefixes>
- </v4-public-lan-prefixes>
- <v6-public-lan-prefixes>
- <t-provided-v6-lan-public-prefixes>
- <request-index>1</request-index>
- <v6-next-hop-address>2001:1890:12e3:2da::</v6-next-hop-address>
- <v6-lan-public-prefix>2001:1890:12e3:2da::</v6-lan-public-prefix>
- <v6-lan-public-prefix-length>28</v6-lan-public-prefix-length>
- </t-provided-v6-lan-public-prefixes>
- <t-provided-v6-lan-public-prefixes>
- <request-index>1</request-index>
- <v6-next-hop-address>2001:1890:12e3:2da::</v6-next-hop-address>
- <v6-lan-public-prefix>2001:1890:12e3:3da::</v6-lan-public-prefix>
- <v6-lan-public-prefix-length>28</v6-lan-public-prefix-length>
- </t-provided-v6-lan-public-prefixes>
- <t-provided-v6-lan-public-prefixes>
- <request-index>1</request-index>
- <v6-next-hop-address>2001:1890:12e3:2da::</v6-next-hop-address>
- <v6-lan-public-prefix>2001:1890:12e3:4da::</v6-lan-public-prefix>
- <v6-lan-public-prefix-length>28</v6-lan-public-prefix-length>
- </t-provided-v6-lan-public-prefixes>
- </v6-public-lan-prefixes>
- </vr-lan-interface>
- <routing-protocol>none</routing-protocol>
- </vr-lan>
-<ucpe-vms-service-information>
- <transport-service-information>
- <transport-service-type>AVPN</transport-service-type>
- <access-circuit-info>
- <access-circuit-id>1</access-circuit-id>
- <dual-mode>Active</dual-mode>
- </access-circuit-info>
- <access-circuit-info>
- <access-circuit-id>2</access-circuit-id>
- <dual-mode>Standby</dual-mode>
- </access-circuit-info>
- </transport-service-information>
- <ucpe-information>
- <ucpe-host-name>hostname</ucpe-host-name>
- <ucpe-activation-code>activecode</ucpe-activation-code>
- <out-of-band-management-modem>OOB</out-of-band-management-modem>
- </ucpe-information>
- <vnf-list>
- <vnf-information>
- <vnf-instance-id>1</vnf-instance-id>
- <vnf-sequence-number>1</vnf-sequence-number>
- <vnf-type>ZZ</vnf-type>
- <vnf-vendor>JUNIPER</vnf-vendor>
- <vnf-model>MODEL1</vnf-model>
- <vnf-id>1</vnf-id>
- <prov-status>1</prov-status>
- <operational-state>1</operational-state>
- <orchestration-status>1</orchestration-status>
- <equipment-role>1</equipment-role>
- </vnf-information>
- <vnf-information>
- <vnf-instance-id>2</vnf-instance-id>
- <vnf-sequence-number>2</vnf-sequence-number>
- <vnf-type>HY</vnf-type>
- <vnf-vendor>JUNIPER</vnf-vendor>
- <vnf-model>MODEL2</vnf-model>
- <vnf-id>2</vnf-id>
- <prov-status>2</prov-status>
- <operational-state>2</operational-state>
- <orchestration-status>2</orchestration-status>
- <equipment-role>2</equipment-role>
- </vnf-information>
- </vnf-list>
- </ucpe-vms-service-information>
- <request-information>
- <request-action>Layer3ServiceActivateRequest</request-action>
- <order-number>4281555</order-number>
- <request-id>155415ab-b4a7-4382-b4c6-d17d9sm42855</request-id>
- <notification-url>https://csi-tst-q22.it.com:22443/Services/com/cingular/csi/sdn/SendManagedNetworkStatusNotification.jws</notification-url>
- <source>OMX</source>
- <order-version>1</order-version>
- </request-information>
- <sdnc-request-header>
- <svc-action>activate</svc-action>
- <svc-notification-url>https://msojra.mtsnjdcp1.aic.cip.com:8443/adapters/rest/SDNCNotify</svc-notification-url>
- <svc-request-id>5b1f3c5d-cdf9-488d-8a4b-d3f1229d7760</svc-request-id>
- </sdnc-request-header>
- <l2-homing-information>
- <topology>MultiPoint</topology>
- <preferred-aic-clli>MTSNJA4LCP1</preferred-aic-clli>
- <evc-name>AS/VLXM/003717//SW</evc-name>
- </l2-homing-information>
- <service-information>
- <service-instance-id>FK/VLXM/003717//SW_INTERNET</service-instance-id>
- <subscriber-name>ST E2E Test42855_1300004281555</subscriber-name>
- <service-type>SDN-ETHERNET-INTERNET</service-type>
- </service-information>
- <internet-service-change-details>
- <internet-evc-speed-value>10</internet-evc-speed-value>
- <internet-evc-speed-units>Kbps</internet-evc-speed-units>
- <t-provided-v4-lan-public-prefixes>
- <request-index>1</request-index>
- <v4-next-hop-address>192.168.1.15</v4-next-hop-address>
- <v4-lan-public-prefix>192.168.1.15</v4-lan-public-prefix>
- <v4-lan-public-prefix-length>28</v4-lan-public-prefix-length>
- </t-provided-v4-lan-public-prefixes>
- <t-provided-v4-lan-public-prefixes>
- <request-index>2</request-index>
- <v4-next-hop-address>192.168.1.16</v4-next-hop-address>
- <v4-lan-public-prefix>192.168.1.16</v4-lan-public-prefix>
- <v4-lan-public-prefix-length>28</v4-lan-public-prefix-length>
- </t-provided-v4-lan-public-prefixes>
- <t-provided-v6-lan-public-prefixes>
- <request-index>1</request-index>
- <v6-next-hop-address>2001:1890:12e3:2da::</v6-next-hop-address>
- <v6-lan-public-prefix>2001:1890:12e3:2da::</v6-lan-public-prefix>
- <v6-lan-public-prefix-length>28</v6-lan-public-prefix-length>
- </t-provided-v6-lan-public-prefixes>
- <t-provided-v6-lan-public-prefixes>
- <request-index>1</request-index>
- <v6-next-hop-address>2001:1890:12e3:2da::</v6-next-hop-address>
- <v6-lan-public-prefix>2001:1890:12e3:2da::</v6-lan-public-prefix>
- <v6-lan-public-prefix-length>28</v6-lan-public-prefix-length>
- </t-provided-v6-lan-public-prefixes>
- </internet-service-change-details>
- </service-data>
- </layer3-service-list>
-</tag0:RequestData>
-"""
-
-def sdncAdapterResponseEmpty =
-"""<sdncadapterworkflow:SDNCAdapterWorkflowResponse xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1">
- <sdncadapterworkflow:response-data/>
-</sdncadapterworkflow:SDNCAdapterWorkflowResponse>"""
-
-def sdncAdapterResponseError =
-"""<sdncadapterworkflow:SDNCAdapterWorkflowResponse xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:tag0="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
- <sdncadapterworkflow:response-data>
- <tag0:CallbackHeader>
- <tag0:RequestId>39542e39-ccc3-4d1a-8b79-04ce88526613</tag0:RequestId>
- <tag0:ResponseCode>404</tag0:ResponseCode>
- <tag0:ResponseMessage>Error processing request to SDNC. Not Found.
- https://sdncodl.us.aic.cip.com:8443/restconf/config/L3SDN-API:services/layer3-service-list/MVM%2FVLXP%2F000855%2F%2FShakeout.
- SDNC Returned-[error-type:application, error-tag:data-missing,
- error-message:Request could not be completed because the relevant
- data model content does not exist.]</tag0:ResponseMessage>
- </tag0:CallbackHeader>
- </sdncadapterworkflow:response-data>
-</sdncadapterworkflow:SDNCAdapterWorkflowResponse>"""
-
-
- @Test
- public void testPreProcessRequest() {
-
- String sdncAdapterWorkflowRequest = FileUtil.readResourceFile("__files/SDN-ETHERNET-INTERNET/SDNCAdapterV1/sdncadapterworkflowrequest.xml");
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getVariable("URN_mso_adapters_po_auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
- when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("sdncAdapterWorkflowRequest")).thenReturn(sdncAdapterWorkflowRequest)
- when(mockExecution.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("http://someurl.someting.com:28080/mso/sdncAdapterCallbackServiceImpl")
- when(mockExecution.getVariable("URN_mso_use_qualified_host")).thenReturn("true")
- when(mockExecution.getProcessInstanceId()).thenReturn("745b1b50-e39e-4685-9cc8-c71f0bde8bf0")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
-
-
- SDNCAdapter sdncAdapter = new SDNCAdapter()
- sdncAdapter.preProcessRequest(mockExecution)
-
- MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
- debugger.printInvocations(mockExecution)
-
-
- verify(mockExecution).setVariable("prefix","SDNCA_")
- verify(mockExecution).setVariable("sdncAdapterResponse","")
- verify(mockExecution).setVariable("asynchronousResponseTimeout",false)
- verify(mockExecution).setVariable("continueListening",false)
- verify(mockExecution).setVariable("BasicAuthHeaderValue","Basic cGFzc3dvcmQ=")
- verify(mockExecution).setVariable("serviceConfigActivate",false)
- verify(mockExecution).setVariable("SDNCA_requestId", "745b1b50-e39e-4685-9cc8-c71f0bde8bf0")
- verify(mockExecution).setVariable("SDNCA_SuccessIndicator",false)
- verify(mockExecution).setVariable("source","")
- verify(mockExecution).setVariable("sdncAdapterRequest", sdncAdapterRequest)
- }
-
- @Test
- public void testProcessResponse()
- {
- String sdncAdapterCallbackResponse = FileUtil.readResourceFile("__files/SDN-ETHERNET-INTERNET/SDNCAdapterV1mock/sdncadaptercallbackrequest.xml");
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getVariable("sdncAdapterCallbackRequest")).thenReturn(sdncAdapterCallbackResponse)
- SDNCAdapter sdncAdapter = new SDNCAdapter()
- sdncAdapter.postProcessResponse(mockExecution)
-
-// MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
-// debugger.printInvocations(mockExecution)
-
- verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution,times(2)).getVariable("sdncAdapterCallbackRequest")
- verify(mockExecution).setVariable("sdncAdapterResponse",workflowResponse)
- verify(mockExecution).setVariable("enhancedCallbackRequestData",enhancedCallbackRequestData)
- verify(mockExecution).setVariable("continueListening",false)
-
- }
-
- @Test
- public void testProcessResponse_ErrorCase_404()
- {
- String sdncAdapterCallbackErrorResponse = FileUtil.readResourceFile("sdncadaptercallbackrequest_404CallBack.xml");
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getVariable("sdncAdapterCallbackRequest")).thenReturn(sdncAdapterCallbackErrorResponse)
- SDNCAdapter sdncAdapter = new SDNCAdapter()
- sdncAdapter.postProcessResponse(mockExecution)
-
- verify(mockExecution, times(1)).getVariable("isDebugLogEnabled")
- verify(mockExecution,times(2)).getVariable("sdncAdapterCallbackRequest")
- verify(mockExecution).setVariable("sdncAdapterResponse", sdncAdapterResponseError)
- verify(mockExecution).setVariable("enhancedCallbackRequestData", "")
- verify(mockExecution).setVariable("continueListening",false)
-
- }
-
- @Test
- public void testProcessResponse_ErrorCase_InvalidCallback()
- {
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getVariable("sdncAdapterCallbackRequest")).thenReturn("<h1>Service Unavailable</h1>")
- SDNCAdapter sdncAdapter = new SDNCAdapter()
- sdncAdapter.postProcessResponse(mockExecution)
-
- verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution,times(2)).getVariable("sdncAdapterCallbackRequest")
- verify(mockExecution).setVariable("sdncAdapterResponse", sdncAdapterResponseEmpty)
- verify(mockExecution).setVariable("enhancedCallbackRequestData", "")
- verify(mockExecution).setVariable("continueListening",false)
-
- }
-
- @Test
- public void postProcessResponse()
- {
-
- String SDNCAdapterCallbackRequest =
- """<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<SDNCAdapterCallbackRequest
- xmlns="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
- <CallbackHeader>
- <RequestId>3bb02798-b344-4d28-9bca-1f029954d1c9</RequestId>
- <ResponseCode>404</ResponseCode>
- <ResponseMessage>Error processing request to SDNC. Not Found.
- https://sdncodl.us.infra.aic.net:8443/restconf/config/L3SDN-API:services/layer3-service-list/85%2FCSIP%2F141203%2FPT_CSI9999998693.
- SDNC Returned-[error-type:application, error-tag:data-missing,
- error-message:Request could not be completed because the relevant
- data model content does not exist ]</ResponseMessage>
- </CallbackHeader>
-</SDNCAdapterCallbackRequest>"""
-
- String sdncAdapterResponse =
- """<sdncadapterworkflow:SDNCAdapterWorkflowResponse xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:tag0="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
- <sdncadapterworkflow:response-data>
- <tag0:CallbackHeader>
- <tag0:RequestId>3bb02798-b344-4d28-9bca-1f029954d1c9</tag0:RequestId>
- <tag0:ResponseCode>404</tag0:ResponseCode>
- <tag0:ResponseMessage>Error processing request to SDNC. Not Found.
- https://sdncodl.us.infra.aic.net:8443/restconf/config/L3SDN-API:services/layer3-service-list/85%2FCSIP%2F141203%2FPT_CSI9999998693.
- SDNC Returned-[error-type:application, error-tag:data-missing,
- error-message:Request could not be completed because the relevant
- data model content does not exist ]</tag0:ResponseMessage>
- </tag0:CallbackHeader>
- </sdncadapterworkflow:response-data>
-</sdncadapterworkflow:SDNCAdapterWorkflowResponse>"""
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getVariable("sdncAdapterCallbackRequest")).thenReturn(SDNCAdapterCallbackRequest)
- SDNCAdapter sdncAdapter = new SDNCAdapter()
- sdncAdapter.postProcessResponse(mockExecution)
-
- verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution,times(2)).getVariable("sdncAdapterCallbackRequest")
- verify(mockExecution).setVariable("sdncAdapterResponse", sdncAdapterResponse)
- verify(mockExecution).setVariable("enhancedCallbackRequestData", "")
- verify(mockExecution).setVariable("continueListening",false)
-
- }
-
-} \ No newline at end of file
diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/SDNCAdapterUtilsTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/SDNCAdapterUtilsTest.groovy
deleted file mode 100644
index 161b71cb9c..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/SDNCAdapterUtilsTest.groovy
+++ /dev/null
@@ -1,213 +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.common.scripts;
-
-import static org.junit.Assert.*;
-import static org.mockito.Mockito.*
-
-import org.junit.Before
-import org.junit.Ignore
-import org.junit.Test
-import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
-import org.camunda.bpm.engine.delegate.DelegateExecution
-import org.openecomp.mso.bpmn.core.WorkflowException
-import org.openecomp.mso.bpmn.common.scripts.SDNCAdapterUtils
-
-import org.openecomp.mso.bpmn.mock.FileUtil
-
-public class SDNCAdapterUtilsTest {
-
- private def map
- private ExecutionEntity svcex
- private WorkflowException wfex
- private AbstractServiceTaskProcessor tp
- private String resp
- private SDNCAdapterUtils utils
-
- @Before
- public void init()
- {
- map = new HashMap<String,Object>()
- svcex = mock(ExecutionEntity.class)
- wfex = null
- tp = new AbstractServiceTaskProcessor() {
- @Override
- public void preProcessRequest(DelegateExecution execution) {
- }
- };
- utils = new SDNCAdapterUtils(tp)
-
- // svcex gets its variables from "map"
- when(svcex.getVariable(any())).thenAnswer(
- { invocation ->
- return map.get(invocation.getArgumentAt(0, String.class)) })
-
- // svcex puts its variables into "map"
- when(svcex.setVariable(any(), any())).thenAnswer(
- { invocation ->
- return map.put(
- invocation.getArgumentAt(0, String.class),
- invocation.getArgumentAt(1, String.class)) })
-
- map.put("isDebugLogEnabled", "true")
- map.put("prefix", "mypfx-")
- map.put("testProcessKey", "mykey")
- }
-
- @Test
- public void testValidateSDNCResponse_Success_NoCode() {
- resp = """<no-response/>"""
-
- utils.validateSDNCResponse(svcex, resp, wfex, true)
-
- assertEquals(true, map.get("mypfx-sdncResponseSuccess"))
- assertEquals("0", map.get("mypfx-sdncRequestDataResponseCode"))
- assertFalse(map.containsKey("WorkflowException"))
- }
-
- @Test
- public void testValidateSDNCResponse_200() {
- utils.validateSDNCResponse(svcex, makeResp("200", "OK", ""), wfex, true)
-
- assertEquals(true, map.get("mypfx-sdncResponseSuccess"))
- assertEquals("200", map.get("mypfx-sdncRequestDataResponseCode"))
- assertFalse(map.containsKey("WorkflowException"))
- }
-
- @Test
- public void testValidateSDNCResponse_408() {
- try {
- utils.validateSDNCResponse(svcex, makeResp("408", "failed", ""), wfex, true)
-
- // this has been commented out as, currently, the code doesn't
- // throw an exception in this case
-// fail("missing exception")
-
- } catch(BpmnError ex) {
- ex.printStackTrace()
- }
-
- assertEquals(false, map.get("mypfx-sdncResponseSuccess"))
- assertEquals("408", map.get("mypfx-sdncRequestDataResponseCode"))
-
- wfex = map.get("WorkflowException")
- assertNotNull(wfex)
-
- assertEquals(5320, wfex.getErrorCode())
- assertEquals("Received error from SDN-C: failed", wfex.getErrorMessage())
- }
-
- @Test
- public void testValidateSDNCResponse_408_200() {
-
- utils.validateSDNCResponse(svcex, makeResp("408", "failed", makeReq("200", "ok")), wfex, true)
-
- assertEquals(true, map.get("mypfx-sdncResponseSuccess"))
- assertEquals("200", map.get("mypfx-sdncRequestDataResponseCode"))
- assertFalse(map.containsKey("WorkflowException"))
- }
-
- @Ignore // 1802 merge
- @Test
- public void testValidateSDNCResponse_408_200_WithEmbeddedLt() {
-
- utils.validateSDNCResponse(svcex, makeResp("408", "failed", makeReq("200", "<success> message")), wfex, true)
-
- assertEquals(true, map.get("mypfx-sdncResponseSuccess"))
- assertEquals("200", map.get("mypfx-sdncRequestDataResponseCode"))
- assertFalse(map.containsKey("WorkflowException"))
- }
-
- @Test
- public void testUpdateHomingInfo() {
- String actual = utils.updateHomingInfo(null, "AIC3.0")
- println actual
- assertEquals("<l2-homing-information><aic-version>AIC3.0</aic-version></l2-homing-information>", actual)
- }
-
- @Test
- public void testUpdateHomingInfo2() {
- String homingInfo = "<l2-homing-information><preferred-aic-clli>TESTCLLI</preferred-aic-clli></l2-homing-information>"
- String actual = utils.updateHomingInfo(homingInfo, "AIC3.0")
- println actual
- assertEquals("<l2-homing-information><preferred-aic-clli>TESTCLLI</preferred-aic-clli><aic-version>AIC3.0</aic-version></l2-homing-information>", actual)
- }
-
- @Ignore // 1802 merge - testing method that doesn't exist
- @Test
- public void testUpdateServiceInfo() {
- String actual = utils.updateServiceInfo(null, "96688f6f-ab06-4ef6-ae55-9d3af28ae909")
- println actual
- assertEquals("<service-information><infra-service-instance-id>96688f6f-ab06-4ef6-ae55-9d3af28ae909</infra-service-instance-id></service-information>", actual)
- }
-
- @Ignore // 1802 merge - testing method that doesn't exist
- @Test
- public void testUpdateServiceInfo2() {
- String serviceInfo = "<service-information><service-type>SDN-ETHERNET-INTERNET</service-type><service-instance-id>MIS/1602/00029/SB_INTERNET</service-instance-id></service-information>"
- String actual = utils.updateServiceInfo(serviceInfo, "96688f6f-ab06-4ef6-ae55-9d3af28ae909")
- println actual
- assertEquals("<service-information><service-type>SDN-ETHERNET-INTERNET</service-type><service-instance-id>MIS/1602/00029/SB_INTERNET</service-instance-id><infra-service-instance-id>96688f6f-ab06-4ef6-ae55-9d3af28ae909</infra-service-instance-id></service-information>", actual)
- }
-
- private String makeResp(String respcode, String respmsg, String reqdata) {
- def rc = encodeXml(respcode)
- def rm = encodeXml(respmsg)
-
- return """
-<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>myreq</tag0:RequestId>
- <tag0:ResponseCode>${rc}</tag0:ResponseCode>
- <tag0:ResponseMessage>${rm}</tag0:ResponseMessage>
- </tag0:CallbackHeader>
- ${reqdata}
- </sdncadapterworkflow:response-data>
-</sdncadapterworkflow:SDNCAdapterWorkflowResponse>
-"""
-
- }
-
- private String makeReq(String respcode, String respmsg) {
- def rc = encodeXml(respcode)
- def rm = encodeXml(respmsg)
-
- def output = """
-<output xmlns="org:onap:sdnc:northbound:generic-resource">
- <svc-request-id>8b46e36e-b44f-4085-9404-427be1bc8a3</svc-request-id>
- <response-code>${rc}</response-code>
- <response-message>${rm}</response-message>
- <ack-final-indicator>Y</ack-final-indicator>
-</output>
-"""
- output = encodeXml(output)
-
- return """<tag0:RequestData xsi:type="xs:string">${output}</tag0:RequestData>"""
- }
-
- private String encodeXml(String txt) {
- return txt.replace("&", "&amp;").replace("<", "&lt;")
- }
-}
diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/TrinityExceptionUtilTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/TrinityExceptionUtilTest.groovy
deleted file mode 100644
index 203f11a42e..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/TrinityExceptionUtilTest.groovy
+++ /dev/null
@@ -1,201 +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.common.scripts
-
-import org.junit.Assert
-import org.junit.Ignore
-import org.junit.runner.RunWith;
-import org.mockito.runners.MockitoJUnitRunner;
-
-
-
-import static org.mockito.Mockito.*
-
-import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
-import org.junit.Before
-import org.junit.runner.RunWith
-import org.mockito.MockitoAnnotations
-import org.mockito.internal.debugging.MockitoDebuggerImpl
-import org.mockito.runners.MockitoJUnitRunner
-import org.openecomp.mso.bpmn.common.scripts.TrinityExceptionUtil;
-@RunWith(MockitoJUnitRunner.class)
-import org.junit.Test
-
-class TrinityExceptionUtilTest {
-
- def aotsFault ="""<n1:Fault xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:n1="http://csi.cingular.com/CSI/Namespaces/OneTicketingSystem/InfrastructureCommon/Types/Public/SoapFault.xsd" xmlns:cer="http://csi.cingular.com/CSI/Namespaces/OneTicketingSystem/InfrastructureCommon/Types/Public/ErrorResponse.xsd" xsi:schemaLocation="http://csi.cingular.com/CSI/Namespaces/OneTicketingSystem/InfrastructureCommon/Types/Public/SoapFault.xsd SoapFault-CDM.xsd">
- <n1:faultcode>xml:space</n1:faultcode>
- <n1:faultstring>String</n1:faultstring>
- <n1:faultactor>http://test.com</n1:faultactor>
- <n1:detail>
- <n1:CSIApplicationException>
- <cer:Response>
- <cer:code>400</cer:code>
- <cer:description>bad stuff</cer:description>
- </cer:Response>
- <cer:ServiceProviderEntity>
- <cer:reportingServiceEntity>String</cer:reportingServiceEntity>
- <cer:faultDate>*** ERROR ***</cer:faultDate>
- <cer:faultSequenceNumber>String</cer:faultSequenceNumber>
- <cer:faultLevel>String</cer:faultLevel>
- <cer:faultCode>String</cer:faultCode>
- <cer:faultDescription>String</cer:faultDescription>
- <cer:ServiceProviderRawError>
- <cer:code>String</cer:code>
- <cer:description>String</cer:description>
- <cer:BISError>
- <cer:code>String</cer:code>
- <cer:description>String</cer:description>
- <cer:origination>String</cer:origination>
- <cer:severity>String</cer:severity>
- </cer:BISError>
- </cer:ServiceProviderRawError>
- </cer:ServiceProviderEntity>
- </n1:CSIApplicationException>
- <n1:CSIInternalException>
- <cer:reportingServiceEntity>String</cer:reportingServiceEntity>
- <cer:faultDate>*** ERROR ***</cer:faultDate>
- <cer:faultSequenceNumber>String</cer:faultSequenceNumber>
- <cer:faultLevel>String</cer:faultLevel>
- <cer:faultCode>String</cer:faultCode>
- <cer:faultDescription>String</cer:faultDescription>
- <cer:cingularErrorCode>String</cer:cingularErrorCode>
- <cer:cingularErrorDescription>String</cer:cingularErrorDescription>
- <cer:cingularErrorCategory>String</cer:cingularErrorCategory>
- </n1:CSIInternalException>
- </n1:detail>
-</n1:Fault>"""
-
-
- @Before
- public void init()
- {
- MockitoAnnotations.initMocks(this)
- }
-
- @Test
- @Ignore
- public void testMapAAIExceptionTCommonException() {
-
-
-
- String restFault = """
- <Fault>
-<requestError>
-<serviceException>
-<messageId>SVC3002</messageId>
-<text>Error writing output performing %1 on %2 (msg=%3) (ec=%4)</text>
-<variables>
-<variable>PUTcustomer</variable>
-<variable>SubName01</variable>
-<variable>Unexpected error reading/updating database:Adding this property for key [service-instance-id] and value [USSTU2CFCNC0101UJZZ01] violates a uniqueness constraint [service-instance-id]</variable>
-<variable>ERR.5.4.5105</variable>
-</variables>
-</serviceException>
-</requestError>
-</Fault>
- """
- def errorString = """<requestError>
-<serviceException>
-<messageId>SVC3002</messageId>
-<text>Error writing output performing %1 on %2 (msg=%3) (ec=%4)</text>
-<variables>
-<variable>PUTcustomer</variable>
-<variable>SubName01</variable>
-<variable>Unexpected error reading/updating database:Adding this property for key [service-instance-id] and value [USSTU2CFCNC0101UJZZ01] violates a uniqueness constraint [service-instance-id]</variable>
-<variable>ERR.5.4.5105</variable>
-</variables>
-</serviceException>
-</requestError>""" as String
-
-
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
-
- TrinityExceptionUtil util = new TrinityExceptionUtil()
- Assert.assertEquals(errorString, util.mapAAIExceptionTCommonException(restFault, mockExecution))
- }
-
-
-
-
- @Test
- public void testBuildException() {
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getVariable("prefix")).thenReturn("test_")
- when(mockExecution.getVariable("test_ResponseCode")).thenReturn("400")
- ArrayList msgVars = new ArrayList()
- msgVars.add("var1")
- msgVars.add("var2")
- when(mockExecution.getVariable("test_errVariables")).thenReturn(msgVars)
-
-
- TrinityExceptionUtil util = new TrinityExceptionUtil()
- String msg = "Bad request"
- String errorString = """<tns:requestError xmlns:tns="http://org.openecomp/mso/request/types/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://org.openecomp/mso/request/types/v1 MsoServiceInstanceTypesV1.xsd">
- <tns:serviceException>
- <tns:messageId>SVC2000</tns:messageId>
- <tns:text>The following service error occurred: %1. Error code is %2.</tns:text>
- <tns:variables>var1</tns:variables>
- <tns:variables>var2</tns:variables>
- </tns:serviceException>
-</tns:requestError>"""
- Assert.assertEquals(errorString, util.buildException(msg, mockExecution))
- }
-
- @Test
- public void testMapAOTSExecptionToCommonException() {
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getVariable("prefix")).thenReturn("test_")
- when(mockExecution.getVariable("test_ResponseCode")).thenReturn("400")
-
- TrinityExceptionUtil util = new TrinityExceptionUtil()
- String errorString = """<tns:requestError xmlns:tns="http://org.openecomp/mso/request/types/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://org.openecomp/mso/request/types/v1 MsoServiceInstanceTypesV1.xsd">
- <tns:serviceException>
- <tns:messageId>SVC2000</tns:messageId>
- <tns:text>The following service error occurred: %1. Error code is %2.</tns:text>
- <tns:variables>Received error from AOTS: bad stuff</tns:variables>
- <tns:variables>400</tns:variables>
- </tns:serviceException>
-</tns:requestError>"""
- Assert.assertEquals(errorString, util.mapAOTSExecptionToCommonException(aotsFault, mockExecution))
- }
-
-
- @Test
- public void testParseError() {
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- String errorString = "The following service error occurred: %1. Error code is %2."
- ArrayList msgVars = new ArrayList()
- msgVars.add("var1")
- msgVars.add("var2")
- when(mockExecution.getVariable("prefix")).thenReturn("test_")
- when(mockExecution.getVariable("test_errTxt")).thenReturn(errorString)
- when(mockExecution.getVariable("test_errVariables")).thenReturn(msgVars)
-
- TrinityExceptionUtil util = new TrinityExceptionUtil()
-
- Assert.assertEquals("The following service error occurred: var1. Error code is var2.", util.parseError(mockExecution))
-}
-
-
-
-}
diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/VidUtilsTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/VidUtilsTest.groovy
deleted file mode 100644
index ffdaf0653d..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/VidUtilsTest.groovy
+++ /dev/null
@@ -1,972 +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.common.scripts;
-
-import static org.mockito.Mockito.*
-
-import org.openecomp.mso.bpmn.common.scripts.VidUtils;
-import org.openecomp.mso.bpmn.core.WorkflowException
-
-import groovy.json.JsonSlurper
-
-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 static org.junit.Assert.*;
-
-import org.mockito.MockitoAnnotations
-import org.mockito.runners.MockitoJUnitRunner
-import org.mockito.internal.debugging.MockitoDebuggerImpl
-import org.junit.Before
-import org.junit.Rule;
-import org.junit.Test
-import org.junit.Ignore
-import org.junit.runner.RunWith
-import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity;
-import org.junit.Before;
-import org.junit.Test;
-
-@RunWith(MockitoJUnitRunner.class)
-
-class VidUtilsTest {
-
- def vfModuleReqJson = """
-{
- "requestDetails": {
- "modelInfo": {
- "modelType": "vfModule",
- "modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff",
- "modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
- "modelName": "STMTN5MMSC21-MMSC::model-1-0",
- "modelVersion": "1",
- "modelCustomizationUuid": "ee6478e5-ea33-3346-ac12-ab121484a3fe"
- },
- "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",
- "modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
- "modelName": "vSAMP12..base..module-0",
- "modelVersion": "1"
- }
- }
- },
- {
- "relatedInstance": {
- "instanceId": "123456",
- "modelInfo": {
- "modelType": "service",
- "modelInvariantUuid": "ff3514e3-5a33-55df-13ab-12abad84e7ff",
- "modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
- "modelName": "SERVICE_MODEL_NAME",
- "modelVersion": "1.0"
- }
- }
- },
- {
- "relatedInstance": {
- "instanceId": "skask",
- "instanceName": "skask-test",
- "modelInfo": {
- "modelType": "vnf",
- "modelInvariantUuid": "skask",
- "modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
- "modelName": "vSAMP12",
- "modelVersion": "1.0",
- "modelInstanceName": "vSAMP12 1"
- }
- }
- }
- ],
- "requestParameters": {
- "userParams": [
- {
- "name": "vnfName",
- "value": "STMTN5MMSC20"
- },
- {
- "name": "tenantId",
- "value": "vpe-tenant-123"
- },
- {
- "name": "aicCloudRegion",
- "value": "MDTWNJ21"
- },
- {
- "name": "isAvpnService",
- "value": "true"
- },
- {
- "name": "asn",
- "value": "asn-1234"
- },
- {
- "name": "releaseForAero",
- "value": "release-for-aero-something"
- },
- {
- "name": "aicClli",
- "value": "MTJWNJA4LCP"
- },
- {
- "name": "svcProviderPartNumber",
- "value": "svc-provide-number-1234"
- }
- ]
- }
- }
-}
-"""
- def bpmnReq1 = """
-{
- "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",
- "modelId": "ff3514e3-5a33-55df-13ab-12abad84e7ff",
- "modelNameVersionId": "fe6985cd-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 vidUtilResp1 = """<volume-request xmlns="http://www.w3.org/2001/XMLSchema">
- <request-info>
- <action>CREATE_VF_MODULE_VOL</action>
- <source>VID</source>
- <service-instance-id>test-service-instance-id-123</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 bpmnReq2 = """
-{
- "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": "Test",
- "modelVersion": "2.0"
- }
- }
- }, {
- "relatedInstance": {
- "instanceId": "{vnf-instance-id}",
- "modelInfo": {
- "modelType": "vnf",
- "modelId": "ff5256d1-5a33-55df-13ab-12abad84e7ff",
- "modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
- "modelName": "vSAMP12",
- "modelVersion": "1",
- "modelInstanceName": "vSAMP12"
- }
- }
- }
- ]
- }
-}
-"""
-
- def bpmnReqJsonVolumeSuppressRollbackTrue = """
-{
- "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": true
- },
- "relatedInstanceList": [
- {
- "relatedInstance": {
- "instanceId": "{service-instance-id}",
- "modelInfo": {
- "modelType": "service",
- "modelId": "ff3514e3-5a33-55df-13ab-12abad84e7ff",
- "modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
- "modelName": "Test",
- "modelVersion": "2.0"
- }
- }
- }, {
- "relatedInstance": {
- "instanceId": "{vnf-instance-id}",
- "modelInfo": {
- "modelType": "vnf",
- "modelId": "ff5256d1-5a33-55df-13ab-12abad84e7ff",
- "modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
- "modelName": "vSAMP12",
- "modelVersion": "1",
- "modelInstanceName": "vSAMP12"
- }
- }
- }
- ]
- }
-}
-"""
-
-def bpmnReqJsonVolumeSuppressRollbackFalse = """
-{
- "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": "Test",
- "modelVersion": "2.0"
- }
- }
- }, {
- "relatedInstance": {
- "instanceId": "{vnf-instance-id}",
- "modelInfo": {
- "modelType": "vnf",
- "modelId": "ff5256d1-5a33-55df-13ab-12abad84e7ff",
- "modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
- "modelName": "vSAMP12",
- "modelVersion": "1",
- "modelInstanceName": "vSAMP12"
- }
- }
- }
- ]
- }
-}
-"""
-
-def bpmnReqJsonVolumeSuppressRollbackNone = """
-{
- "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"
- },
- "relatedInstanceList": [
- {
- "relatedInstance": {
- "instanceId": "{service-instance-id}",
- "modelInfo": {
- "modelType": "service",
- "modelId": "ff3514e3-5a33-55df-13ab-12abad84e7ff",
- "modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
- "modelName": "Test",
- "modelVersion": "2.0"
- }
- }
- }, {
- "relatedInstance": {
- "instanceId": "{vnf-instance-id}",
- "modelInfo": {
- "modelType": "vnf",
- "modelId": "ff5256d1-5a33-55df-13ab-12abad84e7ff",
- "modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
- "modelName": "vSAMP12",
- "modelVersion": "1",
- "modelInstanceName": "vSAMP12"
- }
- }
- }
- ]
- }
-}
-"""
-
- def bpmnReqJsonVfModuleSuppressRollbackTrue = """
-{
-"requestDetails": {
-"modelInfo": {
-"modelType": "vfModule",
-"modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff",
-"modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
-"modelName": "STMTN5MMSC21-MMSC::model-1-0",
-"modelVersion": "1"
-},
-"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": {
-"userParams": {}
-}
-}
-}
-"""
-
-def bpmnReqJsonVfModuleSuppressRollbackFalse = """
-{
-"requestDetails": {
-"modelInfo": {
-"modelType": "vfModule",
-"modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff",
-"modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
-"modelName": "STMTN5MMSC21-MMSC::model-1-0",
-"modelVersion": "1"
-},
-"cloudConfiguration": {
-"lcpCloudRegionId": "MDTWNJ21",
-"tenantId": "fba1bd1e195a404cacb9ce17a9b2b421"
-},
-"requestInfo": {
-"instanceName": "PCRF::module-0-2",
-"source": "VID",
-"suppressRollback": false
-},
-"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": {
-"userParams": {}
-}
-}
-}
-"""
-
-def bpmnReqJsonVfModuleSuppressRollbackNone = """
-{
-"requestDetails": {
-"modelInfo": {
-"modelType": "vfModule",
-"modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff",
-"modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe",
-"modelName": "STMTN5MMSC21-MMSC::model-1-0",
-"modelVersion": "1"
-},
-"cloudConfiguration": {
-"lcpCloudRegionId": "MDTWNJ21",
-"tenantId": "fba1bd1e195a404cacb9ce17a9b2b421"
-},
-"requestInfo": {
-"instanceName": "PCRF::module-0-2",
-"source": "VID"
-},
-"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": {
-"userParams": {}
-}
-}
-}
-"""
- def vidUtilResp2 = """<volume-request xmlns="http://www.w3.org/2001/XMLSchema">
- <request-info>
- <action>CREATE_VF_MODULE_VOL</action>
- <source>VID</source>
- <service-instance-id>test-service-instance-id-123</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/>
- <backout-on-failure>true</backout-on-failure>
- <model-customization-id/>
- </volume-inputs>
- <volume-params/>
-</volume-request>
-"""
-
-def vidUtilVolumeRespBackoutOnFailureFalse = """<volume-request xmlns="http://www.w3.org/2001/XMLSchema">
- <request-info>
- <action>CREATE_VF_MODULE_VOL</action>
- <source>VID</source>
- <service-instance-id>test-service-instance-id-123</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/>
- <backout-on-failure>false</backout-on-failure>
- <model-customization-id/>
- </volume-inputs>
- <volume-params/>
-</volume-request>
-"""
-
-def vidUtilVolumeRespBackoutOnFailureTrue = """<volume-request xmlns="http://www.w3.org/2001/XMLSchema">
- <request-info>
- <action>CREATE_VF_MODULE_VOL</action>
- <source>VID</source>
- <service-instance-id>test-service-instance-id-123</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/>
- <backout-on-failure>true</backout-on-failure>
- <model-customization-id/>
- </volume-inputs>
- <volume-params/>
-</volume-request>
-"""
-
-def vidUtilVolumeRespBackoutOnFailureEmpty = """<volume-request xmlns="http://www.w3.org/2001/XMLSchema">
- <request-info>
- <action>CREATE_VF_MODULE_VOL</action>
- <source>VID</source>
- <service-instance-id>test-service-instance-id-123</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/>
- <backout-on-failure/>
- <model-customization-id/>
- </volume-inputs>
- <volume-params/>
-</volume-request>
-"""
-
-def vidUtilVfModuleRespBackoutOnFailureFalse = """<vnf-request>
- <request-info>
- <request-id>test-request-id-123</request-id>
- <action>CREATE_VF_MODULE</action>
- <source>VID</source>
- <!-- new 1610 field -->
- <service-instance-id>test-service-instance-id-123</service-instance-id>
- </request-info>
- <vnf-inputs><!-- not in use in 1610 -->
- <vnf-name>skask-test</vnf-name>
- <vnf-type>test-vnf-type-123</vnf-type>
- <vnf-id>test-vnf-id-123</vnf-id>
- <volume-group-id>test-volume-group-id-123</volume-group-id>
- <vf-module-id>test-vf-module-id-123</vf-module-id>
- <vf-module-name>PCRF::module-0-2</vf-module-name>
- <vf-module-model-name>STMTN5MMSC21-MMSC::model-1-0</vf-module-model-name>
- <model-customization-id/>
- <is-base-vf-module>false</is-base-vf-module>
- <asdc-service-model-version>1.0</asdc-service-model-version>
- <aic-cloud-region>MDTWNJ21</aic-cloud-region>
- <tenant-id>fba1bd1e195a404cacb9ce17a9b2b421</tenant-id>
- <service-id/>
- <backout-on-failure>false</backout-on-failure>
- <persona-model-id>ff5256d2-5a33-55df-13ab-12abad84e7ff</persona-model-id>
- <persona-model-version>fe6478e5-ea33-3346-ac12-ab121484a3fe</persona-model-version>
- </vnf-inputs>
- <vnf-params/>
-</vnf-request>
-"""
-
-def vidUtilVfModuleRespBackoutOnFailureTrue = """<vnf-request>
- <request-info>
- <request-id>test-request-id-123</request-id>
- <action>CREATE_VF_MODULE</action>
- <source>VID</source>
- <!-- new 1610 field -->
- <service-instance-id>test-service-instance-id-123</service-instance-id>
- </request-info>
- <vnf-inputs><!-- not in use in 1610 -->
- <vnf-name>skask-test</vnf-name>
- <vnf-type>test-vnf-type-123</vnf-type>
- <vnf-id>test-vnf-id-123</vnf-id>
- <volume-group-id>test-volume-group-id-123</volume-group-id>
- <vf-module-id>test-vf-module-id-123</vf-module-id>
- <vf-module-name>PCRF::module-0-2</vf-module-name>
- <vf-module-model-name>STMTN5MMSC21-MMSC::model-1-0</vf-module-model-name>
- <model-customization-id/>
- <is-base-vf-module>false</is-base-vf-module>
- <asdc-service-model-version>1.0</asdc-service-model-version>
- <aic-cloud-region>MDTWNJ21</aic-cloud-region>
- <tenant-id>fba1bd1e195a404cacb9ce17a9b2b421</tenant-id>
- <service-id/>
- <backout-on-failure>true</backout-on-failure>
- <persona-model-id>ff5256d2-5a33-55df-13ab-12abad84e7ff</persona-model-id>
- <persona-model-version>fe6478e5-ea33-3346-ac12-ab121484a3fe</persona-model-version>
- </vnf-inputs>
- <vnf-params/>
-</vnf-request>
-"""
-
-def vidUtilVfModuleRespBackoutOnFailureEmpty = """<vnf-request>
- <request-info>
- <request-id>test-request-id-123</request-id>
- <action>CREATE_VF_MODULE</action>
- <source>VID</source>
- <!-- new 1610 field -->
- <service-instance-id>test-service-instance-id-123</service-instance-id>
- </request-info>
- <vnf-inputs><!-- not in use in 1610 -->
- <vnf-name>skask-test</vnf-name>
- <vnf-type>test-vnf-type-123</vnf-type>
- <vnf-id>test-vnf-id-123</vnf-id>
- <volume-group-id>test-volume-group-id-123</volume-group-id>
- <vf-module-id>test-vf-module-id-123</vf-module-id>
- <vf-module-name>PCRF::module-0-2</vf-module-name>
- <vf-module-model-name>STMTN5MMSC21-MMSC::model-1-0</vf-module-model-name>
- <model-customization-id/>
- <is-base-vf-module>false</is-base-vf-module>
- <asdc-service-model-version>1.0</asdc-service-model-version>
- <aic-cloud-region>MDTWNJ21</aic-cloud-region>
- <tenant-id>fba1bd1e195a404cacb9ce17a9b2b421</tenant-id>
- <service-id/>
- <backout-on-failure/>
- <persona-model-id>ff5256d2-5a33-55df-13ab-12abad84e7ff</persona-model-id>
- <persona-model-version>fe6478e5-ea33-3346-ac12-ab121484a3fe</persona-model-version>
- </vnf-inputs>
- <vnf-params/>
-</vnf-request>
-"""
-
- @Before
- public void init()
- {
- MockitoAnnotations.initMocks(this)
-
- }
-
- @Test
- public void test() {
-
- def jsonSlurper = new JsonSlurper()
- Map reqMap = jsonSlurper.parseText(bpmnReq1)
-
- VidUtils vidUtils = new VidUtils()
- def xmlReq = vidUtils.createXmlVolumeRequest(reqMap, 'CREATE_VF_MODULE_VOL', 'test-service-instance-id-123')
- print xmlReq
- assertEquals(vidUtilResp1, xmlReq)
- }
-
- //@Test
- public void testVfModule() {
-
- def jsonSlurper = new JsonSlurper()
- Map reqMap = jsonSlurper.parseText(vfModuleReqJson)
-
- VidUtils vidUtils = new VidUtils()
- def xmlReq = vidUtils.createXmlVfModuleRequest(null, reqMap, "CREATE_VF_MODULE", "test-service-instance-id-123")
- print xmlReq
- assertTrue(true)
- }
-
- @Test
- public void testNoRequestParams() {
-
- def jsonSlurper = new JsonSlurper()
- Map reqMap = jsonSlurper.parseText(bpmnReq2)
-
- VidUtils vidUtils = new VidUtils()
- def xmlReq = vidUtils.createXmlVolumeRequest(reqMap, 'CREATE_VF_MODULE_VOL', 'test-service-instance-id-123')
-
- assertEquals(vidUtilResp2, xmlReq)
- }
-
- @Test
- public void testVfModuleVolumeRollbackTrue() {
-
- def jsonSlurper = new JsonSlurper()
- Map reqMap = jsonSlurper.parseText(bpmnReqJsonVolumeSuppressRollbackTrue)
-
- VidUtils vidUtils = new VidUtils()
- def xmlReq = vidUtils.createXmlVolumeRequest(reqMap, 'CREATE_VF_MODULE_VOL', 'test-service-instance-id-123')
-
- assertEquals(vidUtilVolumeRespBackoutOnFailureFalse, xmlReq)
- }
-
- @Test
- public void testVfModuleVolumeRollbackFalse() {
-
- def jsonSlurper = new JsonSlurper()
- Map reqMap = jsonSlurper.parseText(bpmnReqJsonVolumeSuppressRollbackFalse)
-
- VidUtils vidUtils = new VidUtils()
- def xmlReq = vidUtils.createXmlVolumeRequest(reqMap, 'CREATE_VF_MODULE_VOL', 'test-service-instance-id-123')
-
- assertEquals(vidUtilVolumeRespBackoutOnFailureTrue, xmlReq)
- }
-
- @Test
- public void testVfModuleVolumeRollbackNone() {
-
- def jsonSlurper = new JsonSlurper()
- Map reqMap = jsonSlurper.parseText(bpmnReqJsonVolumeSuppressRollbackNone)
-
- VidUtils vidUtils = new VidUtils()
- def xmlReq = vidUtils.createXmlVolumeRequest(reqMap, 'CREATE_VF_MODULE_VOL', 'test-service-instance-id-123')
-
- assertEquals(vidUtilVolumeRespBackoutOnFailureEmpty, xmlReq)
- }
-
- @Test
- public void testVfModuleRollbackTrue() {
-
- def jsonSlurper = new JsonSlurper()
- Map reqMap = jsonSlurper.parseText(bpmnReqJsonVfModuleSuppressRollbackTrue)
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getVariable("vnfType")).thenReturn('test-vnf-type-123')
- when(mockExecution.getVariable("vnfId")).thenReturn('test-vnf-id-123')
- when(mockExecution.getVariable("vfModuleId")).thenReturn('test-vf-module-id-123')
- when(mockExecution.getVariable("volumeGroupId")).thenReturn('test-volume-group-id-123')
- when(mockExecution.getVariable("isBaseVfModule")).thenReturn('false')
- when(mockExecution.getVariable("mso-request-id")).thenReturn('test-request-id-123')
-
- VidUtils vidUtils = new VidUtils()
- def xmlReq = vidUtils.createXmlVfModuleRequest(mockExecution, reqMap, 'CREATE_VF_MODULE', 'test-service-instance-id-123')
-
- println 'ggg->' + xmlReq
- assertEquals(vidUtilVfModuleRespBackoutOnFailureFalse, xmlReq)
- }
-
- @Test
- public void testVfModuleRollbackFalse() {
-
- def jsonSlurper = new JsonSlurper()
- Map reqMap = jsonSlurper.parseText(bpmnReqJsonVfModuleSuppressRollbackFalse)
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getVariable("vnfType")).thenReturn('test-vnf-type-123')
- when(mockExecution.getVariable("vnfId")).thenReturn('test-vnf-id-123')
- when(mockExecution.getVariable("vfModuleId")).thenReturn('test-vf-module-id-123')
- when(mockExecution.getVariable("volumeGroupId")).thenReturn('test-volume-group-id-123')
- when(mockExecution.getVariable("isBaseVfModule")).thenReturn('false')
- when(mockExecution.getVariable("mso-request-id")).thenReturn('test-request-id-123')
-
- VidUtils vidUtils = new VidUtils()
- def xmlReq = vidUtils.createXmlVfModuleRequest(mockExecution, reqMap, 'CREATE_VF_MODULE', 'test-service-instance-id-123')
-
- println 'ggg->' + xmlReq
- assertEquals(vidUtilVfModuleRespBackoutOnFailureTrue, xmlReq)
- }
-
- @Test
- public void testVfModuleRollbackNone() {
-
- def jsonSlurper = new JsonSlurper()
- Map reqMap = jsonSlurper.parseText(bpmnReqJsonVfModuleSuppressRollbackNone)
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getVariable("vnfType")).thenReturn('test-vnf-type-123')
- when(mockExecution.getVariable("vnfId")).thenReturn('test-vnf-id-123')
- when(mockExecution.getVariable("vfModuleId")).thenReturn('test-vf-module-id-123')
- when(mockExecution.getVariable("volumeGroupId")).thenReturn('test-volume-group-id-123')
- when(mockExecution.getVariable("isBaseVfModule")).thenReturn('false')
- when(mockExecution.getVariable("mso-request-id")).thenReturn('test-request-id-123')
-
- VidUtils vidUtils = new VidUtils()
- def xmlReq = vidUtils.createXmlVfModuleRequest(mockExecution, reqMap, 'CREATE_VF_MODULE', 'test-service-instance-id-123')
-
- println 'ggg->' + xmlReq
- assertEquals(vidUtilVfModuleRespBackoutOnFailureEmpty, xmlReq)
- }
-}
diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/VnfAdapterRestV1Test.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/VnfAdapterRestV1Test.groovy
deleted file mode 100644
index b37676a044..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/VnfAdapterRestV1Test.groovy
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.openecomp.mso.bpmn.common.scripts
-
-import org.junit.Test
-import static org.junit.Assert.*;
-
-class VnfAdapterRestV1Test {
-
-
- def rollbackReq = """
-<rollbackVolumeGroupRequest>
- <volumeGroupRollback>
- <volumeGroupId>8a07b246-155e-4b08-b56e-76e98a3c2d66</volumeGroupId>
- <volumeGroupStackId>phmaz401me6-vpevre-VOLUMEGROUP/dbd560b6-b03f-4a17-92e7-8942459a60c1</volumeGroupStackId>
- <cloudSiteId>mtrnj1b</cloudSiteId>
- <tenantId>cfb5e0a790374c9a98a1c0d2044206a7</tenantId>
- <volumeGroupCreated>true</volumeGroupCreated>
- <msoRequest>
- <requestId>1e1a72ca-7300-4ac4-b718-30351f3b6845</requestId>
- <serviceInstanceId>15eb2c68-f771-4030-b185-cff179fdad44</serviceInstanceId>
- </msoRequest>
- <messageId>683ca1ac-2145-4a00-9484-20d48bd701aa</messageId>
- </volumeGroupRollback>
- <skipAAI>true</skipAAI>
- <notificationUrl>http://msobpel-app-e2e.ecomp.cci.att.com:8080/mso/WorkflowMessage/VNFAResponse/683ca1ac-2145-4a00-9484-20d48bd701aa</notificationUrl>
-</rollbackVolumeGroupRequest>
-"""
-
- @Test
- public void testGetNodeText() {
- Node root = new XmlParser().parseText(rollbackReq)
- def volGrpId = root.'volumeGroupRollback'.'volumeGroupId'.text()
- assertEquals('8a07b246-155e-4b08-b56e-76e98a3c2d66', volGrpId)
- }
-
- @Test
- public void testGetMessageId() {
- Node root = new XmlParser().parseText(rollbackReq)
- //def messageId = root.'volumeGroupRollback'.'messageId'.text()
-
- VnfAdapterRestV1 p = new VnfAdapterRestV1()
- def messageId = p.getMessageIdForVolumeGroupRollback(root)
- assertEquals('683ca1ac-2145-4a00-9484-20d48bd701aa', messageId)
- }
-}