summaryrefslogtreecommitdiffstats
path: root/esr-mgr/src
diff options
context:
space:
mode:
authorLizi <li.zi30@zte.com.cn>2018-01-10 10:43:29 +0000
committerLizi <li.zi30@zte.com.cn>2018-01-11 01:11:31 +0000
commit769718b3e8b4e659299602701b575cf1b4b182c5 (patch)
treec249a727efe9ea2753b3ab2ea9744b3949f3c7e0 /esr-mgr/src
parent3ca84f4c73c5996a2cc5d4372d70f1e7bce5cf0f (diff)
Fix the nonstandard coding.
Fix the ArrayList usage, Remove the redundancy newly object. Change-Id: I0311297d4e1387f89196eab978ed58a86f54cddb Issue-ID: AAI-500 Signed-off-by: Lizi <li.zi30@zte.com.cn>
Diffstat (limited to 'esr-mgr/src')
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/ExtsysApp.java4
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/CloudRegionList.java8
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/EsrEmsList.java8
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/EsrSystemInfoList.java8
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/EsrThirdpartySdncList.java8
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/EsrVnfmList.java8
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/entity/rest/VimRegisterInfo.java7
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/ExternalSystemProxy.java54
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/resource/ThirdpartySdncManager.java (renamed from esr-mgr/src/main/java/org/onap/aai/esr/resource/ThirdpatySdncManager.java)16
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/util/EmsManagerUtil.java23
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/util/ExtsysUtil.java5
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/util/ThirdpartySdncManagerUtil.java3
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/util/VimManagerUtil.java19
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/wrapper/EmsManagerWrapper.java11
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/wrapper/ThirdpartySdncWrapper.java (renamed from esr-mgr/src/main/java/org/onap/aai/esr/wrapper/ThirdpatySdncWrapper.java)38
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VimManagerWrapper.java7
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VnfmManagerWrapper.java7
-rw-r--r--esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/CloudRegionDetailTest.java3
-rw-r--r--esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/CloudRegionListTest.java3
-rw-r--r--esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrEmsDetailTest.java3
-rw-r--r--esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrEmsListTest.java3
-rw-r--r--esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrSystemInfoListTest.java3
-rw-r--r--esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrThirdpartySdncDetailTest.java3
-rw-r--r--esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrThirdpartySdncListTest.java3
-rw-r--r--esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrVnfmDetailTest.java3
-rw-r--r--esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrVnfmListTest.java3
-rw-r--r--esr-mgr/src/test/java/org/onap/aai/esr/entity/rest/VimRegisterInfoTest.java3
-rw-r--r--esr-mgr/src/test/java/org/onap/aai/esr/util/ExtsysUtilTest.java3
-rw-r--r--esr-mgr/src/test/java/org/onap/aai/esr/util/VimManagerUtilTest.java3
-rw-r--r--esr-mgr/src/test/java/org/onap/aai/esr/wrapper/VnfmManagerWrapperTest.java3
30 files changed, 154 insertions, 119 deletions
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<ExtsysAppConfiguration> {
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> cloudRegion;
+ private List<CloudRegion> cloudRegion;
- public ArrayList<CloudRegion> getCloudRegion() {
+ public List<CloudRegion> getCloudRegion() {
return cloudRegion;
}
- public void setCloudRegion(ArrayList<CloudRegion> cloudRegion) {
+ public void setCloudRegion(List<CloudRegion> 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> esrEms;
+ private List<EsrEms> esrEms;
- public ArrayList<EsrEms> getEsrEms() {
+ public List<EsrEms> getEsrEms() {
return esrEms;
}
- public void setEsrEms(ArrayList<EsrEms> esrEms) {
+ public void setEsrEms(List<EsrEms> 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> esrSystemInfo;
+ private List<EsrSystemInfo> esrSystemInfo;
- public ArrayList<EsrSystemInfo> getEsrSystemInfo() {
+ public List<EsrSystemInfo> getEsrSystemInfo() {
return esrSystemInfo;
}
- public void setEsrSystemInfo(ArrayList<EsrSystemInfo> esrSystemInfo) {
+ public void setEsrSystemInfo(List<EsrSystemInfo> 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> esrThirdpartySdnc;
+ private List<EsrThirdpartySdnc> esrThirdpartySdnc;
- public ArrayList<EsrThirdpartySdnc> getEsrThirdpartySdnc() {
+ public List<EsrThirdpartySdnc> getEsrThirdpartySdnc() {
return esrThirdpartySdnc;
}
- public void setEsrThirdpartySdnc(ArrayList<EsrThirdpartySdnc> esrThirdpartySdnc) {
+ public void setEsrThirdpartySdnc(List<EsrThirdpartySdnc> 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> esrVnfm;
+ private List<EsrVnfm> esrVnfm;
- public ArrayList<EsrVnfm> getEsrVnfm() {
+ public List<EsrVnfm> getEsrVnfm() {
return esrVnfm;
}
- public void setEsrVnfm(ArrayList<EsrVnfm> esrVnfm) {
+ public void setEsrVnfm(List<EsrVnfm> 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<VimAuthInfo> vimAuthInfos;
+ private List<VimAuthInfo> vimAuthInfos;
public String getCloudOwner() {
return cloudOwner;
@@ -103,11 +104,11 @@ public class VimRegisterInfo {
this.cloudExtraInfo = cloudExtraInfo;
}
- public ArrayList<VimAuthInfo> getVimAuthInfos() {
+ public List<VimAuthInfo> getVimAuthInfos() {
return vimAuthInfos;
}
- public void setVimAuthInfos(ArrayList<VimAuthInfo> vimAuthInfos) {
+ public void setVimAuthInfos(List<VimAuthInfo> 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
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<EsrSystemInfo> authInfos = new ArrayList<EsrSystemInfo>();
- authInfos = getAuthInfosFromRegisterData(emsRegisterInfo);
+ List<EsrSystemInfo> authInfos = getAuthInfosFromRegisterData(emsRegisterInfo);
esrEms.setEsrSystemInfoList(extsysUtil.getEsrSystemInfoListFromAuthInfoList(authInfos));
return esrEms;
}
- private ArrayList<EsrSystemInfo> getAuthInfosFromRegisterData(EmsRegisterInfo emsRegisterInfo) {
- ArrayList<EsrSystemInfo> authInfos = new ArrayList<EsrSystemInfo>();
- 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<EsrSystemInfo> getAuthInfosFromRegisterData(EmsRegisterInfo emsRegisterInfo) {
+ List<EsrSystemInfo> 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> esrSystemInfo = new ArrayList<EsrSystemInfo>();
EsrSystemInfo authInfo = new EsrSystemInfo();
- esrSystemInfo = esrEms.getEsrSystemInfoList().getEsrSystemInfo();
+ List<EsrSystemInfo> esrSystemInfo = esrEms.getEsrSystemInfoList().getEsrSystemInfo();
emsRegisterInfo.setEmsId(esrEms.getEmsId());
for(int i=0; i<esrSystemInfo.size(); i++) {
diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/util/ExtsysUtil.java b/esr-mgr/src/main/java/org/onap/aai/esr/util/ExtsysUtil.java
index 834c9d5..c3814e3 100644
--- a/esr-mgr/src/main/java/org/onap/aai/esr/util/ExtsysUtil.java
+++ b/esr-mgr/src/main/java/org/onap/aai/esr/util/ExtsysUtil.java
@@ -18,6 +18,7 @@ package org.onap.aai.esr.util;
import com.google.gson.Gson;
import java.util.ArrayList;
+import java.util.List;
import java.util.UUID;
import org.onap.aai.esr.entity.aai.EsrSystemInfo;
import org.onap.aai.esr.entity.aai.EsrSystemInfoList;
@@ -42,13 +43,13 @@ public class ExtsysUtil {
public EsrSystemInfoList getEsrSystemInfoListFromAuthInfo(EsrSystemInfo esrSystemInfoObj) {
EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
- ArrayList<EsrSystemInfo> esrSystemInfo = new ArrayList<EsrSystemInfo>();
+ List<EsrSystemInfo> esrSystemInfo = new ArrayList<>();
esrSystemInfo.add(esrSystemInfoObj);
esrSystemInfoList.setEsrSystemInfo(esrSystemInfo);
return esrSystemInfoList;
}
- public EsrSystemInfoList getEsrSystemInfoListFromAuthInfoList(ArrayList<EsrSystemInfo> esrSystemInfo) {
+ public EsrSystemInfoList getEsrSystemInfoListFromAuthInfoList(List<EsrSystemInfo> 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> esrSystemInfo = new ArrayList<EsrSystemInfo>();
+ List<EsrSystemInfo> 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<VimAuthInfo> vimAuthInfos) {
+ private EsrSystemInfo vimAuthInfo2EsrSystemInfoObj(List<VimAuthInfo> 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<VimAuthInfo> vimAuthInfos = new ArrayList<VimAuthInfo>();
+ List<VimAuthInfo> 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<EmsRegisterInfo> emsList = new ArrayList<EmsRegisterInfo>();
+ List<EmsRegisterInfo> emsList = new ArrayList<>();
EsrEmsList esrEms = new EsrEmsList();
try {
String esrEmsStr = ExternalSystemProxy.queryEmsList();
@@ -132,8 +133,8 @@ public class EmsManagerWrapper {
return emsRegisterInfo;
}
- private ArrayList<EmsRegisterInfo> getEmsDetailList(EsrEmsList esrEms) {
- ArrayList<EmsRegisterInfo> emsInfoList = new ArrayList<EmsRegisterInfo>();
+ private List<EmsRegisterInfo> getEmsDetailList(EsrEmsList esrEms) {
+ List<EmsRegisterInfo> 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<EsrSystemInfo> newEsrSysInfoList = new ArrayList<EsrSystemInfo>();
+ List<EsrSystemInfo> newEsrSysInfoList = new ArrayList<>();
EsrSystemInfo newEsrSystemInfo = new EsrSystemInfo();
EsrEmsDetail oriEsrEmsDetail = new EsrEmsDetail();
- ArrayList<EsrSystemInfo> oriEsrSysInfoList = new ArrayList<EsrSystemInfo>();
+ List<EsrSystemInfo> 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
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<ThirdpartySdncRegisterInfo> sdncList = new ArrayList<ThirdpartySdncRegisterInfo>();
+ List<ThirdpartySdncRegisterInfo> 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<ThirdpartySdncRegisterInfo> getSdncDetailList(EsrThirdpartySdncList esrThirdPartySdnc) {
- ArrayList<ThirdpartySdncRegisterInfo> sdncInfoList = new ArrayList<ThirdpartySdncRegisterInfo>();
- ThirdpartySdncRegisterInfo sdncInfo = new ThirdpartySdncRegisterInfo();
+ private List<ThirdpartySdncRegisterInfo> getSdncDetailList(EsrThirdpartySdncList esrThirdPartySdnc) {
+ List<ThirdpartySdncRegisterInfo> 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<VimRegisterInfo> vimRegisterInfos = new ArrayList<VimRegisterInfo>();
+ List<VimRegisterInfo> vimRegisterInfos = new ArrayList<>();
CloudRegionList cloudRegionList = new CloudRegionList();
try {
String aaiVimList = cloudRegionProxy.qureyVimList();
@@ -134,8 +135,8 @@ public class VimManagerWrapper {
}
- private ArrayList<VimRegisterInfo> getVimDetailList(CloudRegionList cloudRegionList) {
- ArrayList<VimRegisterInfo> vimRegisterInfos = new ArrayList<VimRegisterInfo>();
+ private List<VimRegisterInfo> getVimDetailList(CloudRegionList cloudRegionList) {
+ List<VimRegisterInfo> 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<VnfmRegisterInfo> vnfmList = new ArrayList<VnfmRegisterInfo>();
+ List<VnfmRegisterInfo> vnfmList = new ArrayList<>();
EsrVnfmList esrVnfm = new EsrVnfmList();
try {
String esrVnfmStr = ExternalSystemProxy.queryVnfmList();
@@ -138,8 +139,8 @@ public class VnfmManagerWrapper {
return vnfm;
}
- private ArrayList<VnfmRegisterInfo> getVnfmDetailList(EsrVnfmList esrVnfm) {
- ArrayList<VnfmRegisterInfo> vnfmInfoList = new ArrayList<VnfmRegisterInfo>();
+ private List<VnfmRegisterInfo> getVnfmDetailList(EsrVnfmList esrVnfm) {
+ List<VnfmRegisterInfo> 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> esrSystemInfo = new ArrayList<EsrSystemInfo>();
+ List<EsrSystemInfo> 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<CloudRegion> cloudRegions = new ArrayList<CloudRegion>();
+ List<CloudRegion> 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> esrSystemInfo = new ArrayList<EsrSystemInfo>();
+ List<EsrSystemInfo> 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<EsrEms> esrEmses = new ArrayList<EsrEms>();
+ List<EsrEms> 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<EsrSystemInfo> esrSystemInfos = new ArrayList<EsrSystemInfo>();
+ List<EsrSystemInfo> 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> esrSystemInfo = new ArrayList<EsrSystemInfo>();
+ List<EsrSystemInfo> 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<EsrThirdpartySdnc> esrThirdpartySdncs = new ArrayList<EsrThirdpartySdnc>();
+ List<EsrThirdpartySdnc> 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> esrSystemInfo = new ArrayList<EsrSystemInfo>();
+ List<EsrSystemInfo> 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<EsrVnfm> esrVnfms = new ArrayList<EsrVnfm>();
+ List<EsrVnfm> 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<VimAuthInfo> vimAuthInfos = new ArrayList<VimAuthInfo>();
+ final List<VimAuthInfo> 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<EsrSystemInfo> esrSystemInfos = new ArrayList<EsrSystemInfo>();
+ List<EsrSystemInfo> 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<VimAuthInfo> vimAuthInfos = new ArrayList<VimAuthInfo>();
+ List<VimAuthInfo> 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<VnfmRegisterInfo> vnfmList = new ArrayList<VnfmRegisterInfo>();
+ List<VnfmRegisterInfo> vnfmList = new ArrayList<>();
VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
vnfmRegisterInfo.setVimId("987654");
vnfmRegisterInfo.setVersion("v1");