Improve tests/issues found in Sonar report - A1 Oslo/NewDelhi/Montreal/London- Part6... 23/138923/1 london
authorraviteja.karumuri <raviteja.karumuri@est.tech>
Fri, 13 Sep 2024 13:05:51 +0000 (14:05 +0100)
committerraviteja.karumuri <raviteja.karumuri@est.tech>
Fri, 13 Sep 2024 13:05:51 +0000 (14:05 +0100)
Issue-ID: CCSDK-4037
Change-Id: Ibbc4ad63cdc339b8ab20683c43470e245ef47f37
Signed-off-by: Raviteja Karumuri <raviteja.karumuri@est.tech>
a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyController.java
a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java

index f471806..43f047a 100644 (file)
@@ -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);
     }
 
index 63b5af8..5eb1a85 100644 (file)
@@ -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);