X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fadmin%2FPolicyNotificationMail.java;h=67d9c8813b40de170bdaeb1d713f81274d4a0768;hb=7f94862a50f552f840cbb2a84ee1c3e20fc3c708;hp=a4e4762000665d20f1fc3b8ce7f6b4bc4a7f719f;hpb=3c519a0d908c34e22d724d663ad3512f6cdd8d8f;p=policy%2Fengine.git diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/PolicyNotificationMail.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/PolicyNotificationMail.java index a4e476200..67d9c8813 100644 --- a/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/PolicyNotificationMail.java +++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/PolicyNotificationMail.java @@ -108,6 +108,9 @@ public class PolicyNotificationMail{ } String policyFileName = entityItem.getPolicyName(); String checkPolicyName = policyName; + if(checkPolicyName.endsWith(".xml") || checkPolicyName.contains(".")){ + checkPolicyName = checkPolicyName.substring(0, checkPolicyName.indexOf(".")); + } if(policyFileName.contains("/")){ policyFileName = policyFileName.substring(0, policyFileName.indexOf("/")); policyFileName = policyFileName.replace("/", File.separator); @@ -122,7 +125,12 @@ public class PolicyNotificationMail{ boolean sendFlag = false; SimpleBindings params = new SimpleBindings(); params.put("policyFileName", policyFileName); - List watchList = policyNotificationDao.getDataByQuery(query, params); + List watchList = null; + if(PolicyController.isjUnit()){ + watchList = policyNotificationDao.getDataByQuery(query, null); + }else{ + watchList = policyNotificationDao.getDataByQuery(query, params); + } if(watchList != null && !watchList.isEmpty()){ for(Object watch : watchList){ WatchPolicyNotificationTable list = (WatchPolicyNotificationTable) watch;