summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.so/src/test
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2019-04-09 08:24:14 -0400
committerPamela Dragosh <pdragosh@research.att.com>2019-04-09 08:24:21 -0400
commit7e63a8833ae226738d858a3ff1aaf715f9b51d6b (patch)
tree96efb370cffa1db2c3482b5a9991df043a3eb8ac /models-interactions/model-actors/actor.so/src/test
parentc54b9408a10c0060e35be2ee0b5bac6a24e9153a (diff)
Parse new model ids from operational policy
Companion review to https://gerrit.onap.org/r/#/c/84235/ Copies the required changes into policy/models. Issue-ID: POLICY-1545 Change-Id: I43fec36f60b5409d9e3df9d925de06209c81fd01 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'models-interactions/model-actors/actor.so/src/test')
-rw-r--r--models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoActorServiceProviderTest.java24
1 files changed, 21 insertions, 3 deletions
diff --git a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoActorServiceProviderTest.java b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoActorServiceProviderTest.java
index a7bdf1a76..8b4bcf20a 100644
--- a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoActorServiceProviderTest.java
+++ b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoActorServiceProviderTest.java
@@ -42,6 +42,7 @@ import org.onap.policy.aai.AaiNqResponseWrapper;
import org.onap.policy.controlloop.ControlLoopOperation;
import org.onap.policy.controlloop.VirtualControlLoopEvent;
import org.onap.policy.controlloop.policy.Policy;
+import org.onap.policy.controlloop.policy.Target;
import org.onap.policy.so.SoOperationType;
import org.onap.policy.so.SoRequest;
import org.onap.policy.so.SoRequestParameters;
@@ -64,7 +65,9 @@ public class SoActorServiceProviderTest {
Policy policy = new Policy();
policy.setActor("Dorothy");
policy.setRecipe("GoToOz");
-
+
+ instantiateTarget(policy);
+
assertNull(new SoActorServiceProvider().constructRequest(onset, operation, policy, aaiNqResp));
policy.setActor("SO");
@@ -88,7 +91,7 @@ public class SoActorServiceProviderTest {
assertEquals("avalue", request.getRequestDetails().getRequestParameters().getUserParams().get(0).get("akey"));
assertEquals(1, request.getRequestDetails().getConfigurationParameters().size());
assertEquals("cvalue", request.getRequestDetails().getConfigurationParameters().get(0).get("ckey"));
-
+
// payload with config, but no request params
policy.setPayload(makePayload());
policy.getPayload().remove(SoActorServiceProvider.REQ_PARAM_NM);
@@ -96,7 +99,7 @@ public class SoActorServiceProviderTest {
assertNotNull(request);
assertNull(request.getRequestDetails().getRequestParameters());
assertNotNull(request.getRequestDetails().getConfigurationParameters());
-
+
// payload with request, but no config params
policy.setPayload(makePayload());
policy.getPayload().remove(SoActorServiceProvider.CONFIG_PARAM_NM);
@@ -112,10 +115,13 @@ public class SoActorServiceProviderTest {
assertNull(new SoActorServiceProvider().constructRequest(onset, operation, policy,
loadAaiResponse(onset, "aai/AaiNqResponse-NoBase.json")));
+ policy.setTarget(null);
+
// response has no non-base VF modules (other than the "dummy")
assertNull(new SoActorServiceProvider().constructRequest(onset, operation, policy,
loadAaiResponse(onset, "aai/AaiNqResponse-NoNonBase.json")));
+ instantiateTarget(policy);
policy.setRecipe(VF_MODULE_DELETE);
SoRequest deleteRequest = new SoActorServiceProvider().constructRequest(onset, operation, policy, aaiNqResp);
assertNotNull(deleteRequest);
@@ -142,6 +148,18 @@ public class SoActorServiceProviderTest {
assertNull(new SoActorServiceProvider().constructRequest(onset, operation, policy, aaiNqResp));
}
+ private void instantiateTarget(Policy policy) {
+
+ Target target = new Target();
+ target.setModelCustomizationId("3e2d67ad-3495-4732-82f6-b0b872791fff");
+ target.setModelInvariantId("90b793b5-b8ae-4c36-b10b-4b6372859d3a");
+ target.setModelName("SproutScalingVf..scaling_sprout..module-1");
+ target.setModelVersion("1");
+ target.setModelVersionId("2210154d-e61a-4d7f-8fb9-0face1aee3f8");
+
+ policy.setTarget(target);
+ }
+
@Test
public void testSendRequest() {
try {