diff options
author | Ram Krishna Verma <ram_krishna.verma@bell.ca> | 2020-05-26 15:48:51 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-05-26 15:48:51 +0000 |
commit | 584b6dde58b4ace70df7f9b976340a6f3775a2f1 (patch) | |
tree | 0eedc9a5f1ef0830fa1c4c3da093a2fc8094b6eb /controlloop/common/eventmanager/src/test/java | |
parent | 84ce39ffa3378a1cf174a780df5a378cd23f13d9 (diff) | |
parent | 18486d18e1a684cd4df27b335f565c1d985d4f06 (diff) |
Merge "Generate SDNR notification even on timeout"
Diffstat (limited to 'controlloop/common/eventmanager/src/test/java')
-rw-r--r-- | controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager2Test.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager2Test.java b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager2Test.java index 3214add1c..be8b70b13 100644 --- a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager2Test.java +++ b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager2Test.java @@ -54,6 +54,7 @@ import org.onap.aai.domain.yang.GenericVnf; import org.onap.policy.aai.AaiCqResponse; import org.onap.policy.common.utils.time.PseudoExecutor; import org.onap.policy.controlloop.ControlLoopOperation; +import org.onap.policy.controlloop.ControlLoopResponse; import org.onap.policy.controlloop.VirtualControlLoopEvent; import org.onap.policy.controlloop.actor.guard.GuardActorServiceProvider; import org.onap.policy.controlloop.actor.guard.GuardOperation; @@ -343,6 +344,32 @@ public class ControlLoopOperationManager2Test { } @Test + public void testMakeControlLoopResponse() { + // should always return its input, if non-null + ControlLoopResponse resp = new ControlLoopResponse(); + assertSame(resp, mgr.makeControlLoopResponse(resp)); + + // not an SDNR action - should return null + assertNull(mgr.makeControlLoopResponse(null)); + + /* + * now work with SDNR actor + */ + policy.setActor("SDNR"); + mgr = new ControlLoopOperationManager2(mgrctx, context, policy, executor); + + // should still return its input, if non-null + resp = new ControlLoopResponse(); + assertSame(resp, mgr.makeControlLoopResponse(resp)); + + // should generate a response + resp = mgr.makeControlLoopResponse(null); + assertNotNull(resp); + assertEquals(REQ_ID, resp.getRequestId()); + assertNull(resp.getPayload()); + } + + @Test public void testGetOperationMessage() { // no history yet assertNull(mgr.getOperationMessage()); |