From 1480d327ff8559c1d912108f7d3353fed03fcd2c Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 24 Oct 2017 06:33:31 -0500 Subject: Change vnf-id to vnf-name These changes now allow a lookup of the source vnf-id based on the onset's vnf-name. Issue-Id: POLICY-366 Change-Id: I6f6bd500b892dddbbb9e12156b4486208309e21d Signed-off-by: Daniel Cruz --- .../org/onap/policy/template/demo/VCPEControlLoopTest.java | 12 ++++++------ .../org/onap/policy/template/demo/VFWControlLoopTest.java | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'controlloop/templates/template.demo') 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 bae7a5155..f18b440d7 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 @@ -276,7 +276,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-id"))) { + if ("getFail".equals(notification.AAI.get("generic-vnf.vnf-name"))) { assertEquals(ControlLoopNotificationType.REJECTED, notification.notification); kieSession.halt(); } @@ -364,22 +364,22 @@ public class VCPEControlLoopTest implements TopicListener { VirtualControlLoopEvent event = new VirtualControlLoopEvent(); event.closedLoopControlName = policy.getControlLoop().getControlLoopName(); event.requestID = requestID; - event.target = "generic-vnf.vnf-id"; + event.target = "generic-vnf.vnf-name"; event.closedLoopAlarmStart = Instant.now(); event.AAI = new HashMap<>(); - event.AAI.put("generic-vnf.vnf-id", "testGenericVnfID"); + event.AAI.put("generic-vnf.vnf-name", "testGenericVnfName"); event.closedLoopEventStatus = status; kieSession.insert(event); } - protected void sendEvent(ControlLoopPolicy policy, UUID requestID, ControlLoopEventStatus status, String vnfId) { + protected void sendEvent(ControlLoopPolicy policy, UUID requestID, ControlLoopEventStatus status, String vnfName) { VirtualControlLoopEvent event = new VirtualControlLoopEvent(); event.closedLoopControlName = policy.getControlLoop().getControlLoopName(); event.requestID = requestID; - event.target = "generic-vnf.vnf-id"; + event.target = "generic-vnf.vnf-name"; event.closedLoopAlarmStart = Instant.now(); event.AAI = new HashMap<>(); - event.AAI.put("generic-vnf.vnf-id", vnfId); + event.AAI.put("generic-vnf.vnf-name", vnfName); event.closedLoopEventStatus = status; kieSession.insert(event); } 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 54591cad0..f73e3b39e 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 @@ -322,7 +322,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-id"))) { + if ("getFail".equals(notification.AAI.get("generic-vnf.vnf-name"))) { assertEquals(ControlLoopNotificationType.REJECTED, notification.notification); kieSession.halt(); } @@ -363,8 +363,8 @@ public class VFWControlLoopTest implements TopicListener { } else if (policyName.endsWith("EVENT.MANAGER")) { logger.debug("Rule Fired: " + notification.policyName); - if ("error".equals(notification.AAI.get("generic-vnf.vnf-id"))) { - assertTrue(ControlLoopNotificationType.FINAL_FAILURE.equals(notification.notification)); + if ("error".equals(notification.AAI.get("generic-vnf.vnf-name"))) { + assertEquals(ControlLoopNotificationType.FINAL_FAILURE, notification.notification); assertEquals("Exception in processing closed loop", notification.message); } else { @@ -408,10 +408,10 @@ public class VFWControlLoopTest implements TopicListener { VirtualControlLoopEvent event = new VirtualControlLoopEvent(); event.closedLoopControlName = policy.getControlLoop().getControlLoopName(); event.requestID = requestID; - event.target = "generic-vnf.vnf-id"; + event.target = "generic-vnf.vnf-name"; event.closedLoopAlarmStart = Instant.now(); event.AAI = new HashMap<>(); - event.AAI.put("generic-vnf.vnf-id", "testGenericVnfID"); + event.AAI.put("generic-vnf.vnf-name", "testGenericVnfID"); event.closedLoopEventStatus = status; kieSession.insert(event); } @@ -429,10 +429,10 @@ public class VFWControlLoopTest implements TopicListener { VirtualControlLoopEvent event = new VirtualControlLoopEvent(); event.closedLoopControlName = policy.getControlLoop().getControlLoopName(); event.requestID = requestID; - event.target = "generic-vnf.vnf-id"; + event.target = "generic-vnf.vnf-name"; event.closedLoopAlarmStart = Instant.now(); event.AAI = new HashMap<>(); - event.AAI.put("generic-vnf.vnf-id", vnfId); + event.AAI.put("generic-vnf.vnf-name", vnfId); event.closedLoopEventStatus = status; kieSession.insert(event); } -- cgit 1.2.3-korg