aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common/actors/actor.appc/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/common/actors/actor.appc/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/common/actors/actor.appc/src/test')
-rw-r--r--controlloop/common/actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/AppcServiceProviderTest.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/controlloop/common/actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/AppcServiceProviderTest.java b/controlloop/common/actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/AppcServiceProviderTest.java
index 7ab368f6f..5a107f814 100644
--- a/controlloop/common/actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/AppcServiceProviderTest.java
+++ b/controlloop/common/actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/AppcServiceProviderTest.java
@@ -29,6 +29,7 @@ import java.util.UUID;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
+import org.onap.policy.aai.AAIGETVnfResponse;
import org.onap.policy.aai.util.AAIException;
import org.onap.policy.appc.Request;
import org.onap.policy.appc.Response;
@@ -54,6 +55,7 @@ public class AppcServiceProviderTest {
private static VirtualControlLoopEvent onsetEvent;
private static ControlLoopOperation operation;
private static Policy policy;
+ private static AAIGETVnfResponse aaiResponse;
static {
/*
@@ -65,11 +67,11 @@ public class AppcServiceProviderTest {
onsetEvent.requestID = UUID.randomUUID();
onsetEvent.closedLoopEventClient = "tca.instance00001";
onsetEvent.target_type = ControlLoopTargetType.VNF;
- onsetEvent.target = "generic-vnf.vnf-id";
+ onsetEvent.target = "generic-vnf.vnf-name";
onsetEvent.from = "DCAE";
onsetEvent.closedLoopAlarmStart = Instant.now();
onsetEvent.AAI = new HashMap<>();
- onsetEvent.AAI.put("generic-vnf.vnf-id", "fw0001vm001fw001");
+ onsetEvent.AAI.put("generic-vnf.vnf-name", "fw0001vm001fw001");
onsetEvent.closedLoopEventStatus = ControlLoopEventStatus.ONSET;
/* Construct an operation with an APPC actor and ModifyConfig operation. */
@@ -92,6 +94,10 @@ public class AppcServiceProviderTest {
policy.setRetry(2);
policy.setTimeout(300);
+ /* Construct a mock A&AI response */
+ aaiResponse = new AAIGETVnfResponse();
+ aaiResponse.vnfID = "vnf01";
+
/* Set environment properties */
PolicyEngine.manager.setEnvironmentProperty("aai.url", "http://localhost:6666");
PolicyEngine.manager.setEnvironmentProperty("aai.username", "AAI");
@@ -118,7 +124,7 @@ public class AppcServiceProviderTest {
Request appcRequest = null;
try {
- appcRequest = APPCActorServiceProvider.constructRequest(onsetEvent, operation, policy);
+ appcRequest = APPCActorServiceProvider.constructRequest(onsetEvent, operation, policy, aaiResponse);
} catch (AAIException e) {
logger.warn(e.toString());
fail("no vnfid found");