Remove Class: HttpsUtils & MicroserviceBusRest
[holmes/common.git] / holmes-actions / src / test / java / org / onap / holmes / common / config / MicroServiceConfigTest.java
index fbc22e5..1fdc335 100644 (file)
@@ -40,7 +40,6 @@ public class MicroServiceConfigTest {
 \r
     private static String ACTUAL_HOSTNAME = System.getenv(HOSTNAME);\r
 \r
-\r
     @Test\r
     public void getMsbServerAddrTest() {\r
         System.setProperty(MSB_IAG_SERVICE_HOST, "test");\r
@@ -119,7 +118,26 @@ public class MicroServiceConfigTest {
     }\r
 \r
     @Test\r
-    public void getConfigBindingServiceAddrInfoTest_consul_exists_propertie_not_exist() throws Exception {\r
+    public void getConfigBindingServiceAddrInfoTest_consul_return_empty_array() throws Exception {\r
+        System.setProperty(CONFIG_BINDING_SERVICE, "config_binding_service");\r
+        PowerMock.mockStaticPartial(MicroServiceConfig.class, "execQuery", String.class);\r
+        PowerMock.expectPrivate(MicroServiceConfig.class, "execQuery", EasyMock.anyObject())\r
+                .andReturn("[]");\r
+        System.setProperty(CONSUL_HOST, "127.0.0.1");\r
+\r
+        PowerMock.replayAll();\r
+\r
+        assertThat(getServiceAddrInfoFromDcaeConsulByHostName(System.getProperty(CONFIG_BINDING_SERVICE)),\r
+                is(nullValue()));\r
+\r
+        PowerMock.verifyAll();\r
+\r
+        System.clearProperty(CONSUL_HOST);\r
+        System.clearProperty(CONFIG_BINDING_SERVICE);\r
+    }\r
+\r
+    @Test\r
+    public void getConfigBindingServiceAddrInfoTest_consul_exists_property_not_exist() throws Exception {\r
         System.setProperty(CONFIG_BINDING_SERVICE, "config_binding_service");\r
         PowerMock.mockStaticPartial(MicroServiceConfig.class, "execQuery", String.class);\r
         PowerMock.expectPrivate(MicroServiceConfig.class, "execQuery", EasyMock.anyObject())\r
@@ -317,52 +335,4 @@ public class MicroServiceConfigTest {
 \r
         System.clearProperty(HOSTNAME);\r
     }\r
-\r
-    @Test\r
-    public void isValidIpAddress_with_port() throws Exception {\r
-        boolean res = WhiteboxImpl.invokeMethod(MicroServiceConfig.class, "isIpAddress", "10.75.13.21:90");\r
-        assertThat(res, is(true));\r
-    }\r
-\r
-    @Test\r
-    public void isValidIpAddress_without_port() throws Exception {\r
-        boolean res = WhiteboxImpl.invokeMethod(MicroServiceConfig.class, "isIpAddress", "10.75.13.21");\r
-        assertThat(res, is(true));\r
-    }\r
-\r
-    @Test\r
-    public void isValidIpAddress_with_port_with_http_prefix() throws Exception {\r
-        boolean res = WhiteboxImpl.invokeMethod(MicroServiceConfig.class, "isIpAddress", "http://10.75.13.21:90");\r
-        assertThat(res, is(true));\r
-    }\r
-\r
-    @Test\r
-    public void isValidIpAddress_without_port_with_https_prefix() throws Exception {\r
-        boolean res = WhiteboxImpl.invokeMethod(MicroServiceConfig.class, "isIpAddress", "https://10.75.13.21");\r
-        assertThat(res, is(true));\r
-    }\r
-\r
-    @Test\r
-    public void isValidIpAddress_invalid_ip_without_port() throws Exception {\r
-        boolean res = WhiteboxImpl.invokeMethod(MicroServiceConfig.class, "isIpAddress", "holmes-rule-mgmt");\r
-        assertThat(res, is(false));\r
-    }\r
-\r
-    @Test\r
-    public void isValidIpAddress_invalid_ip_with_port() throws Exception {\r
-        boolean res = WhiteboxImpl.invokeMethod(MicroServiceConfig.class, "isIpAddress", "holmes-rule-mgmt:443");\r
-        assertThat(res, is(false));\r
-    }\r
-\r
-    @Test\r
-    public void isValidIpAddress_invalid_ip_without_port_with_http_prefix() throws Exception {\r
-        boolean res = WhiteboxImpl.invokeMethod(MicroServiceConfig.class, "isIpAddress", "http://holmes-rule-mgmt");\r
-        assertThat(res, is(false));\r
-    }\r
-\r
-    @Test\r
-    public void isValidIpAddress_invalid_ip_with_port_with_https_prefix() throws Exception {\r
-        boolean res = WhiteboxImpl.invokeMethod(MicroServiceConfig.class, "isIpAddress", "https://holmes-rule-mgmt:443");\r
-        assertThat(res, is(false));\r
-    }\r
 }
\ No newline at end of file