Fix sonar issues 56/141556/1
authoradheli.tavares <adheli.tavares@est.tech>
Mon, 21 Jul 2025 11:03:52 +0000 (12:03 +0100)
committeradheli.tavares <adheli.tavares@est.tech>
Mon, 21 Jul 2025 11:04:12 +0000 (12:04 +0100)
Issue-ID: POLICY-5421
Change-Id: I928d5bf93e6cdee209389b2e77e6c868af99fd79
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
25 files changed:
main/src/main/java/org/onap/policy/pap/main/comm/msgdata/UpdateReq.java
main/src/test/java/org/onap/policy/pap/main/comm/PdpStatusMessageHandlerTest.java
main/src/test/java/org/onap/policy/pap/main/comm/PublisherTest.java
main/src/test/java/org/onap/policy/pap/main/notification/DeploymentStatusTest.java
main/src/test/java/org/onap/policy/pap/main/notification/DeploymentTrackerTest.java
main/src/test/java/org/onap/policy/pap/main/notification/PolicyNotifierTest.java
main/src/test/java/org/onap/policy/pap/main/parameters/TestPdpModifyRequestMapParams.java
main/src/test/java/org/onap/policy/pap/main/parameters/TestRequestParams.java
main/src/test/java/org/onap/policy/pap/main/rest/PapRestControllerV1Test.java
main/src/test/java/org/onap/policy/pap/main/rest/ProviderSuper.java
main/src/test/java/org/onap/policy/pap/main/rest/TestActuatorEndpoints.java
main/src/test/java/org/onap/policy/pap/main/rest/TestGroupData.java
main/src/test/java/org/onap/policy/pap/main/rest/TestHealthCheckRestControllerV1.java
main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupCreateOrUpdateProvider.java
main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupDeleteProvider.java
main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupDeployProvider.java
main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupHealthCheckProvider.java
main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyAuditManager.java
main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyComponentsHealthCheckProvider.java
main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyStatusProvider.java
main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyUndeployerImpl.java
main/src/test/java/org/onap/policy/pap/main/rest/TestProviderBase.java
main/src/test/java/org/onap/policy/pap/main/service/ToscaNodeTemplateServiceTest.java
main/src/test/java/org/onap/policy/pap/main/service/ToscaServiceTemplateServiceTest.java
main/src/test/java/org/onap/policy/pap/main/startstop/TestPapActivator.java

index 98c8e3b..cfdbe01 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP PAP
  * ================================================================================
  * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2021, 2024 Nordix Foundation.
+ * Modifications Copyright (C) 2021, 2024-2025 OpenInfra Foundation Europe. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -31,7 +31,7 @@ import java.util.Optional;
 import java.util.Set;
 import java.util.stream.Collectors;
 import lombok.Getter;
-import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.Strings;
 import org.onap.policy.models.pdp.concepts.PdpMessage;
 import org.onap.policy.models.pdp.concepts.PdpStatus;
 import org.onap.policy.models.pdp.concepts.PdpUpdate;
@@ -85,11 +85,11 @@ public class UpdateReq extends RequestImpl {
 
         PdpUpdate message = getMessage();
 
-        if (!StringUtils.equals(message.getPdpGroup(), response.getPdpGroup())) {
+        if (!Strings.CS.equals(message.getPdpGroup(), response.getPdpGroup())) {
             return "group does not match";
         }
 
-        if (!StringUtils.equals(message.getPdpSubgroup(), response.getPdpSubgroup())) {
+        if (!Strings.CS.equals(message.getPdpSubgroup(), response.getPdpSubgroup())) {
             return "subgroup does not match";
         }
 
@@ -169,11 +169,11 @@ public class UpdateReq extends RequestImpl {
     protected final boolean isSameContent(PdpUpdate second) {
         PdpUpdate first = getMessage();
 
-        if (!StringUtils.equals(first.getPdpGroup(), second.getPdpGroup())) {
+        if (!Strings.CS.equals(first.getPdpGroup(), second.getPdpGroup())) {
             return false;
         }
 
-        if (!StringUtils.equals(first.getPdpSubgroup(), second.getPdpSubgroup())) {
+        if (!Strings.CS.equals(first.getPdpSubgroup(), second.getPdpSubgroup())) {
             return false;
         }
 
index 5a88912..8c8e8e6 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023, 2025 OpenInfra Foundation Europe. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -43,7 +43,7 @@ import org.springframework.test.context.ActiveProfiles;
 class PdpStatusMessageHandlerTest {
 
     @BeforeAll
-    public static void setupClass() {
+    static void setupClass() {
         Registry.newRegistry();
     }
 
index 6189b0b..1c71ffa 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-2024 Nordix Foundation.
+ * Modifications Copyright (C) 2022-2025 OpenInfra Foundation Europe. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -48,7 +48,7 @@ import org.onap.policy.pap.main.PolicyPapException;
 import org.onap.policy.pap.main.parameters.CommonTestData;
 import org.onap.policy.pap.main.parameters.PapParameterGroup;
 
-public class PublisherTest extends Threaded {
+class PublisherTest extends Threaded {
 
     // these messages will have different request IDs
     private static final PdpStateChange MSG1 = new PdpStateChange();
@@ -84,7 +84,7 @@ public class PublisherTest extends Threaded {
      * Configures the topic and attaches a listener.
      */
     @BeforeAll
-    public static void setUpBeforeClass() {
+    static void setUpBeforeClass() {
         final PapParameterGroup parameterGroup = new CommonTestData().getPapParameterGroup(6969);
         TopicEndpointManager.getManager().shutdown();
 
@@ -93,7 +93,7 @@ public class PublisherTest extends Threaded {
     }
 
     @AfterAll
-    public static void tearDownAfterClass() {
+    static void tearDownAfterClass() {
         TopicEndpointManager.getManager().shutdown();
     }
 
index 188bece..31cb96a 100644 (file)
@@ -4,7 +4,7 @@
  * ================================================================================
  * Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023, 2025 OpenInfra Foundation Europe. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -54,7 +54,7 @@ import org.onap.policy.pap.main.PapConstants;
 import org.onap.policy.pap.main.notification.StatusAction.Action;
 import org.onap.policy.pap.main.service.PolicyStatusService;
 
-public class DeploymentStatusTest {
+class DeploymentStatusTest {
 
     private static final String VERSION = "1.2.3";
     private static final @NonNull String GROUP_A = "groupA";
@@ -89,7 +89,7 @@ public class DeploymentStatusTest {
      * Set up the meter registry for tests.
      */
     @BeforeAll
-    public static void setUpBeforeClass() {
+    static void setUpBeforeClass() {
         Registry.registerOrReplace(PapConstants.REG_METER_REGISTRY, new SimpleMeterRegistry());
     }
 
@@ -97,7 +97,7 @@ public class DeploymentStatusTest {
      * Tear down the meter registry after tests.
      */
     @AfterAll
-    public static void tearDownAfterClass() {
+    static void tearDownAfterClass() {
         Registry.unregister(PapConstants.REG_METER_REGISTRY);
     }
 
@@ -105,7 +105,7 @@ public class DeploymentStatusTest {
      * Sets up.
      */
     @BeforeEach
-    public void setUp() {
+    void setUp() {
         autoCloseable = MockitoAnnotations.openMocks(this);
         tracker = new DeploymentStatus(policyStatusService);
 
index 3c351e5..1107d1e 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023, 2025 OpenInfra Foundation Europe. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -54,7 +54,7 @@ class DeploymentTrackerTest {
      * Sets up test objects.
      */
     @BeforeEach
-    public void setUp() {
+    void setUp() {
         tracker = new DeploymentTracker();
         builder = PdpPolicyStatus.builder().deploy(true).state(State.SUCCESS).pdpGroup(MY_GROUP).pdpType(MY_PDP_TYPE)
             .policy(POLICY_A).policyType(POLICY_TYPE).pdpId(PDP_A);
index 3b99ab0..29b2ab1 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP PAP
  * ================================================================================
  * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2021, 2023-2024 Nordix Foundation.
+ * Modifications Copyright (C) 2021, 2023-2025 OpenInfra Foundation Europe. All rights reserved.
  * Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -81,7 +81,7 @@ class PolicyNotifierTest {
      * Creates various objects, including {@link #notifier}.
      */
     @BeforeEach
-    public void setUp() {
+    void setUp() {
         closeable = MockitoAnnotations.openMocks(this);
         lenient().when(policyStatusService.getGroupPolicyStatus(anyString())).thenReturn(Collections.emptyList());
         Registry.registerOrReplace(PapConstants.REG_METER_REGISTRY, new SimpleMeterRegistry());
index ae46e66..c33233b 100644 (file)
@@ -4,7 +4,7 @@
  * ================================================================================
  * Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023, 2025 OpenInfra Foundation Europe. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -52,7 +52,7 @@ class TestPdpModifyRequestMapParams {
      */
     @BeforeEach
     @SuppressWarnings("unchecked")
-    public void setUp() {
+    void setUp() {
         pub = mock(Publisher.class);
         disp = mock(RequestIdDispatcher.class);
         lock = new Object();
index f853f01..176cfcc 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, 2025 OpenInfra Foundation Europe. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -48,7 +48,7 @@ class TestRequestParams {
      */
     @BeforeEach
     @SuppressWarnings("unchecked")
-    public void setUp() {
+    void setUp() {
         pub = mock(Publisher.class);
         disp = mock(RequestIdDispatcher.class);
         lock = new Object();
index 93f73b0..68edbe1 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP PAP
  * ================================================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2021, 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2021, 2023, 2025 OpenInfra Foundation Europe. All rights reserved.
  * Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -45,13 +45,13 @@ class PapRestControllerV1Test {
     private BodyBuilder bldr;
 
     @BeforeEach
-    public void setUp() {
+    void setUp() {
         bldr = ResponseEntity.ok();
         closeable = MockitoAnnotations.openMocks(this);
     }
 
     @AfterEach
-    public void after() throws Exception {
+    void after() throws Exception {
         closeable.close();
     }
 
index 98ce403..2bdea75 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP PAP
  * ================================================================================
  * Copyright (C) 2019-2022 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2021-2024 Nordix Foundation.
+ * Modifications Copyright (C) 2021-2025 OpenInfra Foundation Europe. All rights reserved.
  * Modifications Copyright (C) 2022-2023 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -102,7 +102,7 @@ public class ProviderSuper {
      * Configures DAO, captors, and various mocks.
      */
     @BeforeEach
-    public void setUp() {
+    void setUp() {
 
         Registry.newRegistry();
 
@@ -129,7 +129,7 @@ public class ProviderSuper {
     }
 
     @AfterEach
-    public void tearDown() throws Exception {
+    void tearDown() throws Exception {
         closeable.close();
     }
 
index a1a16bf..415e21f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2022-2023 Nordix Foundation.
+ *  Copyright (C) 2022-2023, 2025 OpenInfra Foundation Europe. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -50,7 +50,7 @@ import org.springframework.web.context.WebApplicationContext;
 @AutoConfigureObservability
 @ContextConfiguration
 @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
-public class TestActuatorEndpoints {
+class TestActuatorEndpoints {
 
     @Autowired
     private WebApplicationContext context;
@@ -62,7 +62,7 @@ public class TestActuatorEndpoints {
         .httpBasic("policyAdmin", "zb!XztG34");
 
     @BeforeAll
-    public static void setupClass() {
+    static void setupClass() {
         Registry.newRegistry();
     }
 
index 4a33e9f..6a8e5c5 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, 2025 OpenInfra Foundation Europe. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -41,7 +41,7 @@ class TestGroupData {
      * Sets up.
      */
     @BeforeEach
-    public void setUp() {
+    void setUp() {
         oldGroup = new PdpGroup();
         oldGroup.setName(NAME);
 
index 036421a..bea6d1f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019, 2022-2024 Nordix Foundation.
+ *  Copyright (C) 2019, 2022-2025 OpenInfra Foundation Europe. All rights reserved.
  *  Modifications Copyright (C) 2019 AT&T Intellectual Property.
  *  Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
  * ================================================================================
@@ -31,8 +31,8 @@ import jakarta.ws.rs.client.SyncInvoker;
 import org.junit.jupiter.api.Test;
 import org.onap.policy.common.utils.report.HealthCheckReport;
 import org.onap.policy.models.base.PfModelRuntimeException;
-import org.springframework.boot.test.mock.mockito.MockBean;
 import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.bean.override.mockito.MockitoBean;
 
 /**
  * Class to perform unit test of {@link HealthCheckRestControllerV1}.
@@ -44,7 +44,7 @@ class TestHealthCheckRestControllerV1 extends CommonPapRestServer {
 
     private static final String HEALTHCHECK_ENDPOINT = "healthcheck";
 
-    @MockBean
+    @MockitoBean
     private PolicyStatusProvider policyStatusProvider;
 
     @Test
index b96b53f..a96d13a 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP PAP
  * ================================================================================
- * Copyright (C) 2019-2021, 2023-2024 Nordix Foundation.
+ * Copyright (C) 2019-2021, 2023-2025 OpenInfra Foundation Europe. All rights reserved.
  * Modifications Copyright (C) 2021 AT&T Intellectual Property.
  * Modifications Copyright (C) 2021-2022 Bell Canada. All rights reserved.
  * ================================================================================
@@ -51,7 +51,7 @@ import org.onap.policy.models.pdp.enums.PdpState;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 import org.onap.policy.pap.main.PapConstants;
 
-public class TestPdpGroupCreateOrUpdateProvider extends ProviderSuper {
+class TestPdpGroupCreateOrUpdateProvider extends ProviderSuper {
     private static final String EXPECTED_EXCEPTION = "expected exception";
 
     private static final String PDP2 = "pdpB";
@@ -61,7 +61,7 @@ public class TestPdpGroupCreateOrUpdateProvider extends ProviderSuper {
 
 
     @AfterAll
-    public static void tearDownAfterClass() {
+    static void tearDownAfterClass() {
         Registry.newRegistry();
     }
 
index 23a62f8..f9703ec 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP PAP
  * ================================================================================
  * Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2020-2024 Nordix Foundation.
+ * Modifications Copyright (C) 2020-2025 OpenInfra Foundation Europe. All rights reserved.
  * Modifications Copyright (C) 2021-2022 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -55,7 +55,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifierOptVersion;
 import org.onap.policy.pap.main.rest.ProviderBase.Updater;
 
-public class TestPdpGroupDeleteProvider extends ProviderSuper {
+class TestPdpGroupDeleteProvider extends ProviderSuper {
     private static final String EXPECTED_EXCEPTION = "expected exception";
     private static final String GROUP1_NAME = "groupA";
 
@@ -72,7 +72,7 @@ public class TestPdpGroupDeleteProvider extends ProviderSuper {
     private Updater updater;
 
     @AfterAll
-    public static void tearDownAfterClass() {
+    static void tearDownAfterClass() {
         Registry.newRegistry();
     }
 
index 6b9ecaf..a5231b6 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP PAP
  * ================================================================================
  * Copyright (C) 2019-2022 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2021, 2023-2024 Nordix Foundation.
+ * Modifications Copyright (C) 2021, 2023-2025 OpenInfra Foundation Europe. All rights reserved.
  * Modifications Copyright (C) 2021-2023 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -55,7 +55,7 @@ import org.onap.policy.models.pdp.concepts.PdpUpdate;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
 
-public class TestPdpGroupDeployProvider extends ProviderSuper {
+class TestPdpGroupDeployProvider extends ProviderSuper {
 
     private static final String EXPECTED_EXCEPTION = "expected exception";
     private static final String POLICY2_NAME = "policyB";
@@ -73,7 +73,7 @@ public class TestPdpGroupDeployProvider extends ProviderSuper {
     private PdpGroupDeployProvider prov;
 
     @AfterAll
-    public static void tearDownAfterClass() {
+    static void tearDownAfterClass() {
         Registry.newRegistry();
     }
 
index 59aa6d2..5409cf4 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019, 2023-2024 Nordix Foundation.
+ *  Copyright (C) 2019, 2023-2025 OpenInfra Foundation Europe. All rights reserved.
  *  Modifications Copyright (C) 2020-2022 Bell Canada. All rights reserved.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
@@ -65,7 +65,7 @@ class TestPdpGroupHealthCheckProvider {
      * Configures DAO and mocks.
      */
     @BeforeEach
-    public void setUp() {
+    void setUp() {
         autoCloseable = MockitoAnnotations.openMocks(this);
         Registry.newRegistry();
         groups = loadFile().getGroups();
@@ -74,7 +74,7 @@ class TestPdpGroupHealthCheckProvider {
     }
 
     @AfterEach
-    public void tearDown() throws Exception {
+    void tearDown() throws Exception {
         autoCloseable.close();
     }
 
index 9fa5948..ccc2e11 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2021, 2023-2024 Nordix Foundation.
+ *  Copyright (C) 2021, 2023-2025 OpenInfra Foundation Europe. All rights reserved.
  *  Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -35,7 +35,7 @@ import org.onap.policy.models.base.PfModelRuntimeException;
 import org.onap.policy.models.pap.concepts.PolicyAudit.AuditAction;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 
-public class TestPolicyAuditManager extends ProviderSuper {
+class TestPolicyAuditManager extends ProviderSuper {
 
     private static final ToscaConceptIdentifier MY_POLICY = new ToscaConceptIdentifier("myPolicy", "1.0.0");
     private static final String GROUP_A = "pdpGroup-A";
@@ -56,7 +56,7 @@ public class TestPolicyAuditManager extends ProviderSuper {
     }
 
     @AfterAll
-    public static void tearDownAfterClass() {
+    static void tearDownAfterClass() {
         Registry.newRegistry();
     }
 
index ddb8f0d..dfb478a 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2020, 2022-2024 Nordix Foundation.
+ *  Copyright (C) 2020, 2022-2025 OpenInfra Foundation Europe. All rights reserved.
  *  Modifications Copyright (C) 2020-2021 AT&T Corp.
  *  Modifications Copyright (C) 2020-2022 Bell Canada. All rights reserved.
  * ================================================================================
@@ -108,7 +108,7 @@ class TestPolicyComponentsHealthCheckProvider {
      * @throws Exception if an error occurs
      */
     @BeforeEach
-    public void setUp() throws Exception {
+    void setUp() throws Exception {
         autoCloseable = MockitoAnnotations.openMocks(this);
         groups = loadPdpGroupsFromFile().getGroups();
         when(pdpGroupService.getPdpGroups()).thenReturn(groups);
@@ -157,7 +157,7 @@ class TestPolicyComponentsHealthCheckProvider {
      * Tear down.
      */
     @AfterEach
-    public void tearDown() throws Exception {
+    void tearDown() throws Exception {
         if (savedPapParameterGroup != null) {
             ParameterService.register(savedPapParameterGroup, true);
         } else {
index 0eb4e7f..ae00104 100644 (file)
@@ -4,7 +4,7 @@
  * ================================================================================
  * Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2021-2022 Bell Canada. All rights reserved.
- * Modifications Copyright (C) 2021, 2023-2024 Nordix Foundation.
+ * Modifications Copyright (C) 2021, 2023-2025 OpenInfra Foundation Europe. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -44,7 +44,7 @@ import org.onap.policy.models.pdp.concepts.PdpPolicyStatus.State;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifierOptVersion;
 
-public class TestPolicyStatusProvider extends ProviderSuper {
+class TestPolicyStatusProvider extends ProviderSuper {
     private static final String MY_GROUP = "MyGroup";
     private static final String MY_PDP_TYPE = "MySubGroup";
     private static final @NonNull String POLICY_TYPE_VERSION = "1.0.3";
@@ -66,13 +66,12 @@ public class TestPolicyStatusProvider extends ProviderSuper {
     private PolicyStatusProvider prov;
 
     @AfterAll
-    public static void tearDownAfterClass() {
+    static void tearDownAfterClass() {
         Registry.newRegistry();
     }
 
     /**
      * Configures mocks and objects.
-     *
      */
     @Override
     @BeforeEach
index ccd0fe4..6f37b8d 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP PAP
  * ================================================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2021, 2023-2024 Nordix Foundation.
+ * Modifications Copyright (C) 2021, 2023-2025 OpenInfra Foundation Europe. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ import org.onap.policy.models.pdp.concepts.PdpGroup;
 import org.onap.policy.models.pdp.concepts.PdpSubGroup;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 
-public class TestPolicyUndeployerImpl extends ProviderSuper {
+class TestPolicyUndeployerImpl extends ProviderSuper {
     private static final String MY_GROUP = "my-group";
     private static final String MY_SUBGROUP = "my-subgroup";
     private static final String MY_SUBGROUP0 = "my-subgroup-0";
@@ -67,7 +67,7 @@ public class TestPolicyUndeployerImpl extends ProviderSuper {
 
 
     @AfterAll
-    public static void tearDownAfterClass() {
+    static void tearDownAfterClass() {
         Registry.newRegistry();
     }
 
index 70d25fd..b42f3c5 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP PAP
  * ================================================================================
  * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2021, 2023-2024 Nordix Foundation.
+ * Modifications Copyright (C) 2021, 2023-2025 OpenInfra Foundation Europe. All rights reserved.
  * Modifications Copyright (C) 2021-2022 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -52,7 +52,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
 import org.onap.policy.pap.main.PapConstants;
 import org.springframework.test.util.ReflectionTestUtils;
 
-public class TestProviderBase extends ProviderSuper {
+class TestProviderBase extends ProviderSuper {
     private static final String EXPECTED_EXCEPTION = "expected exception";
 
     private static final String POLICY1_NAME = "policyA";
@@ -71,7 +71,7 @@ public class TestProviderBase extends ProviderSuper {
     private MyProvider prov;
 
     @AfterAll
-    public static void tearDownAfterClass() {
+    static void tearDownAfterClass() {
         Registry.newRegistry();
     }
 
index 7b64c47..f9e209b 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP PAP
  * ================================================================================
- * Copyright (C) 2022-2023 Nordix Foundation. All rights reserved.
+ * Copyright (C) 2022-2023, 2025 OpenInfra Foundation Europe. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -64,7 +64,7 @@ class ToscaNodeTemplateServiceTest {
      * Set up for tests.
      */
     @BeforeEach
-    public void setup() throws CoderException {
+    void setup() throws CoderException {
         autoCloseable = MockitoAnnotations.openMocks(this);
         coder.decode(ResourceUtils.getResourceAsString("e2e/policyMetadataSet.yaml"),
                 ToscaServiceTemplate.class).getToscaTopologyTemplate().getNodeTemplates()
@@ -75,7 +75,7 @@ class ToscaNodeTemplateServiceTest {
     }
 
     @AfterEach
-    public void tearDown() throws Exception {
+    void tearDown() throws Exception {
         autoCloseable.close();
     }
 
index 032f44d..715edf8 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2022 Bell Canada. All rights reserved.
- *  Modifications Copyright (C) 2022-2024 Nordix Foundation.
+ *  Modifications Copyright (C) 2022-2025 OpenInfra Foundation Europe. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -86,7 +86,7 @@ class ToscaServiceTemplateServiceTest {
      * @throws CoderException the exception
      */
     @BeforeEach
-    public void setup() throws CoderException {
+    void setup() throws CoderException {
         autoCloseable = MockitoAnnotations.openMocks(this);
         coder.decode(ResourceUtils.getResourceAsString("e2e/policyMetadataSet.yaml"),
                 ToscaServiceTemplate.class).getToscaTopologyTemplate().getNodeTemplates()
@@ -115,7 +115,7 @@ class ToscaServiceTemplateServiceTest {
     }
 
     @AfterEach
-    public void tearDown() throws Exception {
+    void tearDown() throws Exception {
         autoCloseable.close();
     }
 
index c740d69..d5c63c3 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019, 2022-2024 Nordix Foundation.
+ *  Copyright (C) 2019, 2022-2025 OpenInfra Foundation Europe. All rights reserved.
  *  Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property.
  *  Modifications Copyright (C) 2021-2023 Bell Canada. All rights reserved.
  * ================================================================================
@@ -55,7 +55,7 @@ import org.onap.policy.pap.main.parameters.PapParameterGroup;
  *
  * @author Ram Krishna Verma (ram.krishna.verma@est.tech)
  */
-public class TestPapActivator {
+class TestPapActivator {
     private static final String CONFIG_FILE = "src/test/resources/parameters/TestConfigParams.json";
 
     private PapActivator activator;
@@ -64,7 +64,7 @@ public class TestPapActivator {
      * Allocates a new DB name, server port, and creates a config file.
      */
     @BeforeAll
-    public static void setUpBeforeClass() {
+    static void setUpBeforeClass() {
         Registry.newRegistry();
         CommonTestData.newDb();
     }
@@ -75,7 +75,7 @@ public class TestPapActivator {
      * @throws Exception if an error occurs
      */
     @BeforeEach
-    public void setUp() throws Exception {
+    void setUp() throws Exception {
         Registry.newRegistry();
         TopicEndpointManager.getManager().shutdown();
         HttpServletServerFactoryInstance.getServerFactory().destroy();
@@ -104,14 +104,14 @@ public class TestPapActivator {
      * @throws Exception if an error occurs
      */
     @AfterEach
-    public void teardown() throws Exception {
+    void teardown() throws Exception {
         if (activator != null && activator.isAlive()) {
             activator.stop();
         }
     }
 
     @AfterAll
-    public static void afterClass() {
+    static void afterClass() {
         Registry.newRegistry();
     }