summaryrefslogtreecommitdiffstats
path: root/ONAP-PAP-REST
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2019-11-13 14:08:14 +0000
committerliamfallon <liam.fallon@est.tech>2019-11-13 22:16:10 +0000
commit2f3ca9fc5edc5a52659b3486605e0db508143318 (patch)
tree0511aa5f0d117fa78032f5b91b2024b57dba5913 /ONAP-PAP-REST
parent0c20d1c294fe146e1018f14b07a8d861c29fe527 (diff)
Unit/SONAR/Checkstyle in ONAP-REST
Fourth batch of JPA pojos (N-P), 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: I9319b514b5c19e6837c34566dde770673d16bca3 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/DictionaryNames.java2
-rw-r--r--ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/UpdateOthersPAPS.java8
-rw-r--r--ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateNewMicroServiceModel.java12
-rw-r--r--ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/NotifyOtherPaps.java8
-rw-r--r--ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDbDao.java20
-rw-r--r--ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/ClosedLoopDictionaryController.java18
-rw-r--r--ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/DictionaryController.java2
-rw-r--r--ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/DictionaryImportController.java18
-rw-r--r--ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/MicroServiceDictionaryController.java12
-rw-r--r--ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/elk/client/PolicyElasticSearchController.java6
-rw-r--r--ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/handler/DictionaryHandlerImpl.java4
-rw-r--r--ONAP-PAP-REST/src/main/resources/META-INF/drop.ddl2
-rw-r--r--ONAP-PAP-REST/src/main/resources/META-INF/persistence.xml16
-rw-r--r--ONAP-PAP-REST/src/test/java/org/onap/policy/pap/test/UpdateOthersPAPSTest.java12
-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/components/NotifyOtherPapsTest.java8
-rw-r--r--ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/ClosedLoopDictionaryControllerTest.java6
-rw-r--r--ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/DictionaryImportControllerTest.java2
-rw-r--r--ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/jpa/PolicyEntityTest.java68
-rw-r--r--ONAP-PAP-REST/src/test/resources/dictionaryImport/PepOptions.csv (renamed from ONAP-PAP-REST/src/test/resources/dictionaryImport/PEPOptions.csv)0
20 files changed, 115 insertions, 115 deletions
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/DictionaryNames.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/DictionaryNames.java
index 2bb2e95bb..0e1cc521a 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/DictionaryNames.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/DictionaryNames.java
@@ -36,7 +36,7 @@ public enum DictionaryNames {
VSCLAction,
ClosedLoopService,
ClosedLoopSite,
- PEPOptions,
+ PepOptions,
VarbindDictionary,
BRMSParamDictionary,
BRMSControllerDictionary,
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/UpdateOthersPAPS.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/UpdateOthersPAPS.java
index 2bb4229a6..1b25c3b9f 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/UpdateOthersPAPS.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/UpdateOthersPAPS.java
@@ -48,7 +48,7 @@ import org.onap.policy.rest.XacmlRestProperties;
import org.onap.policy.rest.dao.CommonClassDao;
import org.onap.policy.rest.jpa.ActionBodyEntity;
import org.onap.policy.rest.jpa.ConfigurationDataEntity;
-import org.onap.policy.rest.jpa.PolicyDBDaoEntity;
+import org.onap.policy.rest.jpa.PolicyDbDaoEntity;
import org.onap.policy.utils.PeCryptoUtils;
import org.onap.policy.xacml.api.XACMLErrorConstants;
import org.springframework.beans.factory.annotation.Autowired;
@@ -103,11 +103,11 @@ public class UpdateOthersPAPS {
body.setOldPolicyName(request.getParameter("oldPolicyName"));
String currentPap = XacmlRestProperties.getProperty("xacml.rest.pap.url");
- List<Object> getPAPUrls = commonClassDao.getData(PolicyDBDaoEntity.class);
+ List<Object> getPAPUrls = commonClassDao.getData(PolicyDbDaoEntity.class);
if (getPAPUrls != null && !getPAPUrls.isEmpty()) {
for (int i = 0; i < getPAPUrls.size(); i++) {
- PolicyDBDaoEntity papId = (PolicyDBDaoEntity) getPAPUrls.get(i);
- String papUrl = papId.getPolicyDBDaoUrl();
+ PolicyDbDaoEntity papId = (PolicyDbDaoEntity) getPAPUrls.get(i);
+ String papUrl = papId.getPolicyDbDaoUrl();
if (!papUrl.equals(currentPap)) {
String userName = papId.getUsername();
String password = papId.getPassword();
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateNewMicroServiceModel.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateNewMicroServiceModel.java
index 573f274f2..ea5e8aa43 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateNewMicroServiceModel.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateNewMicroServiceModel.java
@@ -275,7 +275,7 @@ public class CreateNewMicroServiceModel {
newModel.setDependency("[]");
if (mainClass.getSubClass() != null) {
String value = new Gson().toJson(mainClass.getSubClass());
- newModel.setSub_attributes(value);
+ newModel.setSubAttributes(value);
}
if (mainClass.getAttribute() != null) {
@@ -289,7 +289,7 @@ public class CreateNewMicroServiceModel {
String refAttributes = mainClass.getRefAttribute().toString().replace("{", "").replace("}", "");
int equalsIndex = refAttributes.indexOf("=");
String refAttributesAfterFirstEquals = refAttributes.substring(equalsIndex + 1);
- this.newModel.setRef_attributes(refAttributesAfterFirstEquals);
+ this.newModel.setRefAttributes(refAttributesAfterFirstEquals);
}
if (mainClass.getEnumType() != null) {
@@ -328,14 +328,14 @@ public class CreateNewMicroServiceModel {
}
subAttribute = utils.createSubAttributes(dependency, classMap, this.newModel.getModelName());
- this.newModel.setSub_attributes(subAttribute);
+ this.newModel.setSubAttributes(subAttribute);
if (mainClass.getAttribute() != null && !mainClass.getAttribute().isEmpty()) {
this.newModel.setAttributes(mainClass.getAttribute().toString().replace("{", "").replace("}", ""));
}
if (mainClass.getRefAttribute() != null && !mainClass.getRefAttribute().isEmpty()) {
this.newModel
- .setRef_attributes(mainClass.getRefAttribute().toString().replace("{", "").replace("}", ""));
+ .setRefAttributes(mainClass.getRefAttribute().toString().replace("{", "").replace("}", ""));
}
if (mainClass.getEnumType() != null && !mainClass.getEnumType().isEmpty()) {
@@ -368,8 +368,8 @@ public class CreateNewMicroServiceModel {
model.setDependency(this.newModel.getDependency());
model.setDescription(this.newModel.getDescription());
model.setEnumValues(this.newModel.getEnumValues());
- model.setRef_attributes(this.newModel.getRef_attributes());
- model.setSub_attributes(this.newModel.getSub_attributes());
+ model.setRefAttributes(this.newModel.getRefAttributes());
+ model.setSubAttributes(this.newModel.getSubAttributes());
model.setDataOrderInfo(this.newModel.getDataOrderInfo());
model.setDecisionModel(this.newModel.isDecisionModel());
model.setRuleFormation(this.newModel.getRuleFormation());
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/NotifyOtherPaps.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/NotifyOtherPaps.java
index cd290c66c..e9db043bf 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/NotifyOtherPaps.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/NotifyOtherPaps.java
@@ -35,13 +35,13 @@ import java.util.UUID;
import org.onap.policy.common.logging.flexlogger.FlexLogger;
import org.onap.policy.common.logging.flexlogger.Logger;
import org.onap.policy.rest.XacmlRestProperties;
-import org.onap.policy.rest.jpa.PolicyDBDaoEntity;
+import org.onap.policy.rest.jpa.PolicyDbDaoEntity;
import org.onap.policy.utils.PeCryptoUtils;
public class NotifyOtherPaps {
private static final Logger LOGGER = FlexLogger.getLogger(NotifyOtherPaps.class);
- private List<PolicyDBDaoEntity> failedPaps = null;
+ private List<PolicyDbDaoEntity> failedPaps = null;
public void notifyOthers(long entityId, String entityType) {
notifyOthers(entityId, entityType, null);
@@ -104,8 +104,8 @@ public class NotifyOtherPaps {
@Override
public void run() {
PolicyDbDao dao = new PolicyDbDao();
- PolicyDBDaoEntity dbdEntity = (PolicyDBDaoEntity) obj;
- String otherPap = dbdEntity.getPolicyDBDaoUrl();
+ PolicyDbDaoEntity dbdEntity = (PolicyDbDaoEntity) obj;
+ String otherPap = dbdEntity.getPolicyDbDaoUrl();
String txt;
try {
txt = PeCryptoUtils.decrypt(dbdEntity.getPassword());
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDbDao.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDbDao.java
index e0db53e8b..9af380b05 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDbDao.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDbDao.java
@@ -59,7 +59,7 @@ import org.onap.policy.rest.jpa.ConfigurationDataEntity;
import org.onap.policy.rest.jpa.DatabaseLockEntity;
import org.onap.policy.rest.jpa.GroupEntity;
import org.onap.policy.rest.jpa.PdpEntity;
-import org.onap.policy.rest.jpa.PolicyDBDaoEntity;
+import org.onap.policy.rest.jpa.PolicyDbDaoEntity;
import org.onap.policy.rest.jpa.PolicyEntity;
import org.onap.policy.utils.PeCryptoUtils;
import org.onap.policy.xacml.api.XACMLErrorConstants;
@@ -212,14 +212,14 @@ public class PolicyDbDao {
/**
* Gets the list of other registered PolicyDBDaos from the database.
*
- * @return List (type PolicyDBDaoEntity) of other PolicyDBDaos
+ * @return List (type PolicyDbDaoEntity) of other PolicyDBDaos
*/
private List<?> getRemotePolicyDbDaoList() {
logger.debug("getRemotePolicyDBDaoList() as getRemotePolicyDBDaoList() called");
List<?> policyDbDaoEntityList = new LinkedList<>();
Session session = sessionfactory.openSession();
try {
- Criteria cr = session.createCriteria(PolicyDBDaoEntity.class);
+ Criteria cr = session.createCriteria(PolicyDbDaoEntity.class);
policyDbDaoEntityList = cr.list();
} catch (Exception e) {
PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, POLICYDBDAO_VAR,
@@ -328,7 +328,7 @@ public class PolicyDbDao {
}
/**
- * Register the PolicyDBDao instance in the PolicyDBDaoEntity table.
+ * Register the PolicyDBDao instance in the PolicyDbDaoEntity table.
*
* @return Boolean, were we able to register?
*/
@@ -370,19 +370,19 @@ public class PolicyDbDao {
}
}
logger.debug("\nPolicyDBDao.register. Database locking and concurrency control is initialized\n");
- PolicyDBDaoEntity foundPolicyDbDaoEntity = null;
- Criteria cr = session.createCriteria(PolicyDBDaoEntity.class);
- cr.add(Restrictions.eq("policyDBDaoUrl", url[0]));
+ PolicyDbDaoEntity foundPolicyDbDaoEntity = null;
+ Criteria cr = session.createCriteria(PolicyDbDaoEntity.class);
+ cr.add(Restrictions.eq("policyDbDaoUrl", url[0]));
List<?> data = cr.list();
if (!data.isEmpty()) {
- foundPolicyDbDaoEntity = (PolicyDBDaoEntity) data.get(0);
+ foundPolicyDbDaoEntity = (PolicyDbDaoEntity) data.get(0);
}
// encrypt the password
String txt = PeCryptoUtils.encrypt(url[2]);
if (foundPolicyDbDaoEntity == null) {
- PolicyDBDaoEntity newPolicyDbDaoEntity = new PolicyDBDaoEntity();
- newPolicyDbDaoEntity.setPolicyDBDaoUrl(url[0]);
+ PolicyDbDaoEntity newPolicyDbDaoEntity = new PolicyDbDaoEntity();
+ newPolicyDbDaoEntity.setPolicyDbDaoUrl(url[0]);
newPolicyDbDaoEntity.setDescription("PAP server at " + url[0]);
newPolicyDbDaoEntity.setUsername(url[1]);
newPolicyDbDaoEntity.setPassword(txt);
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/ClosedLoopDictionaryController.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/ClosedLoopDictionaryController.java
index 0b94b40bc..16e8e2e2c 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/ClosedLoopDictionaryController.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/ClosedLoopDictionaryController.java
@@ -38,7 +38,7 @@ import org.onap.policy.rest.dao.CommonClassDao;
import org.onap.policy.rest.jpa.ClosedLoopD2Services;
import org.onap.policy.rest.jpa.ClosedLoopSite;
import org.onap.policy.rest.jpa.OnapName;
-import org.onap.policy.rest.jpa.PEPOptions;
+import org.onap.policy.rest.jpa.PepOptions;
import org.onap.policy.rest.jpa.UserInfo;
import org.onap.policy.rest.jpa.VNFType;
import org.onap.policy.rest.jpa.VSCLAction;
@@ -134,7 +134,7 @@ public class ClosedLoopDictionaryController {
produces = MediaType.APPLICATION_JSON_VALUE)
public void getPEPOptionsDictionaryByNameEntityData(HttpServletResponse response) {
DictionaryUtils utils = getDictionaryUtilsInstance();
- utils.getDataByEntity(response, pepOptionDatas, pepName, PEPOptions.class);
+ utils.getDataByEntity(response, pepOptionDatas, pepName, PepOptions.class);
}
@RequestMapping(
@@ -143,7 +143,7 @@ public class ClosedLoopDictionaryController {
produces = MediaType.APPLICATION_JSON_VALUE)
public void getPEPOptionsDictionaryEntityData(HttpServletResponse response) {
DictionaryUtils utils = getDictionaryUtilsInstance();
- utils.getData(response, pepOptionDatas, PEPOptions.class);
+ utils.getData(response, pepOptionDatas, PepOptions.class);
}
@RequestMapping(
@@ -336,15 +336,15 @@ public class ClosedLoopDictionaryController {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
JsonNode root = mapper.readTree(request.getReader());
- PEPOptions pEPOptions;
+ PepOptions pEPOptions;
GridData gridData;
String userId = null;
if (fromAPI) {
- pEPOptions = mapper.readValue(root.get(dictionaryFields).toString(), PEPOptions.class);
+ pEPOptions = mapper.readValue(root.get(dictionaryFields).toString(), PepOptions.class);
gridData = mapper.readValue(root.get(dictionaryFields).toString(), GridData.class);
userId = "API";
} else {
- pEPOptions = mapper.readValue(root.get("pepOptionsDictionaryData").toString(), PEPOptions.class);
+ pEPOptions = mapper.readValue(root.get("pepOptionsDictionaryData").toString(), PepOptions.class);
gridData = mapper.readValue(root.get("pepOptionsDictionaryData").toString(), GridData.class);
userId = root.get(userid).textValue();
}
@@ -355,10 +355,10 @@ public class ClosedLoopDictionaryController {
}
List<Object> duplicateData =
- commonClassDao.checkDuplicateEntry(pEPOptions.getPepName(), pepName, PEPOptions.class);
+ commonClassDao.checkDuplicateEntry(pEPOptions.getPepName(), pepName, PepOptions.class);
boolean duplicateflag = false;
if (!duplicateData.isEmpty()) {
- PEPOptions data = (PEPOptions) duplicateData.get(0);
+ PepOptions data = (PepOptions) duplicateData.get(0);
if (request.getParameter(operation) != null && "update".equals(request.getParameter(operation))) {
pEPOptions.setId(data.getId());
} else if ((request.getParameter(operation) != null
@@ -377,7 +377,7 @@ public class ClosedLoopDictionaryController {
pEPOptions.setModifiedDate(new Date());
commonClassDao.update(pEPOptions);
}
- responseString = mapper.writeValueAsString(commonClassDao.getData(PEPOptions.class));
+ responseString = mapper.writeValueAsString(commonClassDao.getData(PepOptions.class));
} else {
responseString = duplicateResponseString;
}
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/DictionaryController.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/DictionaryController.java
index 5de2dfbc2..e2e2e3872 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/DictionaryController.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/DictionaryController.java
@@ -211,7 +211,7 @@ public class DictionaryController {
UserInfo userInfo = utils.getUserInfo(userId);
List<Object> duplicateData =
- commonClassDao.checkDuplicateEntry(onapData.getOnapName(), onapName, OnapName.class);
+ commonClassDao.checkDuplicateEntry(onapData.getName(), onapName, OnapName.class);
boolean duplicateflag = false;
if (!duplicateData.isEmpty()) {
OnapName data = (OnapName) duplicateData.get(0);
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 7400eb0c8..ef475039d 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
@@ -56,7 +56,7 @@ import org.onap.policy.rest.jpa.DescriptiveScope;
import org.onap.policy.rest.jpa.GroupServiceList;
import org.onap.policy.rest.jpa.MicroServiceModels;
import org.onap.policy.rest.jpa.OnapName;
-import org.onap.policy.rest.jpa.PEPOptions;
+import org.onap.policy.rest.jpa.PepOptions;
import org.onap.policy.rest.jpa.PrefixList;
import org.onap.policy.rest.jpa.ProtocolList;
import org.onap.policy.rest.jpa.SecurityZone;
@@ -213,7 +213,7 @@ public class DictionaryImportController {
for (int j = 0; j < rows.length; j++) {
if ("onap_name".equalsIgnoreCase(dictSheet.get(0)[j])
|| "Onap Name".equalsIgnoreCase(dictSheet.get(0)[j])) {
- attribute.setOnapName(rows[j]);
+ attribute.setName(rows[j]);
}
if (DESCRIPTION.equalsIgnoreCase(dictSheet.get(0)[j])) {
attribute.setDescription(rows[j]);
@@ -252,10 +252,10 @@ public class DictionaryImportController {
attribute.setEnumValues(rows[j]);
}
if ("Ref Attributes".equalsIgnoreCase(dictSheet.get(0)[j])) {
- attribute.setRef_attributes(rows[j]);
+ attribute.setRefAttributes(rows[j]);
}
if ("Sub Attributes".equalsIgnoreCase(dictSheet.get(0)[j])) {
- attribute.setSub_attributes(rows[j]);
+ attribute.setSubAttributes(rows[j]);
}
if ("annotations".equalsIgnoreCase(dictSheet.get(0)[j])) {
attribute.setAnnotation(rows[j]);
@@ -295,10 +295,10 @@ public class DictionaryImportController {
attribute.setEnumValues(rows[j]);
}
if ("Ref Attributes".equalsIgnoreCase(dictSheet.get(0)[j])) {
- attribute.setRef_attributes(rows[j]);
+ attribute.setRefAttributes(rows[j]);
}
if ("Sub Attributes".equalsIgnoreCase(dictSheet.get(0)[j])) {
- attribute.setSub_attributes(rows[j]);
+ attribute.setSubAttributes(rows[j]);
}
if ("annotations".equalsIgnoreCase(dictSheet.get(0)[j])) {
attribute.setAnnotation(rows[j]);
@@ -389,9 +389,9 @@ public class DictionaryImportController {
commonClassDao.save(attribute);
}
}
- if (dictionaryName.startsWith("PEPOptions")) {
+ if (dictionaryName.startsWith("PepOptions")) {
for (int i = 1; i < dictSheet.size(); i++) {
- PEPOptions attribute = new PEPOptions();
+ PepOptions attribute = new PepOptions();
UserInfo userinfo = new UserInfo();
userinfo.setUserLoginId(userId);
attribute.setUserCreatedBy(userinfo);
@@ -801,7 +801,7 @@ public class DictionaryImportController {
case VSCLAction:
case ClosedLoopService:
case ClosedLoopSite:
- case PEPOptions:
+ case PepOptions:
case VarbindDictionary:
case BRMSParamDictionary:
case BRMSControllerDictionary:
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 dfd7af48d..b9e1ce1ce 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
@@ -658,7 +658,7 @@ public class MicroServiceDictionaryController {
MSAttributeObject mainClass = classMap.get(this.newModel.getModelName());
this.newModel.setDependency("[]");
String value = new Gson().toJson(mainClass.getSubClass());
- this.newModel.setSub_attributes(value);
+ this.newModel.setSubAttributes(value);
String attributes = mainClass.getAttribute().toString().replace("{", "").replace("}", "");
int equalsIndexForAttributes = attributes.indexOf('=');
String atttributesAfterFirstEquals = attributes.substring(equalsIndexForAttributes + 1);
@@ -666,7 +666,7 @@ public class MicroServiceDictionaryController {
String refAttributes = mainClass.getRefAttribute().toString().replace("{", "").replace("}", "");
int equalsIndex = refAttributes.indexOf("=");
String refAttributesAfterFirstEquals = refAttributes.substring(equalsIndex + 1);
- this.newModel.setRef_attributes(refAttributesAfterFirstEquals);
+ this.newModel.setRefAttributes(refAttributesAfterFirstEquals);
this.newModel.setEnumValues(mainClass.getEnumType().toString().replace("{", "").replace("}", ""));
this.newModel
.setAnnotation(mainClass.getMatchingSet().toString().replace("{", "").replace("}", ""));
@@ -713,10 +713,10 @@ public class MicroServiceDictionaryController {
}
}
microServiceModels.setAttributes(this.newModel.getAttributes());
- microServiceModels.setRef_attributes(this.newModel.getRef_attributes());
+ microServiceModels.setRefAttributes(this.newModel.getRefAttributes());
microServiceModels.setDependency(this.newModel.getDependency());
microServiceModels.setModelName(this.newModel.getModelName());
- microServiceModels.setSub_attributes(this.newModel.getSub_attributes());
+ microServiceModels.setSubAttributes(this.newModel.getSubAttributes());
microServiceModels.setVersion(this.newModel.getVersion());
microServiceModels.setEnumValues(this.newModel.getEnumValues());
microServiceModels.setAnnotation(this.newModel.getAnnotation());
@@ -798,9 +798,9 @@ public class MicroServiceDictionaryController {
}
if (mainClass != null) {
this.newModel.setDependency(mainClass.getDependency());
- this.newModel.setSub_attributes(subAttribute);
+ this.newModel.setSubAttributes(subAttribute);
this.newModel.setAttributes(mainClass.getAttribute().toString().replace("{", "").replace("}", ""));
- this.newModel.setRef_attributes(mainClass.getRefAttribute().toString().replace("{", "").replace("}", ""));
+ this.newModel.setRefAttributes(mainClass.getRefAttribute().toString().replace("{", "").replace("}", ""));
this.newModel.setEnumValues(mainClass.getEnumType().toString().replace("{", "").replace("}", ""));
this.newModel.setAnnotation(mainClass.getMatchingSet().toString().replace("{", "").replace("}", ""));
}
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 ad6b9cf8e..f21ac60c8 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
@@ -58,7 +58,7 @@ import org.onap.policy.rest.jpa.GroupPolicyScopeList;
import org.onap.policy.rest.jpa.MicroServiceLocation;
import org.onap.policy.rest.jpa.MicroServiceModels;
import org.onap.policy.rest.jpa.OnapName;
-import org.onap.policy.rest.jpa.PEPOptions;
+import org.onap.policy.rest.jpa.PepOptions;
import org.onap.policy.rest.jpa.RiskType;
import org.onap.policy.rest.jpa.SafePolicyWarning;
import org.onap.policy.rest.jpa.TermList;
@@ -340,7 +340,7 @@ public class PolicyElasticSearchController {
break;
case onapName:
OnapName onapName = mapper.readValue(root.get("data").toString(), OnapName.class);
- value = onapName.getOnapName();
+ value = onapName.getName();
policyList = searchElkDatabase(all, "onapName", value);
break;
case actionPolicy:
@@ -356,7 +356,7 @@ public class PolicyElasticSearchController {
policyList = searchElkDatabase(config, "ruleName", value);
break;
case pepOptions:
- PEPOptions pEPOptions = mapper.readValue(root.get("data").toString(), PEPOptions.class);
+ PepOptions pEPOptions = mapper.readValue(root.get("data").toString(), PepOptions.class);
value = pEPOptions.getPepName();
policyList = searchElkDatabase(closedloop, "jsonBodyData.pepName", value);
break;
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/handler/DictionaryHandlerImpl.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/handler/DictionaryHandlerImpl.java
index 65c50b1c0..f16c2031c 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/handler/DictionaryHandlerImpl.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/handler/DictionaryHandlerImpl.java
@@ -56,7 +56,7 @@ public class DictionaryHandlerImpl implements DictionaryHandler {
case "VNFType":
dictionary.getVnfType(response);
break;
- case "PEPOptions":
+ case "PepOptions":
dictionary.getPEPOptions(response);
break;
case "Varbind":
@@ -206,7 +206,7 @@ public class DictionaryHandlerImpl implements DictionaryHandler {
case "VNFType":
result = dictionary.saveVnfType(request, response);
break;
- case "PEPOptions":
+ case "PepOptions":
result = dictionary.savePEPOptions(request, response);
break;
case "Varbind":
diff --git a/ONAP-PAP-REST/src/main/resources/META-INF/drop.ddl b/ONAP-PAP-REST/src/main/resources/META-INF/drop.ddl
index 062169345..d28a00dde 100644
--- a/ONAP-PAP-REST/src/main/resources/META-INF/drop.ddl
+++ b/ONAP-PAP-REST/src/main/resources/META-INF/drop.ddl
@@ -20,7 +20,7 @@
DROP TABLE IF EXISTS ConfigurationDataEntity
DROP TABLE IF EXISTS PolicyEntity
-DROP TABLE IF EXISTS PolicyDBDaoEntity
+DROP TABLE IF EXISTS PolicyDbDaoEntity
DROP TABLE IF EXISTS ActionBodyEntity
DROP SEQUENCE IF EXISTS seqPolicy
DROP SEQUENCE IF EXISTS seqConfig
diff --git a/ONAP-PAP-REST/src/main/resources/META-INF/persistence.xml b/ONAP-PAP-REST/src/main/resources/META-INF/persistence.xml
index 057666ee6..0280219a7 100644
--- a/ONAP-PAP-REST/src/main/resources/META-INF/persistence.xml
+++ b/ONAP-PAP-REST/src/main/resources/META-INF/persistence.xml
@@ -22,7 +22,7 @@
<persistence-unit name="XACML-PAP-REST">
<class>org.onap.policy.rest.jpa.PolicyEntity</class>
<class>org.onap.policy.rest.jpa.ConfigurationDataEntity</class>
- <class>org.onap.policy.rest.jpa.PolicyDBDaoEntity</class>
+ <class>org.onap.policy.rest.jpa.PolicyDbDaoEntity</class>
<class>org.onap.policy.rest.jpa.GroupEntity</class>
<class>org.onap.policy.rest.jpa.PdpEntity</class>
<class>org.onap.policy.rest.jpa.ActionBodyEntity</class>
@@ -109,7 +109,7 @@
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<class>org.onap.policy.rest.jpa.PolicyEntity</class>
<class>org.onap.policy.rest.jpa.ConfigurationDataEntity</class>
- <class>org.onap.policy.rest.jpa.PolicyDBDaoEntity</class>
+ <class>org.onap.policy.rest.jpa.PolicyDbDaoEntity</class>
<class>org.onap.policy.rest.jpa.GroupEntity</class>
<class>org.onap.policy.rest.jpa.PdpEntity</class>
<class>org.onap.policy.rest.jpa.ActionBodyEntity</class>
@@ -146,12 +146,12 @@
<class>org.onap.policy.rest.jpa.MicroServiceLocation</class>
<class>org.onap.policy.rest.jpa.Obadvice</class>
<class>org.onap.policy.rest.jpa.ObadviceExpression</class>
- <class>org.onap.policy.rest.jpa.PEPOptions</class>
- <class>org.onap.policy.rest.jpa.PIPConfigParam</class>
- <class>org.onap.policy.rest.jpa.PIPConfiguration</class>
- <class>org.onap.policy.rest.jpa.PIPResolver</class>
- <class>org.onap.policy.rest.jpa.PIPResolverParam</class>
- <class>org.onap.policy.rest.jpa.PIPType</class>
+ <class>org.onap.policy.rest.jpa.PepOptions</class>
+ <class>org.onap.policy.rest.jpa.PipConfigParam</class>
+ <class>org.onap.policy.rest.jpa.PipConfiguration</class>
+ <class>org.onap.policy.rest.jpa.PipResolver</class>
+ <class>org.onap.policy.rest.jpa.PipResolverParam</class>
+ <class>org.onap.policy.rest.jpa.PipType</class>
<class>org.onap.policy.rest.jpa.PolicyAlgorithms</class>
<class>org.onap.policy.rest.jpa.PolicyManagement</class>
<class>org.onap.policy.rest.jpa.PolicyScopeService</class>
diff --git a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/test/UpdateOthersPAPSTest.java b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/test/UpdateOthersPAPSTest.java
index 99902012b..ffac655a6 100644
--- a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/test/UpdateOthersPAPSTest.java
+++ b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/test/UpdateOthersPAPSTest.java
@@ -43,7 +43,7 @@ import org.onap.policy.pap.xacml.rest.UpdateOthersPAPS;
import org.onap.policy.pap.xacml.rest.adapters.UpdateObjectData;
import org.onap.policy.pap.xacml.rest.components.Policy;
import org.onap.policy.rest.dao.CommonClassDao;
-import org.onap.policy.rest.jpa.PolicyDBDaoEntity;
+import org.onap.policy.rest.jpa.PolicyDbDaoEntity;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
@@ -65,20 +65,20 @@ public class UpdateOthersPAPSTest {
request = mock(HttpServletRequest.class);
response = new MockHttpServletResponse();
List<Object> data = new ArrayList<>();
- PolicyDBDaoEntity entity = new PolicyDBDaoEntity();
- entity.setPolicyDBDaoUrl("http://localhost:8070/pap");
+ PolicyDbDaoEntity entity = new PolicyDbDaoEntity();
+ entity.setPolicyDbDaoUrl("http://localhost:8070/pap");
entity.setUsername("test");
entity.setPassword("test");
- PolicyDBDaoEntity entity1 = new PolicyDBDaoEntity();
- entity1.setPolicyDBDaoUrl("http://localhost:8071/pap");
+ PolicyDbDaoEntity entity1 = new PolicyDbDaoEntity();
+ entity1.setPolicyDbDaoUrl("http://localhost:8071/pap");
entity1.setUsername("test");
entity1.setPassword("test");
data.add(entity);
data.add(entity1);
System.setProperty("xacml.rest.pap.url", "http://localhost:8070/pap");
- when(commonClassDao.getData(PolicyDBDaoEntity.class)).thenReturn(data);
+ when(commonClassDao.getData(PolicyDbDaoEntity.class)).thenReturn(data);
}
@Test
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 10fcd300d..f978d7464 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
@@ -499,14 +499,14 @@ public class XACMLPAPTest {
// Verify
Mockito.verify(httpServletResponse).setStatus(HttpServletResponse.SC_OK);
//
- // Check PEPOptions
+ // Check PepOptions
//
httpServletRequest = Mockito.mock(HttpServletRequest.class);
httpServletResponse = Mockito.mock(MockHttpServletResponse.class);
json = "{\"dictionaryFields\":{\"pepName\":\"testRestAPI\",\"description\":\"testing create\","
+ "\"attributes\":[{\"option\":\"test1\",\"number\":\"test\"},{\"option\":\"test2\","
+ "\"number\":\"test\"}]}}";
- dictionaryTestSetup(false, "PEPOptions", json);
+ dictionaryTestSetup(false, "PepOptions", json);
// send Request to PAP
pap.service(httpServletRequest, httpServletResponse);
// Verify
@@ -886,7 +886,7 @@ public class XACMLPAPTest {
@Test
public void getDictionary() throws ServletException, IOException {
String[] dictionarys = new String[] {"Attribute", "OnapName", "Action", "BRMSParamTemplate", "VSCLAction",
- "VNFType", "PEPOptions", "Varbind", "Service", "Site", "Settings", "RainyDayTreatments",
+ "VNFType", "PepOptions", "Varbind", "Service", "Site", "Settings", "RainyDayTreatments",
"DescriptiveScope", "ActionList", "ProtocolList", "Zone", "SecurityZone", "PrefixList", "AddressGroup",
"ServiceGroup", "ServiceList", "TermList", "MicroServiceLocation", "MicroServiceConfigName", "DCAEUUID",
"MicroServiceModels", "PolicyScopeService", "PolicyScopeResource", "PolicyScopeType",
diff --git a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/components/NotifyOtherPapsTest.java b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/components/NotifyOtherPapsTest.java
index 50c166aed..7156ec788 100644
--- a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/components/NotifyOtherPapsTest.java
+++ b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/components/NotifyOtherPapsTest.java
@@ -28,7 +28,7 @@ import java.util.List;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.onap.policy.rest.jpa.PolicyDBDaoEntity;
+import org.onap.policy.rest.jpa.PolicyDbDaoEntity;
public class NotifyOtherPapsTest {
private static final String systemKey = XACMLProperties.XACML_PROPERTIES_NAME;
@@ -43,9 +43,9 @@ public class NotifyOtherPapsTest {
@Test
public void negTestNotify() {
NotifyOtherPaps notify = new NotifyOtherPaps();
- List<PolicyDBDaoEntity> otherServers = new ArrayList<PolicyDBDaoEntity>();
- PolicyDBDaoEntity dbdaoEntity = new PolicyDBDaoEntity();
- dbdaoEntity.setPolicyDBDaoUrl("http://test");
+ List<PolicyDbDaoEntity> otherServers = new ArrayList<PolicyDbDaoEntity>();
+ PolicyDbDaoEntity dbdaoEntity = new PolicyDbDaoEntity();
+ dbdaoEntity.setPolicyDbDaoUrl("http://test");
otherServers.add(dbdaoEntity);
long entityId = 0;
String entityType = "entityType";
diff --git a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/ClosedLoopDictionaryControllerTest.java b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/ClosedLoopDictionaryControllerTest.java
index 3472b0df5..fab361118 100644
--- a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/ClosedLoopDictionaryControllerTest.java
+++ b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/ClosedLoopDictionaryControllerTest.java
@@ -42,7 +42,7 @@ import org.onap.policy.pap.xacml.rest.util.DictionaryUtils;
import org.onap.policy.rest.dao.CommonClassDao;
import org.onap.policy.rest.jpa.ClosedLoopD2Services;
import org.onap.policy.rest.jpa.ClosedLoopSite;
-import org.onap.policy.rest.jpa.PEPOptions;
+import org.onap.policy.rest.jpa.PepOptions;
import org.onap.policy.rest.jpa.UserInfo;
import org.onap.policy.rest.jpa.VNFType;
import org.onap.policy.rest.jpa.VSCLAction;
@@ -140,7 +140,7 @@ public class ClosedLoopDictionaryControllerTest {
@Test
public void testGetPEPOptionsDictionaryByNameEntityData() {
- when(commonClassDao.getDataByColumn(PEPOptions.class, "pepName")).thenReturn(data);
+ when(commonClassDao.getDataByColumn(PepOptions.class, "pepName")).thenReturn(data);
controller.getPEPOptionsDictionaryByNameEntityData(response);
try {
assertTrue(response.getContentAsString() != null
@@ -153,7 +153,7 @@ public class ClosedLoopDictionaryControllerTest {
@Test
public void testGetPEPOptionsDictionaryEntityData() {
- when(commonClassDao.getData(PEPOptions.class)).thenReturn(new ArrayList<>());
+ when(commonClassDao.getData(PepOptions.class)).thenReturn(new ArrayList<>());
controller.getPEPOptionsDictionaryEntityData(response);
try {
assertTrue(response.getContentAsString() != null
diff --git a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/DictionaryImportControllerTest.java b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/DictionaryImportControllerTest.java
index ef723a3fd..ee4dff803 100644
--- a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/DictionaryImportControllerTest.java
+++ b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/DictionaryImportControllerTest.java
@@ -96,7 +96,7 @@ public class DictionaryImportControllerTest extends Mockito {
fileNames.add("SearchCriteria.csv");
fileNames.add("VNFType.csv");
fileNames.add("VSCLAction.csv");
- fileNames.add("PEPOptions.csv");
+ fileNames.add("PepOptions.csv");
fileNames.add("Settings.csv");
fileNames.add("Zone.csv");
fileNames.add("ActionList.csv");
diff --git a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/jpa/PolicyEntityTest.java b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/jpa/PolicyEntityTest.java
index 9da3f8b5c..d7fbda259 100644
--- a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/jpa/PolicyEntityTest.java
+++ b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/jpa/PolicyEntityTest.java
@@ -38,7 +38,7 @@ import org.onap.policy.common.logging.flexlogger.Logger;
import org.onap.policy.rest.XacmlRestProperties;
import org.onap.policy.rest.jpa.ActionBodyEntity;
import org.onap.policy.rest.jpa.ConfigurationDataEntity;
-import org.onap.policy.rest.jpa.PolicyDBDaoEntity;
+import org.onap.policy.rest.jpa.PolicyDbDaoEntity;
import org.onap.policy.rest.jpa.PolicyEntity;
public class PolicyEntityTest {
@@ -59,7 +59,7 @@ public class PolicyEntityTest {
et.begin();
// Make sure the DB is clean
- em.createQuery("DELETE FROM PolicyDBDaoEntity").executeUpdate();
+ em.createQuery("DELETE FROM PolicyDbDaoEntity").executeUpdate();
em.createQuery("DELETE FROM PolicyEntity").executeUpdate();
em.createQuery("DELETE FROM ConfigurationDataEntity").executeUpdate();
em.createQuery("DELETE FROM ActionBodyEntity").executeUpdate();
@@ -605,7 +605,7 @@ public class PolicyEntityTest {
+ "\n with exception: " + e);
}
- // ****************Test the PolicyDBDaoEntity************************
+ // ****************Test the PolicyDbDaoEntity************************
// Create a transaction
EntityTransaction et3 = em.getTransaction();
@@ -613,29 +613,29 @@ public class PolicyEntityTest {
et3.begin();
// create one
- PolicyDBDaoEntity pe1 = new PolicyDBDaoEntity();
+ PolicyDbDaoEntity pe1 = new PolicyDbDaoEntity();
em.persist(pe1);
pe1.setDescription("This is pe1");
- pe1.setPolicyDBDaoUrl("http://123.45.2.456:2345");
+ pe1.setPolicyDbDaoUrl("http://123.45.2.456:2345");
// push it to the DB
em.flush();
// create another
- PolicyDBDaoEntity pe2 = new PolicyDBDaoEntity();
+ PolicyDbDaoEntity pe2 = new PolicyDbDaoEntity();
em.persist(pe2);
pe2.setDescription("This is pe2");
- pe2.setPolicyDBDaoUrl("http://789.01.2.345:2345");
+ pe2.setPolicyDbDaoUrl("http://789.01.2.345:2345");
// Print them to the log before flushing
- logger.debug("\n\n***********PolicyEntityTest: PolicyDBDaoEntity objects before flush********"
- + "\n policyDBDaoUrl-1 = " + pe1.getPolicyDBDaoUrl() + "\n description-1 = " + pe1.getDescription()
+ logger.debug("\n\n***********PolicyEntityTest: PolicyDbDaoEntity objects before flush********"
+ + "\n policyDbDaoUrl-1 = " + pe1.getPolicyDbDaoUrl() + "\n description-1 = " + pe1.getDescription()
+ "\n createdDate-1 = " + pe1.getCreatedDate() + "\n modifiedDate-1 " + pe1.getModifiedDate()
- + "\n*****************************************" + "\n policyDBDaoUrl-2 = " + pe2.getPolicyDBDaoUrl()
+ + "\n*****************************************" + "\n policyDbDaoUrl-2 = " + pe2.getPolicyDbDaoUrl()
+ "\n description-2 = " + pe2.getDescription() + "\n createdDate-2 = " + pe2.getCreatedDate()
+ "\n modifiedDate-2 " + pe2.getModifiedDate());
@@ -644,36 +644,36 @@ public class PolicyEntityTest {
// Now let's retrieve them from the DB using the named query
- resultList = em.createNamedQuery("PolicyDBDaoEntity.findAll").getResultList();
+ resultList = em.createNamedQuery("PolicyDbDaoEntity.findAll").getResultList();
- PolicyDBDaoEntity pex = null;
- PolicyDBDaoEntity pey = null;
+ PolicyDbDaoEntity pex = null;
+ PolicyDbDaoEntity pey = null;
if (!resultList.isEmpty()) {
if (resultList.size() != 2) {
- fail("\nPolicyEntityTest: Number of PolicyDBDaoEntity entries = " + resultList.size()
+ fail("\nPolicyEntityTest: Number of PolicyDbDaoEntity entries = " + resultList.size()
+ " instead of 2");
}
for (Object policyDBDaoEntity : resultList) {
- PolicyDBDaoEntity pdbdao = (PolicyDBDaoEntity) policyDBDaoEntity;
- if (pdbdao.getPolicyDBDaoUrl().equals("http://123.45.2.456:2345")) {
+ PolicyDbDaoEntity pdbdao = (PolicyDbDaoEntity) policyDBDaoEntity;
+ if (pdbdao.getPolicyDbDaoUrl().equals("http://123.45.2.456:2345")) {
pex = pdbdao;
- } else if (pdbdao.getPolicyDBDaoUrl().equals("http://789.01.2.345:2345")) {
+ } else if (pdbdao.getPolicyDbDaoUrl().equals("http://789.01.2.345:2345")) {
pey = pdbdao;
}
}
// Print them to the log before flushing
- logger.debug("\n\n***********PolicyEntityTest: PolicyDBDaoEntity objects retrieved from DB********"
- + "\n policyDBDaoUrl-x = " + pex.getPolicyDBDaoUrl() + "\n description-x = "
+ logger.debug("\n\n***********PolicyEntityTest: PolicyDbDaoEntity objects retrieved from DB********"
+ + "\n policyDbDaoUrl-x = " + pex.getPolicyDbDaoUrl() + "\n description-x = "
+ pex.getDescription() + "\n createdDate-x = " + pex.getCreatedDate() + "\n modifiedDate-x "
+ pex.getModifiedDate() + "\n*****************************************"
- + "\n policyDBDaoUrl-y = "
- + pey.getPolicyDBDaoUrl() + "\n description-y = " + pey.getDescription()
+ + "\n policyDbDaoUrl-y = "
+ + pey.getPolicyDbDaoUrl() + "\n description-y = " + pey.getDescription()
+ "\n createdDate-y = "
+ pey.getCreatedDate() + "\n modifiedDate-y " + pey.getModifiedDate());
// Verify the retrieved objects are the same as the ones we stored in the DB
- if (pex.getPolicyDBDaoUrl().equals("http://123.45.2.456:2345")) {
+ if (pex.getPolicyDbDaoUrl().equals("http://123.45.2.456:2345")) {
assertSame(pe1, pex);
assertSame(pe2, pey);
} else {
@@ -682,46 +682,46 @@ public class PolicyEntityTest {
}
} else {
- fail("\nPolicyEntityTest: No PolicyDBDaoEntity DB entry found");
+ fail("\nPolicyEntityTest: No PolicyDbDaoEntity DB entry found");
}
- // Now let's see if we can do an update on the PolicyDBDaoEntity which we retrieved.
+ // Now let's see if we can do an update on the PolicyDbDaoEntity which we retrieved.
// em.persist(pex);
pex.setDescription("This is pex");
em.flush();
// retrieve it
- Query createPolicyQuery = em.createQuery("SELECT p FROM PolicyDBDaoEntity p WHERE p.description=:desc");
+ Query createPolicyQuery = em.createQuery("SELECT p FROM PolicyDbDaoEntity p WHERE p.description=:desc");
resultList = createPolicyQuery.setParameter("desc", "This is pex").getResultList();
- PolicyDBDaoEntity pez = null;
+ PolicyDbDaoEntity pez = null;
if (!resultList.isEmpty()) {
if (resultList.size() != 1) {
- fail("\nPolicyEntityTest: Update Test - Number of PolicyDBDaoEntity entries = " + resultList.size()
+ fail("\nPolicyEntityTest: Update Test - Number of PolicyDbDaoEntity entries = " + resultList.size()
+ " instead of 1");
}
- pez = (PolicyDBDaoEntity) resultList.get(0);
+ pez = (PolicyDbDaoEntity) resultList.get(0);
// Print them to the log before flushing
logger.debug(
- "\n\n***********PolicyEntityTest: Update Test - PolicyDBDaoEntity objects retrieved from "
+ "\n\n***********PolicyEntityTest: Update Test - PolicyDbDaoEntity objects retrieved from "
+ "DB********"
- + "\n policyDBDaoUrl-x = " + pex.getPolicyDBDaoUrl() + "\n description-x = "
+ + "\n policyDbDaoUrl-x = " + pex.getPolicyDbDaoUrl() + "\n description-x = "
+ pex.getDescription() + "\n createdDate-x = " + pex.getCreatedDate()
+ "\n modifiedDate-x " + pex.getModifiedDate()
- + "\n*****************************************" + "\n policyDBDaoUrl-z = "
- + pez.getPolicyDBDaoUrl() + "\n description-z = " + pez.getDescription()
+ + "\n*****************************************" + "\n policyDbDaoUrl-z = "
+ + pez.getPolicyDbDaoUrl() + "\n description-z = " + pez.getDescription()
+ "\n createdDate-z = " + pez.getCreatedDate() + "\n modifiedDate-z "
+ pez.getModifiedDate());
// Verify the retrieved objects are the same as the ones we stored in the DB
assertSame(pex, pez);
} else {
- fail("\nPolicyEntityTest: Update Test - No PolicyDBDaoEntity DB updated entry found");
+ fail("\nPolicyEntityTest: Update Test - No PolicyDbDaoEntity DB updated entry found");
}
// Clean up the DB
- em.createQuery("DELETE FROM PolicyDBDaoEntity").executeUpdate();
+ em.createQuery("DELETE FROM PolicyDbDaoEntity").executeUpdate();
em.createQuery("DELETE FROM PolicyEntity").executeUpdate();
em.createQuery("DELETE FROM ConfigurationDataEntity").executeUpdate();
em.createQuery("DELETE FROM ActionBodyEntity").executeUpdate();
diff --git a/ONAP-PAP-REST/src/test/resources/dictionaryImport/PEPOptions.csv b/ONAP-PAP-REST/src/test/resources/dictionaryImport/PepOptions.csv
index 61adca140..61adca140 100644
--- a/ONAP-PAP-REST/src/test/resources/dictionaryImport/PEPOptions.csv
+++ b/ONAP-PAP-REST/src/test/resources/dictionaryImport/PepOptions.csv