diff options
author | Pamela Dragosh <pdragosh@research.att.com> | 2020-08-27 08:44:12 -0400 |
---|---|---|
committer | Pamela Dragosh <pdragosh@research.att.com> | 2020-08-27 14:29:09 -0400 |
commit | f456cc5c8e1efd15edb6da718e1428d8fd7c66c5 (patch) | |
tree | b7b4ba3fc6255b056e00f6e203d7ec8fd6a7c194 /models-interactions/model-actors/actor.aai/src/test | |
parent | 68a60a45f27287a4a523c82ef466cbeec655f641 (diff) |
Remove Target and TargetType
The dependency should have been removed in the last review to
remove SDC and policy-yaml legacy code.
It was revealed that usage of TargetType and Type were spread out over the
actor code. Those fields are represented differently in the new
TOSCA Operational Policy Type, so fields were created to capture
those values to be used by actor code.
Issue-ID: POLICY-2428
Change-Id: Ib783526a518ca7942ae9e38019bd343639f4dd98
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'models-interactions/model-actors/actor.aai/src/test')
3 files changed, 17 insertions, 17 deletions
diff --git a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperationTest.java b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperationTest.java index 8e8b8f150..5a5e170dd 100644 --- a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperationTest.java +++ b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperationTest.java @@ -53,6 +53,7 @@ import org.onap.policy.common.utils.coder.StandardCoder; import org.onap.policy.common.utils.coder.StandardCoderObject; import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome; import org.onap.policy.controlloop.actorserviceprovider.OperationProperties; +import org.onap.policy.controlloop.actorserviceprovider.OperationResult; import org.onap.policy.controlloop.actorserviceprovider.Util; import org.onap.policy.controlloop.actorserviceprovider.impl.HttpOperation; import org.onap.policy.controlloop.actorserviceprovider.impl.HttpOperator; @@ -60,7 +61,6 @@ import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOp import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpConfig; import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpParams; import org.onap.policy.controlloop.actorserviceprovider.spi.Actor; -import org.onap.policy.controlloop.policy.PolicyResult; public class AaiCustomQueryOperationTest extends BasicAaiOperation { private static final StandardCoder coder = new StandardCoder(); @@ -120,7 +120,7 @@ public class AaiCustomQueryOperationTest extends BasicAaiOperation { oper.setProperty(OperationProperties.AAI_VSERVER_LINK, MY_LINK); outcome = oper.start().get(); - assertEquals(PolicyResult.SUCCESS, outcome.getResult()); + assertEquals(OperationResult.SUCCESS, outcome.getResult()); assertNotNull(outcome.getResponse()); } @@ -171,7 +171,7 @@ public class AaiCustomQueryOperationTest extends BasicAaiOperation { CompletableFuture<OperationOutcome> future2 = oper.start(); - assertEquals(PolicyResult.SUCCESS, getResult(future2)); + assertEquals(OperationResult.SUCCESS, getResult(future2)); // tenant response should have been cached within the context assertNotNull(context.getProperty(AaiGetTenantOperation.getKey(MY_VSERVER))); @@ -198,7 +198,7 @@ public class AaiCustomQueryOperationTest extends BasicAaiOperation { CompletableFuture<OperationOutcome> future2 = oper.start(); - assertEquals(PolicyResult.SUCCESS, getResult(future2)); + assertEquals(OperationResult.SUCCESS, getResult(future2)); // should not have replaced tenant response assertSame(data, context.getProperty(AaiGetTenantOperation.getKey(MY_VSERVER))); @@ -259,10 +259,10 @@ public class AaiCustomQueryOperationTest extends BasicAaiOperation { @Test public void testSetOutcome() { - outcome = oper.setOutcome(params.makeOutcome(null), PolicyResult.SUCCESS, null, null); + outcome = oper.setOutcome(params.makeOutcome(null), OperationResult.SUCCESS, null, null); assertNull(outcome.getResponse()); - outcome = oper.setOutcome(params.makeOutcome(null), PolicyResult.SUCCESS, null, "{}"); + outcome = oper.setOutcome(params.makeOutcome(null), OperationResult.SUCCESS, null, "{}"); assertTrue(outcome.getResponse() instanceof AaiCqResponse); } @@ -289,7 +289,7 @@ public class AaiCustomQueryOperationTest extends BasicAaiOperation { context.setProperty(AaiGetTenantOperation.getKey(SIM_VSERVER), data); } - private PolicyResult getResult(CompletableFuture<OperationOutcome> future2) + private OperationResult getResult(CompletableFuture<OperationOutcome> future2) throws InterruptedException, ExecutionException, TimeoutException { executor.runAll(100); diff --git a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetPnfOperationTest.java b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetPnfOperationTest.java index 13b5b5926..84f28210e 100644 --- a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetPnfOperationTest.java +++ b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetPnfOperationTest.java @@ -43,9 +43,9 @@ import org.onap.policy.common.utils.coder.StandardCoder; import org.onap.policy.common.utils.coder.StandardCoderObject; import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome; import org.onap.policy.controlloop.actorserviceprovider.OperationProperties; +import org.onap.policy.controlloop.actorserviceprovider.OperationResult; import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpConfig; import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpParams; -import org.onap.policy.controlloop.policy.PolicyResult; public class AaiGetPnfOperationTest extends BasicAaiOperation { private static final String INPUT_FIELD = "input"; @@ -100,7 +100,7 @@ public class AaiGetPnfOperationTest extends BasicAaiOperation { oper.setProperty(OperationProperties.AAI_TARGET_ENTITY, "OzVServer"); outcome = oper.start().get(); - assertEquals(PolicyResult.SUCCESS, outcome.getResult()); + assertEquals(OperationResult.SUCCESS, outcome.getResult()); assertTrue(outcome.getResponse() instanceof StandardCoderObject); } @@ -117,7 +117,7 @@ public class AaiGetPnfOperationTest extends BasicAaiOperation { oper.setProperty(OperationProperties.AAI_TARGET_ENTITY, "getFail"); outcome = oper.start().get(); - assertEquals(PolicyResult.FAILURE, outcome.getResult()); + assertEquals(OperationResult.FAILURE, outcome.getResult()); } @Test @@ -139,7 +139,7 @@ public class AaiGetPnfOperationTest extends BasicAaiOperation { executor.runAll(100); assertTrue(future2.isDone()); - assertEquals(PolicyResult.SUCCESS, future2.get().getResult()); + assertEquals(OperationResult.SUCCESS, future2.get().getResult()); // data should have been cached within the context StandardCoderObject data = context.getProperty(AaiGetPnfOperation.getKey(TARGET_ENTITY)); @@ -167,7 +167,7 @@ public class AaiGetPnfOperationTest extends BasicAaiOperation { executor.runAll(100); assertTrue(future2.isDone()); - assertEquals(PolicyResult.FAILURE, future2.get().getResult()); + assertEquals(OperationResult.FAILURE, future2.get().getResult()); // data should NOT have been cached within the context assertNull(context.getProperty(AaiGetPnfOperation.getKey(TARGET_ENTITY))); diff --git a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetTenantOperationTest.java b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetTenantOperationTest.java index 11604cdb9..cf9a7a6a1 100644 --- a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetTenantOperationTest.java +++ b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetTenantOperationTest.java @@ -43,9 +43,9 @@ import org.onap.policy.common.utils.coder.StandardCoder; import org.onap.policy.common.utils.coder.StandardCoderObject; import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome; import org.onap.policy.controlloop.actorserviceprovider.OperationProperties; +import org.onap.policy.controlloop.actorserviceprovider.OperationResult; import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpConfig; import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpParams; -import org.onap.policy.controlloop.policy.PolicyResult; public class AaiGetTenantOperationTest extends BasicAaiOperation { private static final String INPUT_FIELD = "input"; @@ -100,7 +100,7 @@ public class AaiGetTenantOperationTest extends BasicAaiOperation { oper.setProperty(OperationProperties.AAI_TARGET_ENTITY, "OzVServer"); outcome = oper.start().get(); - assertEquals(PolicyResult.SUCCESS, outcome.getResult()); + assertEquals(OperationResult.SUCCESS, outcome.getResult()); assertTrue(outcome.getResponse() instanceof StandardCoderObject); } @@ -117,7 +117,7 @@ public class AaiGetTenantOperationTest extends BasicAaiOperation { oper.setProperty(OperationProperties.AAI_TARGET_ENTITY, "failedVserver"); outcome = oper.start().get(); - assertEquals(PolicyResult.FAILURE, outcome.getResult()); + assertEquals(OperationResult.FAILURE, outcome.getResult()); } @Test @@ -139,7 +139,7 @@ public class AaiGetTenantOperationTest extends BasicAaiOperation { executor.runAll(100); assertTrue(future2.isDone()); - assertEquals(PolicyResult.SUCCESS, future2.get().getResult()); + assertEquals(OperationResult.SUCCESS, future2.get().getResult()); // data should have been cached within the context StandardCoderObject data = context.getProperty(AaiGetTenantOperation.getKey(TARGET_ENTITY)); @@ -167,7 +167,7 @@ public class AaiGetTenantOperationTest extends BasicAaiOperation { executor.runAll(100); assertTrue(future2.isDone()); - assertEquals(PolicyResult.FAILURE, future2.get().getResult()); + assertEquals(OperationResult.FAILURE, future2.get().getResult()); // data should NOT have been cached within the context assertNull(context.getProperty(AaiGetTenantOperation.getKey(TARGET_ENTITY))); |