diff options
author | Jim Hahn <jrh3@att.com> | 2020-02-20 09:40:14 -0500 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2020-02-20 16:29:08 -0500 |
commit | 467247c7970f9ae83464d78929ed970bbf03c593 (patch) | |
tree | 54b78e6505b664c3a61e532bf6f7c276307d6591 /models-interactions/model-actors/actor.aai/src/test | |
parent | f6da7772d9dc01ce4ddd21a55b0f1c5fb7ad814f (diff) |
More actor clean-up
Currently, Operator classes refer to Operation classes, and
vice versa, creating a dependency cycle. In addition, there is
a slight problem in that if an operator is reconfigured, any
running operation may get inconsistent configuration data.
Modified the code to create Config objects that are passed to
the operation, instead of passing the Operator to the operations.
This solved both issues.
Replaceed makeOperator() with constructors.
Added parameter type to HttpActors.
Modified guard to get "ONAP" properties from its configuration,
as a default.
Changed setUp() to setUpBasic(), so "throws Exception" could be
removed, thus resolving a sonar issue.
Issue-ID: POLICY-1625
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I21eb8798acfbc636ff1bd8741b21c7278365b6e4
Diffstat (limited to 'models-interactions/model-actors/actor.aai/src/test')
2 files changed, 5 insertions, 5 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 05b07fb07..1ec7bea4e 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 @@ -77,14 +77,14 @@ public class AaiCustomQueryOperationTest extends BasicAaiOperation<Map<String, S */ @Before public void setUp() throws Exception { - super.setUp(); + super.setUpBasic(); MyTenantOperator tenantOperator = new MyTenantOperator(); when(service.getActor(AaiConstants.ACTOR_NAME)).thenReturn(tenantActor); when(tenantActor.getOperator(AaiGetOperation.TENANT)).thenReturn(tenantOperator); - oper = new AaiCustomQueryOperation(params, operator); + oper = new AaiCustomQueryOperation(params, config); } @Test @@ -216,7 +216,7 @@ public class AaiCustomQueryOperationTest extends BasicAaiOperation<Map<String, S @Override public Operation buildOperation(ControlLoopOperationParams params) { - return new AaiGetOperation(params, this); + return new AaiGetOperation(params, getCurrentConfig()); } @Override diff --git a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetOperationTest.java b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetOperationTest.java index 654864246..4681d9ef4 100644 --- a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetOperationTest.java +++ b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetOperationTest.java @@ -54,8 +54,8 @@ public class AaiGetOperationTest extends BasicAaiOperation<Void> { */ @Before public void setUp() throws Exception { - super.setUp(); - oper = new AaiGetOperation(params, operator); + super.setUpBasic(); + oper = new AaiGetOperation(params, config); } @Test |