From 4f31da1340af41cbef81621999c7e3ad63d02b21 Mon Sep 17 00:00:00 2001 From: edyta Date: Fri, 17 Apr 2020 15:02:08 +0200 Subject: Fix sonar issue EventJob Issue-ID: INT-1517 Signed-off-by: Edyta Krukowska Change-Id: I973fe6d5854d50d93a6bf874d3066b6137a6012b --- .../org/onap/pnfsimulator/simulator/scheduler/EventJob.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pnfsimulator/src/main/java/org/onap/pnfsimulator/simulator/scheduler/EventJob.java b/pnfsimulator/src/main/java/org/onap/pnfsimulator/simulator/scheduler/EventJob.java index c4b40fc..6e4411d 100644 --- a/pnfsimulator/src/main/java/org/onap/pnfsimulator/simulator/scheduler/EventJob.java +++ b/pnfsimulator/src/main/java/org/onap/pnfsimulator/simulator/scheduler/EventJob.java @@ -69,24 +69,25 @@ public class EventJob implements Job { LOGGER.error("Could not send event as client is not available"); } } + private Optional getHttpClientAdapter(JobDataMap jobDataMap, String vesUrl) { HttpClientAdapter adapter = null; try { adapter = (HttpClientAdapter) (jobDataMap.containsKey(CLIENT_ADAPTER) ? jobDataMap.get(CLIENT_ADAPTER) : - new HttpClientAdapterImpl(vesUrl, new SSLAuthenticationHelper())); + new HttpClientAdapterImpl(vesUrl, new SSLAuthenticationHelper())); } catch (MalformedURLException e) { LOGGER.error("Invalid format of vesServerUr: {}", vesUrl); - } catch (IOException | GeneralSecurityException e){ + } catch (IOException | GeneralSecurityException e) { LOGGER.error("Invalid configuration of client certificate"); } return Optional.ofNullable(adapter); } private void logEventDetails(String templateName, String vesUrl, String body, String jobKey) { - LOGGER.info(String.format("Job %s:Sending event to %s from template %s", - jobKey, vesUrl, templateName)); + LOGGER.info("Job {}:Sending event to {} from template {}", + jobKey, vesUrl, templateName); if (LOGGER.isDebugEnabled()) { - LOGGER.debug(String.format("Job %s: Request body %s", jobKey, body)); + LOGGER.debug("Job {}: Request body {}", jobKey, body); } } -- cgit 1.2.3-korg