aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common/eventmanager/src/test
diff options
context:
space:
mode:
authorRam Krishna Verma <ram_krishna.verma@bell.ca>2020-09-02 14:15:47 +0000
committerGerrit Code Review <gerrit@onap.org>2020-09-02 14:15:47 +0000
commit2c1abacecc2ad328288cbb0b4e1cba89157301ee (patch)
tree487ff4c64f5145c787add7afc4d3035bd4622248 /controlloop/common/eventmanager/src/test
parenta588736799d94747f70ed648d3d821210993c5c4 (diff)
parent25c8a555a739b1c80966ed88cc123a6e9ad9318e (diff)
Merge "Allow guards to be dynamically enabled/disabled"
Diffstat (limited to 'controlloop/common/eventmanager/src/test')
-rw-r--r--controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java
index e4c233281..a8632642a 100644
--- a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java
+++ b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java
@@ -49,6 +49,7 @@ import org.onap.policy.controlloop.ControlLoopException;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
import org.onap.policy.controlloop.actorserviceprovider.OperationResult;
import org.onap.policy.controlloop.drl.legacy.ControlLoopParams;
+import org.onap.policy.controlloop.ophistory.OperationHistoryDataManagerStub;
import org.onap.policy.drools.core.lock.LockCallback;
import org.onap.policy.drools.core.lock.LockImpl;
import org.onap.policy.drools.core.lock.LockState;
@@ -241,6 +242,22 @@ public class ControlLoopEventManagerTest {
assertFalse(mgr.contains(MY_KEY));
}
+ /**
+ * Tests getDataManager() when guard.disabled=true.
+ */
+ @Test
+ public void testGetDataManagerDisabled() throws ControlLoopException {
+ mgr = new MyManager(params, REQ_ID) {
+ private static final long serialVersionUID = 1L;
+ @Override
+ protected String getEnvironmentProperty(String propName) {
+ return ("guard.disabled".equals(propName) ? "true" : null);
+ }
+ };
+
+ assertThat(mgr.getDataManager()).isInstanceOf(OperationHistoryDataManagerStub.class);
+ }
+
@Test
public void testToString() {
assertNotNull(mgr.toString());