diff options
author | 2018-11-29 20:46:49 +0530 | |
---|---|---|
committer | 2018-12-02 09:47:45 +0000 | |
commit | 6ce1094d509195fe484761467a67a6b3757593b0 (patch) | |
tree | 4c3b0df6711f80c0f20c20ccf013727ff90428d5 /openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp | |
parent | c2a1b7c2eea934f309838f0082b2b851012be9a1 (diff) |
Fix - Port type and vmtype underscore issue
1. Fix for consolidation of VMs for cases when:
a. VM type contains an underscore
b. Multiple ports per network role
2. Updated the unit test cases and test data
Change-Id: I875f3c8384f8ef2c2aa6add9e30a5f8899ae1a71
Issue-ID: SDC-1966
Signed-off-by: ojasdubey <ojas.dubey@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp')
8 files changed, 352 insertions, 318 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/TestUtils.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/TestUtils.java index 0d981f320a..0ca5e64377 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/TestUtils.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/TestUtils.java @@ -270,6 +270,7 @@ public class TestUtils { public static void updateMultiplePortConsolidationDatas(String serviceTemplateName, List<String> portNodeTemplateIds, + List<String> portTypes, List<List<String>> nodesConnectedInIds, List<List<String>> nodesConnectedOutIds, List<List<String>> groupIds, @@ -277,7 +278,7 @@ public class TestUtils { List<List<Pair<String, GetAttrFuncData>>> getAttrOutFuncDataList, ConsolidationData consolidationData) { for (int i = 0; i < portNodeTemplateIds.size(); i++) { - updatePortConsolidationData(serviceTemplateName, portNodeTemplateIds.get(i), + updatePortConsolidationData(serviceTemplateName, portNodeTemplateIds.get(i), portTypes.get(i), nodesConnectedInIds.get(i), nodesConnectedOutIds.get(i), groupIds.get(i), getAttrInIds.get(i), getAttrOutFuncDataList.get(i), consolidationData); } @@ -310,6 +311,7 @@ public class TestUtils { public static void updatePortConsolidationData(String serviceTemplateFileName, String portNodeTemplateId, + String portType, List<String> nodesConnectedInIds, List<String> nodesConnectedOutIds, List<String> groupIds, List<String> getAttrInIds, @@ -317,7 +319,7 @@ public class TestUtils { ConsolidationData consolidationData) { PortTemplateConsolidationData portTemplateConsolidationData = - createPortTemplateConsolidationData(portNodeTemplateId); + createPortTemplateConsolidationData(portNodeTemplateId, portType); updateRelationsForEntityConsolidationData(nodesConnectedInIds, nodesConnectedOutIds, groupIds, getAttrInIds, getAttrOutFuncDataList, @@ -328,11 +330,12 @@ public class TestUtils { .setPortTemplateConsolidationData(portNodeTemplateId, portTemplateConsolidationData); } - public static PortTemplateConsolidationData createPortTemplateConsolidationData( - String portNodeTemplateId) { + public static PortTemplateConsolidationData createPortTemplateConsolidationData(String portNodeTemplateId, + String portType) { PortTemplateConsolidationData portTemplateConsolidationData = new PortTemplateConsolidationData(); portTemplateConsolidationData.setNodeTemplateId(portNodeTemplateId); + portTemplateConsolidationData.setPortType(portType); return portTemplateConsolidationData; } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/datatypes/heattotosca/unifiedmodel/consolidation/FilePortConsolidationDataTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/datatypes/heattotosca/unifiedmodel/consolidation/FilePortConsolidationDataTest.java index 8dd0307a43..60beaa02c3 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/datatypes/heattotosca/unifiedmodel/consolidation/FilePortConsolidationDataTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/datatypes/heattotosca/unifiedmodel/consolidation/FilePortConsolidationDataTest.java @@ -31,13 +31,14 @@ public class FilePortConsolidationDataTest { private static final String PORT_RESOURCE_ID_1 = "pcm_port_01"; private static final String PORT_RESOURCE_ID_2 = "pcm_port_02"; private static final String PORT_RESOURCE_TYPE = HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource(); + private static final String PORT_TYPE = "pcm_port"; private final FilePortConsolidationData consolidationData = new FilePortConsolidationData(); @Test public void testAddPortConsolidationData() { consolidationData.addPortTemplateConsolidationData(PORT_NODE_TEMPLATE_ID_1, PORT_RESOURCE_ID_1, - PORT_RESOURCE_TYPE); + PORT_RESOURCE_TYPE, PORT_TYPE); Set<String> expectedComputeNodeTypes = new HashSet<>(); expectedComputeNodeTypes.add(PORT_NODE_TEMPLATE_ID_1); checkComputeConsolidationData(consolidationData, PORT_NODE_TEMPLATE_ID_1, expectedComputeNodeTypes); @@ -46,12 +47,12 @@ public class FilePortConsolidationDataTest { @Test public void testAddSameConsolidationDataTwice_noNewCreated() { consolidationData.addPortTemplateConsolidationData(PORT_NODE_TEMPLATE_ID_1, PORT_RESOURCE_ID_1, - PORT_RESOURCE_TYPE); + PORT_RESOURCE_TYPE, PORT_TYPE); PortTemplateConsolidationData firstPortTemplateConsolidationData = consolidationData.getPortTemplateConsolidationData(PORT_NODE_TEMPLATE_ID_1); consolidationData.addPortTemplateConsolidationData(PORT_NODE_TEMPLATE_ID_1, PORT_RESOURCE_ID_1, - PORT_RESOURCE_TYPE); + PORT_RESOURCE_TYPE, PORT_TYPE); PortTemplateConsolidationData secondPortTemplateConsolidationData = consolidationData.getPortTemplateConsolidationData(PORT_NODE_TEMPLATE_ID_1); Assert.assertEquals(firstPortTemplateConsolidationData, secondPortTemplateConsolidationData); @@ -60,13 +61,13 @@ public class FilePortConsolidationDataTest { @Test public void testAddDiffConsolidationData_diffNodeTemplateIds() { consolidationData.addPortTemplateConsolidationData(PORT_NODE_TEMPLATE_ID_1, PORT_RESOURCE_ID_1, - PORT_RESOURCE_TYPE); + PORT_RESOURCE_TYPE, PORT_TYPE); Set<String> expectedComputeNodeTypes = new HashSet<>(); expectedComputeNodeTypes.add(PORT_NODE_TEMPLATE_ID_1); checkComputeConsolidationData(consolidationData, PORT_NODE_TEMPLATE_ID_1, expectedComputeNodeTypes); consolidationData.addPortTemplateConsolidationData(PORT_NODE_TEMPLATE_ID_2, PORT_RESOURCE_ID_2, - PORT_RESOURCE_TYPE); + PORT_RESOURCE_TYPE, PORT_TYPE); expectedComputeNodeTypes.add(PORT_NODE_TEMPLATE_ID_2); checkComputeConsolidationData(consolidationData, PORT_NODE_TEMPLATE_ID_2, expectedComputeNodeTypes); } @@ -74,13 +75,13 @@ public class FilePortConsolidationDataTest { @Test public void testAddDiffConsolidationData_diffResourceIds() { consolidationData.addPortTemplateConsolidationData(PORT_NODE_TEMPLATE_ID_1, PORT_RESOURCE_ID_1, - PORT_RESOURCE_TYPE); + PORT_RESOURCE_TYPE, PORT_TYPE); Set<String> expectedComputeNodeTypes = new HashSet<>(); expectedComputeNodeTypes.add(PORT_NODE_TEMPLATE_ID_1); checkComputeConsolidationData(consolidationData, PORT_NODE_TEMPLATE_ID_1, expectedComputeNodeTypes); consolidationData.addPortTemplateConsolidationData(PORT_NODE_TEMPLATE_ID_1, PORT_RESOURCE_ID_2, - PORT_RESOURCE_TYPE); + PORT_RESOURCE_TYPE, PORT_TYPE); checkComputeConsolidationData(consolidationData, PORT_NODE_TEMPLATE_ID_1, expectedComputeNodeTypes); } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/datatypes/heattotosca/unifiedmodel/consolidation/PortConsolidationDataTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/datatypes/heattotosca/unifiedmodel/consolidation/PortConsolidationDataTest.java index 05382e12ce..f42144d628 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/datatypes/heattotosca/unifiedmodel/consolidation/PortConsolidationDataTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/datatypes/heattotosca/unifiedmodel/consolidation/PortConsolidationDataTest.java @@ -58,14 +58,14 @@ public class PortConsolidationDataTest { @Test public void testAddConsolidationData_noNewCreated() { String serviceTemplateName = ServiceTemplateFileNameEnum.SERVICE_TEMPLATE_FILE_NAME_1.name(); - consolidationData.addPortTemplateConsolidationData(serviceTemplateName, PORT_NODE_TYPE_1, + consolidationData.addPortTemplateConsolidationData(serviceTemplateName, PORT_NODE_TYPE_1, PORT_NODE_TYPE_1, PORT_RESOURCE_ID, PORT_RESOURCE_TYPE); consolidationData.getFilePortConsolidationData(serviceTemplateName); Set<String> expectedServiceTemplateNames = new HashSet<>(); expectedServiceTemplateNames.add(serviceTemplateName); checkPortConsolidationData(consolidationData, serviceTemplateName, expectedServiceTemplateNames); - consolidationData.addPortTemplateConsolidationData(serviceTemplateName, PORT_NODE_TYPE_1, + consolidationData.addPortTemplateConsolidationData(serviceTemplateName, PORT_NODE_TYPE_1, PORT_NODE_TYPE_1, PORT_RESOURCE_ID, PORT_RESOURCE_TYPE); consolidationData.getFilePortConsolidationData(serviceTemplateName); checkPortConsolidationData(consolidationData, serviceTemplateName, expectedServiceTemplateNames); @@ -74,12 +74,12 @@ public class PortConsolidationDataTest { @Test public void testAddConsolidationData_DiffNodeTypes() { String serviceTemplateName = ServiceTemplateFileNameEnum.SERVICE_TEMPLATE_FILE_NAME_1.name(); - consolidationData.addPortTemplateConsolidationData(serviceTemplateName, PORT_NODE_TYPE_1, + consolidationData.addPortTemplateConsolidationData(serviceTemplateName, PORT_NODE_TYPE_1, PORT_NODE_TYPE_1, PORT_RESOURCE_ID, PORT_RESOURCE_TYPE); Set<String> expectedServiceTemplateNames = new HashSet<>(); expectedServiceTemplateNames.add(serviceTemplateName); checkPortConsolidationData(consolidationData, serviceTemplateName, expectedServiceTemplateNames); - consolidationData.addPortTemplateConsolidationData(serviceTemplateName, PORT_NODE_TYPE_2, + consolidationData.addPortTemplateConsolidationData(serviceTemplateName, PORT_NODE_TYPE_2, PORT_NODE_TYPE_2, PORT_RESOURCE_ID, PORT_RESOURCE_TYPE); checkPortConsolidationData(consolidationData, serviceTemplateName, expectedServiceTemplateNames); } @@ -88,14 +88,14 @@ public class PortConsolidationDataTest { public void testAddConsolidationData_DiffServiceTemplate() { String serviceTemplateName1 = ServiceTemplateFileNameEnum.SERVICE_TEMPLATE_FILE_NAME_1.name(); consolidationData.addPortTemplateConsolidationData( - serviceTemplateName1, PORT_NODE_TYPE_1, PORT_RESOURCE_ID, PORT_RESOURCE_TYPE); + serviceTemplateName1, PORT_NODE_TYPE_1, PORT_RESOURCE_ID, PORT_RESOURCE_TYPE, PORT_NODE_TYPE_1); Set<String> expectedServiceTemplateNames = new HashSet<>(); expectedServiceTemplateNames.add(serviceTemplateName1); checkPortConsolidationData(consolidationData, serviceTemplateName1, expectedServiceTemplateNames); String serviceTemplateName2 = ServiceTemplateFileNameEnum.SERVICE_TEMPLATE_FILE_NAME_2.name(); consolidationData.addPortTemplateConsolidationData( - serviceTemplateName2, PORT_NODE_TYPE_2, PORT_RESOURCE_ID, PORT_RESOURCE_TYPE); + serviceTemplateName2, PORT_NODE_TYPE_2, PORT_RESOURCE_ID, PORT_RESOURCE_TYPE, PORT_NODE_TYPE_2); expectedServiceTemplateNames.add(serviceTemplateName2); checkPortConsolidationData(consolidationData, serviceTemplateName2, expectedServiceTemplateNames); } @@ -160,10 +160,10 @@ public class PortConsolidationDataTest { setFilePortConsolidationDataMock(serviceTemplateFileName); consolidationData.addPortTemplateConsolidationData( - serviceTemplateFileName, portNodeType, PORT_RESOURCE_ID, PORT_RESOURCE_TYPE); + serviceTemplateFileName, portNodeType, PORT_RESOURCE_ID, PORT_RESOURCE_TYPE, portNodeType); Mockito.verify(filePortConsolidationDataMock) - .addPortTemplateConsolidationData(portNodeType, PORT_RESOURCE_ID, PORT_RESOURCE_TYPE); + .addPortTemplateConsolidationData(portNodeType, PORT_RESOURCE_ID, PORT_RESOURCE_TYPE, portNodeType); } private void addAndCheckSubInterfaceTemplateConsolidationData(String serviceTemplateFileName, diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationDataUtilTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationDataUtilTest.java index 6b637d2992..ff00b39d7b 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationDataUtilTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationDataUtilTest.java @@ -12,68 +12,70 @@ public class ConsolidationDataUtilTest { private static final String PORT_TYPE_FORMAT_5 = "network_port_22"; private static final String PORT_TYPE_FORMAT_6 = "network_port22"; private static final String PORT_TYPE_FORMAT_7 = "a_network_11_port22"; - private static final String PORT_TYPE_OUTPUT_1 = "a_network_port"; + private static final String PORT_TYPE_OUTPUT_1 = "a_network_port_22"; private static final String PORT_TYPE_OUTPUT_2 = "a_network_port22"; - private static final String PORT_TYPE_OUTPUT_3 = "network_port"; + private static final String PORT_TYPE_OUTPUT_3 = "network_port_22"; private static final String PORT_TYPE_OUTPUT_4 = "network_port22"; private static final String PORT_TYPE_OUTPUT_5 = "a_network_11_port22"; + private static final String VM_TYPE = "a"; + @Test - public void testGetPortType_Empty() throws Exception { + public void testGetPortType_Empty() { String port = ""; - assertEquals(ConsolidationDataUtil.getPortType(port), port); + assertEquals(ConsolidationDataUtil.getPortType(port, VM_TYPE), port); } @Test - public void testGetPortType_Spaces() throws Exception { + public void testGetPortType_Spaces() { String port = " "; - assertEquals(ConsolidationDataUtil.getPortType(port), port); + assertEquals(ConsolidationDataUtil.getPortType(port, VM_TYPE), port); } @Test - public void testGetPortType_Null() throws Exception { + public void testGetPortType_Null() { String port = null; - assertEquals(ConsolidationDataUtil.getPortType(port), port); + assertEquals(ConsolidationDataUtil.getPortType(port, VM_TYPE), port); } @Test - public void testGetPortType_OnlyPortType() throws Exception { + public void testGetPortType_OnlyPortType() { String port = "network"; - assertEquals(ConsolidationDataUtil.getPortType(port), port); + assertEquals(ConsolidationDataUtil.getPortType(port, VM_TYPE), port); } @Test - public void testGetPortType_WithServerAndPortIndex() throws Exception { - assertEquals(ConsolidationDataUtil.getPortType(PORT_TYPE_FORMAT_1), PORT_TYPE_OUTPUT_1); + public void testGetPortType_WithServerAndPortIndex() { + assertEquals(PORT_TYPE_OUTPUT_1, ConsolidationDataUtil.getPortType(PORT_TYPE_FORMAT_1, VM_TYPE)); } @Test - public void testGetPortType_Input_WithServerAndPortIndexWithoutUnderscore() throws Exception { - assertEquals(ConsolidationDataUtil.getPortType(PORT_TYPE_FORMAT_2), PORT_TYPE_OUTPUT_2); + public void testGetPortType_Input_WithServerAndPortIndexWithoutUnderscore() { + assertEquals(PORT_TYPE_OUTPUT_2, ConsolidationDataUtil.getPortType(PORT_TYPE_FORMAT_2, VM_TYPE)); } @Test - public void testGetPortType_Input_WithoutServerIndexAndWithPortIndex() throws Exception { - assertEquals(ConsolidationDataUtil.getPortType(PORT_TYPE_FORMAT_3), PORT_TYPE_OUTPUT_1); + public void testGetPortType_Input_WithoutServerIndexAndWithPortIndex() { + assertEquals(PORT_TYPE_OUTPUT_1, ConsolidationDataUtil.getPortType(PORT_TYPE_FORMAT_3, VM_TYPE)); } @Test - public void testGetPortType_Input_WithoutServerIndexAndWithPortIndexWithoutUnderscore() throws Exception { - assertEquals(ConsolidationDataUtil.getPortType(PORT_TYPE_FORMAT_4), PORT_TYPE_OUTPUT_2); + public void testGetPortType_Input_WithoutServerIndexAndWithPortIndexWithoutUnderscore() { + assertEquals(PORT_TYPE_OUTPUT_2, ConsolidationDataUtil.getPortType(PORT_TYPE_FORMAT_4, VM_TYPE)); } @Test - public void testGetPortType_Input_PortTypeWithIndex() throws Exception { - assertEquals(ConsolidationDataUtil.getPortType(PORT_TYPE_FORMAT_5), PORT_TYPE_OUTPUT_3); + public void testGetPortType_Input_PortTypeWithIndex() { + assertEquals(PORT_TYPE_OUTPUT_3, ConsolidationDataUtil.getPortType(PORT_TYPE_FORMAT_5, VM_TYPE)); } @Test - public void testGetPortType_Input_PortIndexWithoutUnderscore() throws Exception { - assertEquals(ConsolidationDataUtil.getPortType(PORT_TYPE_FORMAT_6), PORT_TYPE_OUTPUT_4); + public void testGetPortType_Input_PortIndexWithoutUnderscore() { + assertEquals(PORT_TYPE_OUTPUT_4, ConsolidationDataUtil.getPortType(PORT_TYPE_FORMAT_6, VM_TYPE)); } @Test - public void testGetPortType_Input_PortIndexAndDigitInBetween() throws Exception { - assertEquals(ConsolidationDataUtil.getPortType(PORT_TYPE_FORMAT_7), PORT_TYPE_OUTPUT_5); + public void testGetPortType_Input_PortIndexAndDigitInBetween() { + assertEquals(PORT_TYPE_OUTPUT_5, ConsolidationDataUtil.getPortType(PORT_TYPE_FORMAT_7, VM_TYPE)); } } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationServiceTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationServiceTest.java index 347ea65c0a..ed8d0a7e73 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationServiceTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationServiceTest.java @@ -45,6 +45,8 @@ import static org.mockito.Mockito.verify; public class ConsolidationServiceTest { + private static final String CM_01_PORT_TYPE = "cm01_port"; + private static final String SM_01_PORT_TYPE = "sm01_port"; @Spy private TranslationContext translationContext = new TranslationContext(); private static String mainST = "MainServiceTemplate.yaml"; @@ -80,8 +82,8 @@ public class ConsolidationServiceTest { consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); - portTypeToIdList.add(new ImmutablePair<>("sm01_port", "sm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(SM_01_PORT_TYPE, "sm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, @@ -95,11 +97,11 @@ public class ConsolidationServiceTest { portTypeToIdList, consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", - null, null, null, null, null, + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, + null, null, null, null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "sm01_port_1", - null, null, null, null, null, + TestUtils.updatePortConsolidationData(mainST, "sm01_port_1", CM_01_PORT_TYPE, + null, null, null, null, null, consolidationData); translationContext.setConsolidationData(consolidationData); @@ -121,8 +123,8 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); - portTypeToIdList.add(new ImmutablePair<>("sm01_port", "sm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(SM_01_PORT_TYPE, "sm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, @@ -131,10 +133,10 @@ public class ConsolidationServiceTest { portTypeToIdList, consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", - null, null, null, null, null, + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, + null, null, null, null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "sm01_port_1", + TestUtils.updatePortConsolidationData(mainST, "sm01_port_1", SM_01_PORT_TYPE, null, null, null, null, null, consolidationData); @@ -156,8 +158,8 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("sm01_port", "sm01_port_1")); - portTypeToIdList.add(new ImmutablePair<>("sm01_port", "sm01_port_2")); + portTypeToIdList.add(new ImmutablePair<>(SM_01_PORT_TYPE, "sm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(SM_01_PORT_TYPE, "sm01_port_2")); TestUtils.updateComputeTemplateConsolidationData( mainST, @@ -193,7 +195,7 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("sm01_port", "sm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(SM_01_PORT_TYPE, "sm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, @@ -202,7 +204,7 @@ public class ConsolidationServiceTest { portTypeToIdList, consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, @@ -211,10 +213,10 @@ public class ConsolidationServiceTest { portTypeToIdList, consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, null, null, null, null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "sm01_port_1", + TestUtils.updatePortConsolidationData(mainST, "sm01_port_1", SM_01_PORT_TYPE, null, null, null, null, null, consolidationData); @@ -237,8 +239,8 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); - portTypeToIdList.add(new ImmutablePair<>("sm01_port", "sm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(SM_01_PORT_TYPE, "sm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, @@ -259,10 +261,10 @@ public class ConsolidationServiceTest { portTypeToIdList, consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, null, null, null, null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "sm01_port_1", + TestUtils.updatePortConsolidationData(mainST, "sm01_port_1", SM_01_PORT_TYPE, null, null, null, null, null, consolidationData); @@ -285,8 +287,8 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); - portTypeToIdList.add(new ImmutablePair<>("sm01_port", "sm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(SM_01_PORT_TYPE, "sm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, @@ -301,7 +303,7 @@ public class ConsolidationServiceTest { portTypeToIdList, consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps03", @@ -309,10 +311,10 @@ public class ConsolidationServiceTest { portTypeToIdList, consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, null, null, null, null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "sm01_port_1", + TestUtils.updatePortConsolidationData(mainST, "sm01_port_1", SM_01_PORT_TYPE, null, null, null, null, null, consolidationData); @@ -338,8 +340,8 @@ public class ConsolidationServiceTest { (mainST, computeNodeTypeName2, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); - portTypeToIdList.add(new ImmutablePair<>("sm01_port", "sm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(SM_01_PORT_TYPE, "sm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, @@ -354,10 +356,10 @@ public class ConsolidationServiceTest { portTypeToIdList, consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, null, null, null, null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "sm01_port_1", + TestUtils.updatePortConsolidationData(mainST, "sm01_port_1", SM_01_PORT_TYPE, null, null, null, null, null, consolidationData); @@ -385,8 +387,8 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName2, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); - portTypeToIdList.add(new ImmutablePair<>("sm01_port", "sm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(SM_01_PORT_TYPE, "sm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, @@ -406,10 +408,10 @@ public class ConsolidationServiceTest { portTypeToIdList, consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, null, null, null, null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "sm01_port_1", + TestUtils.updatePortConsolidationData(mainST, "sm01_port_1", SM_01_PORT_TYPE, null, null, null, null, null, consolidationData); @@ -432,8 +434,8 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); - portTypeToIdList.add(new ImmutablePair<>("sm01_port", "sm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(SM_01_PORT_TYPE, "sm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, @@ -454,10 +456,10 @@ public class ConsolidationServiceTest { portTypeToIdList, consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, null, null, null, null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "sm01_port_1", + TestUtils.updatePortConsolidationData(mainST, "sm01_port_1", SM_01_PORT_TYPE, null, null, null, null, null, consolidationData); @@ -482,8 +484,8 @@ public class ConsolidationServiceTest { mainST, computeNodeTypeName2, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); - portTypeToIdList.add(new ImmutablePair<>("sm01_port", "sm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(SM_01_PORT_TYPE, "sm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, @@ -522,10 +524,10 @@ public class ConsolidationServiceTest { portTypeToIdList, consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, null, null, null, null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "sm01_port_1", + TestUtils.updatePortConsolidationData(mainST, "sm01_port_1", SM_01_PORT_TYPE, null, null, null, null, null, consolidationData); @@ -548,8 +550,8 @@ public class ConsolidationServiceTest { mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); - portTypeToIdList.add(new ImmutablePair<>("sm01_port", "sm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(SM_01_PORT_TYPE, "sm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, @@ -570,10 +572,10 @@ public class ConsolidationServiceTest { portTypeToIdList, consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, null, null, null, null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "sm01_port_1", + TestUtils.updatePortConsolidationData(mainST, "sm01_port_1", SM_01_PORT_TYPE, null, null, null, null, null, consolidationData); @@ -595,8 +597,8 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); - portTypeToIdList.add(new ImmutablePair<>("sm01_port", "sm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(SM_01_PORT_TYPE, "sm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, @@ -614,10 +616,10 @@ public class ConsolidationServiceTest { portTypeToIdList, consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, null, null, null, null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "sm01_port_1", + TestUtils.updatePortConsolidationData(mainST, "sm01_port_1", SM_01_PORT_TYPE, null, null, null, null, null, consolidationData); @@ -639,28 +641,28 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps01", null, null, null, null, null, null, portTypeToIdList, consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_2")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_2")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps02", null, null, null, null, null, null, portTypeToIdList, consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_3")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_3")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps03", null, null, null, null, null, null, portTypeToIdList, consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, null, null, null, null, null, consolidationData); @@ -687,28 +689,28 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps01", null, null, null, null, null, null, portTypeToIdList, consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_2")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_2")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps02", null, null, null, null, null, null, portTypeToIdList, consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_3")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_3")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps03", null, null, null, null, null, null, portTypeToIdList, consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, null, null, null, null, null, consolidationData); @@ -731,27 +733,27 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps01", null, null, null, null, null, null, portTypeToIdList, consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_2")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_2")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps02", null, null, null, null, null, null, portTypeToIdList, consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_3")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_3")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps03", null, null, null, null, null, null, portTypeToIdList, consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, null, null, null, null, null, consolidationData); @@ -774,27 +776,27 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps01", null, null, null, null, null, null, portTypeToIdList, consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_2")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_2")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps02", null, null, null, null, null, null, portTypeToIdList, consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_3")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_3")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps03", null, null, null, null, null, null, portTypeToIdList, consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, null, null, null, null, null, consolidationData); @@ -817,38 +819,38 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps01", null, null, null, null, null, null, portTypeToIdList, consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_2")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_2")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps02", null, null, null, null, null, null, portTypeToIdList, consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_3")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_3")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps03", null, null, null, null, null, null, portTypeToIdList, consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), Collections.singletonList("group_id_1"), null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_2", + TestUtils.updatePortConsolidationData(mainST, "cm01_port_2", CM_01_PORT_TYPE, Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), Collections.singletonList("group_id_1"), null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_3", + TestUtils.updatePortConsolidationData(mainST, "cm01_port_3", CM_01_PORT_TYPE, Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), Collections.singletonList("group_id_1"), null, null, @@ -872,7 +874,7 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps01", Collections.singletonList("cm01_port_1"), @@ -883,7 +885,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_2")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_2")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps02", Collections.singletonList("cm01_port_1"), @@ -894,7 +896,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_3")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_3")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps03", Collections.singletonList("cm01_port_1"), @@ -905,17 +907,17 @@ public class ConsolidationServiceTest { consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), Collections.singletonList("group_id_1"), null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_2", + TestUtils.updatePortConsolidationData(mainST, "cm01_port_2", CM_01_PORT_TYPE, Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), Collections.singletonList("group_id_1"), null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_3", + TestUtils.updatePortConsolidationData(mainST, "cm01_port_3", CM_01_PORT_TYPE, Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), Collections.singletonList("group_id_1"), null, null, @@ -940,7 +942,7 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps01", Collections.singletonList("cm01_port_1"), @@ -951,7 +953,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_2")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_2")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps02", Collections.singletonList("cm01_port_1"), @@ -962,7 +964,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_3")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_3")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps03", Collections.singletonList("cm01_port_2"), @@ -973,7 +975,7 @@ public class ConsolidationServiceTest { consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", null, null, null, null, null, + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, null, null, null, null, null, consolidationData); @@ -995,7 +997,7 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps01", Collections.singletonList("cm01_port_1"), @@ -1006,7 +1008,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_2")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_2")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps02", Collections.singletonList("cm01_port_1"), @@ -1017,7 +1019,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_3")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_3")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps03", Collections.singletonList("cm01_port_1"), @@ -1028,7 +1030,7 @@ public class ConsolidationServiceTest { consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", null, null, null, null, null, + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, null, null, null, null, null, consolidationData); @@ -1050,7 +1052,7 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps01", Collections.singletonList("cm01_port_1"), @@ -1061,7 +1063,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_2")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_2")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps02", Collections.singletonList("cm01_port_1"), @@ -1072,7 +1074,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_3")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_3")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps03", Collections.singletonList("cm01_port_1"), @@ -1083,7 +1085,7 @@ public class ConsolidationServiceTest { consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", null, null, null, null, null, + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, null, null, null, null, null, consolidationData); @@ -1105,7 +1107,7 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps01", Collections.singletonList("cm01_port_1"), @@ -1117,7 +1119,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_2")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_2")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps02", Collections.singletonList("cm01_port_1"), @@ -1128,7 +1130,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_3")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_3")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps03", Collections.singletonList("cm01_port_1"), @@ -1139,7 +1141,7 @@ public class ConsolidationServiceTest { consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", null, null, null, null, null, + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, null, null, null, null, null, consolidationData); @@ -1161,7 +1163,7 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps01", Collections.singletonList("cm01_port_1"), @@ -1173,7 +1175,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_2")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_2")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps02", Collections.singletonList("cm01_port_1"), @@ -1184,7 +1186,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_3")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_3")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps03", Collections.singletonList("cm01_port_1"), @@ -1195,18 +1197,18 @@ public class ConsolidationServiceTest { consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", - Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, + Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), Collections.singletonList("group_id_1"), null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_2", - Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), + TestUtils.updatePortConsolidationData(mainST, "cm01_port_2", CM_01_PORT_TYPE, + Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), Collections.singletonList("group_id_1"), null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_3", - Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), + TestUtils.updatePortConsolidationData(mainST, "cm01_port_3", CM_01_PORT_TYPE, + Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), Collections.singletonList("group_id_1"), null, null, consolidationData); @@ -1229,7 +1231,7 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps01", Collections.singletonList("cm01_port_1"), @@ -1241,7 +1243,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_2")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_2")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps02", Collections.singletonList("cm01_port_1"), @@ -1252,7 +1254,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_3")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_3")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps03", Collections.singletonList("cm01_port_1"), @@ -1263,18 +1265,18 @@ public class ConsolidationServiceTest { consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", - Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, + Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), Collections.singletonList("group_id_1"), null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_2", - Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), + TestUtils.updatePortConsolidationData(mainST, "cm01_port_2", CM_01_PORT_TYPE, + Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), Collections.singletonList("group_id_1"), null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_3", - Collections.singletonList("node_in_2"), Collections.singletonList("net_id_1"), + TestUtils.updatePortConsolidationData(mainST, "cm01_port_3", CM_01_PORT_TYPE, + Collections.singletonList("node_in_2"), Collections.singletonList("net_id_1"), Collections.singletonList("group_id_1"), null, null, consolidationData); @@ -1297,7 +1299,7 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps01", Collections.singletonList("cm01_port_1"), @@ -1309,7 +1311,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_2")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_2")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps02", Collections.singletonList("cm01_port_1"), @@ -1320,7 +1322,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_3")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_3")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps03", Collections.singletonList("cm01_port_1"), @@ -1331,18 +1333,18 @@ public class ConsolidationServiceTest { consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", - Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, + Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), Collections.singletonList("group_id_1"), null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_2", - Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), + TestUtils.updatePortConsolidationData(mainST, "cm01_port_2", CM_01_PORT_TYPE, + Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), Collections.singletonList("group_id_1"), null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_3", - Collections.singletonList("node_in_1"), Collections.singletonList("net_id_2"), + TestUtils.updatePortConsolidationData(mainST, "cm01_port_3", CM_01_PORT_TYPE, + Collections.singletonList("node_in_1"), Collections.singletonList("net_id_2"), Collections.singletonList("group_id_1"), null, null, consolidationData); @@ -1365,7 +1367,7 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps01", Collections.singletonList("cm01_port_1"), @@ -1377,7 +1379,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_2")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_2")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps02", Collections.singletonList("cm01_port_1"), @@ -1388,7 +1390,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_3")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_3")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps03", Collections.singletonList("cm01_port_1"), @@ -1399,16 +1401,16 @@ public class ConsolidationServiceTest { consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", - Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, + Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), Arrays.asList("group_id_1", "group_id_2"), null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_2", - Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), + TestUtils.updatePortConsolidationData(mainST, "cm01_port_2", CM_01_PORT_TYPE, + Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), Arrays.asList("group_id_1", "group_id_2"), null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_3", - Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), + TestUtils.updatePortConsolidationData(mainST, "cm01_port_3", CM_01_PORT_TYPE, + Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), Arrays.asList("group_id_1", "group_id_3"), null, null, consolidationData); @@ -1430,7 +1432,7 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, @@ -1443,7 +1445,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_2")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_2")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps02", Collections.singletonList("cm01_port_1"), @@ -1454,7 +1456,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_3")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_3")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps03", Collections.singletonList("cm01_port_1"), @@ -1465,16 +1467,16 @@ public class ConsolidationServiceTest { consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", - Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, + Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), Arrays.asList("group_id_1", "group_id_2"), null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_2", - Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), + TestUtils.updatePortConsolidationData(mainST, "cm01_port_2", CM_01_PORT_TYPE, + Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), Arrays.asList("group_id_1", "group_id_2"), null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_3", - Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), + TestUtils.updatePortConsolidationData(mainST, "cm01_port_3", CM_01_PORT_TYPE, + Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), Arrays.asList("group_id_1", "group_id_2"), null, null, consolidationData); @@ -1496,7 +1498,7 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, @@ -1509,7 +1511,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_2")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_2")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps02", Collections.singletonList("cm01_port_1"), @@ -1520,7 +1522,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_3")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_3")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps03", Collections.singletonList("cm01_port_1"), @@ -1531,16 +1533,16 @@ public class ConsolidationServiceTest { consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", - Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, + Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), Arrays.asList("group_id_1", "group_id_2"), null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_2", - Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), + TestUtils.updatePortConsolidationData(mainST, "cm01_port_2", CM_01_PORT_TYPE, + Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), Arrays.asList("group_id_1", "group_id_2"), null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_3", - Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), + TestUtils.updatePortConsolidationData(mainST, "cm01_port_3", CM_01_PORT_TYPE, + Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), Arrays.asList("group_id_1", "group_id_2"), null, null, consolidationData); @@ -1562,7 +1564,7 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, @@ -1575,7 +1577,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_2")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_2")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps02", Collections.singletonList("cm01_port_1"), @@ -1586,7 +1588,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_3")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_3")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps03", Collections.singletonList("cm01_port_1"), @@ -1599,6 +1601,8 @@ public class ConsolidationServiceTest { TestUtils.initPortConsolidationData(mainST, consolidationData); List<String> portNodeTemplateIds = Arrays.asList("cm01_port_1", "cm01_port_2", "cm01_port_3"); + List<String> toUpdatePortTypeIds = + Arrays.asList("cm01_port", "cm01_port", "cm01_port"); List<List<String>> nodesConnectedInIds = Arrays.asList(Collections.singletonList("node_in_1"), Collections.singletonList("node_in_1"), @@ -1618,7 +1622,7 @@ public class ConsolidationServiceTest { Arrays.asList(null, null, null); TestUtils.updateMultiplePortConsolidationDatas( - mainST, portNodeTemplateIds, nodesConnectedInIds, nodesConnectedOutIds, groupIds, + mainST, portNodeTemplateIds, toUpdatePortTypeIds, nodesConnectedInIds, nodesConnectedOutIds, groupIds, getAttrInIds, getAttrOut, consolidationData); translationContext.setConsolidationData(consolidationData); @@ -1640,7 +1644,7 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, @@ -1653,7 +1657,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_2")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_2")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps02", Collections.singletonList("cm01_port_1"), @@ -1664,7 +1668,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_3")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_3")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps03", Collections.singletonList("cm01_port_1"), @@ -1677,6 +1681,8 @@ public class ConsolidationServiceTest { TestUtils.initPortConsolidationData(mainST, consolidationData); List<String> portNodeTemplateIds = Arrays.asList("cm01_port_1", "cm01_port_2", "cm01_port_3"); + List<String> toUpdatePortTypeIds = + Arrays.asList("cm01_port", "cm01_port", "cm01_port"); List<List<String>> nodesConnectedInIds = Arrays.asList(Collections.singletonList("node_in_1"), Collections.singletonList("node_in_1"), @@ -1696,7 +1702,7 @@ public class ConsolidationServiceTest { Arrays.asList(null, null, null); TestUtils.updateMultiplePortConsolidationDatas( - mainST, portNodeTemplateIds, nodesConnectedInIds, nodesConnectedOutIds, groupIds, + mainST, portNodeTemplateIds, toUpdatePortTypeIds, nodesConnectedInIds, nodesConnectedOutIds, groupIds, getAttrInIds, getAttrOut, consolidationData); translationContext.setConsolidationData(consolidationData); @@ -1718,7 +1724,7 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, @@ -1731,7 +1737,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_2")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_2")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps02", Collections.singletonList("cm01_port_1"), @@ -1742,7 +1748,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_3")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_3")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps03", Collections.singletonList("cm01_port_1"), @@ -1755,6 +1761,8 @@ public class ConsolidationServiceTest { TestUtils.initPortConsolidationData(mainST, consolidationData); List<String> portNodeTemplateIds = Arrays.asList("cm01_port_1", "cm01_port_2", "cm01_port_3"); + List<String> toUpdatePortTypeIds = + Arrays.asList("cm01_port", "cm01_port", "cm01_port"); List<List<String>> nodesConnectedInIds = Arrays.asList(Collections.singletonList("node_in_1"), Collections.singletonList("node_in_1"), @@ -1774,7 +1782,7 @@ public class ConsolidationServiceTest { Arrays.asList(null, null, null); TestUtils.updateMultiplePortConsolidationDatas( - mainST, portNodeTemplateIds, nodesConnectedInIds, nodesConnectedOutIds, groupIds, + mainST, portNodeTemplateIds, toUpdatePortTypeIds, nodesConnectedInIds, nodesConnectedOutIds, groupIds, getAttrInIds, getAttrOut, consolidationData); translationContext.setConsolidationData(consolidationData); @@ -1796,7 +1804,7 @@ public class ConsolidationServiceTest { GetAttrFuncData getAttrFuncData = new GetAttrFuncData("name", "c1_name"); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps01", Collections.singletonList("cm01_port_1"), @@ -1810,7 +1818,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_2")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_2")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps02", Collections.singletonList("cm01_port_1"), @@ -1823,7 +1831,7 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_3")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_3")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps03", Collections.singletonList("cm01_port_1"), @@ -1836,18 +1844,18 @@ public class ConsolidationServiceTest { consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", - Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, + Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), Arrays.asList("group_id_1", "group_id_2"), Collections.singletonList("sm01_port_2"), null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_2", - Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), + TestUtils.updatePortConsolidationData(mainST, "cm01_port_2", CM_01_PORT_TYPE, + Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), Arrays.asList("group_id_1", "group_id_2"), Collections.singletonList("sm01_port_1"), null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_3", - Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), + TestUtils.updatePortConsolidationData(mainST, "cm01_port_3", CM_01_PORT_TYPE, + Collections.singletonList("node_in_1"), Collections.singletonList("net_id_1"), Arrays.asList("group_id_1", "group_id_2"), Collections.singletonList("rm01_port_1"), null, consolidationData); @@ -1871,8 +1879,8 @@ public class ConsolidationServiceTest { GetAttrFuncData getAttrFuncData = new GetAttrFuncData("name", "c1_name"); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); - portTypeToIdList.add(new ImmutablePair<>("sm01_port", "sm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(SM_01_PORT_TYPE, "sm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps01", Collections.singletonList("cm01_port_1"), @@ -1886,8 +1894,8 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_2")); - portTypeToIdList.add(new ImmutablePair<>("sm01_port", "sm01_port_2")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_2")); + portTypeToIdList.add(new ImmutablePair<>(SM_01_PORT_TYPE, "sm01_port_2")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps02", Collections.singletonList("cm01_port_1"), @@ -1900,8 +1908,8 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_3")); - portTypeToIdList.add(new ImmutablePair<>("sm01_port", "sm01_port_3")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_3")); + portTypeToIdList.add(new ImmutablePair<>(SM_01_PORT_TYPE, "sm01_port_3")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps03", Collections.singletonList("cm01_port_1"), @@ -1919,6 +1927,8 @@ public class ConsolidationServiceTest { Arrays.asList("cm01_port_1", "cm01_port_2", "cm01_port_3", "sm01_port_1", "sm01_port_2", "sm01_port_3"); + List<String> toUpdatePortTypeIds = + Arrays.asList("cm01_port", "cm01_port", "cm01_port", "sm01_port", "sm01_port", "sm01_port"); List<List<String>> nodesConnectedInIds = Arrays.asList(Collections.singletonList("node_in_1"), Collections.singletonList("node_in_1"), Collections.singletonList @@ -1948,7 +1958,7 @@ public class ConsolidationServiceTest { Arrays.asList(null, null, null, null, null, null); - TestUtils.updateMultiplePortConsolidationDatas(mainST, portNodeTemplateIds, + TestUtils.updateMultiplePortConsolidationDatas(mainST, portNodeTemplateIds, toUpdatePortTypeIds, nodesConnectedInIds, nodesConnectedOutIds, groupIds, getAttrInIds, getAttrOut, consolidationData); @@ -1970,8 +1980,8 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); - portTypeToIdList.add(new ImmutablePair<>("sm01_port", "sm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(SM_01_PORT_TYPE, "sm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps01", Collections.singletonList("cm01_port_1"), @@ -1983,8 +1993,8 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_2")); - portTypeToIdList.add(new ImmutablePair<>("sm01_port", "sm01_port_2")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_2")); + portTypeToIdList.add(new ImmutablePair<>(SM_01_PORT_TYPE, "sm01_port_2")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps02", Collections.singletonList("cm01_port_1"), @@ -1995,8 +2005,8 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_3")); - portTypeToIdList.add(new ImmutablePair<>("sm01_port", "sm01_port_3")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_3")); + portTypeToIdList.add(new ImmutablePair<>(SM_01_PORT_TYPE, "sm01_port_3")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps03", Collections.singletonList("cm01_port_1"), @@ -2013,6 +2023,8 @@ public class ConsolidationServiceTest { Arrays.asList("cm01_port_1", "cm01_port_2", "cm01_port_3", "sm01_port_1", "sm01_port_2", "sm01_port_3"); + List<String> toUpdatePortTypeIds = + Arrays.asList("cm01_port", "cm01_port", "cm01_port", "sm01_port", "sm01_port", "sm01_port"); List<List<String>> nodesConnectedInIds = Arrays.asList(Collections.singletonList("node_in_1"), Collections.singletonList("node_in_1"), Collections.singletonList @@ -2048,7 +2060,7 @@ public class ConsolidationServiceTest { Collections.singletonList( new ImmutablePair<>("cm01_port_3", getAttrFuncData))); - TestUtils.updateMultiplePortConsolidationDatas(mainST, portNodeTemplateIds, + TestUtils.updateMultiplePortConsolidationDatas(mainST, portNodeTemplateIds, toUpdatePortTypeIds, nodesConnectedInIds, nodesConnectedOutIds, groupIds, getAttrInIds, getAttrOut, consolidationData); @@ -2070,8 +2082,8 @@ public class ConsolidationServiceTest { .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_1")); - portTypeToIdList.add(new ImmutablePair<>("sm01_port", "sm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_1")); + portTypeToIdList.add(new ImmutablePair<>(SM_01_PORT_TYPE, "sm01_port_1")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps01", Collections.singletonList("cm01_port_1"), @@ -2083,8 +2095,8 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_2")); - portTypeToIdList.add(new ImmutablePair<>("sm01_port", "sm01_port_2")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_2")); + portTypeToIdList.add(new ImmutablePair<>(SM_01_PORT_TYPE, "sm01_port_2")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps02", Collections.singletonList("cm01_port_1"), @@ -2095,8 +2107,8 @@ public class ConsolidationServiceTest { consolidationData); portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("cm01_port", "cm01_port_3")); - portTypeToIdList.add(new ImmutablePair<>("sm01_port", "sm01_port_3")); + portTypeToIdList.add(new ImmutablePair<>(CM_01_PORT_TYPE, "cm01_port_3")); + portTypeToIdList.add(new ImmutablePair<>(SM_01_PORT_TYPE, "sm01_port_3")); TestUtils.updateComputeTemplateConsolidationData( mainST, computeNodeTypeName, "server_ps03", Collections.singletonList("cm01_port_1"), @@ -2113,6 +2125,8 @@ public class ConsolidationServiceTest { Arrays.asList("cm01_port_1", "cm01_port_2", "cm01_port_3", "sm01_port_1", "sm01_port_2", "sm01_port_3"); + List<String> toUpdatePortTypeIds = + Arrays.asList("cm01_port", "cm01_port", "cm01_port", "sm01_port", "sm01_port", "sm01_port"); List<List<String>> nodesConnectedInIds = Arrays.asList(Collections.singletonList("node_in_1"), Collections.singletonList("node_in_1"), Collections.singletonList @@ -2147,7 +2161,7 @@ public class ConsolidationServiceTest { Collections.singletonList( new ImmutablePair<>("cm01_port_3", getAttrFuncData))); - TestUtils.updateMultiplePortConsolidationDatas(mainST, portNodeTemplateIds, + TestUtils.updateMultiplePortConsolidationDatas(mainST, portNodeTemplateIds, toUpdatePortTypeIds, nodesConnectedInIds, nodesConnectedOutIds, groupIds, getAttrInIds, getAttrOut, consolidationData); @@ -2337,18 +2351,18 @@ public class ConsolidationServiceTest { TestUtils .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); - updateComputeConsolidationData("server_ps01", computeNodeTypeName, "cm01_port", + updateComputeConsolidationData("server_ps01", computeNodeTypeName, CM_01_PORT_TYPE, "cm01_port_1", consolidationData); - updateComputeConsolidationData("server_ps02", computeNodeTypeName, "cm01_port", + updateComputeConsolidationData("server_ps02", computeNodeTypeName, CM_01_PORT_TYPE, "cm01_port_2", consolidationData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", - null, null, null, null, null, + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, + null, null, null, null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_2", - null, null, null, null, null, + TestUtils.updatePortConsolidationData(mainST, "cm01_port_2", CM_01_PORT_TYPE, + null, null, null, null, null, consolidationData); } @@ -2495,9 +2509,9 @@ public class ConsolidationServiceTest { TestUtils .initComputeNodeTypeInConsolidationData(mainST, computeNodeTypeName, consolidationData); - updateComputeConsolidationData("server_ps01", computeNodeTypeName, "cm01_port", + updateComputeConsolidationData("server_ps01", computeNodeTypeName, CM_01_PORT_TYPE, "cm01_port_1", consolidationData); - updateComputeConsolidationData("server_ps02", computeNodeTypeName, "cm01_port", + updateComputeConsolidationData("server_ps02", computeNodeTypeName, CM_01_PORT_TYPE, "cm01_port_2", consolidationData); GetAttrFuncData getAttrFuncData = new GetAttrFuncData("name", "c1_name"); @@ -2507,11 +2521,11 @@ public class ConsolidationServiceTest { new ImmutablePair<>("interface_2", getAttrFuncData); TestUtils.initPortConsolidationData(mainST, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", - null, null, null, null, null, + TestUtils.updatePortConsolidationData(mainST, "cm01_port_1", CM_01_PORT_TYPE, + null, null, null, null, null, consolidationData); - TestUtils.updatePortConsolidationData(mainST, "cm01_port_2", - null, null, null, null, null, + TestUtils.updatePortConsolidationData(mainST, "cm01_port_2", CM_01_PORT_TYPE, + null, null, null, null, null, consolidationData); TestUtils diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionServiceTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionServiceTest.java index 92faf85541..a5eb165327 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionServiceTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionServiceTest.java @@ -75,13 +75,27 @@ public class UnifiedCompositionServiceTest { private static final String OUT_PREFIX = "/out"; private static final String FSB1_template = "FSB1_template"; private static final String FSB2_template = "FSB2_template"; - private static final String FSB3_template = "FSB3_template"; private static final String FSB1_INTERNAL = "FSB1_Internal"; private static final String FSB2_INTERNAL = "FSB2_Internal"; private static final String FSB1_INTERNAL_1 = "FSB1_Internal_1"; private static final String FSB1_INTERNAL_2 = "FSB1_Internal_2"; private static final String FSB2_INTERNAL_1 = "FSB2_Internal_1"; private static final String FSB2_INTERNAL_2 = "FSB2_Internal_2"; + + //New ports according to naming convention + //Ports with same port types + private static final String FSB1_INTERNAL_PORT_TYPE_0 = "FSB1_Internal_port_0"; + private static final String FSB1_0_INTERNAL_PORT_0 = "FSB1_0_Internal_port_0"; + private static final String FSB1_1_INTERNAL_PORT_0 = "FSB1_1_Internal_port_0"; + + //For compute type FSB + private static final String FSB_INTERNAL_PORT_TYPE_0 = "FSB_Internal_port_0"; + private static final String FSB_INTERNAL_PORT_TYPE_1 = "FSB_Internal_port_1"; + private static final String FSB_2_INTERNAL_PORT_0 = "FSB_2_Internal_port_0"; + private static final String FSB_2_INTERNAL_PORT_1 = "FSB_2_Internal_port_1"; + private static final String FSB_1_INTERNAL_PORT_0 = "FSB_1_Internal_port_0"; + private static final String FSB_1_INTERNAL_PORT_1 = "FSB_1_Internal_port_1"; + private static final String PORT = "port"; private static final String PORT_1 = "port_1"; private static final String PORT_2 = "port_2"; @@ -149,9 +163,9 @@ public class UnifiedCompositionServiceTest { @Test public void createSubstitutionStNoOutputParamAndDuplicatePortType() throws Exception { List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>(FSB1_INTERNAL, FSB1_INTERNAL_1)); - portTypeToIdList.add(new ImmutablePair<>(FSB2_INTERNAL, FSB2_INTERNAL_2)); - portTypeToIdList.add(new ImmutablePair<>(FSB2_INTERNAL, FSB2_INTERNAL_1)); + portTypeToIdList.add(new ImmutablePair<>(FSB1_INTERNAL_PORT_TYPE_0, FSB1_0_INTERNAL_PORT_0)); + portTypeToIdList.add(new ImmutablePair<>(FSB1_INTERNAL_PORT_TYPE_0, FSB1_1_INTERNAL_PORT_0)); + portTypeToIdList.add(new ImmutablePair<>(FSB1_INTERNAL_1, FSB1_INTERNAL_1)); portTypeToIdList.add(new ImmutablePair<>(FSB1_OAM, FSB1_OAM)); loadInputAndOutputData(BASE_DIRECTORY + "creSubstitutionServiceTemplate/NoOutParamDuplicatePortType"); @@ -174,8 +188,8 @@ public class UnifiedCompositionServiceTest { @Test public void createSubstitutionStWithOutputParamNoConsolidation() throws Exception { List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>(FSB1_INTERNAL, FSB1_INTERNAL_1)); - portTypeToIdList.add(new ImmutablePair<>(FSB2_INTERNAL, FSB2_INTERNAL_2)); + portTypeToIdList.add(new ImmutablePair<>(FSB1_INTERNAL_1, FSB1_INTERNAL_1)); + portTypeToIdList.add(new ImmutablePair<>(FSB2_INTERNAL_2, FSB2_INTERNAL_2)); portTypeToIdList.add(new ImmutablePair<>(FSB1_OAM, FSB1_OAM)); loadInputAndOutputData(BASE_DIRECTORY + "creSubstitutionServiceTemplate/WithOutputParameters/noConsolidation"); @@ -201,8 +215,8 @@ public class UnifiedCompositionServiceTest { public void createSubstitutionStWithOutputParamWithConsolidation() throws Exception { List<UnifiedCompositionData> unifiedCompositionDataList = new ArrayList<>(); List<Pair<String, String>> portTypeToIdList1 = new ArrayList<>(); - portTypeToIdList1.add(new ImmutablePair<>(FSB1_INTERNAL, FSB1_INTERNAL_1)); - portTypeToIdList1.add(new ImmutablePair<>(FSB2_INTERNAL, FSB2_INTERNAL_2)); + portTypeToIdList1.add(new ImmutablePair<>(FSB_INTERNAL_PORT_TYPE_1, FSB_1_INTERNAL_PORT_1)); + portTypeToIdList1.add(new ImmutablePair<>(FSB_INTERNAL_PORT_TYPE_0, FSB_1_INTERNAL_PORT_0)); loadInputAndOutputData(BASE_DIRECTORY + "creSubstitutionServiceTemplate/WithOutputParameters/consolidation"); UnifiedCompositionData unifiedCompositionData1 = @@ -212,8 +226,8 @@ public class UnifiedCompositionServiceTest { unifiedCompositionDataList.add(unifiedCompositionData1); List<Pair<String, String>> portTypeToIdList2 = new ArrayList<>(); - portTypeToIdList2.add(new ImmutablePair<>(FSB1_INTERNAL, FSB1_INTERNAL_2)); - portTypeToIdList2.add(new ImmutablePair<>(FSB2_INTERNAL, FSB2_INTERNAL_1)); + portTypeToIdList2.add(new ImmutablePair<>(FSB_INTERNAL_PORT_TYPE_1, FSB_2_INTERNAL_PORT_1)); + portTypeToIdList2.add(new ImmutablePair<>(FSB_INTERNAL_PORT_TYPE_0, FSB_2_INTERNAL_PORT_0)); UnifiedCompositionData unifiedCompositionData2 = createCompositionData(FSB2_template, portTypeToIdList2); @@ -257,8 +271,8 @@ public class UnifiedCompositionServiceTest { @Test public void createSubstitutionStWithIndex() throws Exception { List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>(FSB1_INTERNAL, FSB1_INTERNAL_1)); - portTypeToIdList.add(new ImmutablePair<>(FSB2_INTERNAL, FSB2_INTERNAL_2)); + portTypeToIdList.add(new ImmutablePair<>(FSB_INTERNAL_PORT_TYPE_0, FSB_1_INTERNAL_PORT_0)); + portTypeToIdList.add(new ImmutablePair<>(FSB_INTERNAL_PORT_TYPE_1, FSB_1_INTERNAL_PORT_1)); portTypeToIdList.add(new ImmutablePair<>(FSB1_OAM, FSB1_OAM)); loadInputAndOutputData(BASE_DIRECTORY + "creSubstitutionServiceTemplate/WithIndex"); @@ -285,8 +299,8 @@ public class UnifiedCompositionServiceTest { UnifiedCompositionData data = createComputeUnifiedCompositionData(FSB1_template); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>(FSB1_INTERNAL, FSB1_INTERNAL_1)); - portTypeToIdList.add(new ImmutablePair<>(FSB2_INTERNAL, FSB2_INTERNAL_2)); + portTypeToIdList.add(new ImmutablePair<>(FSB_INTERNAL_PORT_TYPE_1, FSB_1_INTERNAL_PORT_1)); + portTypeToIdList.add(new ImmutablePair<>(FSB_INTERNAL_PORT_TYPE_0, FSB_2_INTERNAL_PORT_0)); portTypeToIdList.add(new ImmutablePair<>(FSB1_OAM, FSB1_OAM)); addPortDataToCompositionData(portTypeToIdList, data); @@ -316,8 +330,8 @@ public class UnifiedCompositionServiceTest { UnifiedCompositionData data = createComputeUnifiedCompositionData(FSB1_template); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>(FSB1_INTERNAL, FSB1_INTERNAL_1)); - portTypeToIdList.add(new ImmutablePair<>(FSB1_INTERNAL, FSB1_INTERNAL_2)); + portTypeToIdList.add(new ImmutablePair<>(FSB1_INTERNAL_1, FSB1_INTERNAL_1)); + portTypeToIdList.add(new ImmutablePair<>(FSB1_INTERNAL_2, FSB1_INTERNAL_2)); addPortDataToCompositionData(portTypeToIdList, data); List<UnifiedCompositionData> unifiedCompositionDataList = new LinkedList<>(); @@ -403,8 +417,8 @@ public class UnifiedCompositionServiceTest { UnifiedCompositionData data = createComputeUnifiedCompositionData(FSB1_template); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>(FSB1_INTERNAL, FSB1_INTERNAL_1)); - portTypeToIdList.add(new ImmutablePair<>(FSB2_INTERNAL, FSB2_INTERNAL_2)); + portTypeToIdList.add(new ImmutablePair<>(FSB_INTERNAL_PORT_TYPE_0, FSB_2_INTERNAL_PORT_0)); + portTypeToIdList.add(new ImmutablePair<>(FSB_INTERNAL_PORT_TYPE_1, FSB_1_INTERNAL_PORT_1)); portTypeToIdList.add(new ImmutablePair<>(FSB1_OAM, FSB1_OAM)); addPortDataToCompositionData(portTypeToIdList, data); @@ -500,8 +514,8 @@ public class UnifiedCompositionServiceTest { UnifiedCompositionData data = createComputeUnifiedCompositionData(FSB1_template); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>(FSB1_INTERNAL, FSB1_INTERNAL_1)); - portTypeToIdList.add(new ImmutablePair<>(FSB2_INTERNAL, FSB2_INTERNAL_2)); + portTypeToIdList.add(new ImmutablePair<>(FSB_INTERNAL_PORT_TYPE_1, FSB_1_INTERNAL_PORT_1)); + portTypeToIdList.add(new ImmutablePair<>(FSB_INTERNAL_PORT_TYPE_0, FSB_2_INTERNAL_PORT_0)); portTypeToIdList.add(new ImmutablePair<>(FSB1_OAM, FSB1_OAM)); addPortDataToCompositionData(portTypeToIdList, data); @@ -558,8 +572,8 @@ public class UnifiedCompositionServiceTest { loadInputAndOutputData(BASE_DIRECTORY + "updGroupsConnectivity/noConsolidation"); UnifiedCompositionData data = createComputeUnifiedCompositionData("server_smp1"); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>(PORT, PORT_1)); - portTypeToIdList.add(new ImmutablePair<>(PORT, PORT_2)); + portTypeToIdList.add(new ImmutablePair<>(PORT_1, PORT_1)); + portTypeToIdList.add(new ImmutablePair<>(PORT_2, PORT_2)); addPortDataToCompositionData(portTypeToIdList, data); //Add groups @@ -619,8 +633,8 @@ public class UnifiedCompositionServiceTest { @Test public void updOutParamGetAttrInNoConsolidationTest() throws Exception { List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>(FSB1_INTERNAL, FSB1_INTERNAL_1)); - portTypeToIdList.add(new ImmutablePair<>(FSB2_INTERNAL, FSB2_INTERNAL_2)); + portTypeToIdList.add(new ImmutablePair<>(FSB1_INTERNAL_1, FSB1_INTERNAL_1)); + portTypeToIdList.add(new ImmutablePair<>(FSB2_INTERNAL_2, FSB2_INTERNAL_2)); portTypeToIdList.add(new ImmutablePair<>(FSB1_OAM, FSB1_OAM)); loadInputAndOutputData(BASE_DIRECTORY + "updOutputGetAttrIn/noConsolidation"); @@ -646,8 +660,8 @@ public class UnifiedCompositionServiceTest { public void updOutParamGetAttrInWithConsolidationTest() throws Exception { List<UnifiedCompositionData> unifiedCompositionDataList = new ArrayList<>(); List<Pair<String, String>> portTypeToIdList1 = new ArrayList<>(); - portTypeToIdList1.add(new ImmutablePair<>(FSB1_INTERNAL, FSB1_INTERNAL_1)); - portTypeToIdList1.add(new ImmutablePair<>(FSB2_INTERNAL, FSB2_INTERNAL_2)); + portTypeToIdList1.add(new ImmutablePair<>(FSB1_INTERNAL_1, FSB1_INTERNAL_1)); + portTypeToIdList1.add(new ImmutablePair<>(FSB2_INTERNAL_2, FSB2_INTERNAL_2)); loadInputAndOutputData(BASE_DIRECTORY + "updOutputGetAttrIn/consolidation"); UnifiedCompositionData unifiedCompositionData1 = @@ -657,8 +671,8 @@ public class UnifiedCompositionServiceTest { unifiedCompositionDataList.add(unifiedCompositionData1); List<Pair<String, String>> portTypeToIdList2 = new ArrayList<>(); - portTypeToIdList2.add(new ImmutablePair<>(FSB1_INTERNAL, FSB1_INTERNAL_2)); - portTypeToIdList2.add(new ImmutablePair<>(FSB2_INTERNAL, FSB2_INTERNAL_1)); + portTypeToIdList2.add(new ImmutablePair<>(FSB1_INTERNAL_2, FSB1_INTERNAL_2)); + portTypeToIdList2.add(new ImmutablePair<>(FSB2_INTERNAL_1, FSB2_INTERNAL_1)); UnifiedCompositionData unifiedCompositionData2 = createCompositionData(FSB2_template, portTypeToIdList2); @@ -681,8 +695,8 @@ public class UnifiedCompositionServiceTest { @Test public void updNodeGetAttrInNoConsolidationTest() throws Exception { List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>(FSB1_INTERNAL, FSB1_INTERNAL_1)); - portTypeToIdList.add(new ImmutablePair<>(FSB2_INTERNAL, FSB2_INTERNAL_2)); + portTypeToIdList.add(new ImmutablePair<>(FSB_INTERNAL_PORT_TYPE_1, FSB_1_INTERNAL_PORT_1)); + portTypeToIdList.add(new ImmutablePair<>(FSB_INTERNAL_PORT_TYPE_0, FSB_2_INTERNAL_PORT_0)); portTypeToIdList.add(new ImmutablePair<>(FSB1_OAM, FSB1_OAM)); loadInputAndOutputData(BASE_DIRECTORY + "updNodesGetAttrIn/noConsolidation"); @@ -709,8 +723,8 @@ public class UnifiedCompositionServiceTest { public void updNodeGetAttrInWithConsolidationTest() throws Exception { List<UnifiedCompositionData> unifiedCompositionDataList = new ArrayList<>(); List<Pair<String, String>> portTypeToIdList1 = new ArrayList<>(); - portTypeToIdList1.add(new ImmutablePair<>(FSB1_INTERNAL, FSB1_INTERNAL_1)); - portTypeToIdList1.add(new ImmutablePair<>(FSB2_INTERNAL, FSB2_INTERNAL_2)); + portTypeToIdList1.add(new ImmutablePair<>(FSB_INTERNAL_PORT_TYPE_1, FSB_1_INTERNAL_PORT_1)); + portTypeToIdList1.add(new ImmutablePair<>(FSB_INTERNAL_PORT_TYPE_0, FSB_1_INTERNAL_PORT_0)); loadInputAndOutputData(BASE_DIRECTORY + "updNodesGetAttrIn/consolidation"); UnifiedCompositionData unifiedCompositionData1 = @@ -720,8 +734,8 @@ public class UnifiedCompositionServiceTest { unifiedCompositionDataList.add(unifiedCompositionData1); List<Pair<String, String>> portTypeToIdList2 = new ArrayList<>(); - portTypeToIdList2.add(new ImmutablePair<>(FSB1_INTERNAL, FSB1_INTERNAL_2)); - portTypeToIdList2.add(new ImmutablePair<>(FSB2_INTERNAL, FSB2_INTERNAL_1)); + portTypeToIdList2.add(new ImmutablePair<>(FSB_INTERNAL_PORT_TYPE_1, FSB_2_INTERNAL_PORT_1)); + portTypeToIdList2.add(new ImmutablePair<>(FSB_INTERNAL_PORT_TYPE_0, FSB_2_INTERNAL_PORT_0)); UnifiedCompositionData unifiedCompositionData2 = createCompositionData(FSB2_template, portTypeToIdList2); @@ -746,8 +760,8 @@ public class UnifiedCompositionServiceTest { @Test public void updNodesGetAttrFromInnerNodesTest() throws Exception { List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>(FSB1_INTERNAL, FSB1_INTERNAL_1)); - portTypeToIdList.add(new ImmutablePair<>(FSB2_INTERNAL, FSB2_INTERNAL_2)); + portTypeToIdList.add(new ImmutablePair<>(FSB_INTERNAL_PORT_TYPE_1, FSB_1_INTERNAL_PORT_1)); + portTypeToIdList.add(new ImmutablePair<>(FSB_INTERNAL_PORT_TYPE_0, FSB_1_INTERNAL_PORT_0)); portTypeToIdList.add(new ImmutablePair<>(FSB1_OAM, FSB1_OAM)); loadInputAndOutputData(BASE_DIRECTORY + @@ -779,8 +793,8 @@ public class UnifiedCompositionServiceTest { public void updNodesGetAttrFromConsolidationNodesTest() throws Exception { List<UnifiedCompositionData> unifiedCompositionDataList = new ArrayList<>(); List<Pair<String, String>> portTypeToIdList1 = new ArrayList<>(); - portTypeToIdList1.add(new ImmutablePair<>(FSB1_INTERNAL, FSB1_INTERNAL_1)); - portTypeToIdList1.add(new ImmutablePair<>(FSB2_INTERNAL, FSB2_INTERNAL_2)); + portTypeToIdList1.add(new ImmutablePair<>(FSB_INTERNAL_PORT_TYPE_1, FSB_1_INTERNAL_PORT_1)); + portTypeToIdList1.add(new ImmutablePair<>(FSB_INTERNAL_PORT_TYPE_0, FSB_1_INTERNAL_PORT_0)); loadInputAndOutputData(BASE_DIRECTORY + "creSubstitutionServiceTemplate/updNodesGetAttrInFromInnerNodes/consolidation"); @@ -791,8 +805,8 @@ public class UnifiedCompositionServiceTest { unifiedCompositionDataList.add(unifiedCompositionData1); List<Pair<String, String>> portTypeToIdList2 = new ArrayList<>(); - portTypeToIdList2.add(new ImmutablePair<>(FSB1_INTERNAL, FSB1_INTERNAL_2)); - portTypeToIdList2.add(new ImmutablePair<>(FSB2_INTERNAL, FSB2_INTERNAL_1)); + portTypeToIdList2.add(new ImmutablePair<>(FSB_INTERNAL_PORT_TYPE_1, FSB_2_INTERNAL_PORT_1)); + portTypeToIdList2.add(new ImmutablePair<>(FSB_INTERNAL_PORT_TYPE_0, FSB_2_INTERNAL_PORT_0)); UnifiedCompositionData unifiedCompositionData2 = createCompositionData(FSB2_template, portTypeToIdList2); @@ -887,8 +901,8 @@ public class UnifiedCompositionServiceTest { loadInputAndOutputData(BASE_DIRECTORY + "fixNewAbstractNodeTemplate/noConsolidation"); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>(FSB1_INTERNAL, FSB1_INTERNAL_1)); - portTypeToIdList.add(new ImmutablePair<>(FSB1_INTERNAL, FSB1_INTERNAL_2)); + portTypeToIdList.add(new ImmutablePair<>(FSB1_INTERNAL_1, FSB1_INTERNAL_1)); + portTypeToIdList.add(new ImmutablePair<>(FSB1_INTERNAL_2, FSB1_INTERNAL_2)); NodeTemplate cleanedComputeNodeTemplate = getMockNode( @@ -969,11 +983,11 @@ public class UnifiedCompositionServiceTest { context.getTranslatedServiceTemplates() .put(MAIN_SERVICE_TEMPLATE_YAML, inputServiceTemplates.get(MAIN_SERVICE_TEMPLATE_YAML)); - UnifiedCompositionData unifiedComposition = createUnifiedCompositionOnlyNested("server_pcm_001"); - UnifiedCompositionTo unifiedCompositionTo = new UnifiedCompositionTo( - inputServiceTemplates.get(MAIN_SERVICE_TEMPLATE_YAML), inputServiceTemplates.get(nestedFileName), null, - context, null); - unifiedCompositionService.handleUnifiedNestedDefinition(unifiedCompositionTo, unifiedComposition); + UnifiedCompositionData unifiedComposition = createUnifiedCompositionOnlyNested("server_pcm_001"); + UnifiedCompositionTo unifiedCompositionTo = new UnifiedCompositionTo( + inputServiceTemplates.get(MAIN_SERVICE_TEMPLATE_YAML), inputServiceTemplates.get(nestedFileName), null, + context, null); + unifiedCompositionService.handleUnifiedNestedDefinition(unifiedCompositionTo, unifiedComposition); checkSTResults(expectedOutserviceTemplates, nestedFileName, context.getTranslatedServiceTemplates().get(nestedFileName), @@ -1012,17 +1026,17 @@ public class UnifiedCompositionServiceTest { context.getTranslatedServiceTemplates() .put(MAIN_SERVICE_TEMPLATE_YAML, inputServiceTemplates.get(MAIN_SERVICE_TEMPLATE_YAML)); - UnifiedCompositionData unifiedComposition = - createUnifiedCompositionOnlyNested("server_pcm_001"); - UnifiedCompositionTo unifiedCompositionTo1 = new UnifiedCompositionTo(inputServiceTemplates - .get(MAIN_SERVICE_TEMPLATE_YAML), inputServiceTemplates.get(nestedFileName1), null, - context, null); - unifiedCompositionService.handleUnifiedNestedDefinition(unifiedCompositionTo1, unifiedComposition); - unifiedComposition = createUnifiedCompositionOnlyNested("server_oam_001"); - UnifiedCompositionTo unifiedCompositionTo2 = new UnifiedCompositionTo(inputServiceTemplates - .get(MAIN_SERVICE_TEMPLATE_YAML), inputServiceTemplates.get(nestedFileName2), null, - context, null); - unifiedCompositionService.handleUnifiedNestedDefinition(unifiedCompositionTo2, unifiedComposition); + UnifiedCompositionData unifiedComposition = + createUnifiedCompositionOnlyNested("server_pcm_001"); + UnifiedCompositionTo unifiedCompositionTo1 = new UnifiedCompositionTo(inputServiceTemplates + .get(MAIN_SERVICE_TEMPLATE_YAML), inputServiceTemplates.get(nestedFileName1), null, + context, null); + unifiedCompositionService.handleUnifiedNestedDefinition(unifiedCompositionTo1, unifiedComposition); + unifiedComposition = createUnifiedCompositionOnlyNested("server_oam_001"); + UnifiedCompositionTo unifiedCompositionTo2 = new UnifiedCompositionTo(inputServiceTemplates + .get(MAIN_SERVICE_TEMPLATE_YAML), inputServiceTemplates.get(nestedFileName2), null, + context, null); + unifiedCompositionService.handleUnifiedNestedDefinition(unifiedCompositionTo2, unifiedComposition); checkSTResults(expectedOutserviceTemplates, nestedFileName1, context.getTranslatedServiceTemplates().get(nestedFileName1), @@ -1144,8 +1158,8 @@ public class UnifiedCompositionServiceTest { loadInputAndOutputData(BASE_DIRECTORY + "inputoutputparamtype"); ConsolidationData consolidationData = new ConsolidationData(); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - portTypeToIdList.add(new ImmutablePair<>("FSB1_Port", "FSB1_Port_1")); - portTypeToIdList.add(new ImmutablePair<>("VMI", "VMI_1")); + portTypeToIdList.add(new ImmutablePair<>("FSB1_Port_1", "FSB1_Port_1")); + portTypeToIdList.add(new ImmutablePair<>("VMI_1", "VMI_1")); UnifiedCompositionData unifiedCompositionData = createCompositionData(FSB1, portTypeToIdList); @@ -1335,7 +1349,7 @@ public class UnifiedCompositionServiceTest { Multimap<String, RequirementAssignmentData> nodeConnectedOut = TestUtils.getNodeConnectedOutList(portNodeTemplate, "link"); PortTemplateConsolidationData portTemplateConsolidationData = - TestUtils.createPortTemplateConsolidationData(port.getRight()); + TestUtils.createPortTemplateConsolidationData(port.getRight(), port.getLeft()); portTemplateConsolidationData.setNodesConnectedOut(nodeConnectedOut); unifiedCompositionData.addPortTemplateConsolidationData(portTemplateConsolidationData); } @@ -1349,17 +1363,17 @@ public class UnifiedCompositionServiceTest { UnifiedCompositionData data2 = createComputeUnifiedCompositionData(FSB2_template); List<Pair<String, String>> portTypeToIdList = new ArrayList<>(); - ImmutablePair<String, String> portTypePair1 = new ImmutablePair<>(FSB1_INTERNAL, - FSB1_INTERNAL_1); - ImmutablePair<String, String> portTypePair2 = new ImmutablePair<>(FSB2_INTERNAL, - FSB2_INTERNAL_1); + ImmutablePair<String, String> portTypePair1 = new ImmutablePair<>(FSB_INTERNAL_PORT_TYPE_0, + FSB_1_INTERNAL_PORT_0); + ImmutablePair<String, String> portTypePair2 = new ImmutablePair<>(FSB_INTERNAL_PORT_TYPE_1, + FSB_1_INTERNAL_PORT_1); portTypeToIdList.add(portTypePair1); portTypeToIdList.add(portTypePair2); addPortDataToCompositionData(portTypeToIdList, data1); portTypeToIdList.remove(portTypePair1); portTypeToIdList.remove(portTypePair2); - portTypeToIdList.add(new ImmutablePair<>(FSB1_INTERNAL, FSB1_INTERNAL_2)); - portTypeToIdList.add(new ImmutablePair<>(FSB2_INTERNAL, FSB2_INTERNAL_2)); + portTypeToIdList.add(new ImmutablePair<>(FSB_INTERNAL_PORT_TYPE_0, FSB_2_INTERNAL_PORT_0)); + portTypeToIdList.add(new ImmutablePair<>(FSB_INTERNAL_PORT_TYPE_1, FSB_2_INTERNAL_PORT_1)); addPortDataToCompositionData(portTypeToIdList, data2); unifiedCompositionDataList.add(data1); @@ -1421,7 +1435,7 @@ public class UnifiedCompositionServiceTest { Multimap<String, RequirementAssignmentData> portNodeConnectedOut = TestUtils.getNodeConnectedOutList(portNodeTemplate, "link"); PortTemplateConsolidationData portTemplateConsolidationData = TestUtils - .createPortTemplateConsolidationData(port.getRight()); + .createPortTemplateConsolidationData(port.getRight(), port.getLeft()); portTemplateConsolidationData.setNodesConnectedOut(portNodeConnectedOut); //Add node connected in info to test data @@ -1454,12 +1468,12 @@ public class UnifiedCompositionServiceTest { private void addGetAttrForPort(UnifiedCompositionData unifiedCompositionData) { for (PortTemplateConsolidationData portTemplateConsolidationData : unifiedCompositionData .getPortTemplateConsolidationDataList()) { - if (portTemplateConsolidationData.getNodeTemplateId().equals(FSB1_INTERNAL_1)) { + if (portTemplateConsolidationData.getNodeTemplateId().equals(FSB_1_INTERNAL_PORT_1)) { addGetAttInUnifiedCompositionData(portTemplateConsolidationData, "network_name", NETWORK_ID, JSA_NET1); addGetAttInUnifiedCompositionData(portTemplateConsolidationData, SIZE, DEVICE_OWNER, CMAUI_VOLUME1); - } else if (portTemplateConsolidationData.getNodeTemplateId().equals(FSB2_INTERNAL_2)) { + } else if (portTemplateConsolidationData.getNodeTemplateId().equals(FSB_2_INTERNAL_PORT_0)) { addGetAttInUnifiedCompositionData(portTemplateConsolidationData, TENANT_ID, NETWORK_ID, JSA_NET1); addGetAttInUnifiedCompositionData(portTemplateConsolidationData, "qos_policy", @@ -1491,7 +1505,7 @@ public class UnifiedCompositionServiceTest { private void addGetAttrForPortInnerUC(UnifiedCompositionData unifiedCompositionData) { for (PortTemplateConsolidationData portTemplateConsolidationData : unifiedCompositionData .getPortTemplateConsolidationDataList()) { - if (portTemplateConsolidationData.getNodeTemplateId().equals(FSB1_INTERNAL_1)) { + if (portTemplateConsolidationData.getNodeTemplateId().equals(FSB_1_INTERNAL_PORT_1)) { addGetAttInUnifiedCompositionData(portTemplateConsolidationData, AVAILABILITY_ZONE, MYATTR, FSB1_template); addGetAttInUnifiedCompositionData(portTemplateConsolidationData, "metadata", diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/buildconsolidationdata/ConsolidationDataTestUtil.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/buildconsolidationdata/ConsolidationDataTestUtil.java index 1fedc7b09c..b2fa3e7666 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/buildconsolidationdata/ConsolidationDataTestUtil.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/buildconsolidationdata/ConsolidationDataTestUtil.java @@ -394,7 +394,7 @@ public class ConsolidationDataTestUtil { portMap.put(portNode, new LinkedHashMap<>()); } Map<String, List<String>> portTypMaps = portMap.get(portNode); - String id = ConsolidationDataUtil.getPortType(nodeName); + String id = ConsolidationDataUtil.getPortType(nodeName, "a"); if (!portTypMaps.containsKey(id)) { portTypMaps.put(id, new ArrayList<>()); } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/unifiedmodel/commands/PortNewNodeTemplateIdGeneratorTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/unifiedmodel/commands/PortNewNodeTemplateIdGeneratorTest.java index 9d8f6a972f..6791614a19 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/unifiedmodel/commands/PortNewNodeTemplateIdGeneratorTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/unifiedmodel/commands/PortNewNodeTemplateIdGeneratorTest.java @@ -57,7 +57,7 @@ public class PortNewNodeTemplateIdGeneratorTest { Optional<String> nodeTemplateId = unifiedSubstitutionNodeTemplateIdGenerator.generate(unifiedCompositionTo, PCM_PORT_0); if (nodeTemplateId.isPresent()) { - Assert.assertEquals(nodeTemplateId.get(), "pcm_server_pcm_port"); + Assert.assertEquals(nodeTemplateId.get(), "pcm_server_pcm_port_0"); } else { Assert.fail(); } |