diff options
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationDataUtilTest.java')
-rw-r--r-- | openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationDataUtilTest.java | 50 |
1 files changed, 26 insertions, 24 deletions
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)); } } |