From aead9be9cd5aad06f30f15a8c99d68a7108971c2 Mon Sep 17 00:00:00 2001 From: dinesha Date: Mon, 29 Jul 2019 13:09:51 +0530 Subject: Sonar Fix- AnsibleServerEmulator.java Fixed Sonar issues accross the file Issue-ID: APPC-1669 Change-Id: I49db3c6c23f5cf61fe8d898662abaeb14f7c4422 Signed-off-by: dinesha --- .../org/onap/appc/adapter/ansible/impl/AnsibleAdapterImpl.java | 4 ++-- .../onap/appc/adapter/ansible/model/AnsibleServerEmulator.java | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/impl/AnsibleAdapterImpl.java b/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/impl/AnsibleAdapterImpl.java index 971730eba..0ef64d5ce 100644 --- a/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/impl/AnsibleAdapterImpl.java +++ b/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/impl/AnsibleAdapterImpl.java @@ -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()) { diff --git a/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleServerEmulator.java b/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleServerEmulator.java index a7e6af8ee..ccba34a53 100644 --- a/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleServerEmulator.java +++ b/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleServerEmulator.java @@ -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()); } -- cgit 1.2.3-korg