X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=models-interactions%2Fmodel-actors%2FactorServiceProvider%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Fcontrolloop%2Factorserviceprovider%2Fimpl%2FOperationPartialTest.java;h=f6dbcd85f78290f488b5ff8f94ab586c691faa4f;hb=f46e4ec3af461b4036b189fd8d6a18af37acc29d;hp=72a7338d55a9a8a35016db4d8e5be9985cb5e9d7;hpb=1dd41890f83702d47c5a957493046433989ef36c;p=policy%2Fmodels.git diff --git a/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperationPartialTest.java b/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperationPartialTest.java index 72a7338d5..f6dbcd85f 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperationPartialTest.java +++ b/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperationPartialTest.java @@ -283,7 +283,7 @@ public class OperationPartialTest { public void testIsActorFailed() { assertFalse(oper.isActorFailed(null)); - OperationOutcome outcome = params.makeOutcome(null); + OperationOutcome outcome = params.makeOutcome(); // incorrect outcome outcome.setResult(OperationResult.SUCCESS); @@ -343,7 +343,7 @@ public class OperationPartialTest { @Override protected CompletableFuture startOperationAsync(int attempt, OperationOutcome outcome) { - OperationOutcome outcome2 = params.makeOutcome(null); + OperationOutcome outcome2 = params.makeOutcome(); outcome2.setResult(OperationResult.SUCCESS); /* @@ -480,7 +480,7 @@ public class OperationPartialTest { public void testIsSameOperation() { assertFalse(oper.isSameOperation(null)); - OperationOutcome outcome = params.makeOutcome(null); + OperationOutcome outcome = params.makeOutcome(); // wrong actor - should be false outcome.setActor(null); @@ -523,7 +523,7 @@ public class OperationPartialTest { // first task completes, others do not List>> tasks = new LinkedList<>(); - final OperationOutcome outcome = params.makeOutcome(null); + final OperationOutcome outcome = params.makeOutcome(); tasks.add(() -> CompletableFuture.completedFuture(outcome)); tasks.add(() -> new CompletableFuture<>()); @@ -588,7 +588,7 @@ public class OperationPartialTest { @Test public void testAllOfArray() throws Exception { - final OperationOutcome outcome = params.makeOutcome(null); + final OperationOutcome outcome = params.makeOutcome(); CompletableFuture future1 = new CompletableFuture<>(); CompletableFuture future2 = new CompletableFuture<>(); @@ -619,7 +619,7 @@ public class OperationPartialTest { @Test public void testAllOfList() throws Exception { - final OperationOutcome outcome = params.makeOutcome(null); + final OperationOutcome outcome = params.makeOutcome(); CompletableFuture future1 = new CompletableFuture<>(); CompletableFuture future2 = new CompletableFuture<>(); @@ -708,9 +708,9 @@ public class OperationPartialTest { // null outcome - takes precedence over a success List>> tasks = new LinkedList<>(); - tasks.add(() -> CompletableFuture.completedFuture(params.makeOutcome(null))); + tasks.add(() -> CompletableFuture.completedFuture(params.makeOutcome())); tasks.add(() -> CompletableFuture.completedFuture(null)); - tasks.add(() -> CompletableFuture.completedFuture(params.makeOutcome(null))); + tasks.add(() -> CompletableFuture.completedFuture(params.makeOutcome())); CompletableFuture result = oper.allOf(tasks); assertTrue(executor.runAll(MAX_REQUESTS)); @@ -721,9 +721,9 @@ public class OperationPartialTest { IllegalStateException except = new IllegalStateException(EXPECTED_EXCEPTION); tasks.clear(); - tasks.add(() -> CompletableFuture.completedFuture(params.makeOutcome(null))); + tasks.add(() -> CompletableFuture.completedFuture(params.makeOutcome())); tasks.add(() -> CompletableFuture.failedFuture(except)); - tasks.add(() -> CompletableFuture.completedFuture(params.makeOutcome(null))); + tasks.add(() -> CompletableFuture.completedFuture(params.makeOutcome())); result = oper.allOf(tasks); assertTrue(executor.runAll(MAX_REQUESTS)); @@ -736,7 +736,7 @@ public class OperationPartialTest { */ @Test public void testSequence() throws Exception { - final OperationOutcome outcome = params.makeOutcome(null); + final OperationOutcome outcome = params.makeOutcome(); List>> tasks = new LinkedList<>(); tasks.add(() -> CompletableFuture.completedFuture(outcome)); @@ -758,7 +758,7 @@ public class OperationPartialTest { assertSame(outcome, result.get()); // second task fails, third should not run - OperationOutcome failure = params.makeOutcome(null); + OperationOutcome failure = params.makeOutcome(); failure.setResult(OperationResult.FAILURE); tasks.clear(); tasks.add(() -> CompletableFuture.completedFuture(outcome)); @@ -797,7 +797,7 @@ public class OperationPartialTest { OperationOutcome expectedOutcome = null; for (int count = 0; count < results.length; ++count) { - OperationOutcome outcome = params.makeOutcome(null); + OperationOutcome outcome = params.makeOutcome(); outcome.setResult(results[count]); tasks.add(() -> CompletableFuture.completedFuture(outcome)); @@ -817,7 +817,7 @@ public class OperationPartialTest { public void testDetmPriority() throws CoderException { assertEquals(1, oper.detmPriority(null)); - OperationOutcome outcome = params.makeOutcome(null); + OperationOutcome outcome = params.makeOutcome(); Map map = Map.of(OperationResult.SUCCESS, 0, OperationResult.FAILURE_GUARD, 2, OperationResult.FAILURE_RETRIES, 3, OperationResult.FAILURE, 4, OperationResult.FAILURE_TIMEOUT, 5, @@ -1049,7 +1049,7 @@ public class OperationPartialTest { } private OperationOutcome makeSuccess() { - OperationOutcome outcome = params.makeOutcome(null); + OperationOutcome outcome = params.makeOutcome(); outcome.setResult(OperationResult.SUCCESS); return outcome;