From fcd3a920e7c4f1bea70797caef5d0a14e26f9269 Mon Sep 17 00:00:00 2001 From: niranjana Date: Thu, 27 Feb 2020 18:24:48 +0530 Subject: Increase code coverage Issue-ID: DCAEGEN2-2023 Signed-off-by: niranjana Change-Id: Ifbc6817108fbbdfe21a4aa0f94cbb67c422c73c6 --- src/main/java/org/onap/dcaegen2/services/sonhms/Application.java | 1 + src/main/java/org/onap/dcaegen2/services/sonhms/SonController.java | 2 +- .../java/org/onap/dcaegen2/services/sonhms/controller/HealthCheck.java | 2 +- .../java/org/onap/dcaegen2/services/sonhms/dmaap/PolicyDmaapClient.java | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/org/onap/dcaegen2/services/sonhms/Application.java b/src/main/java/org/onap/dcaegen2/services/sonhms/Application.java index 71dabff..af98814 100644 --- a/src/main/java/org/onap/dcaegen2/services/sonhms/Application.java +++ b/src/main/java/org/onap/dcaegen2/services/sonhms/Application.java @@ -94,6 +94,7 @@ public class Application { Thread.sleep(10000); } catch (InterruptedException e) { log.debug("InterruptedException : {}", e); + Thread.currentThread().interrupt(); } log.info("after 10s sleep"); } diff --git a/src/main/java/org/onap/dcaegen2/services/sonhms/SonController.java b/src/main/java/org/onap/dcaegen2/services/sonhms/SonController.java index 3c7d6ac..54f9b8f 100644 --- a/src/main/java/org/onap/dcaegen2/services/sonhms/SonController.java +++ b/src/main/java/org/onap/dcaegen2/services/sonhms/SonController.java @@ -39,7 +39,7 @@ public class SonController { SonRequestsComponent pciRequestsComponent; @RequestMapping(value = "/callbackUrl", method = RequestMethod.POST) - String callBackUrl(@RequestBody AsyncResponseBody callback) { + public String callBackUrl(@RequestBody AsyncResponseBody callback) { log.debug("received request to callback url"); String async = callback.toString(); log.debug("AsyncResponseBody{}", async); diff --git a/src/main/java/org/onap/dcaegen2/services/sonhms/controller/HealthCheck.java b/src/main/java/org/onap/dcaegen2/services/sonhms/controller/HealthCheck.java index 322c113..4a7f8ce 100644 --- a/src/main/java/org/onap/dcaegen2/services/sonhms/controller/HealthCheck.java +++ b/src/main/java/org/onap/dcaegen2/services/sonhms/controller/HealthCheck.java @@ -30,7 +30,7 @@ import org.springframework.web.bind.annotation.RestController; @RestController public class HealthCheck { @RequestMapping(value = "/healthcheck", method = RequestMethod.GET) - ResponseEntity healthCheck() { + public ResponseEntity healthCheck() { return new ResponseEntity<>(HttpStatus.OK); } } diff --git a/src/main/java/org/onap/dcaegen2/services/sonhms/dmaap/PolicyDmaapClient.java b/src/main/java/org/onap/dcaegen2/services/sonhms/dmaap/PolicyDmaapClient.java index 1a8456f..0a9d329 100644 --- a/src/main/java/org/onap/dcaegen2/services/sonhms/dmaap/PolicyDmaapClient.java +++ b/src/main/java/org/onap/dcaegen2/services/sonhms/dmaap/PolicyDmaapClient.java @@ -103,9 +103,9 @@ public class PolicyDmaapClient { int status = payloadObject.getConfiguration().get(0).getStatus().getCode(); String statusToString = Integer.toString(status); log.info("response from policy, status code {}", statusToString); + return true; } - return true; } } catch (IOException e) { log.info("caught io exception while fetching policy response"); -- cgit 1.2.3-korg