aboutsummaryrefslogtreecommitdiffstats
path: root/models-interactions
diff options
context:
space:
mode:
authorkrishnaa96 <krishna.moorthy6@wipro.com>2020-12-07 12:33:17 +0530
committerkrishnaa96 <krishna.moorthy6@wipro.com>2020-12-07 12:35:10 +0530
commit1ca0dd29ae3e348c92b2d23d85c5c135797e21af (patch)
treee0e882e5f6b09bcbb1e34d69f25798a6fe04787e /models-interactions
parentac7d552dfaca9ef9293282b9467ab29873c69f4b (diff)
Fix Modify NSSI operation
Update the operation to receive payload from the onset message Issue-ID: POLICY-2916 Signed-off-by: krishnaa96 <krishna.moorthy6@wipro.com> Change-Id: If49d41b35c1cd6562146fe4d92799a9a77a46db9
Diffstat (limited to 'models-interactions')
-rw-r--r--models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/ModifyNssi.java4
-rw-r--r--models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/ModifyNssiTest.java17
2 files changed, 6 insertions, 15 deletions
diff --git a/models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/ModifyNssi.java b/models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/ModifyNssi.java
index 69d11fd14..2c5038834 100644
--- a/models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/ModifyNssi.java
+++ b/models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/ModifyNssi.java
@@ -38,7 +38,6 @@ public class ModifyNssi extends SoOperation {
public static final String NAME = "Modify NSSI";
private static final List<String> PROPERTY_NAMES = List.of(
- OperationProperties.AAI_SERVICE,
OperationProperties.EVENT_PAYLOAD);
/**
@@ -70,8 +69,7 @@ public class ModifyNssi extends SoOperation {
private SoRequest3gpp makeRequest() {
- Map<String, Object> payload = params.getPayload();
-
+ String payload = getProperty(OperationProperties.EVENT_PAYLOAD);
try {
return getCoder().convert(payload, SoRequest3gpp.class);
} catch (CoderException e) {
diff --git a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/ModifyNssiTest.java b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/ModifyNssiTest.java
index ff5f87c4e..2d290d68a 100644
--- a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/ModifyNssiTest.java
+++ b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/ModifyNssiTest.java
@@ -78,7 +78,7 @@ public class ModifyNssiTest extends BasicSoOperation {
params = params.toBuilder().retry(0).timeoutSec(5).executor(blockingExecutor).build();
oper = new ModifyNssi(params, config);
-
+ oper.setProperty(OperationProperties.EVENT_PAYLOAD, getPayload());
outcome = oper.start().get();
assertEquals(OperationResult.SUCCESS, outcome.getResult());
@@ -100,20 +100,13 @@ public class ModifyNssiTest extends BasicSoOperation {
public void testGetPropertyNames() {
assertThat(oper.getPropertyNames()).isEqualTo(
List.of(
- OperationProperties.AAI_SERVICE,
OperationProperties.EVENT_PAYLOAD));
}
- @Override
- @SuppressWarnings("unchecked")
- protected Map<String, Object> makePayload() {
- String payloadString = ResourceUtils
+ private String getPayload() {
+ return ResourceUtils
.getResourceAsString("src/test/resources/ModifyNSSI.json");
-
- try {
- return coder.decode(payloadString, Map.class);
- } catch (CoderException e) {
- throw new IllegalArgumentException("invalid payload value: " + payloadString, e);
- }
}
+
+
}