summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.appclcm/src
diff options
context:
space:
mode:
Diffstat (limited to 'models-interactions/model-actors/actor.appclcm/src')
-rw-r--r--models-interactions/model-actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperation.java3
-rw-r--r--models-interactions/model-actors/actor.appclcm/src/test/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperationTest.java7
2 files changed, 7 insertions, 3 deletions
diff --git a/models-interactions/model-actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperation.java b/models-interactions/model-actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperation.java
index 303067dde..bf204781a 100644
--- a/models-interactions/model-actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperation.java
+++ b/models-interactions/model-actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperation.java
@@ -84,7 +84,8 @@ public class AppcLcmOperation extends BidirectionalTopicOperation<AppcLcmDmaapWr
* Action Identifiers are required for APPC LCM requests. For R1, the recipes
* supported by Policy only require a vnf-id.
*/
- inputRequest.setActionIdentifiers(Map.of(VNF_ID_KEY, getTargetEntity()));
+ String target = getProperty(OperationProperties.AAI_TARGET_ENTITY);
+ inputRequest.setActionIdentifiers(Map.of(VNF_ID_KEY, target));
/*
* For R1, the payloads will not be required for the Restart, Rebuild, or Migrate
diff --git a/models-interactions/model-actors/actor.appclcm/src/test/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperationTest.java b/models-interactions/model-actors/actor.appclcm/src/test/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperationTest.java
index 650c5da99..b9999f4a1 100644
--- a/models-interactions/model-actors/actor.appclcm/src/test/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperationTest.java
+++ b/models-interactions/model-actors/actor.appclcm/src/test/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperationTest.java
@@ -22,6 +22,7 @@ package org.onap.policy.controlloop.actor.appclcm;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
@@ -94,6 +95,7 @@ public class AppcLcmOperationTest extends BasicBidirectionalTopicOperation<AppcL
response = makeResponse();
oper = new AppcLcmOperation(params, config);
+ oper.setProperty(OperationProperties.AAI_TARGET_ENTITY, TARGET_ENTITY);
}
@After
@@ -118,6 +120,7 @@ public class AppcLcmOperationTest extends BasicBidirectionalTopicOperation<AppcL
params = params.toBuilder().retry(0).timeoutSec(5).executor(blockingExecutor).build();
oper = new AppcLcmOperation(params, config);
+ oper.setProperty(OperationProperties.AAI_TARGET_ENTITY, TARGET_ENTITY);
outcome = oper.start().get();
assertEquals(OperationResult.SUCCESS, outcome.getResult());
@@ -161,6 +164,7 @@ public class AppcLcmOperationTest extends BasicBidirectionalTopicOperation<AppcL
// only builds a payload for ConfigModify
params = params.toBuilder().operation(AppcLcmConstants.OPERATION_CONFIG_MODIFY).build();
oper = new AppcLcmOperation(params, config);
+ oper.setProperty(OperationProperties.AAI_TARGET_ENTITY, TARGET_ENTITY);
oper.generateSubRequestId(2);
AppcLcmDmaapWrapper req = oper.makeRequest(2);
@@ -181,8 +185,7 @@ public class AppcLcmOperationTest extends BasicBidirectionalTopicOperation<AppcL
oper.generateSubRequestId(2);
- assertThatIllegalArgumentException().isThrownBy(() -> oper.makeRequest(2))
- .withMessage("Cannot convert payload");
+ assertThatThrownBy(() -> oper.makeRequest(2)).isInstanceOf(NullPointerException.class);
}
@Test