From: Lizi Date: Wed, 10 Jan 2018 10:43:29 +0000 (+0000) Subject: Fix the nonstandard coding. X-Git-Tag: v1.1.0~54 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=aai%2Fesr-server.git;a=commitdiff_plain;h=769718b3e8b4e659299602701b575cf1b4b182c5 Fix the nonstandard coding. Fix the ArrayList usage, Remove the redundancy newly object. Change-Id: I0311297d4e1387f89196eab978ed58a86f54cddb Issue-ID: AAI-500 Signed-off-by: Lizi --- diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/ExtsysApp.java b/esr-mgr/src/main/java/org/onap/aai/esr/ExtsysApp.java index 2e1ae6f..e1db108 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/ExtsysApp.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/ExtsysApp.java @@ -20,7 +20,7 @@ import org.onap.aai.esr.common.MsbConfig; import org.onap.aai.esr.externalservice.msb.MsbHelper; import org.onap.aai.esr.resource.EmsManager; import org.onap.aai.esr.resource.ServiceTest; -import org.onap.aai.esr.resource.ThirdpatySdncManager; +import org.onap.aai.esr.resource.ThirdpartySdncManager; import org.onap.aai.esr.resource.VimManager; import org.onap.aai.esr.resource.VnfmManager; import org.onap.msb.sdk.httpclient.msb.MSBServiceClient; @@ -50,7 +50,7 @@ public class ExtsysApp extends Application { MsbConfig.setMsbDiscoveryIp(configuration.getMsbDiscoveryIp()); MsbConfig.setMsbDiscoveryPort(configuration.getMsbDiscoveryPort()); environment.jersey().register(new EmsManager()); - environment.jersey().register(new ThirdpatySdncManager()); + environment.jersey().register(new ThirdpartySdncManager()); environment.jersey().register(new VimManager()); environment.jersey().register(new VnfmManager()); environment.jersey().register(new ServiceTest()); diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/CloudRegionList.java b/esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/CloudRegionList.java index aef7bca..c6815d2 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/CloudRegionList.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/CloudRegionList.java @@ -16,7 +16,7 @@ package org.onap.aai.esr.entity.aai; import java.io.Serializable; -import java.util.ArrayList; +import java.util.List; import com.google.gson.annotations.SerializedName; @@ -25,13 +25,13 @@ public class CloudRegionList implements Serializable { public static final long serialVersionUID = 1L; @SerializedName("cloud-region") - private ArrayList cloudRegion; + private List cloudRegion; - public ArrayList getCloudRegion() { + public List getCloudRegion() { return cloudRegion; } - public void setCloudRegion(ArrayList cloudRegion) { + public void setCloudRegion(List cloudRegion) { this.cloudRegion = cloudRegion; } } diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/EsrEmsList.java b/esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/EsrEmsList.java index e14da46..8d4dc69 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/EsrEmsList.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/EsrEmsList.java @@ -16,7 +16,7 @@ package org.onap.aai.esr.entity.aai; import java.io.Serializable; -import java.util.ArrayList; +import java.util.List; import com.google.gson.annotations.SerializedName; @@ -25,13 +25,13 @@ public class EsrEmsList implements Serializable { public static final long serialVersionUID = 1L; @SerializedName("esr-ems") - private ArrayList esrEms; + private List esrEms; - public ArrayList getEsrEms() { + public List getEsrEms() { return esrEms; } - public void setEsrEms(ArrayList esrEms) { + public void setEsrEms(List esrEms) { this.esrEms = esrEms; } } diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/EsrSystemInfoList.java b/esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/EsrSystemInfoList.java index 9306b98..dd06c53 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/EsrSystemInfoList.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/EsrSystemInfoList.java @@ -16,7 +16,7 @@ package org.onap.aai.esr.entity.aai; import java.io.Serializable; -import java.util.ArrayList; +import java.util.List; import com.google.gson.annotations.SerializedName; @@ -25,13 +25,13 @@ public class EsrSystemInfoList implements Serializable { public static final long serialVersionUID = 1L; @SerializedName("esr-system-info") - private ArrayList esrSystemInfo; + private List esrSystemInfo; - public ArrayList getEsrSystemInfo() { + public List getEsrSystemInfo() { return esrSystemInfo; } - public void setEsrSystemInfo(ArrayList esrSystemInfo) { + public void setEsrSystemInfo(List esrSystemInfo) { this.esrSystemInfo = esrSystemInfo; } } diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/EsrThirdpartySdncList.java b/esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/EsrThirdpartySdncList.java index 8340e31..0d4d100 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/EsrThirdpartySdncList.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/EsrThirdpartySdncList.java @@ -16,7 +16,7 @@ package org.onap.aai.esr.entity.aai; import java.io.Serializable; -import java.util.ArrayList; +import java.util.List; import com.google.gson.annotations.SerializedName; @@ -25,13 +25,13 @@ public class EsrThirdpartySdncList implements Serializable { public static final long serialVersionUID = 1L; @SerializedName("esr-thirdparty-sdnc") - private ArrayList esrThirdpartySdnc; + private List esrThirdpartySdnc; - public ArrayList getEsrThirdpartySdnc() { + public List getEsrThirdpartySdnc() { return esrThirdpartySdnc; } - public void setEsrThirdpartySdnc(ArrayList esrThirdpartySdnc) { + public void setEsrThirdpartySdnc(List esrThirdpartySdnc) { this.esrThirdpartySdnc = esrThirdpartySdnc; } } diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/EsrVnfmList.java b/esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/EsrVnfmList.java index 0193147..eec0a07 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/EsrVnfmList.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/EsrVnfmList.java @@ -16,7 +16,7 @@ package org.onap.aai.esr.entity.aai; import java.io.Serializable; -import java.util.ArrayList; +import java.util.List; import com.google.gson.annotations.SerializedName; @@ -25,13 +25,13 @@ public class EsrVnfmList implements Serializable { public static final long serialVersionUID = 1L; @SerializedName("esr-vnfm") - private ArrayList esrVnfm; + private List esrVnfm; - public ArrayList getEsrVnfm() { + public List getEsrVnfm() { return esrVnfm; } - public void setEsrVnfm(ArrayList esrVnfm) { + public void setEsrVnfm(List esrVnfm) { this.esrVnfm = esrVnfm; } diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/entity/rest/VimRegisterInfo.java b/esr-mgr/src/main/java/org/onap/aai/esr/entity/rest/VimRegisterInfo.java index f6b928c..1441f79 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/entity/rest/VimRegisterInfo.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/entity/rest/VimRegisterInfo.java @@ -16,6 +16,7 @@ package org.onap.aai.esr.entity.rest; import java.util.ArrayList; +import java.util.List; public class VimRegisterInfo { @@ -37,7 +38,7 @@ public class VimRegisterInfo { private String status; - private ArrayList vimAuthInfos; + private List vimAuthInfos; public String getCloudOwner() { return cloudOwner; @@ -103,11 +104,11 @@ public class VimRegisterInfo { this.cloudExtraInfo = cloudExtraInfo; } - public ArrayList getVimAuthInfos() { + public List getVimAuthInfos() { return vimAuthInfos; } - public void setVimAuthInfos(ArrayList vimAuthInfos) { + public void setVimAuthInfos(List vimAuthInfos) { this.vimAuthInfos = vimAuthInfos; } 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 6c34265..e6addce 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 @@ -106,18 +106,38 @@ public class ExternalSystemProxy { } public static void registerSdnc(String thirdpartySdncId, EsrThirdpartySdncDetail esrSdncDetail) throws ExtsysException { - ClientConfig config = new ClientConfig(new ThirdpartySdncRegisterProvider()); - IExternalSystem registerSdncServiceproxy = ConsumerFactory - .createConsumer(MsbConfig.getExternalSystemAddr(), config, IExternalSystem.class); - try { - registerSdncServiceproxy.registerThirdpartySdnc(transactionId, fromAppId, authorization, thirdpartySdncId, - esrSdncDetail); - } catch (Exception e) { - throw new ExtsysException("PUT thirdparty SDNC to A&AI failed.", e); + if(!isTest) { + ClientConfig config = new ClientConfig(new ThirdpartySdncRegisterProvider()); + IExternalSystem registerSdncServiceproxy = ConsumerFactory + .createConsumer(MsbConfig.getExternalSystemAddr(), config, IExternalSystem.class); + try { + registerSdncServiceproxy.registerThirdpartySdnc(transactionId, fromAppId, authorization, thirdpartySdncId, + esrSdncDetail); + } catch (Exception e) { + throw new ExtsysException("PUT thirdparty SDNC to A&AI failed.", e); + } } } 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\"," + + "\"protocol\":\"protocol\"}]}}"; + return sdncDetail; + } try { return externalSystemproxy.queryThirdpartySdncDetail(transactionId, fromAppId, authorization, thirdpartySdncId); } catch (Exception e) { @@ -126,6 +146,14 @@ 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\"}]}"; + return sdncList; + } try { return externalSystemproxy.queryThirdpartySdncList(transactionId, fromAppId, authorization); } catch (Exception e) { @@ -134,10 +162,12 @@ public class ExternalSystemProxy { } public static void deleteThirdpartySdnc(String sdncId, String resourceVersion) throws ExtsysException { - try { - externalSystemproxy.deleteThirdpartySdnc(transactionId, fromAppId, authorization, sdncId, resourceVersion); - } catch (Exception e) { - throw new ExtsysException("Delete thirdparty SDNC from A&AI failed.", e); + if(!isTest) { + try { + externalSystemproxy.deleteThirdpartySdnc(transactionId, fromAppId, authorization, sdncId, resourceVersion); + } catch (Exception e) { + throw new ExtsysException("Delete thirdparty SDNC from A&AI failed.", e); + } } } diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/resource/ThirdpatySdncManager.java b/esr-mgr/src/main/java/org/onap/aai/esr/resource/ThirdpartySdncManager.java similarity index 91% rename from esr-mgr/src/main/java/org/onap/aai/esr/resource/ThirdpatySdncManager.java rename to esr-mgr/src/main/java/org/onap/aai/esr/resource/ThirdpartySdncManager.java index 8660ade..93edffb 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/resource/ThirdpatySdncManager.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/resource/ThirdpartySdncManager.java @@ -26,7 +26,7 @@ import io.swagger.annotations.SwaggerDefinition; import org.eclipse.jetty.http.HttpStatus; import org.onap.aai.esr.entity.rest.ThirdpartySdncRegisterInfo; import org.onap.aai.esr.util.ExtsysUtil; -import org.onap.aai.esr.wrapper.ThirdpatySdncWrapper; +import org.onap.aai.esr.wrapper.ThirdpartySdncWrapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -44,9 +44,9 @@ import javax.ws.rs.core.Response; @SwaggerDefinition @Path("/sdncontrollers") @Api(tags = {"ThirdParty sdnc Management "}) -public class ThirdpatySdncManager { +public class ThirdpartySdncManager { - private static final Logger LOGGER = LoggerFactory.getLogger(ThirdpatySdncManager.class); + private static final Logger LOGGER = LoggerFactory.getLogger(ThirdpartySdncManager.class); private static ExtsysUtil extsysUtil = new ExtsysUtil(); /** @@ -65,7 +65,7 @@ public class ThirdpatySdncManager { @Timed public Response queryThirdpartySdncList() { LOGGER.info("start query all thirdParty sdnc!"); - return ThirdpatySdncWrapper.getInstance().queryThirdpartySdncList(); + return ThirdpartySdncWrapper.getInstance().queryThirdpartySdncList(); } /** @@ -85,7 +85,7 @@ public class ThirdpatySdncManager { @Timed public Response queryThirdpartySdncById(@ApiParam(value = "thirdparty sdnc id") @PathParam("thirdPartySdncId") String thirdPartySdncId) { LOGGER.info("start query thirdparty sdnc by id." + thirdPartySdncId); - return ThirdpatySdncWrapper.getInstance().queryThirdpartySdncById(thirdPartySdncId); + return ThirdpartySdncWrapper.getInstance().queryThirdpartySdncById(thirdPartySdncId); } /** @@ -104,7 +104,7 @@ public class ThirdpatySdncManager { @Timed public Response delThirdpartySdnc(@ApiParam(value = "thirdparty sdnc id") @PathParam("thirdPartySdncId") String thirdPartySdncId) { LOGGER.info("start delete thirdparty sdnc .id:" + thirdPartySdncId); - return ThirdpatySdncWrapper.getInstance().delThirdpartySdnc(thirdPartySdncId); + return ThirdpartySdncWrapper.getInstance().delThirdpartySdnc(thirdPartySdncId); } /** @@ -126,7 +126,7 @@ public class ThirdpatySdncManager { public Response updateThirdpartySdnc(@ApiParam(value = "thirdpartySdnc", required = true) ThirdpartySdncRegisterInfo thirdPartySdnc, @ApiParam(value = "sdnc id", required = true) @PathParam("thirdPartySdncId") String thirdPartySdncId) { LOGGER.info("start update sdnc .id:" + thirdPartySdncId + " info:" + extsysUtil.objectToString(thirdPartySdnc)); - return ThirdpatySdncWrapper.getInstance().updateThirdpartySdnc(thirdPartySdnc, thirdPartySdncId); + return ThirdpartySdncWrapper.getInstance().updateThirdpartySdnc(thirdPartySdnc, thirdPartySdncId); } /** @@ -146,6 +146,6 @@ public class ThirdpatySdncManager { @Timed public Response registerThirdpatySdnc(@ApiParam(value = "thirdPartySdnc", required = true) ThirdpartySdncRegisterInfo thirdPartySdnc) { LOGGER.info("start register sdnc" + " info:" + extsysUtil.objectToString(thirdPartySdnc)); - return ThirdpatySdncWrapper.getInstance().registerThirdpartySdnc(thirdPartySdnc); + return ThirdpartySdncWrapper.getInstance().registerThirdpartySdnc(thirdPartySdnc); } } diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/util/EmsManagerUtil.java b/esr-mgr/src/main/java/org/onap/aai/esr/util/EmsManagerUtil.java index 76f9681..404b118 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/util/EmsManagerUtil.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/util/EmsManagerUtil.java @@ -16,6 +16,7 @@ package org.onap.aai.esr.util; import java.util.ArrayList; +import java.util.List; import org.onap.aai.esr.common.SystemType; import org.onap.aai.esr.entity.aai.EsrSystemInfo; @@ -30,20 +31,16 @@ public class EmsManagerUtil { public EsrEmsDetail emsRegisterInfo2EsrEms(EmsRegisterInfo emsRegisterInfo) { EsrEmsDetail esrEms = new EsrEmsDetail(); esrEms.setEmsId(extsysUtil.generateId()); - ArrayList authInfos = new ArrayList(); - authInfos = getAuthInfosFromRegisterData(emsRegisterInfo); + List authInfos = getAuthInfosFromRegisterData(emsRegisterInfo); esrEms.setEsrSystemInfoList(extsysUtil.getEsrSystemInfoListFromAuthInfoList(authInfos)); return esrEms; } - private ArrayList getAuthInfosFromRegisterData(EmsRegisterInfo emsRegisterInfo) { - ArrayList authInfos = new ArrayList(); - EsrSystemInfo resouceAuthInfo = new EsrSystemInfo(); - EsrSystemInfo performanceAuthInfo = new EsrSystemInfo(); - EsrSystemInfo alarmAuthInfo = new EsrSystemInfo(); - resouceAuthInfo = getAuthInfoFromFtpAddr(emsRegisterInfo, SystemType.EMS_RESOUCE.toString()); - performanceAuthInfo = getAuthInfoFromFtpAddr(emsRegisterInfo, SystemType.EMS_PERFORMANCE.toString()); - alarmAuthInfo = getAuthInfoFromAlarmAddr(emsRegisterInfo); + private List getAuthInfosFromRegisterData(EmsRegisterInfo emsRegisterInfo) { + List authInfos = new ArrayList<>(); + EsrSystemInfo resouceAuthInfo = getAuthInfoFromFtpAddr(emsRegisterInfo, SystemType.EMS_RESOUCE.toString()); + EsrSystemInfo performanceAuthInfo = getAuthInfoFromFtpAddr(emsRegisterInfo, SystemType.EMS_PERFORMANCE.toString()); + EsrSystemInfo alarmAuthInfo = getAuthInfoFromAlarmAddr(emsRegisterInfo); authInfos.add(resouceAuthInfo); authInfos.add(performanceAuthInfo); authInfos.add(alarmAuthInfo); @@ -75,8 +72,7 @@ public class EmsManagerUtil { private EsrSystemInfo getAuthInfoFromAlarmAddr(EmsRegisterInfo emsRegisterInfo) { EsrSystemInfo authInfo = new EsrSystemInfo(); - AlarmAddr alarmAddr = new AlarmAddr(); - alarmAddr = emsRegisterInfo.getAlarmAddr(); + AlarmAddr alarmAddr = emsRegisterInfo.getAlarmAddr(); authInfo.setEsrSystemInfoId(extsysUtil.generateId()); authInfo.setIpAddress(alarmAddr.getIp()); authInfo.setPort(alarmAddr.getPort()); @@ -91,9 +87,8 @@ public class EmsManagerUtil { public EmsRegisterInfo EsrEms2EmsRegisterInfo(EsrEmsDetail esrEms) { EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo(); - ArrayList esrSystemInfo = new ArrayList(); EsrSystemInfo authInfo = new EsrSystemInfo(); - esrSystemInfo = esrEms.getEsrSystemInfoList().getEsrSystemInfo(); + List esrSystemInfo = esrEms.getEsrSystemInfoList().getEsrSystemInfo(); emsRegisterInfo.setEmsId(esrEms.getEmsId()); for(int i=0; i esrSystemInfo = new ArrayList(); + List esrSystemInfo = new ArrayList<>(); esrSystemInfo.add(esrSystemInfoObj); esrSystemInfoList.setEsrSystemInfo(esrSystemInfo); return esrSystemInfoList; } - public EsrSystemInfoList getEsrSystemInfoListFromAuthInfoList(ArrayList esrSystemInfo) { + public EsrSystemInfoList getEsrSystemInfoListFromAuthInfoList(List esrSystemInfo) { EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList(); esrSystemInfoList.setEsrSystemInfo(esrSystemInfo);; return esrSystemInfoList; diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/util/ThirdpartySdncManagerUtil.java b/esr-mgr/src/main/java/org/onap/aai/esr/util/ThirdpartySdncManagerUtil.java index d0f61ca..2a01ddc 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/util/ThirdpartySdncManagerUtil.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/util/ThirdpartySdncManagerUtil.java @@ -16,6 +16,7 @@ package org.onap.aai.esr.util; import java.util.ArrayList; +import java.util.List; import org.onap.aai.esr.common.SystemType; import org.onap.aai.esr.entity.aai.EsrSystemInfo; @@ -38,7 +39,7 @@ public class ThirdpartySdncManagerUtil { private EsrSystemInfoList getEsrSystemInfoList(ThirdpartySdncRegisterInfo sdncRegisterInfo) { EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList(); - ArrayList esrSystemInfo = new ArrayList(); + List esrSystemInfo = new ArrayList<>(); EsrSystemInfo authInfo = new EsrSystemInfo(); authInfo.setEsrSystemInfoId(extsysUtil.generateId()); authInfo.setVersion(sdncRegisterInfo.getVersion()); diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/util/VimManagerUtil.java b/esr-mgr/src/main/java/org/onap/aai/esr/util/VimManagerUtil.java index 88cceea..0a69f40 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/util/VimManagerUtil.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/util/VimManagerUtil.java @@ -17,6 +17,7 @@ package org.onap.aai.esr.util; import java.util.ArrayList; +import java.util.List; import org.onap.aai.esr.common.SystemType; import org.onap.aai.esr.entity.aai.EsrSystemInfo; @@ -30,8 +31,6 @@ public class VimManagerUtil { public CloudRegionDetail vimRegisterInfo2CloudRegion(VimRegisterInfo vimRegisterInfo) { CloudRegionDetail cloudRegion = new CloudRegionDetail(); - EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList(); - EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo(); cloudRegion.setCloudOwner(vimRegisterInfo.getCloudOwner()); cloudRegion.setCloudRegionId(vimRegisterInfo.getCloudRegionId()); @@ -42,17 +41,16 @@ public class VimManagerUtil { cloudRegion.setOwnerDefinedType(vimRegisterInfo.getOwnerDefinedType()); cloudRegion.setCloudExtraInfo(vimRegisterInfo.getCloudExtraInfo()); - esrSystemInfoObj = vimAuthInfo2EsrSystemInfoObj(vimRegisterInfo.getVimAuthInfos()); + EsrSystemInfo esrSystemInfoObj = vimAuthInfo2EsrSystemInfoObj(vimRegisterInfo.getVimAuthInfos()); esrSystemInfoObj.setSystemStatus(vimRegisterInfo.getStatus()); - esrSystemInfoList = extsysUtil.getEsrSystemInfoListFromAuthInfo(esrSystemInfoObj); + EsrSystemInfoList esrSystemInfoList = extsysUtil.getEsrSystemInfoListFromAuthInfo(esrSystemInfoObj); cloudRegion.setEsrSystemInfoList(esrSystemInfoList); return cloudRegion; } - private EsrSystemInfo vimAuthInfo2EsrSystemInfoObj(ArrayList vimAuthInfos) { + private EsrSystemInfo vimAuthInfo2EsrSystemInfoObj(List vimAuthInfos) { EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo(); - VimAuthInfo vimAuthInfo = new VimAuthInfo(); - vimAuthInfo = vimAuthInfos.get(0); + VimAuthInfo vimAuthInfo = vimAuthInfos.get(0); esrSystemInfoObj.setCloudDomain(vimAuthInfo.getCloudDomain()); esrSystemInfoObj.setUserName(vimAuthInfo.getUserName()); esrSystemInfoObj.setPassword(vimAuthInfo.getPassword()); @@ -80,13 +78,12 @@ public class VimManagerUtil { public VimRegisterInfo cloudRegion2VimRegisterInfo(CloudRegionDetail cloudRegion) { VimRegisterInfo vimRegisterInfo = new VimRegisterInfo(); - VimAuthInfo vimAuthInfo = new VimAuthInfo(); - ArrayList vimAuthInfos = new ArrayList(); + List vimAuthInfos = new ArrayList<>(); if(cloudRegion.getEsrSystemInfoList()!=null){ - vimAuthInfo = authInfo2VimAuthInfo(cloudRegion.getEsrSystemInfoList().getEsrSystemInfo().get(0)); + VimAuthInfo vimAuthInfo = authInfo2VimAuthInfo(cloudRegion.getEsrSystemInfoList().getEsrSystemInfo().get(0)); + vimAuthInfos.add(vimAuthInfo); vimRegisterInfo.setStatus(cloudRegion.getEsrSystemInfoList().getEsrSystemInfo().get(0).getSystemStatus()); } - vimAuthInfos.add(vimAuthInfo); vimRegisterInfo.setVimAuthInfos(vimAuthInfos); vimRegisterInfo.setCloudExtraInfo(cloudRegion.getCloudExtraInfo()); vimRegisterInfo.setCloudOwner(cloudRegion.getCloudOwner()); diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/EmsManagerWrapper.java b/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/EmsManagerWrapper.java index e1ab970..8acc825 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/EmsManagerWrapper.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/EmsManagerWrapper.java @@ -16,6 +16,7 @@ package org.onap.aai.esr.wrapper; import java.util.ArrayList; +import java.util.List; import javax.ws.rs.core.Response; @@ -79,7 +80,7 @@ public class EmsManagerWrapper { } public Response queryEmsList() { - ArrayList emsList = new ArrayList(); + List emsList = new ArrayList<>(); EsrEmsList esrEms = new EsrEmsList(); try { String esrEmsStr = ExternalSystemProxy.queryEmsList(); @@ -132,8 +133,8 @@ public class EmsManagerWrapper { return emsRegisterInfo; } - private ArrayList getEmsDetailList(EsrEmsList esrEms) { - ArrayList emsInfoList = new ArrayList(); + private List getEmsDetailList(EsrEmsList esrEms) { + List emsInfoList = new ArrayList<>(); EmsRegisterInfo emsInfo = new EmsRegisterInfo(); for (int i = 0; i < esrEms.getEsrEms().size(); i++) { String emsId = esrEms.getEsrEms().get(i).getEmsId(); @@ -159,10 +160,10 @@ public class EmsManagerWrapper { private EsrEmsDetail getNewEsrEmsDetail(EmsRegisterInfo emsRegisterInfo, String emsId) { EsrEmsDetail esrEmsDetail = new EsrEmsDetail(); - ArrayList newEsrSysInfoList = new ArrayList(); + List newEsrSysInfoList = new ArrayList<>(); EsrSystemInfo newEsrSystemInfo = new EsrSystemInfo(); EsrEmsDetail oriEsrEmsDetail = new EsrEmsDetail(); - ArrayList oriEsrSysInfoList = new ArrayList(); + List oriEsrSysInfoList = new ArrayList<>(); EsrSystemInfo originalEsrSystemInfo = new EsrSystemInfo(); oriEsrEmsDetail = queryEsrEmsDetail(emsId); diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/ThirdpatySdncWrapper.java b/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/ThirdpartySdncWrapper.java similarity index 79% rename from esr-mgr/src/main/java/org/onap/aai/esr/wrapper/ThirdpatySdncWrapper.java rename to esr-mgr/src/main/java/org/onap/aai/esr/wrapper/ThirdpartySdncWrapper.java index fd7dc43..a36d0ba 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/ThirdpatySdncWrapper.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/ThirdpartySdncWrapper.java @@ -16,6 +16,7 @@ package org.onap.aai.esr.wrapper; import java.util.ArrayList; +import java.util.List; import javax.ws.rs.core.Response; @@ -33,27 +34,26 @@ import org.slf4j.LoggerFactory; import com.google.gson.Gson; -public class ThirdpatySdncWrapper { +public class ThirdpartySdncWrapper { - private static ThirdpatySdncWrapper thirdpatySdncWrapper; - private static final Logger LOG = LoggerFactory.getLogger(ThirdpatySdncWrapper.class); + private static ThirdpartySdncWrapper thirdpatySdncWrapper; + private static final Logger LOG = LoggerFactory.getLogger(ThirdpartySdncWrapper.class); private static ThirdpartySdncManagerUtil thirdpartySdncManagerUtil = new ThirdpartySdncManagerUtil(); /** * get ThirdpatySdncWrapper instance. * @return ThirdpatySdnc manager wrapper instance */ - public static ThirdpatySdncWrapper getInstance() { + public static ThirdpartySdncWrapper getInstance() { if (thirdpatySdncWrapper == null) { - thirdpatySdncWrapper = new ThirdpatySdncWrapper(); + thirdpatySdncWrapper = new ThirdpartySdncWrapper(); } return thirdpatySdncWrapper; } public Response registerThirdpartySdnc(ThirdpartySdncRegisterInfo thirdpartySdnc) { CommonRegisterResponse result = new CommonRegisterResponse(); - EsrThirdpartySdncDetail esrSdncDetail = new EsrThirdpartySdncDetail(); - esrSdncDetail = thirdpartySdncManagerUtil.sdncRegisterInfo2EsrSdnc(thirdpartySdnc); + EsrThirdpartySdncDetail esrSdncDetail = thirdpartySdncManagerUtil.sdncRegisterInfo2EsrSdnc(thirdpartySdnc); String sdncId = esrSdncDetail.getThirdpartySdncId(); try { ExternalSystemProxy.registerSdnc(sdncId, esrSdncDetail); @@ -68,15 +68,12 @@ public class ThirdpatySdncWrapper { public Response updateThirdpartySdnc(ThirdpartySdncRegisterInfo thirdpartySdnc, String sdncId) { CommonRegisterResponse result = new CommonRegisterResponse(); - EsrThirdpartySdncDetail esrSdncDetail = new EsrThirdpartySdncDetail(); - EsrThirdpartySdncDetail originalEsrSdncDetail = new EsrThirdpartySdncDetail(); - EsrSystemInfo originalEsrSystemInfo = new EsrSystemInfo(); - originalEsrSdncDetail = queryEsrThirdpartySdncDetail(sdncId); - esrSdncDetail = thirdpartySdncManagerUtil.sdncRegisterInfo2EsrSdnc(thirdpartySdnc); + EsrThirdpartySdncDetail originalEsrSdncDetail = queryEsrThirdpartySdncDetail(sdncId); + EsrThirdpartySdncDetail esrSdncDetail = thirdpartySdncManagerUtil.sdncRegisterInfo2EsrSdnc(thirdpartySdnc); String resourceVersion = originalEsrSdncDetail.getResourceVersion(); esrSdncDetail.setResourceVersion(resourceVersion); esrSdncDetail.setThirdpartySdncId(sdncId); - originalEsrSystemInfo = originalEsrSdncDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0); + EsrSystemInfo originalEsrSystemInfo = originalEsrSdncDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0); esrSdncDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0) .setEsrSystemInfoId(originalEsrSystemInfo.getEsrSystemInfoId()); esrSdncDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0) @@ -92,7 +89,7 @@ public class ThirdpatySdncWrapper { } public Response queryThirdpartySdncList() { - ArrayList sdncList = new ArrayList(); + List sdncList = new ArrayList<>(); EsrThirdpartySdncList esrSdnc = new EsrThirdpartySdncList(); try { String esrSdncStr = ExternalSystemProxy.querySdncList(); @@ -106,14 +103,12 @@ public class ThirdpatySdncWrapper { } public Response queryThirdpartySdncById(String thirdpartySdncId) { - ThirdpartySdncRegisterInfo thirdpartySdnc = new ThirdpartySdncRegisterInfo(); - thirdpartySdnc = querySdncDetail(thirdpartySdncId); + ThirdpartySdncRegisterInfo thirdpartySdnc = querySdncDetail(thirdpartySdncId); return Response.ok(thirdpartySdnc).build(); } public Response delThirdpartySdnc(String thirdpartySdncId) { - EsrThirdpartySdncDetail thirdpartySdncDetail = new EsrThirdpartySdncDetail(); - thirdpartySdncDetail = queryEsrThirdpartySdncDetail(thirdpartySdncId); + EsrThirdpartySdncDetail thirdpartySdncDetail = queryEsrThirdpartySdncDetail(thirdpartySdncId); String resourceVersion = thirdpartySdncDetail.getResourceVersion(); try { ExternalSystemProxy.deleteThirdpartySdnc(thirdpartySdncId, resourceVersion); @@ -140,12 +135,11 @@ public class ThirdpatySdncWrapper { } } - private ArrayList getSdncDetailList(EsrThirdpartySdncList esrThirdPartySdnc) { - ArrayList sdncInfoList = new ArrayList(); - ThirdpartySdncRegisterInfo sdncInfo = new ThirdpartySdncRegisterInfo(); + private List getSdncDetailList(EsrThirdpartySdncList esrThirdPartySdnc) { + List sdncInfoList = new ArrayList<>(); for (int i = 0; i < esrThirdPartySdnc.getEsrThirdpartySdnc().size(); i++) { String sdncId = esrThirdPartySdnc.getEsrThirdpartySdnc().get(i).getThirdpartySdncId(); - sdncInfo = querySdncDetail(sdncId); + ThirdpartySdncRegisterInfo sdncInfo = querySdncDetail(sdncId); if (sdncInfo != null) { sdncInfoList.add(sdncInfo); } diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VimManagerWrapper.java b/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VimManagerWrapper.java index 6c4c5af..fa52166 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VimManagerWrapper.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VimManagerWrapper.java @@ -16,6 +16,7 @@ package org.onap.aai.esr.wrapper; import java.util.ArrayList; +import java.util.List; import javax.ws.rs.core.Response; @@ -104,7 +105,7 @@ public class VimManagerWrapper { } public Response queryVimListDetails() { - ArrayList vimRegisterInfos = new ArrayList(); + List vimRegisterInfos = new ArrayList<>(); CloudRegionList cloudRegionList = new CloudRegionList(); try { String aaiVimList = cloudRegionProxy.qureyVimList(); @@ -134,8 +135,8 @@ public class VimManagerWrapper { } - private ArrayList getVimDetailList(CloudRegionList cloudRegionList) { - ArrayList vimRegisterInfos = new ArrayList(); + private List getVimDetailList(CloudRegionList cloudRegionList) { + List vimRegisterInfos = new ArrayList<>(); VimRegisterInfo vimRegisterInfo = new VimRegisterInfo(); int cloudRegionNum = cloudRegionList.getCloudRegion().size(); for (int i = 0; i < cloudRegionNum; i++) { diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VnfmManagerWrapper.java b/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VnfmManagerWrapper.java index d46a846..584a156 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VnfmManagerWrapper.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VnfmManagerWrapper.java @@ -16,6 +16,7 @@ package org.onap.aai.esr.wrapper; import java.util.ArrayList; +import java.util.List; import javax.ws.rs.core.Response; @@ -88,7 +89,7 @@ public class VnfmManagerWrapper { } public Response queryVnfmList() { - ArrayList vnfmList = new ArrayList(); + List vnfmList = new ArrayList<>(); EsrVnfmList esrVnfm = new EsrVnfmList(); try { String esrVnfmStr = ExternalSystemProxy.queryVnfmList(); @@ -138,8 +139,8 @@ public class VnfmManagerWrapper { return vnfm; } - private ArrayList getVnfmDetailList(EsrVnfmList esrVnfm) { - ArrayList vnfmInfoList = new ArrayList(); + private List getVnfmDetailList(EsrVnfmList esrVnfm) { + List vnfmInfoList = new ArrayList<>(); for (int i = 0; i < esrVnfm.getEsrVnfm().size(); i++) { String vnfmId = esrVnfm.getEsrVnfm().get(i).getVnfmId(); VnfmRegisterInfo vnfmInfo = queryVnfmDetail(vnfmId); diff --git a/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/CloudRegionDetailTest.java b/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/CloudRegionDetailTest.java index 89cbd95..ac9de8a 100644 --- a/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/CloudRegionDetailTest.java +++ b/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/CloudRegionDetailTest.java @@ -18,6 +18,7 @@ package org.onap.aai.esr.entity.aai; import static org.junit.Assert.assertEquals; import java.util.ArrayList; +import java.util.List; import org.junit.Test; @@ -89,7 +90,7 @@ public class CloudRegionDetailTest { @Test public void getterAndSetter4esrSystemInfoList(){ final EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList(); - ArrayList esrSystemInfo = new ArrayList(); + List esrSystemInfo = new ArrayList<>(); EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo(); esrSystemInfoObj.setEsrSystemInfoId("123"); esrSystemInfo.add(esrSystemInfoObj ); diff --git a/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/CloudRegionListTest.java b/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/CloudRegionListTest.java index 4786fc1..4a3a432 100644 --- a/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/CloudRegionListTest.java +++ b/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/CloudRegionListTest.java @@ -18,6 +18,7 @@ package org.onap.aai.esr.entity.aai; import static org.junit.Assert.assertEquals; import java.util.ArrayList; +import java.util.List; import org.junit.Test; @@ -26,7 +27,7 @@ public class CloudRegionListTest { @Test public void getterAndSetter4cloudRegion() { CloudRegionList cloudRegionList = new CloudRegionList(); - ArrayList cloudRegions = new ArrayList(); + List cloudRegions = new ArrayList<>(); CloudRegion cloudRegion = new CloudRegion(); cloudRegion.setCloudOwner("owner"); cloudRegion.setCloudRegionId("regionId"); diff --git a/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrEmsDetailTest.java b/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrEmsDetailTest.java index eb1f619..7cdbde3 100644 --- a/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrEmsDetailTest.java +++ b/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrEmsDetailTest.java @@ -18,6 +18,7 @@ package org.onap.aai.esr.entity.aai; import static org.junit.Assert.assertEquals; import java.util.ArrayList; +import java.util.List; import org.junit.Test; @@ -42,7 +43,7 @@ public class EsrEmsDetailTest { @Test public void getterAndSetter4esrSystemInfoList(){ final EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList(); - ArrayList esrSystemInfo = new ArrayList(); + List esrSystemInfo = new ArrayList<>(); EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo(); esrSystemInfoObj.setEsrSystemInfoId("123"); esrSystemInfo.add(esrSystemInfoObj ); diff --git a/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrEmsListTest.java b/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrEmsListTest.java index 3da7aaa..333a900 100644 --- a/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrEmsListTest.java +++ b/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrEmsListTest.java @@ -18,6 +18,7 @@ package org.onap.aai.esr.entity.aai; import static org.junit.Assert.assertEquals; import java.util.ArrayList; +import java.util.List; import org.junit.Test; @@ -25,7 +26,7 @@ public class EsrEmsListTest { @Test public void getterAndSetter4EsrEmsList() { EsrEmsList esrEmsList = new EsrEmsList(); - ArrayList esrEmses = new ArrayList(); + List esrEmses = new ArrayList<>(); EsrEms esrEms = new EsrEms(); esrEms.setEmsId("123"); esrEmses.add(esrEms); diff --git a/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrSystemInfoListTest.java b/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrSystemInfoListTest.java index 98337a0..6beb4b4 100644 --- a/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrSystemInfoListTest.java +++ b/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrSystemInfoListTest.java @@ -18,6 +18,7 @@ package org.onap.aai.esr.entity.aai; import static org.junit.Assert.assertEquals; import java.util.ArrayList; +import java.util.List; import org.junit.Test; @@ -25,7 +26,7 @@ public class EsrSystemInfoListTest { @Test public void getterAndSetter4cloudRegion() { EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList(); - ArrayList esrSystemInfos = new ArrayList(); + List esrSystemInfos = new ArrayList<>(); EsrSystemInfo esrSystemInfo = new EsrSystemInfo(); esrSystemInfo.setEsrSystemInfoId("123"); esrSystemInfos.add(esrSystemInfo); diff --git a/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrThirdpartySdncDetailTest.java b/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrThirdpartySdncDetailTest.java index e83a6f9..7985d55 100644 --- a/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrThirdpartySdncDetailTest.java +++ b/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrThirdpartySdncDetailTest.java @@ -18,6 +18,7 @@ package org.onap.aai.esr.entity.aai; import static org.junit.Assert.assertEquals; import java.util.ArrayList; +import java.util.List; import org.junit.Test; @@ -57,7 +58,7 @@ public class EsrThirdpartySdncDetailTest { @Test public void getterAndSetter4esrSystemInfoList(){ final EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList(); - ArrayList esrSystemInfo = new ArrayList(); + List esrSystemInfo = new ArrayList<>(); EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo(); esrSystemInfoObj.setEsrSystemInfoId("123"); esrSystemInfo.add(esrSystemInfoObj ); diff --git a/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrThirdpartySdncListTest.java b/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrThirdpartySdncListTest.java index 2a531b4..fcf5db4 100644 --- a/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrThirdpartySdncListTest.java +++ b/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrThirdpartySdncListTest.java @@ -18,6 +18,7 @@ package org.onap.aai.esr.entity.aai; import static org.junit.Assert.assertEquals; import java.util.ArrayList; +import java.util.List; import org.junit.Test; @@ -25,7 +26,7 @@ public class EsrThirdpartySdncListTest { @Test public void getterAndSetter4EsrThirdpartySdncList() { EsrThirdpartySdncList esrThirdpartySdncList = new EsrThirdpartySdncList(); - ArrayList esrThirdpartySdncs = new ArrayList(); + List esrThirdpartySdncs = new ArrayList<>(); EsrThirdpartySdnc esrThirdpartySdnc = new EsrThirdpartySdnc(); esrThirdpartySdnc.setThirdpartySdncId("123"); esrThirdpartySdncs.add(esrThirdpartySdnc); diff --git a/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrVnfmDetailTest.java b/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrVnfmDetailTest.java index 4dc4f0e..17991aa 100644 --- a/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrVnfmDetailTest.java +++ b/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrVnfmDetailTest.java @@ -18,6 +18,7 @@ package org.onap.aai.esr.entity.aai; import static org.junit.Assert.assertEquals; import java.util.ArrayList; +import java.util.List; import org.junit.Test; @@ -57,7 +58,7 @@ public class EsrVnfmDetailTest { @Test public void getterAndSetter4esrSystemInfoList(){ final EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList(); - ArrayList esrSystemInfo = new ArrayList(); + List esrSystemInfo = new ArrayList<>(); EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo(); esrSystemInfoObj.setEsrSystemInfoId("123"); esrSystemInfo.add(esrSystemInfoObj ); diff --git a/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrVnfmListTest.java b/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrVnfmListTest.java index f5d5228..943307b 100644 --- a/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrVnfmListTest.java +++ b/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrVnfmListTest.java @@ -18,6 +18,7 @@ package org.onap.aai.esr.entity.aai; import static org.junit.Assert.assertEquals; import java.util.ArrayList; +import java.util.List; import org.junit.Test; @@ -25,7 +26,7 @@ public class EsrVnfmListTest { @Test public void getterAndSetter4EsrVnfmList() { EsrVnfmList esrVnfmList = new EsrVnfmList(); - ArrayList esrVnfms = new ArrayList(); + List esrVnfms = new ArrayList<>(); EsrVnfm esrVnfm = new EsrVnfm(); esrVnfm.setVnfmId("fadasf"); esrVnfms.add(esrVnfm); diff --git a/esr-mgr/src/test/java/org/onap/aai/esr/entity/rest/VimRegisterInfoTest.java b/esr-mgr/src/test/java/org/onap/aai/esr/entity/rest/VimRegisterInfoTest.java index 04db4a3..4f4c989 100644 --- a/esr-mgr/src/test/java/org/onap/aai/esr/entity/rest/VimRegisterInfoTest.java +++ b/esr-mgr/src/test/java/org/onap/aai/esr/entity/rest/VimRegisterInfoTest.java @@ -18,6 +18,7 @@ package org.onap.aai.esr.entity.rest; import static org.junit.Assert.assertEquals; import java.util.ArrayList; +import java.util.List; import org.junit.Test; @@ -96,7 +97,7 @@ public class VimRegisterInfoTest { @Test public void getterAndSetter4vimAuthInfos(){ - final ArrayList vimAuthInfos = new ArrayList(); + final List vimAuthInfos = new ArrayList<>(); VimRegisterInfo vimRegisterInfo = new VimRegisterInfo(); vimRegisterInfo.setVimAuthInfos(vimAuthInfos); assertEquals(vimRegisterInfo.getVimAuthInfos(), vimAuthInfos); diff --git a/esr-mgr/src/test/java/org/onap/aai/esr/util/ExtsysUtilTest.java b/esr-mgr/src/test/java/org/onap/aai/esr/util/ExtsysUtilTest.java index 1bd8a62..7e71571 100644 --- a/esr-mgr/src/test/java/org/onap/aai/esr/util/ExtsysUtilTest.java +++ b/esr-mgr/src/test/java/org/onap/aai/esr/util/ExtsysUtilTest.java @@ -18,6 +18,7 @@ package org.onap.aai.esr.util; import static org.junit.Assert.assertEquals; import java.util.ArrayList; +import java.util.List; import org.junit.Test; import org.onap.aai.esr.entity.aai.EsrSystemInfo; @@ -88,7 +89,7 @@ public class ExtsysUtilTest { @Test public void getEsrSystemInfoListFromAuthInfoListTest() { - ArrayList esrSystemInfos = new ArrayList(); + List esrSystemInfos = new ArrayList<>(); EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList(); EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo(); ExtsysUtil extsysUtil = new ExtsysUtil(); diff --git a/esr-mgr/src/test/java/org/onap/aai/esr/util/VimManagerUtilTest.java b/esr-mgr/src/test/java/org/onap/aai/esr/util/VimManagerUtilTest.java index 647c952..202368f 100644 --- a/esr-mgr/src/test/java/org/onap/aai/esr/util/VimManagerUtilTest.java +++ b/esr-mgr/src/test/java/org/onap/aai/esr/util/VimManagerUtilTest.java @@ -18,6 +18,7 @@ package org.onap.aai.esr.util; import static org.junit.Assert.assertEquals; import java.util.ArrayList; +import java.util.List; import org.junit.Test; import org.onap.aai.esr.entity.aai.CloudRegionDetail; @@ -33,7 +34,7 @@ public class VimManagerUtilTest { VimManagerUtil vimManagerUtil = new VimManagerUtil(); CloudRegionDetail cloudRegionDetail = new CloudRegionDetail(); VimRegisterInfo vimRegisterInfo = new VimRegisterInfo(); - ArrayList vimAuthInfos = new ArrayList(); + List vimAuthInfos = new ArrayList<>(); VimAuthInfo vimAuthInfo = new VimAuthInfo(); vimAuthInfo.setAuthUrl("http://10.11.22.33:5000/v3"); vimAuthInfo.setCloudDomain("default"); 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 00dc1f7..735e169 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 @@ -18,6 +18,7 @@ package org.onap.aai.esr.wrapper; import static org.junit.Assert.assertEquals; import java.util.ArrayList; +import java.util.List; import javax.ws.rs.core.Response; @@ -88,7 +89,7 @@ public class VnfmManagerWrapperTest { public void test_queryVnfmList() { ExternalSystemProxy.isTest = true; ExtsysUtil extsysUtil = new ExtsysUtil(); - ArrayList vnfmList = new ArrayList(); + List vnfmList = new ArrayList<>(); VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo(); vnfmRegisterInfo.setVimId("987654"); vnfmRegisterInfo.setVersion("v1");