summaryrefslogtreecommitdiffstats
path: root/controlloop/common/eventmanager/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'controlloop/common/eventmanager/src/test')
-rw-r--r--controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java20
-rw-r--r--controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManagerTest.java20
2 files changed, 39 insertions, 1 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 223361505..be0eb2bc3 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
@@ -40,6 +40,7 @@ import org.onap.policy.aai.Relationship;
import org.onap.policy.aai.RelationshipData;
import org.onap.policy.aai.RelationshipDataItem;
import org.onap.policy.aai.RelationshipList;
+import org.onap.policy.aai.util.AAIException;
import org.onap.policy.controlloop.ControlLoopEventStatus;
import org.onap.policy.controlloop.ControlLoopException;
import org.onap.policy.controlloop.ControlLoopNotificationType;
@@ -227,6 +228,17 @@ public class ControlLoopEventManagerTest {
assertNotNull(notification);
assertEquals(ControlLoopNotificationType.ACTIVE, notification.notification);
+
+ ControlLoopEventManager.NEW_EVENT_STATUS status = null;
+ try {
+ status = manager.onNewEvent(event);
+ } catch (AAIException e) {
+ logger.warn(e.toString());
+ fail("A&AI Query Failed");
+ }
+ assertNotNull(status);
+ assertEquals(ControlLoopEventManager.NEW_EVENT_STATUS.FIRST_ONSET, status);
+
AAIGETVnfResponse response = manager.getVnfResponse();
assertNotNull(response);
assertNull(manager.getVserverResponse());
@@ -240,7 +252,13 @@ public class ControlLoopEventManagerTest {
event2.AAI = new HashMap<>();
event2.AAI.put("generic-vnf.vnf-name", "onsetTwo");
- ControlLoopEventManager.NEW_EVENT_STATUS status = manager.onNewEvent(event2);
+
+ try {
+ status = manager.onNewEvent(event2);
+ } catch (AAIException e) {
+ logger.warn(e.toString());
+ fail("A&AI Query Failed");
+ }
assertEquals(ControlLoopEventManager.NEW_EVENT_STATUS.SUBSEQUENT_ONSET, status);
AAIGETVnfResponse response2 = manager.getVnfResponse();
assertNotNull(response2);
diff --git a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManagerTest.java b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManagerTest.java
index e7a31190e..1714d3e26 100644
--- a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManagerTest.java
+++ b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManagerTest.java
@@ -107,6 +107,16 @@ public class ControlLoopOperationManagerTest {
assertNotNull(notification);
assertEquals(ControlLoopNotificationType.ACTIVE, notification.notification);
+ ControlLoopEventManager.NEW_EVENT_STATUS status = null;
+ try {
+ status = eventManager.onNewEvent(onset);
+ } catch (AAIException e) {
+ logger.warn(e.toString());
+ fail("A&AI Query Failed");
+ }
+ assertNotNull(status);
+ assertEquals(ControlLoopEventManager.NEW_EVENT_STATUS.FIRST_ONSET, status);
+
ControlLoopOperationManager manager = new ControlLoopOperationManager(onset, processor.getCurrentPolicy(), eventManager);
logger.debug("{}",manager);
//
@@ -226,6 +236,16 @@ public class ControlLoopOperationManagerTest {
assertNotNull(notification);
assertEquals(ControlLoopNotificationType.ACTIVE, notification.notification);
+ ControlLoopEventManager.NEW_EVENT_STATUS status = null;
+ try {
+ status = eventManager.onNewEvent(onset);
+ } catch (AAIException e) {
+ logger.warn(e.toString());
+ fail("A&AI Query Failed");
+ }
+ assertNotNull(status);
+ assertEquals(ControlLoopEventManager.NEW_EVENT_STATUS.FIRST_ONSET, status);
+
ControlLoopOperationManager manager = new ControlLoopOperationManager(onset, processor.getCurrentPolicy(), eventManager);
//
//