From 3d776b9d24b73b366b2f1e70b6c536e4d2705202 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Wed, 18 Nov 2020 12:04:26 -0500 Subject: Delete preprocessed flag from actors Removed the "preprocessed" flag from the Actor parameters, now that the actors no longer have a startPreprocess() method. Also removed targetEntity from the parameters. Issue-ID: POLICY-2804 Change-Id: I13bc80e1b6bb22d8d21b176796ca062109ce6658 Signed-off-by: Jim Hahn --- .../policy/drools/apps/controller/usecases/UsecasesEventManager.java | 1 - controlloop/common/controller-usecases/src/main/resources/usecases.drl | 2 +- .../policy/drools/apps/controller/usecases/step/AaiCqStep2Test.java | 3 +-- .../drools/apps/controller/usecases/step/AaiGetTenantStep2Test.java | 2 +- .../policy/drools/apps/controller/usecases/step/GuardStep2Test.java | 1 - .../policy/drools/apps/controller/usecases/step/LockStep2Test.java | 2 +- .../onap/policy/drools/apps/controller/usecases/step/Step2Test.java | 2 +- 7 files changed, 5 insertions(+), 8 deletions(-) (limited to 'controlloop/common/controller-usecases') diff --git a/controlloop/common/controller-usecases/src/main/java/org/onap/policy/drools/apps/controller/usecases/UsecasesEventManager.java b/controlloop/common/controller-usecases/src/main/java/org/onap/policy/drools/apps/controller/usecases/UsecasesEventManager.java index 091b26b2d..0649f1882 100644 --- a/controlloop/common/controller-usecases/src/main/java/org/onap/policy/drools/apps/controller/usecases/UsecasesEventManager.java +++ b/controlloop/common/controller-usecases/src/main/java/org/onap/policy/drools/apps/controller/usecases/UsecasesEventManager.java @@ -338,7 +338,6 @@ public class UsecasesEventManager extends ControlLoopEventManager implements Ste .actor(actor.getActor()) .operation(actor.getOperation()) .requestId(event.getRequestId()) - .preprocessed(true) .executor(getExecutor()) .retry(policy.getRetries()) .timeoutSec(policy.getTimeout()) diff --git a/controlloop/common/controller-usecases/src/main/resources/usecases.drl b/controlloop/common/controller-usecases/src/main/resources/usecases.drl index 12c9849f9..578bd9ca4 100644 --- a/controlloop/common/controller-usecases/src/main/resources/usecases.drl +++ b/controlloop/common/controller-usecases/src/main/resources/usecases.drl @@ -395,7 +395,7 @@ rule "EVENT.MANAGER.EXECUTE.STEP" if (guardDisabled && "GUARD".equals($step.getActorName())) { // guard is disabled - just enqueue a "SUCCESS" (i.e., "Permit") - OperationOutcome outcome = $step.getParams().makeOutcome(); + OperationOutcome outcome = $step.getParams().makeOutcome(null); outcome.setStart(Instant.now()); outcome.setEnd(outcome.getStart()); diff --git a/controlloop/common/controller-usecases/src/test/java/org/onap/policy/drools/apps/controller/usecases/step/AaiCqStep2Test.java b/controlloop/common/controller-usecases/src/test/java/org/onap/policy/drools/apps/controller/usecases/step/AaiCqStep2Test.java index 9869c2182..d05aa604c 100644 --- a/controlloop/common/controller-usecases/src/test/java/org/onap/policy/drools/apps/controller/usecases/step/AaiCqStep2Test.java +++ b/controlloop/common/controller-usecases/src/test/java/org/onap/policy/drools/apps/controller/usecases/step/AaiCqStep2Test.java @@ -48,7 +48,6 @@ import org.onap.policy.controlloop.actorserviceprovider.spi.Actor; import org.onap.policy.controlloop.eventmanager.StepContext; public class AaiCqStep2Test { - private static final String MY_TARGET = "my-target"; private static final UUID REQ_ID = UUID.randomUUID(); @Mock @@ -80,7 +79,7 @@ public class AaiCqStep2Test { future = new CompletableFuture<>(); when(params.toBuilder()).thenReturn(ControlLoopOperationParams.builder().actorService(actors) - .targetEntity(MY_TARGET).requestId(REQ_ID)); + .requestId(REQ_ID)); // configure policy operation when(actors.getActor(AaiActor.NAME)).thenReturn(policyActor); diff --git a/controlloop/common/controller-usecases/src/test/java/org/onap/policy/drools/apps/controller/usecases/step/AaiGetTenantStep2Test.java b/controlloop/common/controller-usecases/src/test/java/org/onap/policy/drools/apps/controller/usecases/step/AaiGetTenantStep2Test.java index 65c27b45f..7b1bae7d8 100644 --- a/controlloop/common/controller-usecases/src/test/java/org/onap/policy/drools/apps/controller/usecases/step/AaiGetTenantStep2Test.java +++ b/controlloop/common/controller-usecases/src/test/java/org/onap/policy/drools/apps/controller/usecases/step/AaiGetTenantStep2Test.java @@ -84,7 +84,7 @@ public class AaiGetTenantStep2Test { future = new CompletableFuture<>(); when(params.toBuilder()).thenReturn(ControlLoopOperationParams.builder().actorService(actors) - .targetEntity("my-target").requestId(REQ_ID)); + .requestId(REQ_ID)); // configure policy operation when(actors.getActor(AaiActor.NAME)).thenReturn(policyActor); diff --git a/controlloop/common/controller-usecases/src/test/java/org/onap/policy/drools/apps/controller/usecases/step/GuardStep2Test.java b/controlloop/common/controller-usecases/src/test/java/org/onap/policy/drools/apps/controller/usecases/step/GuardStep2Test.java index ab9507221..2ab647aa4 100644 --- a/controlloop/common/controller-usecases/src/test/java/org/onap/policy/drools/apps/controller/usecases/step/GuardStep2Test.java +++ b/controlloop/common/controller-usecases/src/test/java/org/onap/policy/drools/apps/controller/usecases/step/GuardStep2Test.java @@ -168,7 +168,6 @@ public class GuardStep2Test { params = ControlLoopOperationParams.builder() .actor(MASTER_ACTOR) .operation(MASTER_OPERATION) - .targetEntity(MY_TARGET) .requestId(REQ_ID) .targetType(target) .build(); diff --git a/controlloop/common/controller-usecases/src/test/java/org/onap/policy/drools/apps/controller/usecases/step/LockStep2Test.java b/controlloop/common/controller-usecases/src/test/java/org/onap/policy/drools/apps/controller/usecases/step/LockStep2Test.java index 2afd39547..c68f1873f 100644 --- a/controlloop/common/controller-usecases/src/test/java/org/onap/policy/drools/apps/controller/usecases/step/LockStep2Test.java +++ b/controlloop/common/controller-usecases/src/test/java/org/onap/policy/drools/apps/controller/usecases/step/LockStep2Test.java @@ -107,7 +107,7 @@ public class LockStep2Test { assertTrue(step.start(100)); // complete the operation's future - OperationOutcome outcome = params.makeOutcome(); + OperationOutcome outcome = step.makeOutcome(); outcome.setTarget(MY_TARGET); future.complete(outcome); diff --git a/controlloop/common/controller-usecases/src/test/java/org/onap/policy/drools/apps/controller/usecases/step/Step2Test.java b/controlloop/common/controller-usecases/src/test/java/org/onap/policy/drools/apps/controller/usecases/step/Step2Test.java index 7695d5b20..811901963 100644 --- a/controlloop/common/controller-usecases/src/test/java/org/onap/policy/drools/apps/controller/usecases/step/Step2Test.java +++ b/controlloop/common/controller-usecases/src/test/java/org/onap/policy/drools/apps/controller/usecases/step/Step2Test.java @@ -132,7 +132,7 @@ public class Step2Test { params = ControlLoopOperationParams.builder().actor(POLICY_ACTOR).actorService(actors) .completeCallback(completions::add).executor(ForkJoinPool.commonPool()) .operation(POLICY_OPERATION).payload(new TreeMap<>(payload)).startCallback(starts::add) - .targetType(TargetType.VM).targetEntityIds(entityIds).targetEntity(MY_TARGET) + .targetType(TargetType.VM).targetEntityIds(entityIds) .requestId(REQ_ID).build(); step = new Step2(stepContext, params, event); -- cgit 1.2.3-korg