Delete preprocessed flag from actors
[policy/models.git] / models-interactions / model-actors / actorServiceProvider / src / test / java / org / onap / policy / controlloop / actorserviceprovider / impl / OperationPartialTest.java
index 6db824f..72a7338 100644 (file)
@@ -29,7 +29,6 @@ import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
 import ch.qos.logback.classic.Logger;
@@ -60,7 +59,6 @@ import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
-import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
@@ -71,17 +69,15 @@ import org.onap.policy.common.utils.coder.StandardCoder;
 import org.onap.policy.common.utils.test.log.logback.ExtractAppender;
 import org.onap.policy.common.utils.time.PseudoExecutor;
 import org.onap.policy.controlloop.ControlLoopOperation;
-import org.onap.policy.controlloop.VirtualControlLoopEvent;
 import org.onap.policy.controlloop.actorserviceprovider.ActorService;
 import org.onap.policy.controlloop.actorserviceprovider.Operation;
 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.Operator;
-import org.onap.policy.controlloop.actorserviceprovider.controlloop.ControlLoopEventContext;
 import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams;
 import org.onap.policy.controlloop.actorserviceprovider.parameters.OperatorConfig;
 import org.onap.policy.controlloop.actorserviceprovider.spi.Actor;
-import org.onap.policy.controlloop.policy.PolicyResult;
 import org.slf4j.LoggerFactory;
 
 public class OperationPartialTest {
@@ -99,8 +95,8 @@ public class OperationPartialTest {
     private static final int TIMEOUT = 1000;
     private static final UUID REQ_ID = UUID.randomUUID();
 
-    private static final List<PolicyResult> FAILURE_RESULTS = Arrays.asList(PolicyResult.values()).stream()
-                    .filter(result -> result != PolicyResult.SUCCESS).collect(Collectors.toList());
+    private static final List<OperationResult> FAILURE_RESULTS = Arrays.asList(OperationResult.values()).stream()
+                    .filter(result -> result != OperationResult.SUCCESS).collect(Collectors.toList());
 
     /**
      * Used to attach an appender to the class' logger.
@@ -119,8 +115,6 @@ public class OperationPartialTest {
     @Mock
     private Operation guardOperation;
 
-    private VirtualControlLoopEvent event;
-    private ControlLoopEventContext context;
     private PseudoExecutor executor;
     private ControlLoopOperationParams params;
 
@@ -167,16 +161,11 @@ public class OperationPartialTest {
     @Before
     public void setUp() {
         MockitoAnnotations.initMocks(this);
-
-        event = new VirtualControlLoopEvent();
-        event.setRequestId(REQ_ID);
-
-        context = new ControlLoopEventContext(event);
         executor = new PseudoExecutor();
 
-        params = ControlLoopOperationParams.builder().completeCallback(this::completer).context(context)
+        params = ControlLoopOperationParams.builder().completeCallback(this::completer).requestId(REQ_ID)
                         .executor(executor).actorService(service).actor(ACTOR).operation(OPERATION).timeoutSec(TIMEOUT)
-                        .startCallback(this::starter).targetEntity(MY_TARGET_ENTITY).build();
+                        .startCallback(this::starter).build();
 
         when(service.getActor(OperationPartial.GUARD_ACTOR_NAME)).thenReturn(guardActor);
         when(guardActor.getOperator(OperationPartial.GUARD_OPERATION_NAME)).thenReturn(guardOperator);
@@ -226,19 +215,25 @@ public class OperationPartialTest {
     }
 
     @Test
-    public void testGetProperty_testSetProperty() {
+    public void testGetProperty_testSetProperty_testGetRequiredProperty() {
         oper.setProperty("propertyA", "valueA");
         oper.setProperty("propertyB", "valueB");
         oper.setProperty("propertyC", 20);
+        oper.setProperty("propertyD", "valueD");
 
         assertEquals("valueA", oper.getProperty("propertyA"));
         assertEquals("valueB", oper.getProperty("propertyB"));
         assertEquals(Integer.valueOf(20), oper.getProperty("propertyC"));
+
+        assertEquals("valueD", oper.getRequiredProperty("propertyD", "typeD"));
+
+        assertThatIllegalStateException().isThrownBy(() -> oper.getRequiredProperty("propertyUnknown", "some type"))
+                        .withMessage("missing some type");
     }
 
     @Test
     public void testStart() {
-        verifyRun("testStart", 1, 1, PolicyResult.SUCCESS);
+        verifyRun("testStart", 1, 1, OperationResult.SUCCESS);
     }
 
     /**
@@ -254,125 +249,13 @@ public class OperationPartialTest {
 
         assertNotNull(opstart);
         assertNotNull(opend);
-        assertEquals(PolicyResult.SUCCESS, opend.getResult());
+        assertEquals(OperationResult.SUCCESS, opend.getResult());
 
         assertEquals(MAX_PARALLEL, numStart);
         assertEquals(MAX_PARALLEL, oper.getCount());
         assertEquals(MAX_PARALLEL, numEnd);
     }
 
-    /**
-     * Tests startPreprocessor() when the preprocessor returns a failure.
-     */
-    @Test
-    public void testStartPreprocessorFailure() {
-        oper.setPreProc(CompletableFuture.completedFuture(makeFailure()));
-
-        verifyRun("testStartPreprocessorFailure", 1, 0, PolicyResult.FAILURE_GUARD);
-    }
-
-    /**
-     * Tests startPreprocessor() when the preprocessor throws an exception.
-     */
-    @Test
-    public void testStartPreprocessorException() {
-        // arrange for the preprocessor to throw an exception
-        oper.setPreProc(CompletableFuture.failedFuture(new IllegalStateException(EXPECTED_EXCEPTION)));
-
-        verifyRun("testStartPreprocessorException", 1, 0, PolicyResult.FAILURE_GUARD);
-    }
-
-    /**
-     * Tests startPreprocessor() when the pipeline is not running.
-     */
-    @Test
-    public void testStartPreprocessorNotRunning() {
-        // arrange for the preprocessor to return success, which will be ignored
-        // oper.setGuard(CompletableFuture.completedFuture(makeSuccess()));
-
-        oper.start().cancel(false);
-        assertTrue(executor.runAll(MAX_REQUESTS));
-
-        assertNull(opstart);
-        assertNull(opend);
-
-        assertEquals(0, numStart);
-        assertEquals(0, oper.getCount());
-        assertEquals(0, numEnd);
-    }
-
-    /**
-     * Tests startPreprocessor() when the preprocessor <b>builder</b> throws an exception.
-     */
-    @Test
-    public void testStartPreprocessorBuilderException() {
-        oper = new MyOper() {
-            @Override
-            protected CompletableFuture<OperationOutcome> startPreprocessorAsync() {
-                throw new IllegalStateException(EXPECTED_EXCEPTION);
-            }
-        };
-
-        assertThatIllegalStateException().isThrownBy(() -> oper.start());
-
-        // should be nothing in the queue
-        assertEquals(0, executor.getQueueLength());
-    }
-
-    @Test
-    public void testStartPreprocessorAsync() {
-        assertNull(oper.startPreprocessorAsync());
-    }
-
-    @Test
-    public void testStartGuardAsync() throws Exception {
-        CompletableFuture<OperationOutcome> future = oper.startGuardAsync();
-        assertTrue(future.isDone());
-        assertEquals(PolicyResult.SUCCESS, future.get().getResult());
-
-        // verify the parameters that were passed
-        ArgumentCaptor<ControlLoopOperationParams> paramsCaptor =
-                        ArgumentCaptor.forClass(ControlLoopOperationParams.class);
-        verify(guardOperator).buildOperation(paramsCaptor.capture());
-
-        params = paramsCaptor.getValue();
-        assertEquals(OperationPartial.GUARD_ACTOR_NAME, params.getActor());
-        assertEquals(OperationPartial.GUARD_OPERATION_NAME, params.getOperation());
-        assertNull(params.getRetry());
-        assertNull(params.getTimeoutSec());
-
-        Map<String, Object> payload = params.getPayload();
-        assertNotNull(payload);
-
-        assertEquals(oper.makeGuardPayload(), payload);
-    }
-
-    /**
-     * Tests startGuardAsync() when preprocessing is disabled.
-     */
-    @Test
-    public void testStartGuardAsyncDisabled() {
-        params = params.toBuilder().preprocessed(true).build();
-        assertNull(new MyOper().startGuardAsync());
-    }
-
-    @Test
-    public void testMakeGuardPayload() {
-        Map<String, Object> payload = oper.makeGuardPayload();
-        assertSame(REQ_ID, payload.get("requestId"));
-
-        // request id changes, so remove it
-        payload.remove("requestId");
-
-        assertEquals("{actor=my-actor, operation=my-operation, target=my-entity}", payload.toString());
-
-        // repeat, but with closed loop name
-        event.setClosedLoopControlName("my-loop");
-        payload = oper.makeGuardPayload();
-        payload.remove("requestId");
-        assertEquals("{actor=my-actor, operation=my-operation, target=my-entity, clname=my-loop}", payload.toString());
-    }
-
     @Test
     public void testStartOperationAsync() {
         oper.start();
@@ -387,10 +270,10 @@ public class OperationPartialTest {
 
         OperationOutcome outcome = new OperationOutcome();
 
-        outcome.setResult(PolicyResult.SUCCESS);
+        outcome.setResult(OperationResult.SUCCESS);
         assertTrue(oper.isSuccess(outcome));
 
-        for (PolicyResult failure : FAILURE_RESULTS) {
+        for (OperationResult failure : FAILURE_RESULTS) {
             outcome.setResult(failure);
             assertFalse("testIsSuccess-" + failure, oper.isSuccess(outcome));
         }
@@ -403,14 +286,14 @@ public class OperationPartialTest {
         OperationOutcome outcome = params.makeOutcome(null);
 
         // incorrect outcome
-        outcome.setResult(PolicyResult.SUCCESS);
+        outcome.setResult(OperationResult.SUCCESS);
         assertFalse(oper.isActorFailed(outcome));
 
-        outcome.setResult(PolicyResult.FAILURE_RETRIES);
+        outcome.setResult(OperationResult.FAILURE_RETRIES);
         assertFalse(oper.isActorFailed(outcome));
 
         // correct outcome
-        outcome.setResult(PolicyResult.FAILURE);
+        outcome.setResult(OperationResult.FAILURE);
 
         // incorrect actor
         outcome.setActor(MY_SINK);
@@ -441,7 +324,7 @@ public class OperationPartialTest {
         assertTrue(executor.runAll(MAX_REQUESTS));
 
         assertNotNull(opend);
-        assertEquals(PolicyResult.FAILURE_EXCEPTION, opend.getResult());
+        assertEquals(OperationResult.FAILURE_EXCEPTION, opend.getResult());
     }
 
     @Test
@@ -461,7 +344,7 @@ public class OperationPartialTest {
             protected CompletableFuture<OperationOutcome> startOperationAsync(int attempt, OperationOutcome outcome) {
 
                 OperationOutcome outcome2 = params.makeOutcome(null);
-                outcome2.setResult(PolicyResult.SUCCESS);
+                outcome2.setResult(OperationResult.SUCCESS);
 
                 /*
                  * Create an incomplete future that will timeout after the operation's
@@ -476,7 +359,7 @@ public class OperationPartialTest {
             }
         };
 
-        assertEquals(PolicyResult.FAILURE_TIMEOUT, oper.start().get().getResult());
+        assertEquals(OperationResult.FAILURE_TIMEOUT, oper.start().get().getResult());
     }
 
     /**
@@ -491,7 +374,7 @@ public class OperationPartialTest {
 
         oper.setMaxFailures(10);
 
-        verifyRun("testSetRetryFlag_testRetryOnFailure_ZeroRetries", 1, 1, PolicyResult.FAILURE);
+        verifyRun("testSetRetryFlag_testRetryOnFailure_ZeroRetries", 1, 1, OperationResult.FAILURE);
     }
 
     /**
@@ -506,7 +389,7 @@ public class OperationPartialTest {
 
         oper.setMaxFailures(10);
 
-        verifyRun("testSetRetryFlag_testRetryOnFailure_NullRetries", 1, 1, PolicyResult.FAILURE);
+        verifyRun("testSetRetryFlag_testRetryOnFailure_NullRetries", 1, 1, OperationResult.FAILURE);
     }
 
     /**
@@ -523,7 +406,7 @@ public class OperationPartialTest {
         oper.setMaxFailures(10);
 
         verifyRun("testSetRetryFlag_testRetryOnFailure_RetriesExhausted", maxRetries + 1, maxRetries + 1,
-                        PolicyResult.FAILURE_RETRIES);
+                        OperationResult.FAILURE_RETRIES);
     }
 
     /**
@@ -540,7 +423,7 @@ public class OperationPartialTest {
         oper.setMaxFailures(maxFailures);
 
         verifyRun("testSetRetryFlag_testRetryOnFailure_SuccessAfterRetries", maxFailures + 1, maxFailures + 1,
-                        PolicyResult.SUCCESS);
+                        OperationResult.SUCCESS);
     }
 
     /**
@@ -560,7 +443,7 @@ public class OperationPartialTest {
             }
         };
 
-        verifyRun("testSetRetryFlag_testRetryOnFailure_NullOutcome", 1, 1, PolicyResult.FAILURE, noop());
+        verifyRun("testSetRetryFlag_testRetryOnFailure_NullOutcome", 1, 1, OperationResult.FAILURE, noop());
     }
 
     @Test
@@ -616,40 +499,12 @@ public class OperationPartialTest {
         assertTrue(oper.isSameOperation(outcome));
     }
 
-    /**
-     * Tests handleFailure() when the outcome is a success.
-     */
-    @Test
-    public void testHandlePreprocessorFailureSuccess() {
-        oper.setPreProc(CompletableFuture.completedFuture(makeSuccess()));
-        verifyRun("testHandlePreprocessorFailureTrue", 1, 1, PolicyResult.SUCCESS);
-    }
-
-    /**
-     * Tests handleFailure() when the outcome is <i>not</i> a success.
-     */
-    @Test
-    public void testHandlePreprocessorFailureFailed() throws Exception {
-        oper.setPreProc(CompletableFuture.completedFuture(makeFailure()));
-        verifyRun("testHandlePreprocessorFailureFalse", 1, 0, PolicyResult.FAILURE_GUARD);
-    }
-
-    /**
-     * Tests handleFailure() when the outcome is {@code null}.
-     */
-    @Test
-    public void testHandlePreprocessorFailureNull() throws Exception {
-        // arrange to return a null outcome from the preprocessor
-        oper.setPreProc(CompletableFuture.completedFuture(null));
-        verifyRun("testHandlePreprocessorFailureNull", 1, 0, PolicyResult.FAILURE_GUARD);
-    }
-
     @Test
     public void testFromException() {
         // arrange to generate an exception when operation runs
         oper.setGenException(true);
 
-        verifyRun("testFromException", 1, 1, PolicyResult.FAILURE_EXCEPTION);
+        verifyRun("testFromException", 1, 1, OperationResult.FAILURE_EXCEPTION);
     }
 
     /**
@@ -657,7 +512,7 @@ public class OperationPartialTest {
      */
     @Test
     public void testFromExceptionNoExcept() {
-        verifyRun("testFromExceptionNoExcept", 1, 1, PolicyResult.SUCCESS);
+        verifyRun("testFromExceptionNoExcept", 1, 1, OperationResult.SUCCESS);
     }
 
     /**
@@ -843,13 +698,13 @@ public class OperationPartialTest {
     @Test
     public void testCombineOutcomes() throws Exception {
         // only one outcome
-        verifyOutcomes(0, PolicyResult.SUCCESS);
-        verifyOutcomes(0, PolicyResult.FAILURE_EXCEPTION);
+        verifyOutcomes(0, OperationResult.SUCCESS);
+        verifyOutcomes(0, OperationResult.FAILURE_EXCEPTION);
 
         // maximum is in different positions
-        verifyOutcomes(0, PolicyResult.FAILURE, PolicyResult.SUCCESS, PolicyResult.FAILURE_GUARD);
-        verifyOutcomes(1, PolicyResult.SUCCESS, PolicyResult.FAILURE, PolicyResult.FAILURE_GUARD);
-        verifyOutcomes(2, PolicyResult.SUCCESS, PolicyResult.FAILURE_GUARD, PolicyResult.FAILURE);
+        verifyOutcomes(0, OperationResult.FAILURE, OperationResult.SUCCESS, OperationResult.FAILURE_GUARD);
+        verifyOutcomes(1, OperationResult.SUCCESS, OperationResult.FAILURE, OperationResult.FAILURE_GUARD);
+        verifyOutcomes(2, OperationResult.SUCCESS, OperationResult.FAILURE_GUARD, OperationResult.FAILURE);
 
         // null outcome - takes precedence over a success
         List<Supplier<CompletableFuture<OperationOutcome>>> tasks = new LinkedList<>();
@@ -904,7 +759,7 @@ public class OperationPartialTest {
 
         // second task fails, third should not run
         OperationOutcome failure = params.makeOutcome(null);
-        failure.setResult(PolicyResult.FAILURE);
+        failure.setResult(OperationResult.FAILURE);
         tasks.clear();
         tasks.add(() -> CompletableFuture.completedFuture(outcome));
         tasks.add(() -> CompletableFuture.completedFuture(failure));
@@ -936,7 +791,7 @@ public class OperationPartialTest {
         assertSame(future1, oper.sequence(() -> future1));
     }
 
-    private void verifyOutcomes(int expected, PolicyResult... results) throws Exception {
+    private void verifyOutcomes(int expected, OperationResult... results) throws Exception {
         List<Supplier<CompletableFuture<OperationOutcome>>> tasks = new LinkedList<>();
 
         OperationOutcome expectedOutcome = null;
@@ -964,11 +819,11 @@ public class OperationPartialTest {
 
         OperationOutcome outcome = params.makeOutcome(null);
 
-        Map<PolicyResult, Integer> map = Map.of(PolicyResult.SUCCESS, 0, PolicyResult.FAILURE_GUARD, 2,
-                        PolicyResult.FAILURE_RETRIES, 3, PolicyResult.FAILURE, 4, PolicyResult.FAILURE_TIMEOUT, 5,
-                        PolicyResult.FAILURE_EXCEPTION, 6);
+        Map<OperationResult, Integer> map = Map.of(OperationResult.SUCCESS, 0, OperationResult.FAILURE_GUARD, 2,
+                OperationResult.FAILURE_RETRIES, 3, OperationResult.FAILURE, 4, OperationResult.FAILURE_TIMEOUT, 5,
+                OperationResult.FAILURE_EXCEPTION, 6);
 
-        for (Entry<PolicyResult, Integer> ent : map.entrySet()) {
+        for (Entry<OperationResult, Integer> ent : map.entrySet()) {
             outcome.setResult(ent.getKey());
             assertEquals(ent.getKey().toString(), ent.getValue().intValue(), oper.detmPriority(outcome));
         }
@@ -1039,12 +894,12 @@ public class OperationPartialTest {
         outcome = new OperationOutcome();
         oper.setOutcome(outcome, timex);
         assertEquals(ControlLoopOperation.FAILED_MSG, outcome.getMessage());
-        assertEquals(PolicyResult.FAILURE_TIMEOUT, outcome.getResult());
+        assertEquals(OperationResult.FAILURE_TIMEOUT, outcome.getResult());
 
         outcome = new OperationOutcome();
         oper.setOutcome(outcome, new IllegalStateException(EXPECTED_EXCEPTION));
         assertEquals(ControlLoopOperation.FAILED_MSG, outcome.getMessage());
-        assertEquals(PolicyResult.FAILURE_EXCEPTION, outcome.getResult());
+        assertEquals(OperationResult.FAILURE_EXCEPTION, outcome.getResult());
     }
 
     @Test
@@ -1052,15 +907,15 @@ public class OperationPartialTest {
         OperationOutcome outcome;
 
         outcome = new OperationOutcome();
-        oper.setOutcome(outcome, PolicyResult.SUCCESS);
+        oper.setOutcome(outcome, OperationResult.SUCCESS);
         assertEquals(ControlLoopOperation.SUCCESS_MSG, outcome.getMessage());
-        assertEquals(PolicyResult.SUCCESS, outcome.getResult());
+        assertEquals(OperationResult.SUCCESS, outcome.getResult());
 
-        oper.setOutcome(outcome, PolicyResult.SUCCESS);
+        oper.setOutcome(outcome, OperationResult.SUCCESS);
         assertEquals(ControlLoopOperation.SUCCESS_MSG, outcome.getMessage());
-        assertEquals(PolicyResult.SUCCESS, outcome.getResult());
+        assertEquals(OperationResult.SUCCESS, outcome.getResult());
 
-        for (PolicyResult result : FAILURE_RESULTS) {
+        for (OperationResult result : FAILURE_RESULTS) {
             outcome = new OperationOutcome();
             oper.setOutcome(outcome, result);
             assertEquals(result.toString(), ControlLoopOperation.FAILED_MSG, outcome.getMessage());
@@ -1068,6 +923,12 @@ public class OperationPartialTest {
         }
     }
 
+    @Test
+    public void testMakeOutcome() {
+        oper.setProperty(OperationProperties.AAI_TARGET_ENTITY, MY_TARGET_ENTITY);
+        assertEquals(MY_TARGET_ENTITY, oper.makeOutcome().getTarget());
+    }
+
     @Test
     public void testIsTimeout() {
         final TimeoutException timex = new TimeoutException(EXPECTED_EXCEPTION);
@@ -1151,16 +1012,6 @@ public class OperationPartialTest {
         assertEquals(OperationPartial.DEFAULT_RETRY_WAIT_MS, oper2.getRetryWaitMs());
     }
 
-    @Test
-    public void testGetTargetEntity() {
-        // get it from the params
-        assertEquals(MY_TARGET_ENTITY, oper.getTargetEntity());
-
-        // now get it from the properties
-        oper.setProperty(OperationProperties.AAI_TARGET_ENTITY, "entityX");
-        assertEquals("entityX", oper.getTargetEntity());
-    }
-
     @Test
     public void testGetTimeOutMs() {
         assertEquals(TIMEOUT * 1000, oper.getTimeoutMs(params.getTimeoutSec()));
@@ -1199,14 +1050,7 @@ public class OperationPartialTest {
 
     private OperationOutcome makeSuccess() {
         OperationOutcome outcome = params.makeOutcome(null);
-        outcome.setResult(PolicyResult.SUCCESS);
-
-        return outcome;
-    }
-
-    private OperationOutcome makeFailure() {
-        OperationOutcome outcome = params.makeOutcome(null);
-        outcome.setResult(PolicyResult.FAILURE);
+        outcome.setResult(OperationResult.SUCCESS);
 
         return outcome;
     }
@@ -1220,7 +1064,7 @@ public class OperationPartialTest {
      * @param expectedResult expected outcome
      */
     private void verifyRun(String testName, int expectedCallbacks, int expectedOperations,
-                    PolicyResult expectedResult) {
+            OperationResult expectedResult) {
 
         verifyRun(testName, expectedCallbacks, expectedOperations, expectedResult, noop());
     }
@@ -1236,8 +1080,8 @@ public class OperationPartialTest {
      *        {@link OperationPartial#start(ControlLoopOperationParams)} before the tasks
      *        in the executor are run
      */
-    private void verifyRun(String testName, int expectedCallbacks, int expectedOperations, PolicyResult expectedResult,
-                    Consumer<CompletableFuture<OperationOutcome>> manipulator) {
+    private void verifyRun(String testName, int expectedCallbacks, int expectedOperations,
+            OperationResult expectedResult, Consumer<CompletableFuture<OperationOutcome>> manipulator) {
 
         tstart = null;
         opstart = null;
@@ -1342,9 +1186,9 @@ public class OperationPartialTest {
             operation.setSubRequestId(String.valueOf(attempt));
 
             if (count > maxFailures) {
-                operation.setResult(PolicyResult.SUCCESS);
+                operation.setResult(OperationResult.SUCCESS);
             } else {
-                operation.setResult(PolicyResult.FAILURE);
+                operation.setResult(OperationResult.FAILURE);
             }
 
             return operation;
@@ -1358,10 +1202,5 @@ public class OperationPartialTest {
              */
             return 0L;
         }
-
-        @Override
-        protected CompletableFuture<OperationOutcome> startPreprocessorAsync() {
-            return (preProc != null ? preProc : super.startPreprocessorAsync());
-        }
     }
 }