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 --- .../actor/appclcm/AppcLcmActorServiceProvider.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'controlloop/common/actors/actor.appclcm/src') diff --git a/controlloop/common/actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmActorServiceProvider.java b/controlloop/common/actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmActorServiceProvider.java index eaff2503a..9f556fa2e 100644 --- a/controlloop/common/actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmActorServiceProvider.java +++ b/controlloop/common/actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmActorServiceProvider.java @@ -49,6 +49,7 @@ import org.onap.policy.controlloop.VirtualControlLoopEvent; import org.onap.policy.controlloop.actorServiceProvider.spi.Actor; import org.onap.policy.controlloop.policy.Policy; import org.onap.policy.controlloop.policy.PolicyResult; +import org.onap.policy.drools.system.PolicyEngine; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -157,10 +158,17 @@ public class AppcLcmActorServiceProvider implements Actor { aaiRequest.instanceFilters = new AAINQInstanceFilters(); aaiRequest.instanceFilters.instanceFilter.add(filter); - //TODO: URL should not be hard coded for future releases + /* + * Obtain A&AI credentials from properties.environment file + * TODO: What if these are null? + */ + String aaiUrl = PolicyEngine.manager.getEnvironmentProperty("aai.url"); + String aaiUsername = PolicyEngine.manager.getEnvironmentProperty("aai.username"); + String aaiPassword = PolicyEngine.manager.getEnvironmentProperty("aai.password"); + AAINQResponse aaiResponse = AAIManager.postQuery( - "http://localhost:6666", - "policy", "policy", + aaiUrl, + aaiUsername, aaiPassword, aaiRequest, requestId); //TODO: What if the resourceId never matches? -- cgit 1.2.3-korg