Sonar Fix- AnsibleServerEmulator.java 70/92170/4
authordinesha <dineshgs@in.ibm.com>
Mon, 29 Jul 2019 07:39:51 +0000 (13:09 +0530)
committerTakamune Cho <takamune.cho@att.com>
Wed, 31 Jul 2019 14:13:04 +0000 (14:13 +0000)
Fixed Sonar issues accross the file

Issue-ID: APPC-1669
Change-Id: I49db3c6c23f5cf61fe8d898662abaeb14f7c4422
Signed-off-by: dinesha <dineshgs@in.ibm.com>
appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/impl/AnsibleAdapterImpl.java
appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleServerEmulator.java

index 971730e..0ef64d5 100644 (file)
@@ -495,7 +495,7 @@ public class AnsibleAdapterImpl implements AnsibleAdapter {
             httpClientLocal.close();
           }
         } else {
-            testResult = testServer.Post(agentUrl, payload);
+            testResult = testServer.post(agentUrl, payload);
         }
         return testResult;
     }
@@ -527,7 +527,7 @@ public class AnsibleAdapterImpl implements AnsibleAdapter {
                 httpClientLocal.close();
               }
             } else {
-                testResult = testServer.Get(agentUrl);
+                testResult = testServer.get(agentUrl);
             }
             if (testResult.getStatusCode() != AnsibleResultCodes.IO_EXCEPTION.getValue()
                     && testResult.getStatusCode() != AnsibleResultCodes.PENDING.getValue()) {
index a7e6af8..ccba34a 100644 (file)
@@ -55,7 +55,7 @@ public class AnsibleServerEmulator {
      * Returns an ansible object result. The response code is always the http code 200 (i.e connection successful)
      * payload is json string as would be sent back by Ansible Server
      **/
-    public AnsibleResult Post(String agentUrl, String payload) {
+    public AnsibleResult post(String agentUrl, String payload) {
         AnsibleResult result = new AnsibleResult();
 
         try {
@@ -85,7 +85,7 @@ public class AnsibleServerEmulator {
      * payload is json string as would be sent back by Ansible Server
      *
      **/
-    public AnsibleResult Get(String agentUrl) {
+    public AnsibleResult get(String agentUrl) {
 
         Pattern pattern = Pattern.compile(".*?\\?Id=(.*?)&Type.*");
         Matcher matcher = pattern.matcher(agentUrl);
@@ -118,11 +118,11 @@ public class AnsibleServerEmulator {
         return getResult;
     }
 
-    private void rejectRequest(AnsibleResult result, String Message) {
+    private void rejectRequest(AnsibleResult result, String message) {
         result.setStatusCode(200);
         JSONObject response = new JSONObject();
         response.put(STATUS_CODE, AnsibleResultCodes.REJECTED.getValue());
-        response.put(STATUS_MESSAGE, Message);
+        response.put(STATUS_MESSAGE, message);
         result.setStatusMessage(response.toString());
     }