Fix public modifiers in tests 72/142172/1
authoradheli.tavares <adheli.tavares@est.tech>
Wed, 1 Oct 2025 09:51:09 +0000 (10:51 +0100)
committeradheli.tavares <adheli.tavares@est.tech>
Wed, 1 Oct 2025 09:56:08 +0000 (10:56 +0100)
Issue-ID: POLICY-5461
Change-Id: I6d27195b22d1a90532452884b3f655c5bfc7c85c
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
19 files changed:
models-base/src/test/java/org/onap/policy/models/base/PfKeyImplTest.java
models-dao/src/test/java/org/onap/policy/models/dao/EntityTest.java
models-interactions/model-impl/rest/src/test/java/org/onap/policy/rest/RestTest.java
models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/AaiSimulatorTest.java
models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/AppcLcmTopicServerTest.java
models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/AppcLegacyTopicServerTest.java
models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/SdnrTopicServerTest.java
models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/SoSimulatorTest.java
models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/TopicServerTest.java
models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/XacmlSimulatorTest.java
models-provider/src/test/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderTest.java
models-provider/src/test/java/org/onap/policy/models/provider/impl/PolicyToscaPersistenceTest.java
models-provider/src/test/java/org/onap/policy/models/provider/impl/PolicyTypePersistenceTest.java
models-provider/src/test/java/org/onap/policy/models/provider/revisionhierarchy/HierarchyFetchTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaEntityFilterTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaTypedEntityFilterTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderGenericTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderPolicyTypeTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaWithToscaPropertiesTest.java

index 5557c97..78bb663 100644 (file)
@@ -68,7 +68,7 @@ class PfKeyImplTest {
      * Sets data in Keys for the tests.
      */
     @BeforeAll
-    public static void setUp() {
+    static void setUp() {
         someKey = new MyKey();
 
         someKey0 = new MyKey();
index 35080d8..98339fb 100644 (file)
@@ -71,7 +71,7 @@ class EntityTest {
      * Closes the DAO.
      */
     @AfterAll
-    public static void tearDown() {
+    static void tearDown() {
         if (pfDao != null) {
             pfDao.close();
             pfDao = null;
index 1bc3d6e..8eff9fc 100644 (file)
@@ -56,7 +56,7 @@ import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInst
 import org.onap.policy.common.utils.network.NetworkUtil;
 
 @Path("RestTest")
-public class RestTest {
+public class RestTest {   // NOSONAR - class needs to be public for Jersey to work
     private static final String MERGE_PATCH_PLUS_JSON = "application/merge-patch+json";
 
     private static final String NAME_PARAM = "Bob";
@@ -85,7 +85,7 @@ public class RestTest {
      * Sets server endpoint for the tests.
      */
     @BeforeAll
-    public static void setUp() throws Exception {
+    static void setUp() throws Exception {
 
         port = NetworkUtil.allocPort();
         baseUri = "http://" + LOCALHOST + ":" + port + "/" + BASE + "/";
@@ -110,7 +110,7 @@ public class RestTest {
      *
      */
     @AfterAll
-    public static void tearDown() {
+    static void tearDown() {
         HttpServletServerFactoryInstance.getServerFactory().destroy();
     }
 
index 76fc928..6eb7d12 100644 (file)
@@ -41,7 +41,7 @@ class AaiSimulatorTest {
      * Set up test class.
      */
     @BeforeAll
-    public static void setUpSimulator() {
+    static void setUpSimulator() {
         try {
             var testServer = Util.buildAaiSim();
             assertNotNull(testServer);
@@ -51,7 +51,7 @@ class AaiSimulatorTest {
     }
 
     @AfterAll
-    public static void tearDownSimulator() {
+    static void tearDownSimulator() {
         HttpServletServerFactoryInstance.getServerFactory().destroy();
     }
 
index dc20355..9a5f892 100644 (file)
@@ -53,7 +53,7 @@ class AppcLcmTopicServerTest {
      * Sets up.
      */
     @BeforeEach
-    public void setUp() {
+    void setUp() {
         server = new AppcLcmTopicServer(sink, source);
     }
 
index 019a93a..2819ea0 100644 (file)
@@ -53,7 +53,7 @@ class SdnrTopicServerTest {
      * Sets up.
      */
     @BeforeEach
-    public void setUp() {
+    void setUp() {
         server = new SdnrTopicServer(sink, source);
     }
 
index 0a8edb5..ee60528 100644 (file)
@@ -55,7 +55,7 @@ class SoSimulatorTest {
      * Set up test class.
      */
     @BeforeAll
-    public static void setUpSimulator() {
+    static void setUpSimulator() {
         try {
             var testServer = Util.buildSoSim();
             assertNotNull(testServer);
@@ -65,7 +65,7 @@ class SoSimulatorTest {
     }
 
     @AfterAll
-    public static void tearDownSimulator() {
+    static void tearDownSimulator() {
         HttpServletServerFactoryInstance.getServerFactory().destroy();
         SoSimulatorJaxRs.setRequirePolling(false);
     }
index 24e9c93..45c51f0 100644 (file)
@@ -46,7 +46,7 @@ class XacmlSimulatorTest {
      * Set up test class.
      */
     @BeforeAll
-    public static void setupSimulator() {
+    static void setupSimulator() {
         try {
             var testServer = Util.buildXacmlSim();
             assertNotNull(testServer);
@@ -56,7 +56,7 @@ class XacmlSimulatorTest {
     }
 
     @AfterAll
-    public static void tearDownSimulator() {
+    static void tearDownSimulator() {
         HttpServletServerFactoryInstance.getServerFactory().destroy();
     }
 
index 0db2e0d..75a6ca0 100644 (file)
@@ -85,7 +85,7 @@ class DatabasePolicyModelsProviderTest {
      * Initialize parameters.
      */
     @BeforeAll
-    public static void setupParameters() {
+    static void setupParameters() {
         parameters = new PolicyModelsProviderParameters();
         parameters.setDatabaseDriver("org.h2.Driver");
         parameters.setDatabaseUrl("jdbc:h2:mem:DatabasePolicyModelsProviderTest");
@@ -98,7 +98,7 @@ class DatabasePolicyModelsProviderTest {
      * Closes the DB.
      */
     @AfterAll
-    public static void tearDown() throws PfModelException {
+    static void tearDown() throws PfModelException {
         if (databaseProvider != null) {
             databaseProvider.close();
         }
index 55b9f9a..430e4f0 100644 (file)
@@ -72,7 +72,7 @@ class PolicyToscaPersistenceTest {
      * @throws CoderException on JSON encoding and decoding errors
      */
     @BeforeAll
-    public static void setupParameters() throws Exception {
+    static void setupParameters() throws Exception {
 
         PolicyModelsProviderParameters parameters = new PolicyModelsProviderParameters();
 
@@ -90,7 +90,7 @@ class PolicyToscaPersistenceTest {
     }
 
     @AfterAll
-    public static void teardown() throws Exception {
+    static void teardown() throws Exception {
         databaseProvider.close();
     }
 
index 057af76..b3cdd7a 100644 (file)
@@ -58,7 +58,7 @@ class PolicyTypePersistenceTest {
      * @throws PfModelException on exceptions in the tests
      */
     @BeforeAll
-    public static void setupParameters() throws PfModelException {
+    static void setupParameters() throws PfModelException {
 
         PolicyModelsProviderParameters parameters = new PolicyModelsProviderParameters();
 
@@ -72,7 +72,7 @@ class PolicyTypePersistenceTest {
     }
 
     @AfterAll
-    public static void teardown() throws Exception {
+    static void teardown() throws Exception {
         databaseProvider.close();
     }
 
index f005ba2..30552b3 100644 (file)
@@ -48,7 +48,7 @@ class HierarchyFetchTest {
     private static PolicyModelsProvider databaseProvider;
 
     @BeforeAll
-    public static void beforeSetupParameters() {
+    static void beforeSetupParameters() {
         parameters = new PolicyModelsProviderParameters();
         parameters.setDatabaseDriver("org.h2.Driver");
         parameters.setDatabaseUrl("jdbc:h2:mem:HierarchyFetchTest");
@@ -61,7 +61,7 @@ class HierarchyFetchTest {
      * Closes the DB.
      */
     @AfterAll
-    public static void tearDown() throws PfModelException {
+    static void tearDown() throws PfModelException {
         if (databaseProvider != null) {
             databaseProvider.close();
         }
index f2fc60c..e2b614b 100644 (file)
@@ -83,7 +83,7 @@ class ToscaEntityFilterTest {
      * @throws CoderException on JSON decoding errors
      */
     @BeforeAll
-    public static void setupTypeList() throws CoderException {
+    static void setupTypeList() throws CoderException {
         for (String policyTypeResourceName : policyTypeResourceNames) {
             String policyTypeString = ResourceUtils.getResourceAsString(policyTypeResourceName);
             Object yamlObject = new Yaml().load(policyTypeString);
index ea9fab7..da4d971 100644 (file)
@@ -78,7 +78,7 @@ class ToscaTypedEntityFilterTest {
      * @throws CoderException on JSON decoding errors
      */
     @BeforeAll
-    public static void setupTypeList() throws CoderException {
+    static void setupTypeList() throws CoderException {
         for (String policyResourceName : policyResourceNames) {
             String policyString = ResourceUtils.getResourceAsString(policyResourceName);
             if (policyResourceName.endsWith("yaml")) {
index a6e84bb..dd4e129 100644 (file)
@@ -64,7 +64,7 @@ class AuthorativeToscaProviderGenericTest {
      * Read the policy type definition.
      */
     @BeforeAll
-    public static void readPolicyDefinition() {
+    static void readPolicyDefinition() {
         String yamlString = ResourceUtils.getResourceAsString("src/test/resources/onap.policies.NoVersion.yaml");
 
         Object yamlObject = new Yaml().load(yamlString);
index 9ae7842..512650c 100644 (file)
@@ -67,7 +67,7 @@ class AuthorativeToscaProviderPolicyTypeTest {
      *
      */
     @BeforeAll
-    public static void readPolicyDefinition() {
+    static void readPolicyDefinition() {
         String yamlString = ResourceUtils.getResourceAsString("src/test/resources/onap.policies.NoVersion.yaml");
 
         Object yamlObject = new Yaml().load(yamlString);
index 4bfff20..3d7c96b 100644 (file)
@@ -63,7 +63,7 @@ class JpaToscaWithToscaPropertiesTest {
      * Initializes the properties.
      */
     @BeforeAll
-    public static void setUpBeforeClass() {
+    static void setUpBeforeClass() {
         JPA_PROP1.setDescription(DESCRIPT1);
         JPA_PROP2.setDescription(DESCRIPT2);