From e3938e43b8a1f02f74368ecb75c38530285feac0 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Tue, 31 Jan 2023 10:41:01 +0000 Subject: Upgrade and clean up dependencies - Upgrade Hibernate - Upgrade Mockito - Upgrade Mockserver - Remove Powermock (no longer supported) and replace with spring-test ReflectionTestUtils - Upgrade Spring Framework - Add spring-security to allow authentication on unit tests using MockMVC Minor clean-up - Replace deprecated authorization configuraiton on spring boot applications with SecurityFilterChain bean - Change @LocalPort include on tests to use test include rather than runtime include - Remove unused imports - Remove unused constants and variables - Add deprecation annotations where required Issue-ID: POLICY-4482 Change-Id: Ie8d6ee1e8bcdad282bcef3cad409c5c109e907f1 Signed-off-by: liamfallon --- models-base/pom.xml | 6 +- models-interactions/model-actors/actor.a1p/pom.xml | 6 +- .../controlloop/actor/a1p/A1pOperationTest.java | 4 + models-interactions/model-actors/actor.aai/pom.xml | 6 +- .../actor/aai/AaiCustomQueryOperationTest.java | 7 +- .../controlloop/actor/aai/AaiGetOperationTest.java | 4 + .../actor/aai/AaiGetPnfOperationTest.java | 4 + .../actor/aai/AaiGetTenantOperationTest.java | 4 + .../model-actors/actor.appc/pom.xml | 6 +- .../controlloop/actor/appc/AppcActorTest.java | 5 +- .../controlloop/actor/appc/AppcOperationTest.java | 4 + .../actor/appc/ModifyConfigOperationTest.java | 4 + .../model-actors/actor.appclcm/pom.xml | 154 ++++++++++----------- .../actor/appclcm/AppcLcmOperationTest.java | 4 + .../model-actors/actor.sdnc/pom.xml | 6 +- .../actor/sdnc/BandwidthOnDemandOperationTest.java | 4 + .../actor/sdnc/RerouteOperationTest.java | 4 + .../controlloop/actor/sdnc/SdncOperationTest.java | 5 + .../model-actors/actor.sdnr/pom.xml | 6 +- .../controlloop/actor/sdnr/SdnrOperationTest.java | 4 + models-interactions/model-actors/actor.so/pom.xml | 6 +- .../controlloop/actor/so/BasicSoOperation.java | 17 +-- .../policy/controlloop/actor/so/ModifyCllTest.java | 4 + .../controlloop/actor/so/ModifyNssiTest.java | 5 +- .../controlloop/actor/so/SoOperationTest.java | 12 +- .../controlloop/actor/so/VfModuleCreateTest.java | 4 + .../controlloop/actor/so/VfModuleDeleteTest.java | 30 ++-- .../model-actors/actor.test/pom.xml | 6 +- .../test/BasicBidirectionalTopicOperation.java | 9 +- .../controlloop/actor/test/BasicHttpOperation.java | 27 ++-- .../actor/test/BasicHttpOperationTest.java | 4 + .../controlloop/actor/test/BasicOperationTest.java | 4 + models-interactions/model-actors/actor.vfc/pom.xml | 8 +- .../controlloop/actor/vfc/BasicVfcOperation.java | 15 +- .../policy/controlloop/actor/vfc/RestartTest.java | 4 + .../controlloop/actor/vfc/VfcOperationTest.java | 4 + .../model-actors/actor.xacml/pom.xml | 7 +- .../actor/xacml/ConfigureOperationTest.java | 8 +- .../actor/xacml/DecisionOperationTest.java | 4 + .../actor/xacml/GuardOperationTest.java | 4 + .../model-actors/actorServiceProvider/pom.xml | 8 +- models-interactions/model-impl/aai/pom.xml | 7 +- models-interactions/model-simulators/pom.xml | 8 +- models-sim/models-sim-dmaap/pom.xml | 11 +- .../models/sim/dmaap/provider/TopicDataTest.java | 5 +- models-sim/policy-models-sim-pdp/pom.xml | 4 +- .../models/sim/pdp/TestPdpSimulatorConstants.java | 11 +- models-sim/policy-models-simulators/pom.xml | 5 +- 48 files changed, 298 insertions(+), 190 deletions(-) diff --git a/models-base/pom.xml b/models-base/pom.xml index 89c439547..b00c22040 100644 --- a/models-base/pom.xml +++ b/models-base/pom.xml @@ -1,6 +1,6 @@ - 4.0.0 + 4.0.0 - - org.onap.policy.models.policy-models-interactions.model-actors - model-actors - 2.8.1-SNAPSHOT - + + org.onap.policy.models.policy-models-interactions.model-actors + model-actors + 2.8.1-SNAPSHOT + - actor.appclcm + actor.appclcm - - - org.onap.policy.models.policy-models-interactions.model-actors - actorServiceProvider - ${project.version} - provided - - - org.onap.policy.models.policy-models-interactions.model-impl - appclcm - ${project.version} - provided - - - org.onap.policy.models.policy-models-interactions.model-impl - aai - ${project.version} - provided - - - org.onap.policy.models.policy-models-interactions.model-actors - actor.appc - ${project.version} - provided - - - com.google.code.gson - gson - test - - - org.onap.policy.models.policy-models-interactions.model-impl - events - ${project.version} - provided - - - org.onap.policy.common - policy-endpoints - ${policy.common.version} - provided - - - org.apache.commons - commons-lang3 - - - org.onap.policy.models.policy-models-interactions.model-actors - actor.test - ${project.version} - test - - - org.onap.policy.models.policy-models-interactions - simulators - ${project.version} - test - - - junit - junit - test - - - org.powermock - powermock-api-mockito2 - test - - + + + org.onap.policy.models.policy-models-interactions.model-actors + actorServiceProvider + ${project.version} + provided + + + org.onap.policy.models.policy-models-interactions.model-impl + appclcm + ${project.version} + provided + + + org.onap.policy.models.policy-models-interactions.model-impl + aai + ${project.version} + provided + + + org.onap.policy.models.policy-models-interactions.model-actors + actor.appc + ${project.version} + provided + + + com.google.code.gson + gson + test + + + org.onap.policy.models.policy-models-interactions.model-impl + events + ${project.version} + provided + + + org.onap.policy.common + policy-endpoints + ${policy.common.version} + provided + + + org.apache.commons + commons-lang3 + + + org.onap.policy.models.policy-models-interactions.model-actors + actor.test + ${project.version} + test + + + org.onap.policy.models.policy-models-interactions + simulators + ${project.version} + test + + + junit + junit + test + + + org.mockito + mockito-core + test + + diff --git a/models-interactions/model-actors/actor.appclcm/src/test/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperationTest.java b/models-interactions/model-actors/actor.appclcm/src/test/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperationTest.java index 36496455a..5765e3c98 100644 --- a/models-interactions/model-actors/actor.appclcm/src/test/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperationTest.java +++ b/models-interactions/model-actors/actor.appclcm/src/test/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperationTest.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,6 +42,8 @@ import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.junit.MockitoJUnitRunner; import org.onap.policy.appclcm.AppcLcmBody; import org.onap.policy.appclcm.AppcLcmCommonHeader; import org.onap.policy.appclcm.AppcLcmDmaapWrapper; @@ -62,6 +65,7 @@ import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOp import org.onap.policy.simulators.AppcLcmTopicServer; import org.onap.policy.simulators.TopicServer; +@RunWith(MockitoJUnitRunner.class) public class AppcLcmOperationTest extends BasicBidirectionalTopicOperation { private static final String EXPECTED_EXCEPTION = "expected exception"; diff --git a/models-interactions/model-actors/actor.sdnc/pom.xml b/models-interactions/model-actors/actor.sdnc/pom.xml index d60846ec4..103a9cab6 100644 --- a/models-interactions/model-actors/actor.sdnc/pom.xml +++ b/models-interactions/model-actors/actor.sdnc/pom.xml @@ -2,7 +2,7 @@