aboutsummaryrefslogtreecommitdiffstats
path: root/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful
diff options
context:
space:
mode:
authorjhh <jorge.hernandez-herrero@att.com>2021-01-15 16:51:47 -0600
committerjhh <jorge.hernandez-herrero@att.com>2021-01-27 00:39:32 -0600
commit77d088a607c33c236bc41c58d9567e10299357a5 (patch)
treec35c7d92a58f49cc6d069910a4eab20a6bd08993 /feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful
parent6d94c4ec33520776971c781c6ea6e80e6d0070b5 (diff)
sync policies when native artifact policies added
interoperability between native and non-native policies present several difficulties. The code submitted operates in deltas where deploy and undeploy operations are performed on the deltas of the updates. In order to support interoperability, policies not part of a delta update may need to be reapplied. For example, in the case when the delta is just a new native controller artifact, we should go through the set of already deployed policies and reapply non-native policies as long as the policy types that the native artifact policy supports. Issue-ID: POLICY-2762 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: Ieb8e5e17862e9d607433a1d4e86a026725d73498 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Diffstat (limited to 'feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful')
-rw-r--r--feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java11
1 files changed, 1 insertions, 10 deletions
diff --git a/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java b/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java
index 3a04c313..43d3fe32 100644
--- a/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java
+++ b/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java
@@ -25,8 +25,6 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Collections;
@@ -441,15 +439,8 @@ public class RestLifecycleManagerTest {
}
private LifecycleFsm newFsmInstance() throws NoSuchFieldException, IllegalAccessException {
- Field fsmField = LifecycleFeature.class.getDeclaredField("fsm");
- fsmField.setAccessible(true);
-
- Field modifiers = Field.class.getDeclaredField("modifiers");
- modifiers.setAccessible(true);
- modifiers.setInt(fsmField, fsmField.getModifiers() & ~Modifier.FINAL);
-
LifecycleFsm fsm = new LifecycleFsm();
- fsmField.set(null, fsm);
+ ControllerSupport.setStaticField(LifecycleFeature.class, "fsm", fsm);
return fsm;
}