aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorraviteja.karumuri <raviteja.karumuri@est.tech>2024-09-13 14:05:51 +0100
committerraviteja.karumuri <raviteja.karumuri@est.tech>2024-09-13 14:05:51 +0100
commit1acaa80b1a3dd1fa32f0fa1da7f4c94d3c93741b (patch)
tree369b2ce40425f316b00bdf5499c93e0a6f25e27d
parent151a0f682982470b4de366ad5723af062bda83a4 (diff)
Improve tests/issues found in Sonar report - A1 Oslo/NewDelhi/Montreal/London- Part6 -Londonlondon
Issue-ID: CCSDK-4037 Change-Id: Ibbc4ad63cdc339b8ab20683c43470e245ef47f37 Signed-off-by: Raviteja Karumuri <raviteja.karumuri@est.tech>
-rw-r--r--a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyController.java2
-rw-r--r--a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java3
2 files changed, 2 insertions, 3 deletions
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyController.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyController.java
index f4718063..43f047ae 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyController.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyController.java
@@ -182,7 +182,7 @@ public class PolicyController {
@RequestHeader Map<String, String> headers) throws EntityNotFoundException {
Policy policy = policies.getPolicy(id);
return authorization.doAccessControl(headers, policy, AccessType.READ) //
- .map(x -> new ResponseEntity<>((Object) gson.toJson(toPolicyInfo(policy)), HttpStatus.OK)) //
+ .map(x -> new ResponseEntity<Object>(gson.toJson(toPolicyInfo(policy)), HttpStatus.OK)) //
.onErrorResume(this::handleException);
}
diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java
index 63b5af87..5eb1a854 100644
--- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java
+++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java
@@ -96,7 +96,6 @@ import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.test.context.TestPropertySource;
import org.springframework.util.FileSystemUtils;
-import org.springframework.web.reactive.function.client.WebClientRequestException;
import org.springframework.web.reactive.function.client.WebClientResponseException;
import reactor.core.publisher.Mono;
@@ -220,7 +219,7 @@ class ApplicationTest {
@Test
@DisplayName("test ZZ Actuator")
- void testZZActuator() throws Exception {
+ void testZZActuator() {
// The test must be run last, hence the "ZZ" in the name. All succeeding tests
// will fail.
AsyncRestClient client = restClient(baseUrl(), false);