X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=holmes-actions%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fholmes%2Fcommon%2Faai%2FAaiQueryTest.java;h=b3f1eb6c45c9cbede96c262cdf96ce4aceccbe9e;hb=1be6bdd6b55219294a9ce6f708433fef3737cc13;hp=7872f2bd8fd4a301a94024dabeaa96f0400bbfe8;hpb=c8e4878d4f519e63a81bd30b30fcba0a0b398eb5;p=holmes%2Fcommon.git diff --git a/holmes-actions/src/test/java/org/onap/holmes/common/aai/AaiQueryTest.java b/holmes-actions/src/test/java/org/onap/holmes/common/aai/AaiQueryTest.java index 7872f2b..b3f1eb6 100644 --- a/holmes-actions/src/test/java/org/onap/holmes/common/aai/AaiQueryTest.java +++ b/holmes-actions/src/test/java/org/onap/holmes/common/aai/AaiQueryTest.java @@ -97,7 +97,7 @@ public class AaiQueryTest { when(HttpsUtils.get(url, headers)).thenReturn("{}"); PowerMockito.mockStatic(MicroServiceConfig.class); - when(MicroServiceConfig.getMsbServerAddr()).thenReturn("http://10.96.33.33:80"); + when(MicroServiceConfig.getMsbServerAddrWithHttpPrefix()).thenReturn("http://10.96.33.33:80"); PowerMock.expectPrivate(aaiQuery, "getVmResourceLinks", "test1", "test2") .andReturn("/aai/v11/cloud-infrastructure"); @@ -131,7 +131,7 @@ public class AaiQueryTest { when(HttpsUtils.get(url, headers)).thenReturn(""); PowerMockito.mockStatic(MicroServiceConfig.class); - when(MicroServiceConfig.getMsbServerAddr()).thenReturn("http://10.96.33.33:80"); + when(MicroServiceConfig.getMsbServerAddrWithHttpPrefix()).thenReturn("http://10.96.33.33:80"); PowerMock.expectPrivate(aaiQuery, "getVmResourceLinks", "test1", "test2") .andReturn("/aai/v11/cloud-infrastructure"); @@ -162,7 +162,7 @@ public class AaiQueryTest { when(HttpsUtils.get(url, headers)).thenThrow(new CorrelationException("")); PowerMockito.mockStatic(MicroServiceConfig.class); - when(MicroServiceConfig.getMsbServerAddr()).thenReturn("http://10.96.33.33:80"); + when(MicroServiceConfig.getMsbServerAddrWithHttpPrefix()).thenReturn("http://10.96.33.33:80"); PowerMock.expectPrivate(aaiQuery, "getVmResourceLinks", "test1", "test2") .andReturn("/aai/v11/cloud-infrastructure"); @@ -216,7 +216,7 @@ public class AaiQueryTest { Whitebox.setInternalState(aaiQuery, "aaiResponseUtil", aaiResponseUtil); PowerMockito.mockStatic(MicroServiceConfig.class); - when(MicroServiceConfig.getMsbServerAddr()).thenReturn("host_url"); + when(MicroServiceConfig.getMsbServerAddrWithHttpPrefix()).thenReturn("host_url"); PowerMock.expectPrivate(aaiQuery, "getResponse", anyObject(String.class)).andReturn("").anyTimes(); PowerMock.replayAll(); @@ -235,7 +235,7 @@ public class AaiQueryTest { Whitebox.setInternalState(aaiQuery, "aaiResponseUtil", aaiResponseUtil); PowerMockito.mockStatic(MicroServiceConfig.class); - when(MicroServiceConfig.getMsbServerAddr()).thenReturn("host_url"); + when(MicroServiceConfig.getMsbServerAddrWithHttpPrefix()).thenReturn("host_url"); PowerMock.expectPrivate(aaiQuery, "getResponse", anyObject(String.class)).andReturn("").anyTimes(); PowerMock.replayAll(); @@ -307,8 +307,8 @@ public class AaiQueryTest { aaiQuery = new AaiQuery(); PowerMockito.mockStatic(MicroServiceConfig.class); - when(MicroServiceConfig.getMsbServerAddr()).thenReturn("http://10.96.33.33:80"); - when(MicroServiceConfig.getServiceAddrInfoFromCBS("nihao")).thenReturn(""); + when(MicroServiceConfig.getMsbServerAddrWithHttpPrefix()).thenReturn("http://10.96.33.33:80"); + when(MicroServiceConfig.getServiceConfigInfoFromCBS("nihao")).thenReturn(""); PowerMock.replayAll(); String actual = Whitebox.invokeMethod(aaiQuery,"getBaseUrl", "/url"); @@ -322,8 +322,8 @@ public class AaiQueryTest { aaiQuery = new AaiQuery(); PowerMockito.mockStatic(MicroServiceConfig.class); - when(MicroServiceConfig.getMsbServerAddr()).thenThrow(new NullPointerException()); - when(MicroServiceConfig.getServiceAddrInfoFromCBS("aai_config")).thenReturn("aai"); + when(MicroServiceConfig.getMsbServerAddrWithHttpPrefix()).thenThrow(new NullPointerException()); + when(MicroServiceConfig.getServiceConfigInfoFromCBS("aai_config")).thenReturn("aai"); PowerMock.replayAll(); String actual = Whitebox.invokeMethod(aaiQuery,"getBaseUrl", "url"); @@ -338,8 +338,8 @@ public class AaiQueryTest { aaiQuery = new AaiQuery(); PowerMockito.mockStatic(MicroServiceConfig.class); - when(MicroServiceConfig.getMsbServerAddr()).thenThrow(new NullPointerException()); - when(MicroServiceConfig.getServiceAddrInfoFromCBS("aai_config")) + when(MicroServiceConfig.getMsbServerAddrWithHttpPrefix()).thenThrow(new NullPointerException()); + when(MicroServiceConfig.getServiceConfigInfoFromCBS("aai_config")) .thenThrow(new NullPointerException()); PowerMock.replayAll();