aboutsummaryrefslogtreecommitdiffstats
path: root/ONAP-PAP-REST
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2019-11-07 10:38:07 +0000
committerliamfallon <liam.fallon@est.tech>2019-11-07 10:51:33 +0000
commite4ac1ef3c51fc9afe44849ada5bea8c3d6057897 (patch)
tree51100e9b91cd1c2db2c6238625eedacab92c1aca /ONAP-PAP-REST
parentf4ec47c009cdc385a7efed02dda5d26f2ec31b57 (diff)
JUnit/SONAR/Checkstyle in ONAP-REST
Second batch of JPA pojos (B-D), 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: I9466f27ffa606001209ed978be592ae95d1b32c4 Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'ONAP-PAP-REST')
-rw-r--r--ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateBRMSRuleTemplate.java6
-rw-r--r--ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateBrmsParamPolicy.java4
-rw-r--r--ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/BRMSDictionaryController.java66
-rw-r--r--ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/DictionaryImportController.java12
-rw-r--r--ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/MicroServiceDictionaryController.java20
-rw-r--r--ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/elk/client/PolicyElasticSearchController.java10
-rw-r--r--ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreation.java6
-rw-r--r--ONAP-PAP-REST/src/test/java/org/onap/policy/pap/test/XACMLPAPTest.java6
-rw-r--r--ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/BRMSDictionaryControllerTest.java8
-rw-r--r--ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/MicroServiceDictionaryControllerTest.java6
10 files changed, 72 insertions, 72 deletions
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateBRMSRuleTemplate.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateBRMSRuleTemplate.java
index 8321505de..2151a1988 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateBRMSRuleTemplate.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateBRMSRuleTemplate.java
@@ -27,7 +27,7 @@ import java.util.Map;
import org.onap.policy.common.logging.flexlogger.FlexLogger;
import org.onap.policy.common.logging.flexlogger.Logger;
import org.onap.policy.rest.dao.CommonClassDao;
-import org.onap.policy.rest.jpa.BRMSParamTemplate;
+import org.onap.policy.rest.jpa.BrmsParamTemplate;
import org.onap.policy.rest.jpa.UserInfo;
import org.onap.policy.utils.PolicyUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -50,13 +50,13 @@ public class CreateBRMSRuleTemplate {
Map<String, String> responseMap = new HashMap<>();
if (rule != null && !PolicyUtils.brmsRawValidate(rule).contains("[ERR")) {
List<Object> duplicateData =
- commonClassDao.checkDuplicateEntry(ruleName, "ruleName", BRMSParamTemplate.class);
+ commonClassDao.checkDuplicateEntry(ruleName, "ruleName", BrmsParamTemplate.class);
if (duplicateData != null && !duplicateData.isEmpty()) {
LOGGER.error("Import new service failed. Service already exists");
responseMap.put("DBError", "EXISTS");
return responseMap;
} else {
- BRMSParamTemplate brmsParamTemplate = new BRMSParamTemplate();
+ BrmsParamTemplate brmsParamTemplate = new BrmsParamTemplate();
brmsParamTemplate.setDescription(description);
brmsParamTemplate.setRuleName(ruleName);
brmsParamTemplate.setRule(rule);
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateBrmsParamPolicy.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateBrmsParamPolicy.java
index 7be1d39b0..36ab893fe 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateBrmsParamPolicy.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateBrmsParamPolicy.java
@@ -66,7 +66,7 @@ import org.onap.policy.common.logging.flexlogger.Logger;
import org.onap.policy.pap.xacml.rest.controller.BRMSDictionaryController;
import org.onap.policy.pap.xacml.rest.daoimpl.CommonClassDaoImpl;
import org.onap.policy.rest.adapter.PolicyRestAdapter;
-import org.onap.policy.rest.jpa.BRMSParamTemplate;
+import org.onap.policy.rest.jpa.BrmsParamTemplate;
public class CreateBrmsParamPolicy extends Policy {
@@ -189,7 +189,7 @@ public class CreateBrmsParamPolicy extends Policy {
params.put("templateName", templateName);
List<Object> result = dbConnection.getDataByQuery(queryString, params);
if (!result.isEmpty()) {
- BRMSParamTemplate template = (BRMSParamTemplate) result.get(0);
+ BrmsParamTemplate template = (BrmsParamTemplate) result.get(0);
ruleTemplate = template.getRule();
}
return ruleTemplate;
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/BRMSDictionaryController.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/BRMSDictionaryController.java
index a669d82a0..d9cde35bb 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/BRMSDictionaryController.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/BRMSDictionaryController.java
@@ -40,9 +40,9 @@ import org.onap.policy.common.logging.flexlogger.Logger;
import org.onap.policy.pap.xacml.rest.components.CreateBRMSRuleTemplate;
import org.onap.policy.pap.xacml.rest.util.DictionaryUtils;
import org.onap.policy.rest.dao.CommonClassDao;
-import org.onap.policy.rest.jpa.BRMSController;
-import org.onap.policy.rest.jpa.BRMSDependency;
-import org.onap.policy.rest.jpa.BRMSParamTemplate;
+import org.onap.policy.rest.jpa.BrmsController;
+import org.onap.policy.rest.jpa.BrmsDependency;
+import org.onap.policy.rest.jpa.BrmsParamTemplate;
import org.onap.policy.rest.jpa.OnapName;
import org.onap.policy.rest.jpa.UserInfo;
import org.onap.policy.utils.PolicyUtils;
@@ -99,7 +99,7 @@ public class BRMSDictionaryController {
produces = MediaType.APPLICATION_JSON_VALUE)
public void getBRMSParamDictionaryByNameEntityData(HttpServletResponse response) {
DictionaryUtils utils = getDictionaryUtilsInstance();
- utils.getDataByEntity(response, brmsParamDatas, ruleName, BRMSParamTemplate.class);
+ utils.getDataByEntity(response, brmsParamDatas, ruleName, BrmsParamTemplate.class);
}
@RequestMapping(
@@ -108,7 +108,7 @@ public class BRMSDictionaryController {
produces = MediaType.APPLICATION_JSON_VALUE)
public void getBRMSParamDictionaryEntityData(HttpServletResponse response) {
DictionaryUtils utils = getDictionaryUtilsInstance();
- utils.getData(response, brmsParamDatas, BRMSParamTemplate.class);
+ utils.getData(response, brmsParamDatas, BrmsParamTemplate.class);
}
@RequestMapping(value = {"/brms_dictionary/set_BRMSParamData"}, method = {RequestMethod.POST})
@@ -129,24 +129,24 @@ public class BRMSDictionaryController {
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
JsonNode root = mapper.readTree(request.getReader());
- BRMSParamTemplate bRMSParamTemplateData;
+ BrmsParamTemplate bRMSParamTemplateData;
String userId = null;
if (fromAPI) {
bRMSParamTemplateData =
- mapper.readValue(root.get(dictionaryFields).toString(), BRMSParamTemplate.class);
+ mapper.readValue(root.get(dictionaryFields).toString(), BrmsParamTemplate.class);
userId = "API";
} else {
bRMSParamTemplateData =
- mapper.readValue(root.get("brmsParamDictionaryData").toString(), BRMSParamTemplate.class);
+ mapper.readValue(root.get("brmsParamDictionaryData").toString(), BrmsParamTemplate.class);
userId = root.get(userid).textValue();
}
UserInfo userInfo = utils.getUserInfo(userId);
List<Object> duplicateData = commonClassDao.checkDuplicateEntry(bRMSParamTemplateData.getRuleName(),
- ruleName, BRMSParamTemplate.class);
+ ruleName, BrmsParamTemplate.class);
boolean duplicateflag = false;
if (!duplicateData.isEmpty()) {
- BRMSParamTemplate data = (BRMSParamTemplate) duplicateData.get(0);
+ BrmsParamTemplate data = (BrmsParamTemplate) duplicateData.get(0);
if (request.getParameter(operation) != null && "update".equals(request.getParameter(operation))) {
bRMSParamTemplateData.setId(data.getId());
} else if ((request.getParameter(operation) != null
@@ -168,7 +168,7 @@ public class BRMSDictionaryController {
} else {
commonClassDao.update(bRMSParamTemplateData);
}
- responseString = mapper.writeValueAsString(commonClassDao.getData(BRMSParamTemplate.class));
+ responseString = mapper.writeValueAsString(commonClassDao.getData(BrmsParamTemplate.class));
} else {
responseString = duplicateResponseString;
}
@@ -197,7 +197,7 @@ public class BRMSDictionaryController {
@RequestMapping(value = {"/brms_dictionary/remove_brmsParam"}, method = {RequestMethod.POST})
public void removeBRMSParamDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException {
DictionaryUtils utils = getDictionaryUtilsInstance();
- utils.removeData(request, response, brmsParamDatas, BRMSParamTemplate.class);
+ utils.removeData(request, response, brmsParamDatas, BrmsParamTemplate.class);
}
@RequestMapping(
@@ -206,7 +206,7 @@ public class BRMSDictionaryController {
produces = MediaType.APPLICATION_JSON_VALUE)
public void getBRMSDependencyDictionaryByNameEntityData(HttpServletResponse response) {
DictionaryUtils utils = getDictionaryUtilsInstance();
- utils.getDataByEntity(response, brmsDependencyDatas, dependencyName, BRMSDependency.class);
+ utils.getDataByEntity(response, brmsDependencyDatas, dependencyName, BrmsDependency.class);
}
@RequestMapping(
@@ -215,7 +215,7 @@ public class BRMSDictionaryController {
produces = MediaType.APPLICATION_JSON_VALUE)
public void getBRMSDependencyDictionaryEntityData(HttpServletResponse response) {
DictionaryUtils utils = getDictionaryUtilsInstance();
- utils.getData(response, brmsDependencyDatas, BRMSDependency.class);
+ utils.getData(response, brmsDependencyDatas, BrmsDependency.class);
}
@RequestMapping(value = {"/brms_dictionary/save_BRMSDependencyData"}, method = {RequestMethod.POST})
@@ -229,23 +229,23 @@ public class BRMSDictionaryController {
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
JsonNode root = mapper.readTree(request.getReader());
- BRMSDependency brmsDependency;
+ BrmsDependency brmsDependency;
String userId = null;
if (fromAPI) {
- brmsDependency = mapper.readValue(root.get(dictionaryFields).toString(), BRMSDependency.class);
+ brmsDependency = mapper.readValue(root.get(dictionaryFields).toString(), BrmsDependency.class);
userId = "API";
} else {
brmsDependency =
- mapper.readValue(root.get("brmsDependencyDictionaryData").toString(), BRMSDependency.class);
+ mapper.readValue(root.get("brmsDependencyDictionaryData").toString(), BrmsDependency.class);
userId = root.get(userid).textValue();
}
UserInfo userInfo = utils.getUserInfo(userId);
List<Object> duplicateData = commonClassDao.checkDuplicateEntry(brmsDependency.getDependencyName(),
- dependencyName, BRMSDependency.class);
+ dependencyName, BrmsDependency.class);
boolean duplicateflag = false;
if (!duplicateData.isEmpty()) {
- BRMSDependency data = (BRMSDependency) duplicateData.get(0);
+ BrmsDependency data = (BrmsDependency) duplicateData.get(0);
if (request.getParameter(operation) != null && "update".equals(request.getParameter(operation))) {
brmsDependency.setId(data.getId());
} else if ((request.getParameter(operation) != null
@@ -277,7 +277,7 @@ public class BRMSDictionaryController {
brmsDependency.setModifiedDate(new Date());
commonClassDao.update(brmsDependency);
}
- responseString = mapper.writeValueAsString(commonClassDao.getData(BRMSDependency.class));
+ responseString = mapper.writeValueAsString(commonClassDao.getData(BrmsDependency.class));
} else {
responseString = duplicateResponseString;
}
@@ -305,7 +305,7 @@ public class BRMSDictionaryController {
public void removeBRMSDependencyDictionary(HttpServletRequest request, HttpServletResponse response)
throws IOException {
DictionaryUtils utils = getDictionaryUtilsInstance();
- utils.removeData(request, response, brmsDependencyDatas, BRMSDependency.class);
+ utils.removeData(request, response, brmsDependencyDatas, BrmsDependency.class);
}
@RequestMapping(
@@ -314,7 +314,7 @@ public class BRMSDictionaryController {
produces = MediaType.APPLICATION_JSON_VALUE)
public void getBRMSControllerDictionaryByNameEntityData(HttpServletResponse response) {
DictionaryUtils utils = getDictionaryUtilsInstance();
- utils.getDataByEntity(response, brmsControllerDatas, controllerName, BRMSController.class);
+ utils.getDataByEntity(response, brmsControllerDatas, controllerName, BrmsController.class);
}
@RequestMapping(
@@ -323,7 +323,7 @@ public class BRMSDictionaryController {
produces = MediaType.APPLICATION_JSON_VALUE)
public void getBRMSControllerDictionaryEntityData(HttpServletResponse response) {
DictionaryUtils utils = getDictionaryUtilsInstance();
- utils.getData(response, brmsControllerDatas, BRMSController.class);
+ utils.getData(response, brmsControllerDatas, BrmsController.class);
}
@RequestMapping(value = {"/brms_dictionary/save_BRMSControllerData"}, method = {RequestMethod.POST})
@@ -336,23 +336,23 @@ public class BRMSDictionaryController {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
JsonNode root = mapper.readTree(request.getReader());
- BRMSController brmsController;
+ BrmsController brmsController;
String userId = null;
if (fromAPI) {
- brmsController = mapper.readValue(root.get(dictionaryFields).toString(), BRMSController.class);
+ brmsController = mapper.readValue(root.get(dictionaryFields).toString(), BrmsController.class);
userId = "API";
} else {
brmsController =
- mapper.readValue(root.get("brmsControllerDictionaryData").toString(), BRMSController.class);
+ mapper.readValue(root.get("brmsControllerDictionaryData").toString(), BrmsController.class);
userId = root.get(userid).textValue();
}
UserInfo userInfo = utils.getUserInfo(userId);
List<Object> duplicateData = commonClassDao.checkDuplicateEntry(brmsController.getControllerName(),
- controllerName, BRMSController.class);
+ controllerName, BrmsController.class);
boolean duplicateflag = false;
if (!duplicateData.isEmpty()) {
- BRMSController data = (BRMSController) duplicateData.get(0);
+ BrmsController data = (BrmsController) duplicateData.get(0);
if (request.getParameter(operation) != null && "update".equals(request.getParameter(operation))) {
brmsController.setId(data.getId());
} else if ((request.getParameter(operation) != null
@@ -409,16 +409,16 @@ public class BRMSDictionaryController {
public void removeBRMSControllerDictionary(HttpServletRequest request, HttpServletResponse response)
throws IOException {
DictionaryUtils utils = getDictionaryUtilsInstance();
- utils.removeData(request, response, brmsControllerDatas, BRMSController.class);
+ utils.removeData(request, response, brmsControllerDatas, BrmsController.class);
}
- public BRMSDependency getDependencyDataByID(String dependencyName) {
- return (BRMSDependency) commonClassDao.getEntityItem(BRMSDependency.class,
+ public BrmsDependency getDependencyDataByID(String dependencyName) {
+ return (BrmsDependency) commonClassDao.getEntityItem(BrmsDependency.class,
BRMSDictionaryController.dependencyName, dependencyName);
}
- public BRMSController getControllerDataByID(String controllerName) {
- return (BRMSController) commonClassDao.getEntityItem(BRMSController.class,
+ public BrmsController getControllerDataByID(String controllerName) {
+ return (BrmsController) commonClassDao.getEntityItem(BrmsController.class,
BRMSDictionaryController.controllerName, controllerName);
}
}
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/DictionaryImportController.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/DictionaryImportController.java
index f56da990c..7400eb0c8 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/DictionaryImportController.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/DictionaryImportController.java
@@ -44,9 +44,9 @@ import org.onap.policy.rest.jpa.ActionList;
import org.onap.policy.rest.jpa.ActionPolicyDict;
import org.onap.policy.rest.jpa.AddressGroup;
import org.onap.policy.rest.jpa.Attribute;
-import org.onap.policy.rest.jpa.BRMSController;
-import org.onap.policy.rest.jpa.BRMSDependency;
-import org.onap.policy.rest.jpa.BRMSParamTemplate;
+import org.onap.policy.rest.jpa.BrmsController;
+import org.onap.policy.rest.jpa.BrmsDependency;
+import org.onap.policy.rest.jpa.BrmsParamTemplate;
import org.onap.policy.rest.jpa.Category;
import org.onap.policy.rest.jpa.ClosedLoopD2Services;
import org.onap.policy.rest.jpa.ClosedLoopSite;
@@ -439,7 +439,7 @@ public class DictionaryImportController {
}
if (dictionaryName.startsWith("BRMSParamDictionary")) {
for (int i = 1; i < dictSheet.size(); i++) {
- BRMSParamTemplate attribute = new BRMSParamTemplate();
+ BrmsParamTemplate attribute = new BrmsParamTemplate();
UserInfo userinfo = new UserInfo();
userinfo.setUserLoginId(userId);
attribute.setUserCreatedBy(userinfo);
@@ -461,7 +461,7 @@ public class DictionaryImportController {
}
if (dictionaryName.startsWith("BRMSControllerDictionary")) {
for (int i = 1; i < dictSheet.size(); i++) {
- BRMSController attribute = new BRMSController();
+ BrmsController attribute = new BrmsController();
UserInfo userinfo = new UserInfo();
userinfo.setUserLoginId(userId);
attribute.setUserCreatedBy(userinfo);
@@ -483,7 +483,7 @@ public class DictionaryImportController {
}
if (dictionaryName.startsWith("BRMSDependencyDictionary")) {
for (int i = 1; i < dictSheet.size(); i++) {
- BRMSDependency attribute = new BRMSDependency();
+ BrmsDependency attribute = new BrmsDependency();
UserInfo userinfo = new UserInfo();
userinfo.setUserLoginId(userId);
attribute.setUserCreatedBy(userinfo);
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/MicroServiceDictionaryController.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/MicroServiceDictionaryController.java
index 1582dab19..dfd7af48d 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/MicroServiceDictionaryController.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/MicroServiceDictionaryController.java
@@ -45,7 +45,7 @@ import org.onap.policy.pap.xacml.rest.XACMLPapServlet;
import org.onap.policy.pap.xacml.rest.util.DictionaryUtils;
import org.onap.policy.pap.xacml.rest.util.JsonMessage;
import org.onap.policy.rest.dao.CommonClassDao;
-import org.onap.policy.rest.jpa.DCAEuuid;
+import org.onap.policy.rest.jpa.DcaeUuid;
import org.onap.policy.rest.jpa.DictionaryData;
import org.onap.policy.rest.jpa.MicroServiceAttribute;
import org.onap.policy.rest.jpa.MicroServiceConfigName;
@@ -119,7 +119,7 @@ public class MicroServiceDictionaryController {
produces = MediaType.APPLICATION_JSON_VALUE)
public void getDCAEUUIDDictionaryByNameEntityData(HttpServletResponse response) {
DictionaryUtils utils = getDictionaryUtilsInstance();
- utils.getDataByEntity(response, dcaeUUIDDatas, "name", DCAEuuid.class);
+ utils.getDataByEntity(response, dcaeUUIDDatas, "name", DcaeUuid.class);
}
@RequestMapping(
@@ -128,7 +128,7 @@ public class MicroServiceDictionaryController {
produces = MediaType.APPLICATION_JSON_VALUE)
public void getDCAEUUIDDictionaryEntityData(HttpServletResponse response) {
DictionaryUtils utils = getDictionaryUtilsInstance();
- utils.getData(response, dcaeUUIDDatas, DCAEuuid.class);
+ utils.getData(response, dcaeUUIDDatas, DcaeUuid.class);
}
@RequestMapping(value = {"/ms_dictionary/save_dcaeUUID"}, method = {RequestMethod.POST})
@@ -140,17 +140,17 @@ public class MicroServiceDictionaryController {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
JsonNode root = mapper.readTree(request.getReader());
- DCAEuuid dCAEuuid;
+ DcaeUuid dCAEuuid;
if (fromAPI) {
- dCAEuuid = mapper.readValue(root.get(dictionaryFields).toString(), DCAEuuid.class);
+ dCAEuuid = mapper.readValue(root.get(dictionaryFields).toString(), DcaeUuid.class);
} else {
- dCAEuuid = mapper.readValue(root.get("dcaeUUIDDictionaryData").toString(), DCAEuuid.class);
+ dCAEuuid = mapper.readValue(root.get("dcaeUUIDDictionaryData").toString(), DcaeUuid.class);
}
- List<Object> duplicateData = commonClassDao.checkDuplicateEntry(dCAEuuid.getName(), "name", DCAEuuid.class);
+ List<Object> duplicateData = commonClassDao.checkDuplicateEntry(dCAEuuid.getName(), "name", DcaeUuid.class);
boolean duplicateflag = false;
if (duplicateData != null && !duplicateData.isEmpty()) {
- DCAEuuid data = (DCAEuuid) duplicateData.get(0);
+ DcaeUuid data = (DcaeUuid) duplicateData.get(0);
if (request.getParameter(operation) != null && "update".equals(request.getParameter(operation))) {
dCAEuuid.setId(data.getId());
} else if ((request.getParameter(operation) != null
@@ -166,7 +166,7 @@ public class MicroServiceDictionaryController {
} else {
commonClassDao.update(dCAEuuid);
}
- responseString = mapper.writeValueAsString(commonClassDao.getData(DCAEuuid.class));
+ responseString = mapper.writeValueAsString(commonClassDao.getData(DcaeUuid.class));
} else {
responseString = duplicateResponseString;
}
@@ -184,7 +184,7 @@ public class MicroServiceDictionaryController {
@RequestMapping(value = {"/ms_dictionary/remove_dcaeuuid"}, method = {RequestMethod.POST})
public void removeDCAEUUIDDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException {
DictionaryUtils utils = getDictionaryUtilsInstance();
- utils.removeData(request, response, dcaeUUIDDatas, DCAEuuid.class);
+ utils.removeData(request, response, dcaeUUIDDatas, DcaeUuid.class);
}
@RequestMapping(
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/elk/client/PolicyElasticSearchController.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/elk/client/PolicyElasticSearchController.java
index 36ecf83b8..ad6b9cf8e 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/elk/client/PolicyElasticSearchController.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/elk/client/PolicyElasticSearchController.java
@@ -48,10 +48,10 @@ import org.onap.policy.rest.adapter.PolicyRestAdapter;
import org.onap.policy.rest.dao.CommonClassDao;
import org.onap.policy.rest.jpa.ActionPolicyDict;
import org.onap.policy.rest.jpa.Attribute;
-import org.onap.policy.rest.jpa.BRMSParamTemplate;
+import org.onap.policy.rest.jpa.BrmsParamTemplate;
import org.onap.policy.rest.jpa.ClosedLoopD2Services;
import org.onap.policy.rest.jpa.ClosedLoopSite;
-import org.onap.policy.rest.jpa.DCAEuuid;
+import org.onap.policy.rest.jpa.DcaeUuid;
import org.onap.policy.rest.jpa.DecisionSettings;
import org.onap.policy.rest.jpa.DescriptiveScope;
import org.onap.policy.rest.jpa.GroupPolicyScopeList;
@@ -350,8 +350,8 @@ public class PolicyElasticSearchController {
policyList = searchElkDatabase(action, "actionAttributeValue", value);
break;
case brmsParam:
- BRMSParamTemplate bRMSParamTemplate =
- mapper.readValue(root.get("data").toString(), BRMSParamTemplate.class);
+ BrmsParamTemplate bRMSParamTemplate =
+ mapper.readValue(root.get("data").toString(), BrmsParamTemplate.class);
value = bRMSParamTemplate.getRuleName();
policyList = searchElkDatabase(config, "ruleName", value);
break;
@@ -399,7 +399,7 @@ public class PolicyElasticSearchController {
policyList = searchElkDatabase(config, pholder, value);
break;
case msDCAEUUID:
- DCAEuuid dcaeUUID = mapper.readValue(root.get("data").toString(), DCAEuuid.class);
+ DcaeUuid dcaeUUID = mapper.readValue(root.get("data").toString(), DcaeUuid.class);
value = dcaeUUID.getName();
policyList = searchElkDatabase(config, "uuid", value);
break;
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreation.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreation.java
index 34ea2c099..29b244046 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreation.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreation.java
@@ -56,7 +56,7 @@ import org.onap.policy.pap.xacml.rest.util.AbstractPolicyCreation;
import org.onap.policy.rest.adapter.PolicyRestAdapter;
import org.onap.policy.rest.dao.CommonClassDao;
import org.onap.policy.rest.jpa.ActionPolicyDict;
-import org.onap.policy.rest.jpa.BRMSParamTemplate;
+import org.onap.policy.rest.jpa.BrmsParamTemplate;
import org.onap.policy.rest.jpa.PolicyEditorScopes;
import org.onap.policy.rest.jpa.PolicyVersion;
import org.onap.policy.rest.jpa.UserInfo;
@@ -314,8 +314,8 @@ public class PolicyCreation extends AbstractPolicyCreation {
String modelName = drlRuleAndUiParams.get("templateName");
PolicyLogger.info("Template name from API is: " + modelName);
- BRMSParamTemplate template = (BRMSParamTemplate) commonClassDao
- .getEntityItem(BRMSParamTemplate.class, "ruleName", modelName);
+ BrmsParamTemplate template = (BrmsParamTemplate) commonClassDao
+ .getEntityItem(BrmsParamTemplate.class, "ruleName", modelName);
if (template == null) {
String message =
XACMLErrorConstants.ERROR_DATA_ISSUE + "Invalid Template. The template name, "
diff --git a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/test/XACMLPAPTest.java b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/test/XACMLPAPTest.java
index ebfbf551f..10fcd300d 100644
--- a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/test/XACMLPAPTest.java
+++ b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/test/XACMLPAPTest.java
@@ -71,7 +71,7 @@ import org.onap.policy.pap.xacml.rest.policycontroller.PolicyCreation;
import org.onap.policy.pap.xacml.rest.util.DictionaryUtils;
import org.onap.policy.rest.dao.CommonClassDao;
import org.onap.policy.rest.jpa.ActionPolicyDict;
-import org.onap.policy.rest.jpa.BRMSParamTemplate;
+import org.onap.policy.rest.jpa.BrmsParamTemplate;
import org.onap.policy.rest.jpa.Category;
import org.onap.policy.rest.jpa.FunctionDefinition;
import org.onap.policy.rest.jpa.PolicyEditorScopes;
@@ -459,7 +459,7 @@ public class XACMLPAPTest {
editorScope.setUserModifiedBy(userInfo);
Mockito.when(commonClassDao.getEntityItem(PolicyEditorScopes.class, "scopeName", "test"))
.thenReturn(editorScope);
- BRMSParamTemplate template = new BRMSParamTemplate();
+ BrmsParamTemplate template = new BrmsParamTemplate();
template.setRuleName("testPolicy");
template.setUserCreatedBy(userInfo);
String rule = "package com.sample;\n" + "import com.sample.DroolsTest.Message;\n" + "declare Params\n"
@@ -471,7 +471,7 @@ public class XACMLPAPTest {
+ "Params($param.samPoll > 50)\n" + "then\n" + "System.out.println(\"Firing rule 1\");\n"
+ "System.out.println($param);\n" + "end\n";
template.setRule(rule);
- Mockito.when(commonClassDao.getEntityItem(BRMSParamTemplate.class, "ruleName", "testPolicy"))
+ Mockito.when(commonClassDao.getEntityItem(BrmsParamTemplate.class, "ruleName", "testPolicy"))
.thenReturn(template);
}
diff --git a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/BRMSDictionaryControllerTest.java b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/BRMSDictionaryControllerTest.java
index e68860e4d..7d260907b 100644
--- a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/BRMSDictionaryControllerTest.java
+++ b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/BRMSDictionaryControllerTest.java
@@ -41,7 +41,7 @@ import org.onap.policy.common.logging.flexlogger.FlexLogger;
import org.onap.policy.common.logging.flexlogger.Logger;
import org.onap.policy.pap.xacml.rest.util.DictionaryUtils;
import org.onap.policy.rest.dao.CommonClassDao;
-import org.onap.policy.rest.jpa.BRMSParamTemplate;
+import org.onap.policy.rest.jpa.BrmsParamTemplate;
import org.onap.policy.rest.jpa.UserInfo;
import org.springframework.mock.web.MockHttpServletResponse;
@@ -64,9 +64,9 @@ public class BRMSDictionaryControllerTest {
when(commonClassDao.getEntityItem(UserInfo.class, "userLoginId", "testing")).thenReturn(userInfo);
List<String> brms = new ArrayList<String>();
brms.add("BRMS-Model");
- when(commonClassDao.getDataByColumn(BRMSParamTemplate.class, "name")).thenReturn(brms);
- doNothing().when(commonClassDao).delete(new BRMSParamTemplate());
- doNothing().when(commonClassDao).save(new BRMSParamTemplate());
+ when(commonClassDao.getDataByColumn(BrmsParamTemplate.class, "name")).thenReturn(brms);
+ doNothing().when(commonClassDao).delete(new BrmsParamTemplate());
+ doNothing().when(commonClassDao).save(new BrmsParamTemplate());
controller = new BRMSDictionaryController();
request = Mockito.mock(HttpServletRequest.class);
response = new MockHttpServletResponse();
diff --git a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/MicroServiceDictionaryControllerTest.java b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/MicroServiceDictionaryControllerTest.java
index 43cba2e61..115e30249 100644
--- a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/MicroServiceDictionaryControllerTest.java
+++ b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/MicroServiceDictionaryControllerTest.java
@@ -43,7 +43,7 @@ import org.onap.policy.common.logging.flexlogger.FlexLogger;
import org.onap.policy.common.logging.flexlogger.Logger;
import org.onap.policy.pap.xacml.rest.util.DictionaryUtils;
import org.onap.policy.rest.dao.CommonClassDao;
-import org.onap.policy.rest.jpa.DCAEuuid;
+import org.onap.policy.rest.jpa.DcaeUuid;
import org.onap.policy.rest.jpa.MicroServiceLocation;
import org.onap.policy.rest.jpa.MicroServiceModels;
import org.onap.policy.rest.jpa.UserInfo;
@@ -77,7 +77,7 @@ public class MicroServiceDictionaryControllerTest {
List<String> listIds = new ArrayList<String>();
listIds.add("Jack");
- when(commonClassDao.getDataByColumn(DCAEuuid.class, "name")).thenReturn(listIds);
+ when(commonClassDao.getDataByColumn(DcaeUuid.class, "name")).thenReturn(listIds);
List<String> microList = new ArrayList<String>();
microList.add("MC-Model");
@@ -85,7 +85,7 @@ public class MicroServiceDictionaryControllerTest {
List<Object> listId = new ArrayList<Object>();
listId.add("smith");
- when(commonClassDao.getData(DCAEuuid.class)).thenReturn(listId);
+ when(commonClassDao.getData(DcaeUuid.class)).thenReturn(listId);
MicroServiceModels microServiceModels = new MicroServiceModels();
doNothing().when(commonClassDao).delete(microServiceModels);