aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common/eventmanager/src/test/java
diff options
context:
space:
mode:
authorpramod.jamkhedkar <pramod@research.att.com>2019-05-21 12:03:53 -0400
committerpramod.jamkhedkar <pramod@research.att.com>2019-05-21 12:05:03 -0400
commit7a4f105bdc6878e311d5b12db19e1571e106a933 (patch)
treec522bdaf5e31b790f6eb0b079529fcd076cbf632 /controlloop/common/eventmanager/src/test/java
parent8aa65370a1eeef842a002ad403c7172702a614ea (diff)
Check for null vserver.
Handles the case where vserver name is not present in onset mesage. Issue-ID: POLICY-1778 Change-Id: Ie7a1b9d207860a70b49309049b512fc8ce05a984 Signed-off-by: pramod.jamkhedkar <pramod@research.att.com>
Diffstat (limited to 'controlloop/common/eventmanager/src/test/java')
-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 bce96b2f0..1eec0a750 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
@@ -1293,11 +1293,28 @@ public class ControlLoopEventManagerTest {
}
@Test
+ public void testGetCqResponseEmptyVserver() {
+ try {
+ ControlLoopEventManager mgr = null;
+ mgr = makeManager(onset);
+ mgr.queryAai(onset);
+ mgr.getCqResponse(onset);
+ fail();
+
+
+ } catch (AaiException e) {
+ logger.error("testGetCqResponse Exception: ", e);
+ assertEquals(e.getMessage(), "Vserver name is missing");
+ }
+ }
+
+ @Test
public void testGetCqResponse() {
try {
ControlLoopEventManager mgr = null;
mgr = makeManager(onset);
mgr.queryAai(onset);
+ onset.getAai().put("vserver.vserver-name", "sample");
AaiCqResponse aaiCqResponse = mgr.getCqResponse(onset);
assertNotNull(aaiCqResponse);