diff options
author | 2017-09-02 13:36:19 +0800 | |
---|---|---|
committer | 2017-09-02 13:36:19 +0800 | |
commit | 892ee11e90a7ad564a8dae5d744287db3bf3ba04 (patch) | |
tree | 27c7e6061b8c34d223755a86248bd4dd56a4ecb4 /holmes-actions/src/test/java | |
parent | 23d05bd2fc5e6b97ed54e50a0bafb0e9dc4ab406 (diff) |
Introduce MSB Java SDK
Add the registration logic using MSB Java SDK
Add corresponding unit test codes
Add dependencies into pom.xml
Change-Id: I4c003c3585702d4956855f62c7ce341bc66b07f4
Issue-ID: HOLMES-48
Signed-off-by: Guangrong Fu <fu.guangrong@zte.com.cn>
Diffstat (limited to 'holmes-actions/src/test/java')
-rw-r--r-- | holmes-actions/src/test/java/org/onap/holmes/common/config/MicroServiceConfigTest.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/holmes-actions/src/test/java/org/onap/holmes/common/config/MicroServiceConfigTest.java b/holmes-actions/src/test/java/org/onap/holmes/common/config/MicroServiceConfigTest.java index 33431ff..b29e490 100644 --- a/holmes-actions/src/test/java/org/onap/holmes/common/config/MicroServiceConfigTest.java +++ b/holmes-actions/src/test/java/org/onap/holmes/common/config/MicroServiceConfigTest.java @@ -18,6 +18,7 @@ package org.onap.holmes.common.config; import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
import org.junit.Test;
@@ -31,6 +32,32 @@ public class MicroServiceConfigTest { }
@Test
+ public void getMsbServerIpTest() {
+ System.setProperty("MSB_ADDR", "10.54.23.79");
+ assertThat("10.54.23.79", equalTo(MicroServiceConfig.getMsbServerIp()));
+ System.clearProperty("MSB_ADDR");
+ }
+
+ @Test
+ public void getMsbPortTest() {
+ System.setProperty("MSB_PORT", "110");
+ assertTrue(110 == MicroServiceConfig.getMsbServerPort());
+ System.clearProperty("MSB_PORT");
+ }
+
+ @Test
+ public void getMsbPortTestNonnumeric() {
+ System.setProperty("MSB_PORT", "test");
+ assertTrue(80 == MicroServiceConfig.getMsbServerPort());
+ System.clearProperty("MSB_PORT");
+ }
+
+ @Test
+ public void getMsbPortTestNullValue() {
+ assertTrue(80 == MicroServiceConfig.getMsbServerPort());
+ }
+
+ @Test
public void getServiceIpTest() {
System.setProperty("SERVICE_IP", "test");
assertThat("test", equalTo(MicroServiceConfig.getServiceIp()));
|