From 5ee687ecedd616c3e4b83622103232a06c4783c2 Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 21 Sep 2017 14:29:07 -0500 Subject: Fix Use Case Testing These changes are necessary to get the use cases working on an actual PDP. So far vCPE, vFW, and vDNS have been tested successfully on a pdp. These are priliminary tests to just test a FINAL SUCCESS without A&AI GET queries being used. A&AI named queries for vFW and vDNS have been verified to work. Changes in the template were made for SO as there were changes in the JUnit template that did not get reflected in the archetype template. Changes in the code were made in various places to use the environment properties for REST urls, usernames, and passwords. Due to VoLTE not being tested yet, the url for VFC is still hard coded and will be changed later. It has been confirmed with APPC that LCM will have two topics: APPC-LCM-READ and APPC-LCM-WRITE. Policy needs to sink to APPC-LCM-READ and pull from source APPC-LCM-WRITE. This has been reflected in the controller properties file. Issue-ID: POLICY-259 Change-Id: Ib9a8df07ae5ad9d3052c88907c1e522952af474d Signed-off-by: Daniel Cruz --- .../controlloop/actor/appc/AppcServiceProviderTest.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'controlloop/common/actors/actor.appc/src') 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 dcdf59a56..9d7e46320 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 @@ -30,6 +30,8 @@ import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import org.onap.policy.appc.Request; +import org.onap.policy.appc.Response; +import org.onap.policy.appc.ResponseCode; import org.onap.policy.appc.util.Serialization; import org.onap.policy.controlloop.ControlLoopEventStatus; import org.onap.policy.controlloop.ControlLoopOperation; @@ -39,6 +41,7 @@ import org.onap.policy.controlloop.policy.Policy; import org.onap.policy.controlloop.policy.Target; import org.onap.policy.controlloop.policy.TargetType; import org.onap.policy.drools.http.server.HttpServletServer; +import org.onap.policy.drools.system.PolicyEngine; import org.onap.policy.simulators.Util; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -87,7 +90,12 @@ public class AppcServiceProviderTest { policy.setPayload(null); policy.setRetry(2); policy.setTimeout(300); - + + /* Set environment properties */ + PolicyEngine.manager.setEnvironmentProperty("aai.url", "http://localhost:6666"); + PolicyEngine.manager.setEnvironmentProperty("aai.username", "AAI"); + PolicyEngine.manager.setEnvironmentProperty("aai.password", "AAI"); + } @BeforeClass @@ -139,6 +147,13 @@ public class AppcServiceProviderTest { assertTrue(jsonRequest.contains("Payload")); assertTrue(jsonRequest.contains("generic-vnf.vnf-id")); assertTrue(jsonRequest.contains("pg-streams")); + + Response appcResponse = new Response(appcRequest); + appcResponse.getStatus().Code = ResponseCode.SUCCESS.getValue(); + appcResponse.getStatus().Description = "AppC success"; + /* Print out request as json to make sure serialization works */ + String jsonResponse = Serialization.gsonPretty.toJson(appcResponse); + logger.debug("JSON Output: \n" + jsonResponse); } } -- cgit 1.2.3-korg