summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.guard/src/test
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-06-10 14:14:40 -0400
committerJim Hahn <jrh3@att.com>2020-06-10 14:15:11 -0400
commit905f592c969066b78f14fe89f48485b80c67d475 (patch)
treea0b9e4edb4beb64f84ba89fbab2f17175a6988ef /models-interactions/model-actors/actor.guard/src/test
parent5dc52f7d5b3dadc422e58823b1086084a25788a3 (diff)
Rename GuardOperation to DecisionOperation
Issue-ID: POLICY-2628 Change-Id: I94eec317ff91f37add417f70f33c2d23fa0f3026 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-actors/actor.guard/src/test')
-rw-r--r--models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/DecisionOperationTest.java (renamed from models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/GuardOperationTest.java)14
-rw-r--r--models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/DecisionOperatorTest.java (renamed from models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/GuardOperatorTest.java)6
-rw-r--r--models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/GuardActorServiceProviderTest.java4
3 files changed, 12 insertions, 12 deletions
diff --git a/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/GuardOperationTest.java b/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/DecisionOperationTest.java
index daf4dff6e..da0ee95b5 100644
--- a/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/GuardOperationTest.java
+++ b/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/DecisionOperationTest.java
@@ -54,7 +54,7 @@ import org.onap.policy.models.decisions.concepts.DecisionRequest;
import org.onap.policy.models.decisions.concepts.DecisionResponse;
import org.onap.policy.simulators.GuardSimulatorJaxRs;
-public class GuardOperationTest extends BasicHttpOperation<DecisionRequest> {
+public class DecisionOperationTest extends BasicHttpOperation<DecisionRequest> {
@Mock
private Consumer<OperationOutcome> started;
@@ -62,7 +62,7 @@ public class GuardOperationTest extends BasicHttpOperation<DecisionRequest> {
private Consumer<OperationOutcome> completed;
private GuardConfig guardConfig;
- private GuardOperation oper;
+ private DecisionOperation oper;
/**
* Starts the simulator.
@@ -105,7 +105,7 @@ public class GuardOperationTest extends BasicHttpOperation<DecisionRequest> {
params = params.toBuilder().startCallback(started).completeCallback(completed).build();
- oper = new GuardOperation(params, config);
+ oper = new DecisionOperation(params, config);
}
/**
@@ -117,7 +117,7 @@ public class GuardOperationTest extends BasicHttpOperation<DecisionRequest> {
config = new GuardConfig(blockingExecutor, opParams, HttpClientFactoryInstance.getClientFactory());
params = params.toBuilder().retry(0).timeoutSec(5).executor(blockingExecutor).build();
- oper = new GuardOperation(params, config);
+ oper = new DecisionOperation(params, config);
outcome = oper.start().get();
assertEquals(PolicyResult.SUCCESS, outcome.getResult());
@@ -134,7 +134,7 @@ public class GuardOperationTest extends BasicHttpOperation<DecisionRequest> {
params = params.toBuilder().retry(0).timeoutSec(5).executor(blockingExecutor)
.payload(Map.of("clname", GuardSimulatorJaxRs.DENY_CLNAME)).build();
- oper = new GuardOperation(params, config);
+ oper = new DecisionOperation(params, config);
outcome = oper.start().get();
assertEquals(PolicyResult.FAILURE, outcome.getResult());
@@ -154,7 +154,7 @@ public class GuardOperationTest extends BasicHttpOperation<DecisionRequest> {
assertFalse(future2.isDone());
DecisionResponse resp = new DecisionResponse();
- resp.setStatus(GuardOperation.PERMIT);
+ resp.setStatus(DecisionOperation.PERMIT);
when(rawResponse.readEntity(String.class)).thenReturn(Util.translate("", resp, String.class));
verify(client).post(callbackCaptor.capture(), any(), requestCaptor.capture(), any());
@@ -205,7 +205,7 @@ public class GuardOperationTest extends BasicHttpOperation<DecisionRequest> {
// null payload - start with fresh parameters and operation
params = params.toBuilder().payload(null).build();
- oper = new GuardOperation(params, config);
+ oper = new DecisionOperation(params, config);
assertThatIllegalArgumentException().isThrownBy(() -> oper.makeRequest());
}
diff --git a/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/GuardOperatorTest.java b/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/DecisionOperatorTest.java
index 36263329a..170bcdf7e 100644
--- a/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/GuardOperatorTest.java
+++ b/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/DecisionOperatorTest.java
@@ -35,7 +35,7 @@ import org.onap.policy.common.endpoints.http.client.HttpClientFactory;
import org.onap.policy.controlloop.actorserviceprovider.Util;
import org.onap.policy.controlloop.actorserviceprovider.parameters.ParameterValidationRuntimeException;
-public class GuardOperatorTest {
+public class DecisionOperatorTest {
private static final String ACTOR = "my-actor";
private static final String OPERATION = "my-name";
private static final String CLIENT = "my-client";
@@ -53,7 +53,7 @@ public class GuardOperatorTest {
private HttpClientFactory factory;
- private GuardOperator oper;
+ private DecisionOperator oper;
/**
* Initializes fields, including {@link #oper}, and resets the static fields used by
@@ -92,7 +92,7 @@ public class GuardOperatorTest {
}
- private class MyOperator extends GuardOperator {
+ private class MyOperator extends DecisionOperator {
public MyOperator() {
super(ACTOR, OPERATION, null);
}
diff --git a/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/GuardActorServiceProviderTest.java b/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/GuardActorServiceProviderTest.java
index 6721ff7d0..0ad8161c6 100644
--- a/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/GuardActorServiceProviderTest.java
+++ b/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/GuardActorServiceProviderTest.java
@@ -35,7 +35,7 @@ public class GuardActorServiceProviderTest extends BasicActor {
final GuardActorServiceProvider prov = new GuardActorServiceProvider();
// verify that it has the operators we expect
- var expected = Arrays.asList(GuardOperation.NAME).stream().sorted().collect(Collectors.toList());
+ var expected = Arrays.asList(DecisionOperation.NAME).stream().sorted().collect(Collectors.toList());
var actual = prov.getOperationNames().stream().sorted().collect(Collectors.toList());
assertEquals(expected.toString(), actual.toString());
@@ -43,6 +43,6 @@ public class GuardActorServiceProviderTest extends BasicActor {
// verify that it all plugs into the ActorService
verifyActorService(GuardActorServiceProvider.NAME, "service.yaml");
- assertTrue(prov.getOperator(GuardOperation.NAME) instanceof GuardOperator);
+ assertTrue(prov.getOperator(DecisionOperation.NAME) instanceof DecisionOperator);
}
}