aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/templates
diff options
context:
space:
mode:
authordaniel <dc443y@att.com>2017-09-12 09:44:59 -0500
committerdaniel <dc443y@att.com>2017-09-12 19:01:34 -0500
commitc226d61d3c1266f592fc3d785164aedb34a25ef6 (patch)
tree89516010b0d4dacfc5ae5d9a92352c670fad6771 /controlloop/templates
parente126a975d8c6f3970dbf87ead79fa69afe510301 (diff)
Fix A&AI Named Query for vFW
The vFW named query has now been verified with the A&AI simulator. Null checks were added to make the namedQuery method work properly. In addition, a recursive A&AI response parser was added to traverse the response to find the correct generic-vnf object with the target vnf-id. For now the simulator URL is hard coded and the UUID of the named query is hard coded. These should be configurable in future releases. Issue-ID: POLICY-104 Change-Id: I05a1a992ff68ca2c17fb6a578983e6b21626bf44 Signed-off-by: Daniel Cruz <dc443y@att.com>
Diffstat (limited to 'controlloop/templates')
-rw-r--r--controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFWControlLoopTest.java17
1 files changed, 17 insertions, 0 deletions
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 e2b688d5d..49cbf5227 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
@@ -28,6 +28,8 @@ import java.time.Instant;
import java.util.HashMap;
import java.util.UUID;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
import org.junit.Test;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.rule.FactHandle;
@@ -40,6 +42,7 @@ import org.onap.policy.controlloop.VirtualControlLoopEvent;
import org.onap.policy.controlloop.VirtualControlLoopNotification;
import org.onap.policy.controlloop.policy.ControlLoopPolicy;
import org.onap.policy.controlloop.policy.TargetType;
+import org.onap.policy.drools.http.server.HttpServletServer;
import org.onap.policy.drools.impl.PolicyEngineJUnitImpl;
import org.onap.policy.guard.PolicyGuard;
import org.slf4j.Logger;
@@ -53,6 +56,20 @@ public class VFWControlLoopTest {
private Util.Pair<ControlLoopPolicy, String> pair;
private PolicyEngineJUnitImpl engine;
+ @BeforeClass
+ public static void setUpSimulator() {
+ try {
+ Util.buildAaiSim();
+ } catch (InterruptedException e) {
+ fail(e.getMessage());
+ }
+ }
+
+ @AfterClass
+ public static void tearDownSimulator() {
+ HttpServletServer.factory.destroy();
+ }
+
@Test
public void successTest() {