diff options
author | 2018-01-22 02:58:34 +0000 | |
---|---|---|
committer | 2018-01-22 03:01:20 +0000 | |
commit | 93934b27fdc08e18165766860949258ac3edb9a3 (patch) | |
tree | bf1de64ca50ad9606c049d684c9006c2d0c62d7c /esr-mgr | |
parent | ecebfc09567fcb2f1d8a5389a09b250624272741 (diff) |
Deal the sonar issue.
Change-Id: Ic02f862a4652e9daddb78b54b9373275145e252f
Issue-ID: AAI-638
Signed-off-by: Lizi <li.zi30@zte.com.cn>
Diffstat (limited to 'esr-mgr')
4 files changed, 51 insertions, 51 deletions
diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/ExternalSystemProxy.java b/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/ExternalSystemProxy.java index 8f7a1f4..69d4e47 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/ExternalSystemProxy.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/ExternalSystemProxy.java @@ -51,12 +51,12 @@ public class ExternalSystemProxy { public static String queryVnfmDetail(String vnfmId) throws ExtsysException { if (isTest) { - String esrVnfmDetailStr = "{\"vnfm-id\":\"123456\"," + "\"vim-id\":\"987654\"," - + "\"certificate-url\":\"http://11.22.33.44:5000/v3\"," + "\"esr-system-info-list\":{" - + "\"esr-system-info\":[{" + "\"esr-system-info-id\":\"qwerty\"," + "\"system-name\":\"ONAP VNFM\"," - + "\"type\":\"vnfm\"," + "\"vendor\":\"zte\"," + "\"version\":\"v1\"," - + "\"service-url\":\"http://10.11.22.33:8000\"," + "\"user-name\":\"onap\"," - + "\"password\":\"987654\"," + "\"system-type\":\"VNFM\"}]}}"; + String esrVnfmDetailStr = "{\"vnfm-id\":\"123456\",\"vim-id\":\"987654\"," + + "\"certificate-url\":\"http://ip:5000/v3\",\"esr-system-info-list\":{" + + "\"esr-system-info\":[{\"esr-system-info-id\":\"qwerty\",\"system-name\":\"ONAP VNFM\"," + + "\"type\":\"vnfm\",\"vendor\":\"zte\",\"version\":\"v1\"," + + "\"service-url\":\"http://ip:8000\",\"user-name\":\"onap\"," + + "\"password\":\"987654\",\"system-type\":\"VNFM\"}]}}"; return esrVnfmDetailStr; } try { @@ -68,8 +68,8 @@ public class ExternalSystemProxy { public static String queryVnfmList() throws ExtsysException { if (isTest) { - String vnfmListStr = "{\"esr-vnfm\": " + "[{\"vnfm-id\": \"123456\"," + "\"vim-id\": \"987654\"," - + "\"certificate-url\": \"http://11.22.33.44:5000/v3\"," + "\"resource-version\": \"1\"}]}"; + String vnfmListStr = "{\"esr-vnfm\": [{\"vnfm-id\": \"123456\",\"vim-id\": \"987654\"," + + "\"certificate-url\": \"http://ip:5000/v3\",\"resource-version\": \"1\"}]}"; return vnfmListStr; } try { @@ -106,11 +106,11 @@ public class ExternalSystemProxy { public static String queryThirdpartySdncDetail(String thirdpartySdncId) throws ExtsysException { if (isTest) { - String sdncDetail = "{\"thirdparty-sdnc-id\":\"123456\"," + "\"location\":\"edge\"," - + "\"product-name\":\"thirdparty SDNC\"," + "\"esr-system-info-list\":{" + "\"esr-system-info\":" - + "[{\"esr-system-info-id\":\"987654\"," + "\"system-name\":\"SDNC_TEST\"," + "\"type\":\"SDNC\"," - + "\"vendor\":\"zte\"," + "\"version\":\"v1\"," + "\"service-url\":\"http://127.0.0.1:8000\"," - + "\"user-name\":\"nancy\"," + "\"password\":\"123987\"," + "\"system-type\":\"thirdparty_SDNC\"," + String sdncDetail = "{\"thirdparty-sdnc-id\":\"123456\",\"location\":\"edge\"," + + "\"product-name\":\"thirdparty SDNC\",\"esr-system-info-list\":{\"esr-system-info\":" + + "[{\"esr-system-info-id\":\"987654\",\"system-name\":\"SDNC_TEST\",\"type\":\"SDNC\"," + + "\"vendor\":\"zte\",\"version\":\"v1\",\"service-url\":\"http://ip:8000\"," + + "\"user-name\":\"nancy\",\"password\":\"123987\",\"system-type\":\"thirdparty_SDNC\"," + "\"protocol\":\"protocol\"}]}}"; return sdncDetail; } @@ -125,8 +125,8 @@ public class ExternalSystemProxy { public static String querySdncList() throws ExtsysException { if (isTest) { String sdncList = - "{\"esr-thirdparty-sdnc\": " + "[{\"thirdparty-sdnc-id\": \"123456\"," + "\"location\": \"edge\"," - + "\"product-name\": \"thirdparty SDNC\"," + "\"resource-version\": \"1\"}]}"; + "{\"esr-thirdparty-sdnc\": [{\"thirdparty-sdnc-id\": \"123456\",\"location\": \"edge\"," + + "\"product-name\": \"thirdparty SDNC\",\"resource-version\": \"1\"}]}"; return sdncList; } try { @@ -162,18 +162,18 @@ public class ExternalSystemProxy { public static String queryEmsDetail(String emsId) throws ExtsysException { if (isTest) { - String emsDetailStr = "{\"ems-id\":\"123456\"," + "\"esr-system-info-list\":" + "{\"esr-system-info\":" - + "[{\"esr-system-info-id\":\"234567\"," + "\"system-name\":\"EMS_TEST\"," + "\"type\":\"sftp\"," - + "\"vendor\":\"ZTE\"," + "\"version\":\"V1\"," + "\"user-name\":\"nancy\"," + "\"password\":\"asdf\"," - + "\"system-type\":\"EMS_RESOUCE\"," + "\"ip-address\":\"127.0.0.1\"," + "\"port\":\"5000\"," - + "\"passive\":true," + "\"remote-path\":\"/home/per\"}," + "{\"esr-system-info-id\":\"345678\"," - + "\"system-name\":\"EMS_TEST\"," + "\"type\":\"sftp\"," + "\"vendor\":\"ZTE\"," + "\"version\":\"V1\"," - + "\"user-name\":\"nancy\"," + "\"password\":\"asdf\"," + "\"system-type\":\"EMS_PERFORMANCE\"," - + "\"ip-address\":\"127.0.0.1\"," + "\"port\":\"5000\"," + "\"passive\":true," - + "\"remote-path\":\"/home/per\"}," + "{\"esr-system-info-id\":\"456789\"," - + "\"system-name\":\"EMS_TEST\"," + "\"vendor\":\"ZTE\"," + "\"version\":\"V1\"," - + "\"user-name\":\"nancy\"," + "\"password\":\"987654\"," + "\"system-type\":\"EMS_ALARM\"," - + "\"ip-address\":\"127.0.0.1\"," + "\"port\":\"5000\"}]}}"; + String emsDetailStr = "{\"ems-id\":\"123456\",\"esr-system-info-list\":{\"esr-system-info\":" + + "[{\"esr-system-info-id\":\"234567\",\"system-name\":\"EMS_TEST\",\"type\":\"sftp\"," + + "\"vendor\":\"ZTE\",\"version\":\"V1\",\"user-name\":\"nancy\",\"password\":\"asdf\"," + + "\"system-type\":\"EMS_RESOUCE\",\"ip-address\":\"ip\",\"port\":\"5000\"," + + "\"passive\":true,\"remote-path\":\"/home/per\"},{\"esr-system-info-id\":\"345678\"," + + "\"system-name\":\"EMS_TEST\",\"type\":\"sftp\",\"vendor\":\"ZTE\",\"version\":\"V1\"," + + "\"user-name\":\"nancy\",\"password\":\"asdf\",\"system-type\":\"EMS_PERFORMANCE\"," + + "\"ip-address\":\"ip\",\"port\":\"5000\",\"passive\":true," + + "\"remote-path\":\"/home/per\"},{\"esr-system-info-id\":\"456789\"," + + "\"system-name\":\"EMS_TEST\",\"vendor\":\"ZTE\",\"version\":\"V1\"," + + "\"user-name\":\"nancy\",\"password\":\"987654\",\"system-type\":\"EMS_ALARM\"," + + "\"ip-address\":\"ip\",\"port\":\"5000\"}]}}"; return emsDetailStr; } try { diff --git a/esr-mgr/src/test/java/org/onap/aai/esr/wrapper/EmsManagerWrapperTest.java b/esr-mgr/src/test/java/org/onap/aai/esr/wrapper/EmsManagerWrapperTest.java index affd66f..bf35019 100644 --- a/esr-mgr/src/test/java/org/onap/aai/esr/wrapper/EmsManagerWrapperTest.java +++ b/esr-mgr/src/test/java/org/onap/aai/esr/wrapper/EmsManagerWrapperTest.java @@ -59,19 +59,19 @@ public class EmsManagerWrapperTest { AlarmAddr alarmAddr = new AlarmAddr(); FtpAddr resourceAddr = new FtpAddr(); FtpAddr performanceAddr = new FtpAddr(); - alarmAddr.setIp("127.0.0.1"); + alarmAddr.setIp("ip"); alarmAddr.setPassword("987654"); alarmAddr.setPort("5000"); alarmAddr.setUser("nancy"); resourceAddr.setFtptype("sftp"); - resourceAddr.setIp("127.0.0.1"); + resourceAddr.setIp("ip"); resourceAddr.setPassive(true); resourceAddr.setPassword("asdf"); resourceAddr.setPort("5000"); resourceAddr.setRemotepath("/home/per"); resourceAddr.setUser("nancy"); performanceAddr.setFtptype("sftp"); - performanceAddr.setIp("127.0.0.1"); + performanceAddr.setIp("ip"); performanceAddr.setPassive(true); performanceAddr.setPassword("asdf"); performanceAddr.setPort("5000"); @@ -96,19 +96,19 @@ public class EmsManagerWrapperTest { AlarmAddr alarmAddr = new AlarmAddr(); FtpAddr resourceAddr = new FtpAddr(); FtpAddr performanceAddr = new FtpAddr(); - alarmAddr.setIp("127.0.0.1"); + alarmAddr.setIp("ip"); alarmAddr.setPassword("987654"); alarmAddr.setPort("5000"); alarmAddr.setUser("nancy"); resourceAddr.setFtptype("sftp"); - resourceAddr.setIp("127.0.0.1"); + resourceAddr.setIp("ip"); resourceAddr.setPassive(true); resourceAddr.setPassword("asdf"); resourceAddr.setPort("5000"); resourceAddr.setRemotepath("/home/per"); resourceAddr.setUser("nancy"); performanceAddr.setFtptype("sftp"); - performanceAddr.setIp("127.0.0.1"); + performanceAddr.setIp("ip"); performanceAddr.setPassive(true); performanceAddr.setPassword("asdf"); performanceAddr.setPort("5000"); @@ -136,19 +136,19 @@ public class EmsManagerWrapperTest { AlarmAddr alarmAddr = new AlarmAddr(); FtpAddr resourceAddr = new FtpAddr(); FtpAddr performanceAddr = new FtpAddr(); - alarmAddr.setIp("127.0.0.1"); + alarmAddr.setIp("ip"); alarmAddr.setPassword("987654"); alarmAddr.setPort("5000"); alarmAddr.setUser("nancy"); resourceAddr.setFtptype("sftp"); - resourceAddr.setIp("127.0.0.1"); + resourceAddr.setIp("ip"); resourceAddr.setPassive(true); resourceAddr.setPassword("asdf"); resourceAddr.setPort("5000"); resourceAddr.setRemotepath("/home/per"); resourceAddr.setUser("nancy"); performanceAddr.setFtptype("sftp"); - performanceAddr.setIp("127.0.0.1"); + performanceAddr.setIp("ip"); performanceAddr.setPassive(true); performanceAddr.setPassword("asdf"); performanceAddr.setPort("5000"); @@ -175,19 +175,19 @@ public class EmsManagerWrapperTest { AlarmAddr alarmAddr = new AlarmAddr(); FtpAddr resourceAddr = new FtpAddr(); FtpAddr performanceAddr = new FtpAddr(); - alarmAddr.setIp("127.0.0.1"); + alarmAddr.setIp("ip"); alarmAddr.setPassword("987654"); alarmAddr.setPort("5000"); alarmAddr.setUser("nancy"); resourceAddr.setFtptype("sftp"); - resourceAddr.setIp("127.0.0.1"); + resourceAddr.setIp("ip"); resourceAddr.setPassive(true); resourceAddr.setPassword("asdf"); resourceAddr.setPort("5000"); resourceAddr.setRemotepath("/home/per"); resourceAddr.setUser("nancy"); performanceAddr.setFtptype("sftp"); - performanceAddr.setIp("127.0.0.1"); + performanceAddr.setIp("ip"); performanceAddr.setPassive(true); performanceAddr.setPassword("asdf"); performanceAddr.setPort("5000"); diff --git a/esr-mgr/src/test/java/org/onap/aai/esr/wrapper/ThirdpartySdncWrapperTest.java b/esr-mgr/src/test/java/org/onap/aai/esr/wrapper/ThirdpartySdncWrapperTest.java index 0ece8a0..c236f30 100644 --- a/esr-mgr/src/test/java/org/onap/aai/esr/wrapper/ThirdpartySdncWrapperTest.java +++ b/esr-mgr/src/test/java/org/onap/aai/esr/wrapper/ThirdpartySdncWrapperTest.java @@ -61,7 +61,7 @@ public class ThirdpartySdncWrapperTest { sdncRegisterInfo.setProtocol("protocol"); sdncRegisterInfo.setThirdpartySdncId("123456"); sdncRegisterInfo.setType("SDNC"); - sdncRegisterInfo.setUrl("http://127.0.0.1:8000"); + sdncRegisterInfo.setUrl("http://ip:8000"); sdncRegisterInfo.setUserName("nancy"); sdncRegisterInfo.setVendor("zte"); sdncRegisterInfo.setVersion("v1"); @@ -90,7 +90,7 @@ public class ThirdpartySdncWrapperTest { sdncRegisterInfo.setProtocol("protocol"); sdncRegisterInfo.setThirdpartySdncId("123456"); sdncRegisterInfo.setType("SDNC"); - sdncRegisterInfo.setUrl("http://127.0.0.1:8000"); + sdncRegisterInfo.setUrl("http://ip:8000"); sdncRegisterInfo.setUserName("nancy"); sdncRegisterInfo.setVendor("zte"); sdncRegisterInfo.setVersion("v1"); @@ -113,7 +113,7 @@ public class ThirdpartySdncWrapperTest { sdncRegisterInfo.setProtocol("protocol"); sdncRegisterInfo.setThirdpartySdncId("123456"); sdncRegisterInfo.setType("SDNC"); - sdncRegisterInfo.setUrl("http://127.0.0.1:8000"); + sdncRegisterInfo.setUrl("http://ip:8000"); sdncRegisterInfo.setUserName("nancy"); sdncRegisterInfo.setVendor("zte"); sdncRegisterInfo.setVersion("v1"); @@ -135,7 +135,7 @@ public class ThirdpartySdncWrapperTest { sdncRegisterInfo.setProtocol("protocol"); sdncRegisterInfo.setThirdpartySdncId("123456"); sdncRegisterInfo.setType("SDNC"); - sdncRegisterInfo.setUrl("http://127.0.0.1:8000"); + sdncRegisterInfo.setUrl("http://ip:8000"); sdncRegisterInfo.setUserName("nancy"); sdncRegisterInfo.setVendor("zte"); sdncRegisterInfo.setVersion("v1"); diff --git a/esr-mgr/src/test/java/org/onap/aai/esr/wrapper/VnfmManagerWrapperTest.java b/esr-mgr/src/test/java/org/onap/aai/esr/wrapper/VnfmManagerWrapperTest.java index 1e2abed..5f31241 100644 --- a/esr-mgr/src/test/java/org/onap/aai/esr/wrapper/VnfmManagerWrapperTest.java +++ b/esr-mgr/src/test/java/org/onap/aai/esr/wrapper/VnfmManagerWrapperTest.java @@ -58,11 +58,11 @@ public class VnfmManagerWrapperTest { vnfmRegisterInfo.setVersion("v1"); vnfmRegisterInfo.setVendor("zte"); vnfmRegisterInfo.setUserName("onap"); - vnfmRegisterInfo.setUrl("http://10.11.22.33:8000"); + vnfmRegisterInfo.setUrl("http://ip:8000"); vnfmRegisterInfo.setType("vnfm"); vnfmRegisterInfo.setPassword("987654"); vnfmRegisterInfo.setName("ONAP VNFM"); - vnfmRegisterInfo.setCertificateUrl("http://11.22.33.44:5000/v3"); + vnfmRegisterInfo.setCertificateUrl("http://ip:5000/v3"); Response response = vnfmManagerWrapper.registerVnfm(vnfmRegisterInfo); if (response != null) { Assert.assertTrue(response.getStatus() == 200); @@ -77,11 +77,11 @@ public class VnfmManagerWrapperTest { vnfmRegisterInfo.setVersion("v1"); vnfmRegisterInfo.setVendor("zte"); vnfmRegisterInfo.setUserName("onap"); - vnfmRegisterInfo.setUrl("http://10.11.22.33:8000"); + vnfmRegisterInfo.setUrl("http://ip:8000"); vnfmRegisterInfo.setType("vnfm"); vnfmRegisterInfo.setPassword("987654"); vnfmRegisterInfo.setName("ONAP VNFM"); - vnfmRegisterInfo.setCertificateUrl("http://11.22.33.44:5000/v3"); + vnfmRegisterInfo.setCertificateUrl("http://ip:5000/v3"); vnfmRegisterInfo.setVnfmId("123456"); Response response = vnfmManagerWrapper.queryVnfmById("123456"); if (response != null) { @@ -99,11 +99,11 @@ public class VnfmManagerWrapperTest { vnfmRegisterInfo.setVersion("v1"); vnfmRegisterInfo.setVendor("zte"); vnfmRegisterInfo.setUserName("onap"); - vnfmRegisterInfo.setUrl("http://10.11.22.33:8000"); + vnfmRegisterInfo.setUrl("http://ip:8000"); vnfmRegisterInfo.setType("vnfm"); vnfmRegisterInfo.setPassword("987654"); vnfmRegisterInfo.setName("ONAP VNFM"); - vnfmRegisterInfo.setCertificateUrl("http://11.22.33.44:5000/v3"); + vnfmRegisterInfo.setCertificateUrl("http://ip:5000/v3"); vnfmRegisterInfo.setVnfmId("123456"); vnfmList.add(vnfmRegisterInfo); Response response = vnfmManagerWrapper.queryVnfmList(); @@ -128,11 +128,11 @@ public class VnfmManagerWrapperTest { vnfmRegisterInfo.setVersion("v1"); vnfmRegisterInfo.setVendor("zte"); vnfmRegisterInfo.setUserName("onap"); - vnfmRegisterInfo.setUrl("http://10.11.22.33:8000"); + vnfmRegisterInfo.setUrl("http://ip:8000"); vnfmRegisterInfo.setType("vnfm"); vnfmRegisterInfo.setPassword("987654"); vnfmRegisterInfo.setName("ONAP VNFM"); - vnfmRegisterInfo.setCertificateUrl("http://11.22.33.44:5000/v3"); + vnfmRegisterInfo.setCertificateUrl("http://ip:5000/v3"); vnfmRegisterInfo.setVnfmId("123456"); Response response = vnfmManagerWrapper.updateVnfm(vnfmRegisterInfo, "123456"); if (response != null) { |