diff options
Diffstat (limited to 'models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/parameters/ControlLoopOperationParamsTest.java')
-rw-r--r-- | models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/parameters/ControlLoopOperationParamsTest.java | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/parameters/ControlLoopOperationParamsTest.java b/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/parameters/ControlLoopOperationParamsTest.java index b6bd50c7e..fc36c12ba 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/parameters/ControlLoopOperationParamsTest.java +++ b/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/parameters/ControlLoopOperationParamsTest.java @@ -112,8 +112,8 @@ public class ControlLoopOperationParamsTest { params = ControlLoopOperationParams.builder().actorService(actorService).completeCallback(completer) .requestId(REQ_ID).executor(executor).actor(ACTOR).operation(OPERATION).payload(payload) - .retry(RETRY).targetEntity(TARGET_ENTITY).timeoutSec(TIMEOUT) - .startCallback(starter).preprocessed(true).build(); + .retry(RETRY).timeoutSec(TIMEOUT) + .startCallback(starter).build(); outcome = params.makeOutcome(TARGET_ENTITY); } @@ -139,13 +139,20 @@ public class ControlLoopOperationParamsTest { @Test public void testMakeOutcome() { - assertEquals(ACTOR, outcome.getActor()); - assertEquals(OPERATION, outcome.getOperation()); + outcome = params.makeOutcome(); + assertNull(outcome.getTarget()); + checkRemainingFields("with actor"); + } + + @Test + public void testMakeOutcomeString() { + assertEquals(TARGET_ENTITY, outcome.getTarget()); checkRemainingFields("with actor"); } protected void checkRemainingFields(String testName) { - assertEquals(testName, TARGET_ENTITY, outcome.getTarget()); + assertEquals(ACTOR, outcome.getActor()); + assertEquals(OPERATION, outcome.getOperation()); assertNull(testName, outcome.getStart()); assertNull(testName, outcome.getEnd()); assertNull(testName, outcome.getSubRequestId()); @@ -212,7 +219,7 @@ public class ControlLoopOperationParamsTest { testValidate("requestId", NULL_MSG, bldr -> bldr.requestId(null)); // has no target entity - BeanValidationResult result = params.toBuilder().targetEntity(null).build().validate(); + BeanValidationResult result = params.toBuilder().build().validate(); assertTrue(result.isValid()); // check edge cases @@ -224,7 +231,7 @@ public class ControlLoopOperationParamsTest { // test with minimal fields assertTrue(ControlLoopOperationParams.builder().actorService(actorService).requestId(REQ_ID).actor(ACTOR) - .operation(OPERATION).targetEntity(TARGET_ENTITY).build().validate().isValid()); + .operation(OPERATION).build().validate().isValid()); } private void testValidate(String fieldName, String expected, @@ -277,14 +284,6 @@ public class ControlLoopOperationParamsTest { } @Test - public void test() { - assertTrue(params.isPreprocessed()); - - // should be false when unspecified - assertFalse(ControlLoopOperationParams.builder().build().isPreprocessed()); - } - - @Test public void testGetRetry() { assertSame(RETRY, params.getRetry()); @@ -312,9 +311,4 @@ public class ControlLoopOperationParamsTest { public void testGetCompleteCallback() { assertSame(completer, params.getCompleteCallback()); } - - @Test - public void testGetTargetEntity() { - assertEquals(TARGET_ENTITY, params.getTargetEntity()); - } } |