X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=holmes-actions%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fholmes%2Fcommon%2Futils%2FCommonUtilsTest.java;h=6e02055725b73db66366da4acb16999d9eaf5316;hb=64e336dadd4eb89dd0a8caf6bf62f0e86f4732a6;hp=15cc44d9b86f61c6d06093897fa51ce7f8f30605;hpb=c03d170278c22f9c7ba271f1783811f3b0f5bda8;p=holmes%2Fcommon.git diff --git a/holmes-actions/src/test/java/org/onap/holmes/common/utils/CommonUtilsTest.java b/holmes-actions/src/test/java/org/onap/holmes/common/utils/CommonUtilsTest.java index 15cc44d..6e02055 100644 --- a/holmes-actions/src/test/java/org/onap/holmes/common/utils/CommonUtilsTest.java +++ b/holmes-actions/src/test/java/org/onap/holmes/common/utils/CommonUtilsTest.java @@ -22,73 +22,73 @@ import static org.junit.Assert.assertThat; public class CommonUtilsTest { @Test - public void isHttpsEnabled_normal_true() throws Exception { + public void isHttpsEnabled_normal_true() { System.setProperty("ENABLE_ENCRYPT", "true"); assertThat(CommonUtils.isHttpsEnabled(), is(true)); } @Test - public void isHttpsEnabled_normal_false() throws Exception { + public void isHttpsEnabled_normal_false() { System.setProperty("ENABLE_ENCRYPT", "false"); assertThat(CommonUtils.isHttpsEnabled(), is(false)); } @Test - public void isHttpsEnabled_invalid_input() throws Exception { + public void isHttpsEnabled_invalid_input() { System.setProperty("ENABLE_ENCRYPT", "whatever"); assertThat(CommonUtils.isHttpsEnabled(), is(false)); } @Test - public void getEnv() throws Exception { + public void getEnv() { System.setProperty("TEST", "COMMON_UTILS"); assertThat(CommonUtils.getEnv("TEST"), equalTo("COMMON_UTILS")); } @Test - public void isValidIpAddress_with_port() throws Exception { + public void isValidIpAddress_with_port() { boolean res = CommonUtils.isIpAddress("10.75.13.21:90"); assertThat(res, is(true)); } @Test - public void isValidIpAddress_without_port() throws Exception { + public void isValidIpAddress_without_port() { boolean res = CommonUtils.isIpAddress("10.75.13.21"); assertThat(res, is(true)); } @Test - public void isValidIpAddress_with_port_with_http_prefix() throws Exception { + public void isValidIpAddress_with_port_with_http_prefix() { boolean res = CommonUtils.isIpAddress("http://10.75.13.21:90"); assertThat(res, is(true)); } @Test - public void isValidIpAddress_without_port_with_https_prefix() throws Exception { + public void isValidIpAddress_without_port_with_https_prefix() { boolean res = CommonUtils.isIpAddress("https://10.75.13.21"); assertThat(res, is(true)); } @Test - public void isValidIpAddress_invalid_ip_without_port() throws Exception { + public void isValidIpAddress_invalid_ip_without_port() { boolean res = CommonUtils.isIpAddress("holmes-rule-mgmt"); assertThat(res, is(false)); } @Test - public void isValidIpAddress_invalid_ip_with_port() throws Exception { + public void isValidIpAddress_invalid_ip_with_port() { boolean res = CommonUtils.isIpAddress("holmes-rule-mgmt:443"); assertThat(res, is(false)); } @Test - public void isValidIpAddress_invalid_ip_without_port_with_http_prefix() throws Exception { + public void isValidIpAddress_invalid_ip_without_port_with_http_prefix() { boolean res = CommonUtils.isIpAddress("http://holmes-rule-mgmt"); assertThat(res, is(false)); } @Test - public void isValidIpAddress_invalid_ip_with_port_with_https_prefix() throws Exception { + public void isValidIpAddress_invalid_ip_with_port_with_https_prefix() { boolean res = CommonUtils.isIpAddress("https://holmes-rule-mgmt:443"); assertThat(res, is(false)); }