diff options
author | 2017-10-30 07:58:34 -0500 | |
---|---|---|
committer | 2017-10-30 08:08:59 -0500 | |
commit | 08c54826db08f104359e36a67e4a3affb477a245 (patch) | |
tree | 3899d7df05736589f5d2dcef07c3b60d4c8dfba7 /controlloop/templates/template.demo/src/test/java/org | |
parent | c9d429d17c8e19620ff760870d295ce05d5190af (diff) |
Fix Final Failure on AAI Queries
The drools engine will now send final failure notifications
if there is an error returned from A&AI queries instead of
rejected notifications.
Issue-Id: POLICY-364
Change-Id: Ie9c22686d859c633bad47d223726957cc9599f7c
Signed-off-by: Daniel Cruz <dc443y@att.com>
Diffstat (limited to 'controlloop/templates/template.demo/src/test/java/org')
3 files changed, 17 insertions, 23 deletions
diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VCPEControlLoopTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VCPEControlLoopTest.java index aaa40d1ad..55812f154 100644 --- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VCPEControlLoopTest.java +++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VCPEControlLoopTest.java @@ -279,13 +279,7 @@ public class VCPEControlLoopTest implements TopicListener { String policyName = notification.policyName; if (policyName.endsWith("EVENT")) { logger.debug("Rule Fired: " + notification.policyName); - if ("getFail".equals(notification.AAI.get("generic-vnf.vnf-name"))) { - assertEquals(ControlLoopNotificationType.REJECTED, notification.notification); - kieSession.halt(); - } - else { - assertTrue(ControlLoopNotificationType.ACTIVE.equals(notification.notification)); - } + assertTrue(ControlLoopNotificationType.ACTIVE.equals(notification.notification)); } else if (policyName.endsWith("GUARD_NOT_YET_QUERIED")) { logger.debug("Rule Fired: " + notification.policyName); @@ -320,8 +314,14 @@ public class VCPEControlLoopTest implements TopicListener { } else if (policyName.endsWith("EVENT.MANAGER")) { logger.debug("Rule Fired: " + notification.policyName); - assertTrue(ControlLoopNotificationType.FINAL_SUCCESS.equals(notification.notification)); - kieSession.halt(); + if ("getFail".equals(notification.AAI.get("generic-vnf.vnf-name"))) { + assertEquals(ControlLoopNotificationType.FINAL_FAILURE, notification.notification); + kieSession.halt(); + } + else { + assertTrue(ControlLoopNotificationType.FINAL_SUCCESS.equals(notification.notification)); + kieSession.halt(); + } } else if (policyName.endsWith("EVENT.MANAGER.TIMEOUT")) { logger.debug("Rule Fired: " + notification.policyName); diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VDNSControlLoopTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VDNSControlLoopTest.java index 3e1785d18..f7e2c3049 100644 --- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VDNSControlLoopTest.java +++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VDNSControlLoopTest.java @@ -322,13 +322,7 @@ public class VDNSControlLoopTest implements TopicListener { String policyName = notification.policyName; if (policyName.endsWith("EVENT")) { logger.debug("Rule Fired: " + notification.policyName); - if ("getFail".equals(notification.AAI.get("generic-vnf.vnf-id"))) { - assertEquals(ControlLoopNotificationType.REJECTED, notification.notification); - kieSession.halt(); - } - else { - assertTrue(ControlLoopNotificationType.ACTIVE.equals(notification.notification)); - } + assertTrue(ControlLoopNotificationType.ACTIVE.equals(notification.notification)); } else if (policyName.endsWith("GUARD_NOT_YET_QUERIED")) { logger.debug("Rule Fired: " + notification.policyName); @@ -365,6 +359,9 @@ public class VDNSControlLoopTest implements TopicListener { if ("error".equals(notification.AAI.get("vserver.vserver-name"))) { assertEquals(ControlLoopNotificationType.FINAL_FAILURE, notification.notification); } + else if ("getFail".equals(notification.AAI.get("vserver.vserver-name"))) { + assertEquals(ControlLoopNotificationType.FINAL_FAILURE, notification.notification); + } else { assertTrue(ControlLoopNotificationType.FINAL_SUCCESS.equals(notification.notification)); } diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFWControlLoopTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFWControlLoopTest.java index 601eef0eb..5ef20b544 100644 --- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFWControlLoopTest.java +++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFWControlLoopTest.java @@ -325,13 +325,7 @@ public class VFWControlLoopTest implements TopicListener { String policyName = notification.policyName; if (policyName.endsWith("EVENT")) { logger.debug("Rule Fired: " + notification.policyName); - if ("getFail".equals(notification.AAI.get("generic-vnf.vnf-name"))) { - assertEquals(ControlLoopNotificationType.REJECTED, notification.notification); - kieSession.halt(); - } - else { - assertTrue(ControlLoopNotificationType.ACTIVE.equals(notification.notification)); - } + assertTrue(ControlLoopNotificationType.ACTIVE.equals(notification.notification)); } else if (policyName.endsWith("GUARD_NOT_YET_QUERIED")) { logger.debug("Rule Fired: " + notification.policyName); @@ -370,6 +364,9 @@ public class VFWControlLoopTest implements TopicListener { assertEquals(ControlLoopNotificationType.FINAL_FAILURE, notification.notification); assertEquals("Target vnf-id could not be found", notification.message); } + else if ("getFail".equals(notification.AAI.get("generic-vnf.vnf-name"))) { + assertEquals(ControlLoopNotificationType.FINAL_FAILURE, notification.notification); + } else { assertTrue(ControlLoopNotificationType.FINAL_SUCCESS.equals(notification.notification)); } |