summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.appc
diff options
context:
space:
mode:
Diffstat (limited to 'models-interactions/model-actors/actor.appc')
-rw-r--r--models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/ModifyConfigOperation.java4
-rw-r--r--models-interactions/model-actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/AppcOperationTest.java10
-rw-r--r--models-interactions/model-actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/ModifyConfigOperationTest.java10
3 files changed, 24 insertions, 0 deletions
diff --git a/models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/ModifyConfigOperation.java b/models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/ModifyConfigOperation.java
index d1f27b505..680bd9cc7 100644
--- a/models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/ModifyConfigOperation.java
+++ b/models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/ModifyConfigOperation.java
@@ -56,6 +56,10 @@ public class ModifyConfigOperation extends AppcOperation {
@Override
@SuppressWarnings("unchecked")
protected CompletableFuture<OperationOutcome> startPreprocessorAsync() {
+ if (params.isPreprocessed()) {
+ return null;
+ }
+
ControlLoopOperationParams cqParams = params.toBuilder().actor(AaiConstants.ACTOR_NAME)
.operation(AaiCqResponse.OPERATION).payload(null).retry(null).timeoutSec(null).build();
diff --git a/models-interactions/model-actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/AppcOperationTest.java b/models-interactions/model-actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/AppcOperationTest.java
index e544d46cb..4bbb057d7 100644
--- a/models-interactions/model-actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/AppcOperationTest.java
+++ b/models-interactions/model-actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/AppcOperationTest.java
@@ -23,6 +23,7 @@ package org.onap.policy.controlloop.actor.appc;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import java.util.Arrays;
@@ -85,6 +86,15 @@ public class AppcOperationTest extends BasicAppcOperation {
assertNotNull(oper.startPreprocessorAsync());
}
+ /**
+ * Tests startPreprocessorAsync(), when preprocessing is disabled.
+ */
+ @Test
+ public void testStartPreprocessorAsyncDisabled() {
+ params = params.toBuilder().preprocessed(true).build();
+ assertNull(new MyOper(params, config).startPreprocessorAsync());
+ }
+
@Test
public void testMakeRequest() {
oper.generateSubRequestId(2);
diff --git a/models-interactions/model-actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/ModifyConfigOperationTest.java b/models-interactions/model-actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/ModifyConfigOperationTest.java
index d000038e3..9c602f52e 100644
--- a/models-interactions/model-actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/ModifyConfigOperationTest.java
+++ b/models-interactions/model-actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/ModifyConfigOperationTest.java
@@ -25,6 +25,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
@@ -156,6 +157,15 @@ public class ModifyConfigOperationTest extends BasicAppcOperation {
assertEquals(PolicyResult.SUCCESS, future3.get().getResult());
}
+ /**
+ * Tests startPreprocessorAsync(), when preprocessing is disabled.
+ */
+ @Test
+ public void testStartPreprocessorAsyncDisabled() {
+ params = params.toBuilder().preprocessed(true).build();
+ assertNull(new ModifyConfigOperation(params, config).startPreprocessorAsync());
+ }
+
@Test
public void testMakeRequest() throws CoderException {
AaiCqResponse cq = new AaiCqResponse("{}");