blob: bbc99bd258eb0ecec14d7129d3d2c72d887728da (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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();
}
}
|