aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);
- }
}
+
+
}