### Question:
OperationsHelper { public Operation.State computeProcessState(String processId) { return processHelper.computeProcessState(processId); } @Inject  OperationsHelper(OperationService operationService, ProcessTypeToOperationMetadataMapper metadataMapper,
                            ProcessHelper processHelper); String getProcessDefinitionKey(Operation operation); Operation addErrorType(Operation operation); Operation addState(Operation operation); Operation.State computeState(Operation operation); Operation.State computeProcessState(String processId); List<Operation> findOperations(List<Operation> operations, List<Operation.State> statusList);  }### Answer:
@Test void testComputeOperationStateWhenProcessIsInNonFinalStateAndProcessIsAborted() { Mockito.when(processHelper.computeProcessState(PROCESS_ID)) .thenReturn(State.ABORTED); Operation.State state = operationsHelper.computeProcessState(PROCESS_ID); Assertions.assertEquals(Operation.State.ABORTED, state); }
@Test void testComputeOperationStateWhenProcessIsInNonFinalStateAndProcessIsAtReceiveTask() { Mockito.when(processHelper.computeProcessState(PROCESS_ID)) .thenReturn(State.ACTION_REQUIRED); Operation.State state = operationsHelper.computeProcessState(PROCESS_ID); Assertions.assertEquals(Operation.State.ACTION_REQUIRED, state); }
@Test void testComputeOperationStateWhenProcessIsInNonFinalStateAndProcessIsInErrorState() { Mockito.when(processHelper.computeProcessState(PROCESS_ID)) .thenReturn(State.ERROR); Operation.State state = operationsHelper.computeProcessState(PROCESS_ID); Assertions.assertEquals(Operation.State.ERROR, state); }
@Test void testComputeOperationStateWhenProcessIsInNonFinalStateAndProcessIsRunning() { Mockito.when(processHelper.computeProcessState(PROCESS_ID)) .thenReturn(State.RUNNING); Operation.State state = operationsHelper.computeProcessState(PROCESS_ID); Assertions.assertEquals(Operation.State.RUNNING, state); }
@Test void testComputeOperationStateWhenProcessIsInFinalStateAndProcessIsAborted() { Mockito.when(processHelper.computeProcessState(PROCESS_ID)) .thenReturn(State.ABORTED); Operation.State state = operationsHelper.computeProcessState(PROCESS_ID); Assertions.assertEquals(Operation.State.ABORTED, state); }
@Test void testComputeOperationStateWhenProcessIsInFinalStateAndProcessIsNotAborted() { Mockito.when(processHelper.computeProcessState(PROCESS_ID)) .thenReturn(State.FINISHED); Operation.State state = operationsHelper.computeProcessState(PROCESS_ID); Assertions.assertEquals(Operation.State.FINISHED, state); }