From 33917aa3bd7ef8ad24e58f9c966eae3be2536961 Mon Sep 17 00:00:00 2001 From: uj426b Date: Tue, 9 Apr 2019 15:27:45 -0400 Subject: Add Additional Junit and fix Sonar new bug. Issue-ID: POLICY-1416 Signed-off-by: uj426b Change-Id: Ie4e6e91d555be448caa290bce36eb58075046619 Signed-off-by: uj426b --- .../onap/policy/pap/xacml/rest/handler/DictionaryHandlerImpl.java | 6 +++--- .../policy/controller/CreateDcaeMicroServiceControllerTest.java | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) 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 5fd0b9169..5fc737887 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 @@ -313,7 +313,7 @@ public class DictionaryHandlerImpl implements DictionaryHandler { response.addHeader("error", message); return; } - if (result.equalsIgnoreCase("Success")) { + if(("Success").equalsIgnoreCase(result)) { response.setStatus(HttpServletResponse.SC_OK); response.addHeader("successMapKey", "success"); if (operation.equalsIgnoreCase("update")) { @@ -321,10 +321,10 @@ public class DictionaryHandlerImpl implements DictionaryHandler { } else { response.addHeader("operation", "createDictionary"); } - } else if (result.equalsIgnoreCase("Duplicate")) { + } else if (("Duplicate").equalsIgnoreCase(result)) { response.setStatus(HttpServletResponse.SC_CONFLICT); response.addHeader("error", "dictionaryItemExists"); - } else if (result.equalsIgnoreCase("DuplicateGroup")) { + } else if (("DuplicateGroup").equalsIgnoreCase(result)) { response.setStatus(HttpServletResponse.SC_CONFLICT); response.addHeader("error", "duplicateGroup"); } else { diff --git a/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/CreateDcaeMicroServiceControllerTest.java b/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/CreateDcaeMicroServiceControllerTest.java index f5f8a18ae..e4ededa1f 100644 --- a/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/CreateDcaeMicroServiceControllerTest.java +++ b/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/CreateDcaeMicroServiceControllerTest.java @@ -163,10 +163,10 @@ public class CreateDcaeMicroServiceControllerTest { + "\"testttt\",\"Email Notification for failures\":\"sds@l.com\"," + "\"Select Server Scope\":\"testttt\",\"Parent Correlation Name\":" + "\"testttt\",\"Parent Correlation Traversal\":\"testttt\",\"logicalConnector\":" - + "\"OR\",\"triggerSignature@0.signatures.alarmSignatures@0.traversal\":\"testttt\"," - + "\"triggerSignature@0.signatures.alarmSignatures@0.alarmSignature@0.VnfType\":" - + "\" testttt\",\"triggerSignature@0.signatures.alarmSignatures@0." - + "alarmSignature@0.Contains\":\"AND\",\"triggerSignature@0.signatures." + + "\"OR\",\"triggerSignature@0.signaturesAlarm.alarmSignatures@0.traversal\":\"testttt\"," + + "\"triggerSignature@0.signaturesAlarm.alarmSignatures@0.alarmSignature@0.VnfType\":" + + "\" testttt\",\"triggerSignature@0.signaturesAlarm.alarmSignatures@0." + + "alarmSignature@0.Contains\":\"AND\",\"triggerSignature@0.signaturesAlarm." + "alarmSignatures@0.alarmSignature@0.FilterValue\":\"testttt\"}}"; configBodyString = "{\"service\":\"SniroPolicyEntityTest\",\"policyName\":\"someone\",\"description\":\"test\"," -- cgit 1.2.3-korg