1 package org.onap.so.heatbridge.utils;
3 import static org.assertj.core.api.Assertions.assertThat;
4 import java.util.Optional;
7 public class HeatBridgeUtilsTest {
9 @Test(expected = IllegalStateException.class)
10 public void matchServerName_canNotBeNull() {
11 HeatBridgeUtils.getMatchingPserverPifName(null);
15 public void matchServerName_isDedicated() {
16 Optional<String> serverName = HeatBridgeUtils.getMatchingPserverPifName("dedicated-testServer");
17 assertThat(serverName).isNotEmpty().hasValue("sriov-d-testServer");
21 public void matchServerName_isShared() {
22 Optional<String> serverName = HeatBridgeUtils.getMatchingPserverPifName("shared-testServer");
23 assertThat(serverName).isNotEmpty().hasValue("sriov-s-testServer");
27 public void matchServerName_unknown() {
28 Optional<String> serverName = HeatBridgeUtils.getMatchingPserverPifName("differentServerName");
29 assertThat(serverName).isEmpty();