Fix small sonar issues 91/138891/1
authoradheli.tavares <adheli.tavares@est.tech>
Tue, 3 Sep 2024 10:23:13 +0000 (11:23 +0100)
committeradheli.tavares <adheli.tavares@est.tech>
Tue, 3 Sep 2024 10:26:29 +0000 (11:26 +0100)
Issue-ID: POLICY-5068
Change-Id: I2f58c2e8ef510ebdd48cb90b713eb95822ff1fb8
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
main/src/test/java/org/onap/policy/pap/main/comm/PdpRequestsTest.java
main/src/test/java/org/onap/policy/pap/main/comm/PublisherTest.java
main/src/test/java/org/onap/policy/pap/main/comm/TimerManagerTest.java
main/src/test/java/org/onap/policy/pap/main/comm/msgdata/StateChangeReqTest.java
main/src/test/java/org/onap/policy/pap/main/notification/PolicyNotifierTest.java
main/src/test/java/org/onap/policy/pap/main/service/ToscaServiceTemplateServiceTest.java

index 865ad7a..8bafdd2 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP PAP
  * ================================================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023-2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -45,6 +45,7 @@ class PdpRequestsTest extends CommonRequestBase {
     /**
      * Sets up.
      */
+    @Override
     @BeforeEach
     public void setUp() {
         update = makeUpdateReq(PDP1, MY_GROUP, MY_SUBGROUP);
index 4eeeae1..4e83ef0 100644 (file)
@@ -4,7 +4,7 @@
  * ================================================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
- * Modifications Copyright (C) 2022-2023 Nordix Foundation.
+ * Modifications Copyright (C) 2022-2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -102,6 +102,7 @@ public class PublisherTest extends Threaded {
      *
      * @throws Exception if an error occurs
      */
+    @Override
     @BeforeEach
     public void setUp() throws Exception {
         super.setUp();
@@ -117,6 +118,7 @@ public class PublisherTest extends Threaded {
      *
      * @throws Exception if an error occurs
      */
+    @Override
     @AfterEach
     public void tearDown() throws Exception {
         TopicEndpointManager.getManager().getNoopTopicSink(PDP_PAP_TOPIC).unregister(listener);
index 67f3d36..94aa4da 100644 (file)
@@ -31,7 +31,6 @@ import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
 import java.util.function.Consumer;
-import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.onap.policy.pap.main.comm.TimerManager.Timer;
index 1ec2335..76e8612 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP PAP
  * ================================================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023-2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -46,6 +46,7 @@ class StateChangeReqTest extends CommonRequestBase {
      *
      * @throws Exception if an error occurs
      */
+    @Override
     @BeforeEach
     public void setUp() throws Exception {
         super.setUp();
index 8196dd7..3b99ab0 100644 (file)
@@ -30,7 +30,6 @@ import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.lenient;
 import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
 
 import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
 import jakarta.ws.rs.core.Response.Status;
index 04eacd5..032f44d 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2022 Bell Canada. All rights reserved.
- *  Modifications Copyright (C) 2022-2023 Nordix Foundation.
+ *  Modifications Copyright (C) 2022-2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -120,7 +120,7 @@ class ToscaServiceTemplateServiceTest {
     }
 
     @Test
-    void testGetPolicyList() throws PfModelException {
+    void testGetPolicyList() {
         assertThatThrownBy(() -> toscaService.getPolicyList(NAME, VERSION))
             .isInstanceOf(PfModelRuntimeException.class).hasRootCauseMessage(INVALID_VERSION_ERR_MSG);
 
@@ -134,7 +134,7 @@ class ToscaServiceTemplateServiceTest {
     }
 
     @Test
-    void testPolicyForMetadataSet() throws PfModelException {
+    void testPolicyForMetadataSet() {
         List<ToscaPolicy> policies = toscaService.getPolicyList("onap.restart.tca", VERSION_1);
 
         assertThat(policies.get(0).getMetadata()).containsEntry("metadataSet", nodeTemplate.getMetadata());