diff options
author | 2020-08-20 18:27:40 -0500 | |
---|---|---|
committer | 2020-08-20 18:27:40 -0500 | |
commit | 78ef929d8bd41712bec2e7c438c95dfa15c1a5bc (patch) | |
tree | 5bfce695c1a3ffbc7356cfcc50aec079357a6f65 /feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateActivePoliciesTest.java | |
parent | a7d8e6416439ad5129059a5612896a49bdee0fa8 (diff) |
remove legacy operational policies support
Issue-ID: POLICY-2765
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I6066b8040add53ed32572a71854f3f7094bc41d6
Diffstat (limited to 'feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateActivePoliciesTest.java')
-rw-r--r-- | feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateActivePoliciesTest.java | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateActivePoliciesTest.java b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateActivePoliciesTest.java index fdcaac50..49e439d9 100644 --- a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateActivePoliciesTest.java +++ b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateActivePoliciesTest.java @@ -28,8 +28,6 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; import java.util.Collections; import java.util.List; import java.util.Map; @@ -143,11 +141,11 @@ public class LifecycleStateActivePoliciesTest extends LifecycleStateRunningTest assertEquals(policyNativeArtifact, fsm.getPoliciesMap().get(policyNativeArtifact.getIdentifier())); // - // add a legacy operational policy + // add an operational policy // - String restart = Files.readString(Paths.get("src/test/resources/tosca-policy-operational-restart.json")); - ToscaPolicy opPolicyRestart = new StandardCoder().decode(restart, ToscaPolicy.class); + ToscaPolicy opPolicyRestart = + getExamplesPolicy("policies/vCPE.policy.operational.input.tosca.json", "operational.restart"); update.setPolicies(List.of(policyNativeController, policyNativeArtifact, opPolicyRestart)); assertFalse(fsm.update(update)); @@ -159,14 +157,12 @@ public class LifecycleStateActivePoliciesTest extends LifecycleStateRunningTest fsm.start(controllerSupport.getController()); - assertEquals(4, fsm.policyTypesMap.size()); + assertEquals(3, fsm.policyTypesMap.size()); assertNotNull(fsm.getPolicyTypesMap().get( new ToscaPolicyTypeIdentifier("onap.policies.native.drools.Controller", "1.0.0"))); assertNotNull(fsm.getPolicyTypesMap().get( new ToscaPolicyTypeIdentifier("onap.policies.native.drools.Artifact", "1.0.0"))); assertNotNull(fsm.getPolicyTypesMap().get( - new ToscaPolicyTypeIdentifier("onap.policies.controlloop.Operational", "1.0.0"))); - assertNotNull(fsm.getPolicyTypesMap().get( new ToscaPolicyTypeIdentifier("onap.policies.controlloop.operational.common.Drools", "1.0.0"))); @@ -193,9 +189,9 @@ public class LifecycleStateActivePoliciesTest extends LifecycleStateRunningTest // upgrade operational policy with valid controller name - String restartV2 = Files.readString( - Paths.get("src/test/resources/tosca-policy-operational-restart.v2.json")); - ToscaPolicy opPolicyRestartV2 = new StandardCoder().decode(restartV2, ToscaPolicy.class); + ToscaPolicy opPolicyRestartV2 = + getExamplesPolicy("policies/vCPE.policy.operational.input.tosca.json", "operational.restart"); + opPolicyRestartV2.setVersion("2.0.0"); opPolicyRestartV2.getProperties().put("controllerName", "lifecycle"); update.setPolicies(List.of(policyNativeController, policyNativeArtifact, opPolicyRestartV2)); assertTrue(fsm.update(update)); |