summaryrefslogtreecommitdiffstats
path: root/integrity-audit/src/main
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-07-03 14:04:48 -0400
committerJim Hahn <jrh3@att.com>2019-07-03 15:37:19 -0400
commit53f9550501ca1854318c1f552b0aba2e255b6748 (patch)
tree7880100f7af979c83c1ea1f06b001acacefa3c2b /integrity-audit/src/main
parent7bdb762dca351370630050d544b68c0d7972fb43 (diff)
Fix remaining sonar issues in Integrity Audit
Renamed enums to upper case - this might disrupt other repos, though it should be minimal. Renamed constants in a junit test. Change-Id: Ifd864bb61eec3d9b3c7a0321fe3841696046f6f6 Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'integrity-audit/src/main')
-rw-r--r--integrity-audit/src/main/java/org/onap/policy/common/ia/AuditThread.java2
-rw-r--r--integrity-audit/src/main/java/org/onap/policy/common/ia/DbDao.java2
-rw-r--r--integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAudit.java9
-rw-r--r--integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAuditProperties.java2
4 files changed, 8 insertions, 7 deletions
diff --git a/integrity-audit/src/main/java/org/onap/policy/common/ia/AuditThread.java b/integrity-audit/src/main/java/org/onap/policy/common/ia/AuditThread.java
index 25bafdc4..25335540 100644
--- a/integrity-audit/src/main/java/org/onap/policy/common/ia/AuditThread.java
+++ b/integrity-audit/src/main/java/org/onap/policy/common/ia/AuditThread.java
@@ -131,7 +131,7 @@ public class AuditThread extends Thread {
* other nodes of similar type.
*/
dbDao = new DbDao(this.resourceName, this.persistenceUnit, this.properties);
- this.nodeType = properties.getProperty(IntegrityAuditProperties.NODE_TYPE);
+ this.nodeType = properties.getProperty(IntegrityAuditProperties.NODE_TYPE).toLowerCase();
}
diff --git a/integrity-audit/src/main/java/org/onap/policy/common/ia/DbDao.java b/integrity-audit/src/main/java/org/onap/policy/common/ia/DbDao.java
index 0235715d..80177b30 100644
--- a/integrity-audit/src/main/java/org/onap/policy/common/ia/DbDao.java
+++ b/integrity-audit/src/main/java/org/onap/policy/common/ia/DbDao.java
@@ -143,7 +143,7 @@ public class DbDao {
this.dbUrl = properties.getProperty(IntegrityAuditProperties.DB_URL).trim();
this.dbUser = properties.getProperty(IntegrityAuditProperties.DB_USER).trim();
this.siteName = properties.getProperty(IntegrityAuditProperties.SITE_NAME).trim();
- this.nodeType = properties.getProperty(IntegrityAuditProperties.NODE_TYPE).trim();
+ this.nodeType = properties.getProperty(IntegrityAuditProperties.NODE_TYPE).trim().toLowerCase();
this.properties = properties;
logger.debug("DbDao.assignProperties: exit:" + "\nresourceName: " + this.resourceName + "\npersistenceUnit: "
+ this.persistenceUnit + "\nproperties: " + this.properties);
diff --git a/integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAudit.java b/integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAudit.java
index 61bf947e..41aea118 100644
--- a/integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAudit.java
+++ b/integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAudit.java
@@ -105,7 +105,7 @@ public class IntegrityAudit {
*/
public static boolean isNodeTypeEnum(String nt) {
for (NodeTypeEnum n : NodeTypeEnum.values()) {
- if (n.toString().equals(nt)) {
+ if (n.toString().equalsIgnoreCase(nt)) {
return true;
}
}
@@ -171,11 +171,12 @@ public class IntegrityAudit {
} else {
nodeType = nodeType.trim();
if (!isNodeTypeEnum(nodeType)) {
- String nodetypes = "nodeType must be one of[";
+ badparams.append("nodeType must be one of[");
for (NodeTypeEnum n : NodeTypeEnum.values()) {
- nodetypes = nodetypes.concat(n.toString() + " ");
+ badparams.append(n.toString());
+ badparams.append(' ');
}
- badparams.append(nodetypes + "] ");
+ badparams.append("] ");
return true;
}
}
diff --git a/integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAuditProperties.java b/integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAuditProperties.java
index 2ca5dd58..40b2af5a 100644
--- a/integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAuditProperties.java
+++ b/integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAuditProperties.java
@@ -35,7 +35,7 @@ public class IntegrityAuditProperties {
public static final String NODE_TYPE = "node_type";
public enum NodeTypeEnum {
- pdp_xacml, pdp_drools, pap, pap_admin, logparser, brms_gateway, astra_gateway, elk_server, pypdp
+ PDP_XACML, PDP_DROOLS, PAP, PAP_ADMIN, LOGPARSER, BRMS_GATEWAY, ASTRA_GATEWAY, ELK_SERVER, PYPDP
}