summaryrefslogtreecommitdiffstats
path: root/controlloop/templates/template.demo/src/test
diff options
context:
space:
mode:
authordaniel <dc443y@att.com>2017-10-24 06:33:31 -0500
committerdaniel <dc443y@att.com>2017-10-24 13:16:10 -0500
commit1480d327ff8559c1d912108f7d3353fed03fcd2c (patch)
tree8745bec65ea2ee8962f42048ed0362961d0dfc60 /controlloop/templates/template.demo/src/test
parentbaea880ddf0564d81d61bf87ae7f124229bf08f0 (diff)
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 <dc443y@att.com>
Diffstat (limited to 'controlloop/templates/template.demo/src/test')
-rw-r--r--controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VCPEControlLoopTest.java12
-rw-r--r--controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFWControlLoopTest.java14
2 files changed, 13 insertions, 13 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 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);
}