@Test(expected = StateNotAllowedException.class) @RunWithCustomExecutor public void testResumeNotInitiatedWorkflow() throws ProcessingException, StateNotAllowedException { VitamThreadUtils.getVitamSession().setTenantId(1); when(processDataManagement.getProcessWorkflowFor(eq(1), anyString())) .thenReturn(new HashMap<>()); processManagementImpl = new ProcessManagementImpl(new ServerConfiguration(), processDistributor, processDataAccess, processDataManagement, operationContextMonitor); processManagementImpl.resume( WorkerParametersFactory.newWorkerParameters(ID, ID, "NotExistsContainer", ID, Lists.newArrayList(ID), "http: "http: 1, false); }
@Override public ItemStatus resume(WorkerParameters workerParameters, Integer tenantId, boolean useForcedPause) throws ProcessingException, StateNotAllowedException { return execute(workerParameters.getContainerName(), tenantId, workerParameters, useForcedPause, ProcessAction.RESUME); }
ProcessManagementImpl implements ProcessManagement { @Override public ItemStatus resume(WorkerParameters workerParameters, Integer tenantId, boolean useForcedPause) throws ProcessingException, StateNotAllowedException { return execute(workerParameters.getContainerName(), tenantId, workerParameters, useForcedPause, ProcessAction.RESUME); } }
ProcessManagementImpl implements ProcessManagement { @Override public ItemStatus resume(WorkerParameters workerParameters, Integer tenantId, boolean useForcedPause) throws ProcessingException, StateNotAllowedException { return execute(workerParameters.getContainerName(), tenantId, workerParameters, useForcedPause, ProcessAction.RESUME); } ProcessManagementImpl(ServerConfiguration config, ProcessDistributor processDistributor); @VisibleForTesting  ProcessManagementImpl(ServerConfiguration config,
        ProcessDistributor processDistributor, ProcessDataAccess processDataAccess,
        ProcessDataManagement processDataManagement, OperationContextMonitor operationContextMonitor); }
ProcessManagementImpl implements ProcessManagement { @Override public ItemStatus resume(WorkerParameters workerParameters, Integer tenantId, boolean useForcedPause) throws ProcessingException, StateNotAllowedException { return execute(workerParameters.getContainerName(), tenantId, workerParameters, useForcedPause, ProcessAction.RESUME); } ProcessManagementImpl(ServerConfiguration config, ProcessDistributor processDistributor); @VisibleForTesting  ProcessManagementImpl(ServerConfiguration config,
        ProcessDistributor processDistributor, ProcessDataAccess processDataAccess,
        ProcessDataManagement processDataManagement, OperationContextMonitor operationContextMonitor); @Override void startProcess(); @Override void stopProcess(); @Override ProcessWorkflow init(WorkerParameters workerParameters, String workflowId); @Override ItemStatus next(WorkerParameters workerParameters, Integer tenantId); @Override ItemStatus resume(WorkerParameters workerParameters, Integer tenantId, boolean useForcedPause); @Override ItemStatus replay(WorkerParameters workerParameters, Integer tenantId); @Override ItemStatus pause(String operationId, Integer tenantId); @Override ItemStatus cancel(String operationId, Integer tenantId); ItemStatus execute(String operationId, Integer tenantId, WorkerParameters workerParameters,
        Boolean useForcedPause,
        ProcessAction action); @Override void forcePause(ProcessPause pause); @Override void removeForcePause(ProcessPause pause); @Override void close(); @Override List<ProcessWorkflow> findAllProcessWorkflow(Integer tenantId); @Override ProcessWorkflow findOneProcessWorkflow(String operationId, Integer tenantId); @Override Map<String, WorkFlow> getWorkflowDefinitions(); @Override void reloadWorkflowDefinitions(); Map<Integer, Map<String, ProcessWorkflow>> getWorkFlowList(); @Override Map<String, IEventsState> getProcessMonitorList(); List<ProcessDetail> getFilteredProcess(ProcessQuery query, Integer tenantId); @Override ServerConfiguration getConfiguration(); }
ProcessManagementImpl implements ProcessManagement { @Override public ItemStatus resume(WorkerParameters workerParameters, Integer tenantId, boolean useForcedPause) throws ProcessingException, StateNotAllowedException { return execute(workerParameters.getContainerName(), tenantId, workerParameters, useForcedPause, ProcessAction.RESUME); } ProcessManagementImpl(ServerConfiguration config, ProcessDistributor processDistributor); @VisibleForTesting  ProcessManagementImpl(ServerConfiguration config,
        ProcessDistributor processDistributor, ProcessDataAccess processDataAccess,
        ProcessDataManagement processDataManagement, OperationContextMonitor operationContextMonitor); @Override void startProcess(); @Override void stopProcess(); @Override ProcessWorkflow init(WorkerParameters workerParameters, String workflowId); @Override ItemStatus next(WorkerParameters workerParameters, Integer tenantId); @Override ItemStatus resume(WorkerParameters workerParameters, Integer tenantId, boolean useForcedPause); @Override ItemStatus replay(WorkerParameters workerParameters, Integer tenantId); @Override ItemStatus pause(String operationId, Integer tenantId); @Override ItemStatus cancel(String operationId, Integer tenantId); ItemStatus execute(String operationId, Integer tenantId, WorkerParameters workerParameters,
        Boolean useForcedPause,
        ProcessAction action); @Override void forcePause(ProcessPause pause); @Override void removeForcePause(ProcessPause pause); @Override void close(); @Override List<ProcessWorkflow> findAllProcessWorkflow(Integer tenantId); @Override ProcessWorkflow findOneProcessWorkflow(String operationId, Integer tenantId); @Override Map<String, WorkFlow> getWorkflowDefinitions(); @Override void reloadWorkflowDefinitions(); Map<Integer, Map<String, ProcessWorkflow>> getWorkFlowList(); @Override Map<String, IEventsState> getProcessMonitorList(); List<ProcessDetail> getFilteredProcess(ProcessQuery query, Integer tenantId); @Override ServerConfiguration getConfiguration();  }