diff options
author | 2017-09-15 13:49:38 +0000 | |
---|---|---|
committer | 2017-09-15 13:49:38 +0000 | |
commit | 65f1e2bfc7d34ed125055f5c881d44bd4f5d38d0 (patch) | |
tree | 2c1e405a3f68c22a68d8df8a4ae44a7613ebd152 /ONAP-PDP-REST/src | |
parent | 274e07a953f07192923193a7b49f2f268b43d994 (diff) | |
parent | e0385921034ae9ce860038ea65d2d13259f7cc4c (diff) |
Merge "Adding Junits for policy engine"
Diffstat (limited to 'ONAP-PDP-REST/src')
3 files changed, 6 insertions, 6 deletions
diff --git a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/ConfigPolicyService.java b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/ConfigPolicyService.java index c8d3d74d1..690e94a5e 100644 --- a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/ConfigPolicyService.java +++ b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/ConfigPolicyService.java @@ -82,12 +82,12 @@ public class ConfigPolicyService { message = XACMLErrorConstants.ERROR_DATA_ISSUE + "No Config Name given."; return false; } - message = PolicyUtils.emptyPolicyValidator(onapName); + message = PolicyUtils.policySpecialCharValidator(onapName); if(!message.contains("success")){ message = XACMLErrorConstants.ERROR_DATA_ISSUE+ message; return false; } - message = PolicyUtils.emptyPolicyValidator(configName); + message = PolicyUtils.policySpecialCharValidator(configName); if(!message.contains("success")){ message = XACMLErrorConstants.ERROR_DATA_ISSUE+ message; return false; diff --git a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/CreateUpdatePolicyServiceImpl.java b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/CreateUpdatePolicyServiceImpl.java index 945cdba8b..528e5cda9 100644 --- a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/CreateUpdatePolicyServiceImpl.java +++ b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/CreateUpdatePolicyServiceImpl.java @@ -234,12 +234,12 @@ public class CreateUpdatePolicyServiceImpl implements CreateUpdatePolicyService message = XACMLErrorConstants.ERROR_DATA_ISSUE + "No Policy Name given."; return false; } - message = PolicyUtils.emptyPolicyValidator(policyScope); + message = PolicyUtils.policySpecialCharValidator(policyScope); if(!message.contains("success")){ message = XACMLErrorConstants.ERROR_DATA_ISSUE+ message; return false; } - message = PolicyUtils.emptyPolicyValidator(policyName); + message = PolicyUtils.policySpecialCharValidator(policyName); if(!message.contains("success")){ message = XACMLErrorConstants.ERROR_DATA_ISSUE+ message; return false; diff --git a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/NotificationService.java b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/NotificationService.java index 6ca52ca40..bba51965b 100644 --- a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/NotificationService.java +++ b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/NotificationService.java @@ -99,7 +99,7 @@ public class NotificationService { dmaapServers = XACMLProperties.getProperty(XACMLRestProperties.PROP_NOTIFICATION_SERVERS); aafLogin = XACMLProperties.getProperty("DMAAP_AAF_LOGIN"); aafPassword = XACMLProperties.getProperty("DMAAP_AAF_PASSWORD"); - interval = Integer.parseInt(XACMLProperties.getProperty(XACMLRestProperties.PROP_NOTIFICATION_DELAY, Integer.toString(interval))); + interval = Integer.parseInt(XACMLProperties.getProperty("CLIENT_INTERVAL", Integer.toString(interval))); if(dmaapServers==null || aafLogin==null || aafPassword==null){ logger.error(XACMLErrorConstants.ERROR_DATA_ISSUE + "DMaaP properties are missing from the property file "); return; @@ -269,7 +269,7 @@ public class NotificationService { Date currentTime = new Date(); long timeDiff = 0; timeDiff = currentTime.getTime()-map.getValue().getTime(); - if(timeDiff < (interval+1500)){ + if(timeDiff > (interval+1500)){ removeTopic(map.getKey()); } } |