aboutsummaryrefslogtreecommitdiffstats
path: root/adapters/mso-openstack-adapters/src/test
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2019-04-15 15:01:27 +0000
committerGerrit Code Review <gerrit@onap.org>2019-04-15 15:01:27 +0000
commit57d0aa50ca07497fee884fd6e505695e24f046ac (patch)
tree5c91076bd7247b35f86ff5bd69ce5e8b5eb08dd3 /adapters/mso-openstack-adapters/src/test
parent9c0663079469cb5a42c96ff990385c23be2f361e (diff)
parentf892e78757872bdb811e6b08fe2bfcba3ebb54fc (diff)
Merge "add junit coverage for HeatBridgeUtils"
Diffstat (limited to 'adapters/mso-openstack-adapters/src/test')
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/utils/HeatBridgeUtilsTest.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/utils/HeatBridgeUtilsTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/utils/HeatBridgeUtilsTest.java
new file mode 100644
index 0000000000..bbc99bd258
--- /dev/null
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/utils/HeatBridgeUtilsTest.java
@@ -0,0 +1,31 @@
+package org.onap.so.heatbridge.utils;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import java.util.Optional;
+import org.junit.Test;
+
+public class HeatBridgeUtilsTest {
+
+ @Test(expected = IllegalStateException.class)
+ public void matchServerName_canNotBeNull() {
+ HeatBridgeUtils.getMatchingPserverPifName(null);
+ }
+
+ @Test
+ public void matchServerName_isDedicated() {
+ Optional<String> serverName = HeatBridgeUtils.getMatchingPserverPifName("dedicated-testServer");
+ assertThat(serverName).isNotEmpty().hasValue("sriov-d-testServer");
+ }
+
+ @Test
+ public void matchServerName_isShared() {
+ Optional<String> serverName = HeatBridgeUtils.getMatchingPserverPifName("shared-testServer");
+ assertThat(serverName).isNotEmpty().hasValue("sriov-s-testServer");
+ }
+
+ @Test
+ public void matchServerName_unknown() {
+ Optional<String> serverName = HeatBridgeUtils.getMatchingPserverPifName("differentServerName");
+ assertThat(serverName).isEmpty();
+ }
+}