aboutsummaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.guard/src
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-07-29 13:50:40 -0400
committerJim Hahn <jrh3@att.com>2020-07-31 14:08:17 -0400
commitacded8235dcbb0b06abaa98297fecef78b4eec41 (patch)
tree8b400d09875cd2c6f7844fbbe0c4d9e1e1a16230 /models-interactions/model-actors/actor.guard/src
parent1da24b28d9df7c8ad5154d7788dab0ab9da589f8 (diff)
Add property lists to Actors
Modified the Actor code to provide a list of properties needed by the actor to perform a given operation. Added a build() method to the parameter class so invokers can build an operation and set its properties prior to starting it. Added a "preprocessed" field to the parameter class so invokers can indicate that the Actor need not perform any preprocessing steps. Will modify the actors, in a subsequent review, to observe the flag. Added "properties" to Operation so invokers can set the properties. Will modify the actors, in a subsequent review, to use the property values instead of the event context. Tweaked a few Actors to get values using the "params" object instead of reaching inside to the event object that it contains. Addressed review comment(s): - add prefix to other property names Issue-ID: POLICY-2746 Change-Id: I65996aef5cec5afe25e8287c0b2f5f322c532ca5 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-actors/actor.guard/src')
-rw-r--r--models-interactions/model-actors/actor.guard/src/main/java/org/onap/policy/controlloop/actor/guard/DecisionOperation.java3
-rw-r--r--models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/DecisionOperationTest.java6
2 files changed, 8 insertions, 1 deletions
diff --git a/models-interactions/model-actors/actor.guard/src/main/java/org/onap/policy/controlloop/actor/guard/DecisionOperation.java b/models-interactions/model-actors/actor.guard/src/main/java/org/onap/policy/controlloop/actor/guard/DecisionOperation.java
index 6a7b6fd93..bd4f0e3b6 100644
--- a/models-interactions/model-actors/actor.guard/src/main/java/org/onap/policy/controlloop/actor/guard/DecisionOperation.java
+++ b/models-interactions/model-actors/actor.guard/src/main/java/org/onap/policy/controlloop/actor/guard/DecisionOperation.java
@@ -20,6 +20,7 @@
package org.onap.policy.controlloop.actor.guard;
+import java.util.Collections;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;
@@ -81,7 +82,7 @@ public class DecisionOperation extends HttpOperation<DecisionResponse> {
* @param config configuration for this operation
*/
public DecisionOperation(ControlLoopOperationParams params, HttpConfig config) {
- super(params, config, DecisionResponse.class);
+ super(params, config, DecisionResponse.class, Collections.emptyList());
this.config = (GuardConfig) config;
}
diff --git a/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/DecisionOperationTest.java b/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/DecisionOperationTest.java
index 6fe8ceac2..ac6d6c8e3 100644
--- a/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/DecisionOperationTest.java
+++ b/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/DecisionOperationTest.java
@@ -20,6 +20,7 @@
package org.onap.policy.controlloop.actor.guard;
+import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -148,6 +149,11 @@ public class DecisionOperationTest extends BasicHttpOperation {
}
@Test
+ public void testGetPropertyNames() {
+ assertThat(oper.getPropertyNames()).isEmpty();
+ }
+
+ @Test
public void testStartOperationAsync() throws Exception {
CompletableFuture<OperationOutcome> future2 = oper.start();
executor.runAll(100);