diff options
author | 2020-04-21 09:13:14 +0200 | |
---|---|---|
committer | 2020-04-21 09:13:14 +0200 | |
commit | 947aac66eb03dc62a5f93e798325a3ad30e3c10d (patch) | |
tree | bd573b82896e9d2bc65ff7cb2bf611545a899acb /pnfsimulator/src/main/java/org/onap/pnfsimulator/rest | |
parent | 245f62cd9e2a0ced2be03e5fff04fa86ea505596 (diff) |
Resolve checkstyle warnings in PNF simulator
Issue-ID: INT-1517
Signed-off-by: Bartosz Gardziejewski <bartosz.gardziejewski@nokia.com>
Change-Id: I43e9f129c24ef33d93b550600e4dd850f881126b
Diffstat (limited to 'pnfsimulator/src/main/java/org/onap/pnfsimulator/rest')
-rw-r--r-- | pnfsimulator/src/main/java/org/onap/pnfsimulator/rest/SimulatorController.java | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/pnfsimulator/src/main/java/org/onap/pnfsimulator/rest/SimulatorController.java b/pnfsimulator/src/main/java/org/onap/pnfsimulator/rest/SimulatorController.java index 0e4bd56..75a7b74 100644 --- a/pnfsimulator/src/main/java/org/onap/pnfsimulator/rest/SimulatorController.java +++ b/pnfsimulator/src/main/java/org/onap/pnfsimulator/rest/SimulatorController.java @@ -52,7 +52,6 @@ import org.springframework.web.bind.annotation.RestController; import javax.validation.Valid; import java.io.IOException; -import java.net.MalformedURLException; import java.security.GeneralSecurityException; import java.text.DateFormat; import java.text.SimpleDateFormat; @@ -60,13 +59,13 @@ import java.util.List; import java.util.Map; import java.util.UUID; -import static org.onap.pnfsimulator.logging.MDCVariables.INSTANCE_UUID; -import static org.onap.pnfsimulator.logging.MDCVariables.INVOCATION_ID; -import static org.onap.pnfsimulator.logging.MDCVariables.REQUEST_ID; -import static org.onap.pnfsimulator.logging.MDCVariables.RESPONSE_CODE; -import static org.onap.pnfsimulator.logging.MDCVariables.SERVICE_NAME; -import static org.onap.pnfsimulator.logging.MDCVariables.X_INVOCATION_ID; -import static org.onap.pnfsimulator.logging.MDCVariables.X_ONAP_REQUEST_ID; +import static org.onap.pnfsimulator.logging.MdcVariables.INSTANCE_UUID; +import static org.onap.pnfsimulator.logging.MdcVariables.INVOCATION_ID; +import static org.onap.pnfsimulator.logging.MdcVariables.REQUEST_ID; +import static org.onap.pnfsimulator.logging.MdcVariables.RESPONSE_CODE; +import static org.onap.pnfsimulator.logging.MdcVariables.SERVICE_NAME; +import static org.onap.pnfsimulator.logging.MdcVariables.X_INVOCATION_ID; +import static org.onap.pnfsimulator.logging.MdcVariables.X_ONAP_REQUEST_ID; import static org.onap.pnfsimulator.rest.util.ResponseBuilder.MESSAGE; import static org.onap.pnfsimulator.rest.util.ResponseBuilder.TIMESTAMP; import static org.springframework.http.HttpStatus.ACCEPTED; @@ -118,13 +117,12 @@ public class SimulatorController { return buildResponse(BAD_REQUEST, ImmutableMap.of(MESSAGE, String .format(INCORRECT_TEMPLATE_MESSAGE, triggerEventRequest.getTemplateName(), e.getMessage()))); - } catch (GeneralSecurityException e ){ - MDC.put(RESPONSE_CODE, INTERNAL_SERVER_ERROR.toString() ); + } catch (GeneralSecurityException e) { + MDC.put(RESPONSE_CODE, INTERNAL_SERVER_ERROR.toString()); LOGGER.error("Client certificate validation failed: {}", e.getMessage()); return buildResponse(INTERNAL_SERVER_ERROR, ImmutableMap.of(MESSAGE, "Invalid or misconfigured client certificate")); - } - catch (IOException e) { + } catch (IOException e) { MDC.put(RESPONSE_CODE, BAD_REQUEST.toString()); LOGGER.warn("Json validation failed: {}", e.getMessage()); return buildResponse(BAD_REQUEST, @@ -179,7 +177,7 @@ public class SimulatorController { @PostMapping("event") public ResponseEntity sendEventDirectly(@RequestHeader HttpHeaders headers, @Valid @RequestBody FullEvent event) - throws IOException, GeneralSecurityException{ + throws IOException, GeneralSecurityException { logContextHeaders(headers, "/simulator/event"); LOGGER.info(ENTRY, "Trying to send one-time event directly to VES Collector"); simulatorService.triggerOneTimeEvent(event); |