Fix sonar issues in CamundaCockpitController 58/82658/1
authorburdziak <olaf.burdziakowski@nokia.com>
Tue, 19 Mar 2019 10:16:43 +0000 (11:16 +0100)
committerburdziak <olaf.burdziakowski@nokia.com>
Tue, 19 Mar 2019 10:16:43 +0000 (11:16 +0100)
Change-Id: I0bc13626a91a55c8e324bfd69f02ce7841350cf3
Issue-ID: PORTAL-523
Signed-off-by: burdziak <olaf.burdziakowski@nokia.com>
ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/CamundaCockpitController.java

index c43b4ac..4c32b96 100644 (file)
@@ -59,20 +59,22 @@ import org.springframework.web.bind.annotation.ResponseBody;
 
 @Controller
 @RequestMapping("/") 
-public class CamundaCockpitController extends RestrictedBaseController {               
+public class CamundaCockpitController extends RestrictedBaseController {
+
+       private static final String CAMUNDA_COCKPIT_LINK = "camunda_cockpit_link";
        @SuppressWarnings("rawtypes")
        @RequestMapping(value = {"/get_camunda_cockpit_link" }, method = RequestMethod.GET, produces = "application/json")
        @ResponseBody
        public Map getCamundaCockpitLink(HttpServletRequest request,HttpServletResponse response) {
-               Map<String,String> map = new HashMap<String,String>();
+               Map<String,String> map = new HashMap<>();
                String camundaCockpitUrl = "";
                String camundaCockpitlinkDefined = "false";
-               if (SystemProperties.containsProperty("camunda_cockpit_link")){
-                       camundaCockpitUrl = SystemProperties.getProperty("camunda_cockpit_link");
+               if (SystemProperties.containsProperty(CAMUNDA_COCKPIT_LINK)){
+                       camundaCockpitUrl = SystemProperties.getProperty(CAMUNDA_COCKPIT_LINK);
                        camundaCockpitlinkDefined = "true";
                };
                map.put("link_defined", camundaCockpitlinkDefined);
-               map.put("camunda_cockpit_link", camundaCockpitUrl);                             
+               map.put(CAMUNDA_COCKPIT_LINK, camundaCockpitUrl);
                return map;             
        };
 }