summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorniranjana <niranjana.y60@wipro.com>2020-02-27 18:24:48 +0530
committerniranjana <niranjana.y60@wipro.com>2020-02-27 18:24:48 +0530
commitfcd3a920e7c4f1bea70797caef5d0a14e26f9269 (patch)
tree5fa8ef7a8a1e4402e44c572f5ff998102fe49a8c /src/main/java
parent4df89dfce2ef6ad2a0d28e8750822c594529ae25 (diff)
Increase code coverage
Issue-ID: DCAEGEN2-2023 Signed-off-by: niranjana <niranjana.y60@wipro.com> Change-Id: Ifbc6817108fbbdfe21a4aa0f94cbb67c422c73c6
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/onap/dcaegen2/services/sonhms/Application.java1
-rw-r--r--src/main/java/org/onap/dcaegen2/services/sonhms/SonController.java2
-rw-r--r--src/main/java/org/onap/dcaegen2/services/sonhms/controller/HealthCheck.java2
-rw-r--r--src/main/java/org/onap/dcaegen2/services/sonhms/dmaap/PolicyDmaapClient.java2
4 files changed, 4 insertions, 3 deletions
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<HttpStatus> healthCheck() {
+ public ResponseEntity<HttpStatus> 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");