From 779125e31adbcc59a9864843b523bd6ed2751cbb Mon Sep 17 00:00:00 2001 From: liamfallon Date: Mon, 18 Nov 2019 12:36:28 +0000 Subject: Unit/SONAR/Checkstyle in ONAP-REST Util package of ONAP-REST, with JUnit added and SONAR/Checkstyle issues addressed. In cases where a class name change caused an update in another package, the license header on files for those knock on changes are not updated. Issue-ID: POLICY-2131 Change-Id: Ic134408efe76b9838f5607a07f1735d12bd41032 Signed-off-by: liamfallon --- .../onap/policy/controller/AutoPushController.java | 6 +++--- .../controller/CreateDcaeMicroServiceController.java | 20 ++++++++++---------- .../controller/CreateOptimizationController.java | 20 ++++++++++---------- 3 files changed, 23 insertions(+), 23 deletions(-) (limited to 'POLICY-SDK-APP') diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/AutoPushController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/AutoPushController.java index b26709ff4..e8217b99b 100644 --- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/AutoPushController.java +++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/AutoPushController.java @@ -58,7 +58,7 @@ import org.onap.policy.rest.adapter.AutoPushTabAdapter; import org.onap.policy.rest.dao.CommonClassDao; import org.onap.policy.rest.jpa.PolicyEntity; import org.onap.policy.rest.jpa.PolicyVersion; -import org.onap.policy.rest.util.PDPPolicyContainer; +import org.onap.policy.rest.util.PdpPolicyContainer; import org.onap.policy.utils.PolicyUtils; import org.onap.policy.xacml.api.XACMLErrorConstants; import org.onap.policy.xacml.api.pap.OnapPDPGroup; @@ -84,7 +84,7 @@ public class AutoPushController extends RestrictedBaseController { CommonClassDao commonClassDao; private PDPGroupContainer container; - private PDPPolicyContainer policyContainer; + private PdpPolicyContainer policyContainer; private PolicyController policyController; protected List groups = Collections.synchronizedList(new ArrayList<>()); @@ -377,7 +377,7 @@ public class AutoPushController extends RestrictedBaseController { logger.info( "**********************************************************************************************"); - policyContainer = new PDPPolicyContainer(group); + policyContainer = new PdpPolicyContainer(group); if (removePolicyData.size() > 0) { IntStream.range(0, removePolicyData.size()).mapToObj(i -> removePolicyData.get(i).toString()) .forEach(polData -> this.policyContainer.removeItem(polData)); diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java index 2e7654e84..5dee2e61f 100644 --- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java +++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java @@ -94,9 +94,9 @@ import org.onap.policy.rest.jpa.GroupPolicyScopeList; import org.onap.policy.rest.jpa.MicroServiceModels; import org.onap.policy.rest.jpa.MicroserviceHeaderdeFaults; import org.onap.policy.rest.jpa.PolicyEntity; -import org.onap.policy.rest.util.MSAttributeObject; -import org.onap.policy.rest.util.MSModelUtils; -import org.onap.policy.rest.util.MSModelUtils.MODEL_TYPE; +import org.onap.policy.rest.util.MsAttributeObject; +import org.onap.policy.rest.util.MsModelUtils; +import org.onap.policy.rest.util.MsModelUtils.ModelType; import org.onap.policy.utils.PolicyUtils; import org.onap.portalsdk.core.controller.RestrictedBaseController; import org.onap.portalsdk.core.web.support.JsonMessage; @@ -126,7 +126,7 @@ public class CreateDcaeMicroServiceController extends RestrictedBaseController { private String directory; private List modelList = new ArrayList<>(); private List dirDependencyList = new ArrayList<>(); - private LinkedHashMap classMap = new LinkedHashMap<>(); + private LinkedHashMap classMap = new LinkedHashMap<>(); String referenceAttributes; String attributeString; Set allManyTrueKeys = null; @@ -1539,7 +1539,7 @@ public class CreateDcaeMicroServiceController extends RestrictedBaseController { } List fileList = new ArrayList<>(); - MSModelUtils msModelUtils = new MSModelUtils(commonClassDao); + MsModelUtils msModelUtils = new MsModelUtils(commonClassDao); this.directory = "model"; if (zip) { extractFolder(this.newFile); @@ -1579,7 +1579,7 @@ public class CreateDcaeMicroServiceController extends RestrictedBaseController { modelType = "yml"; modelList.add(this.newModel.getModelName()); String className = this.newModel.getModelName(); - MSAttributeObject msAttributes = new MSAttributeObject(); + MsAttributeObject msAttributes = new MsAttributeObject(); msAttributes.setClassName(className); LinkedHashMap returnAttributeList = new LinkedHashMap<>(); @@ -1681,10 +1681,10 @@ public class CreateDcaeMicroServiceController extends RestrictedBaseController { private void retrieveDependency(String workingFile) { - MSModelUtils utils = new MSModelUtils(PolicyController.getMsOnapName(), PolicyController.getMsPolicyName()); - Map tempMap; + MsModelUtils utils = new MsModelUtils(PolicyController.getMsOnapName(), PolicyController.getMsPolicyName()); + Map tempMap; - tempMap = utils.processEpackage(workingFile, MODEL_TYPE.XMI); + tempMap = utils.processEpackage(workingFile, ModelType.XMI); classMap.putAll(tempMap); LOGGER.info(tempMap); @@ -1734,7 +1734,7 @@ public class CreateDcaeMicroServiceController extends RestrictedBaseController { private List createList() { List list = new ArrayList<>(); - for (Entry entrySet : classMap.entrySet()) { + for (Entry entrySet : classMap.entrySet()) { if (entrySet.getValue().isPolicyTempalate()) { list.add(entrySet.getKey()); } diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateOptimizationController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateOptimizationController.java index 0e42c78ce..37f543f35 100644 --- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateOptimizationController.java +++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateOptimizationController.java @@ -75,9 +75,9 @@ import org.onap.policy.rest.dao.CommonClassDao; import org.onap.policy.rest.jpa.MicroserviceHeaderdeFaults; import org.onap.policy.rest.jpa.OptimizationModels; import org.onap.policy.rest.jpa.PolicyEntity; -import org.onap.policy.rest.util.MSAttributeObject; -import org.onap.policy.rest.util.MSModelUtils; -import org.onap.policy.rest.util.MSModelUtils.MODEL_TYPE; +import org.onap.policy.rest.util.MsAttributeObject; +import org.onap.policy.rest.util.MsModelUtils; +import org.onap.policy.rest.util.MsModelUtils.ModelType; import org.onap.policy.utils.PolicyUtils; import org.onap.portalsdk.core.controller.RestrictedBaseController; import org.springframework.beans.factory.annotation.Autowired; @@ -103,7 +103,7 @@ public class CreateOptimizationController extends RestrictedBaseController { private String directory; private List modelList = new ArrayList<>(); private List dirDependencyList = new ArrayList<>(); - private LinkedHashMap classMap = new LinkedHashMap<>(); + private LinkedHashMap classMap = new LinkedHashMap<>(); String referenceAttributes; String attributeString; Set allManyTrueKeys = new HashSet<>(); @@ -668,7 +668,7 @@ public class CreateOptimizationController extends RestrictedBaseController { } List fileList = new ArrayList<>(); - MSModelUtils modelUtil = new MSModelUtils(); + MsModelUtils modelUtil = new MsModelUtils(); this.directory = MODEL; if (zip) { extractFolder(this.newFile); @@ -698,7 +698,7 @@ public class CreateOptimizationController extends RestrictedBaseController { modelType = "yml"; modelList.add(this.newModel.getModelName()); String className = this.newModel.getModelName(); - MSAttributeObject optimizationAttributes = new MSAttributeObject(); + MsAttributeObject optimizationAttributes = new MsAttributeObject(); optimizationAttributes.setClassName(className); LinkedHashMap returnAttributeList = new LinkedHashMap<>(); @@ -798,10 +798,10 @@ public class CreateOptimizationController extends RestrictedBaseController { private void retrieveDependency(String workingFile) { - MSModelUtils utils = new MSModelUtils(PolicyController.getMsOnapName(), PolicyController.getMsPolicyName()); - Map tempMap; + MsModelUtils utils = new MsModelUtils(PolicyController.getMsOnapName(), PolicyController.getMsPolicyName()); + Map tempMap; - tempMap = utils.processEpackage(workingFile, MODEL_TYPE.XMI); + tempMap = utils.processEpackage(workingFile, ModelType.XMI); classMap.putAll(tempMap); LOGGER.info(tempMap); @@ -823,7 +823,7 @@ public class CreateOptimizationController extends RestrictedBaseController { private List createList() { List list = new ArrayList<>(); - for (Entry entrySet : classMap.entrySet()) { + for (Entry entrySet : classMap.entrySet()) { if (entrySet.getValue().isPolicyTempalate()) { list.add(entrySet.getKey()); } -- cgit 1.2.3-korg