@Test(expected = StateNotAllowedException.class) @RunWithCustomExecutor public void test_resume_on_running_state_ko() throws StateNotAllowedException, ProcessingException { StateMachine stateMachine = mock(StateMachine.class); ProcessState state = ProcessState.RUNNING; doAnswer(o -> { state.eval(ProcessState.RUNNING); return null; }).when(stateMachine).resume(any()); stateMachine.resume(null); }
@Override synchronized public void resume(WorkerParameters workerParameters) throws StateNotAllowedException, ProcessingException { this.processWorkflow.getState().eval(ProcessState.RUNNING); this.doRunning(workerParameters, ProcessState.RUNNING); }
StateMachine implements IEventsState, IEventsProcessEngine { @Override synchronized public void resume(WorkerParameters workerParameters) throws StateNotAllowedException, ProcessingException { this.processWorkflow.getState().eval(ProcessState.RUNNING); this.doRunning(workerParameters, ProcessState.RUNNING); } }
StateMachine implements IEventsState, IEventsProcessEngine { @Override synchronized public void resume(WorkerParameters workerParameters) throws StateNotAllowedException, ProcessingException { this.processWorkflow.getState().eval(ProcessState.RUNNING); this.doRunning(workerParameters, ProcessState.RUNNING); } StateMachine(ProcessWorkflow processWorkflow, ProcessEngine processEngine); @VisibleForTesting  StateMachine(ProcessWorkflow processWorkflow, ProcessEngine processEngine,
        ProcessDataManagement dataManagement,
        WorkspaceClientFactory workspaceClientFactory, LogbookOperationsClientFactory logbookOperationsClientFactory); }
StateMachine implements IEventsState, IEventsProcessEngine { @Override synchronized public void resume(WorkerParameters workerParameters) throws StateNotAllowedException, ProcessingException { this.processWorkflow.getState().eval(ProcessState.RUNNING); this.doRunning(workerParameters, ProcessState.RUNNING); } StateMachine(ProcessWorkflow processWorkflow, ProcessEngine processEngine); @VisibleForTesting  StateMachine(ProcessWorkflow processWorkflow, ProcessEngine processEngine,
        ProcessDataManagement dataManagement,
        WorkspaceClientFactory workspaceClientFactory, LogbookOperationsClientFactory logbookOperationsClientFactory); @Override synchronized void resume(WorkerParameters workerParameters); @Override synchronized void next(WorkerParameters workerParameters); @Override synchronized void replay(WorkerParameters workerParameters); @Override synchronized void pause(); @Override void shutdown(); @Override synchronized void cancel(); @Override boolean isDone(); @Override int getTenant(); @Override String getWorkflowId(); @Override String getContextId(); @Override Map<String, String> getWorkflowParameters(); @Override boolean isStepByStep(); @Override LogbookTypeProcess getLogbookTypeProcess(); @Override synchronized void onUpdate(StatusCode statusCode); @Override StatusCode getCurrentProcessWorkflowStatus(); @Override synchronized void onUpdate(String messageIdentifier, String originatingAgency); @Override synchronized void onError(Throwable throwable); @Override synchronized void onProcessEngineCancel(WorkerParameters workerParameters); @Override synchronized void onProcessEngineCompleteStep(ItemStatus itemStatus, WorkerParameters workerParameters); boolean isCompleted(); @Override boolean isRecover(); }
StateMachine implements IEventsState, IEventsProcessEngine { @Override synchronized public void resume(WorkerParameters workerParameters) throws StateNotAllowedException, ProcessingException { this.processWorkflow.getState().eval(ProcessState.RUNNING); this.doRunning(workerParameters, ProcessState.RUNNING); } StateMachine(ProcessWorkflow processWorkflow, ProcessEngine processEngine); @VisibleForTesting  StateMachine(ProcessWorkflow processWorkflow, ProcessEngine processEngine,
        ProcessDataManagement dataManagement,
        WorkspaceClientFactory workspaceClientFactory, LogbookOperationsClientFactory logbookOperationsClientFactory); @Override synchronized void resume(WorkerParameters workerParameters); @Override synchronized void next(WorkerParameters workerParameters); @Override synchronized void replay(WorkerParameters workerParameters); @Override synchronized void pause(); @Override void shutdown(); @Override synchronized void cancel(); @Override boolean isDone(); @Override int getTenant(); @Override String getWorkflowId(); @Override String getContextId(); @Override Map<String, String> getWorkflowParameters(); @Override boolean isStepByStep(); @Override LogbookTypeProcess getLogbookTypeProcess(); @Override synchronized void onUpdate(StatusCode statusCode); @Override StatusCode getCurrentProcessWorkflowStatus(); @Override synchronized void onUpdate(String messageIdentifier, String originatingAgency); @Override synchronized void onError(Throwable throwable); @Override synchronized void onProcessEngineCancel(WorkerParameters workerParameters); @Override synchronized void onProcessEngineCompleteStep(ItemStatus itemStatus, WorkerParameters workerParameters); boolean isCompleted(); @Override boolean isRecover();  }