@Test public void givenRunningProcessWhenExecuteThenReturnResponseOK() throws Exception { action.addOutIOParameters(out); when(processManagementClient.listOperationsDetails(any())) .thenReturn(new RequestResponseOK<ProcessDetail>().addAllResults(list)); saveWorkspacePutObject( UpdateWorkflowConstants.PROCESSING_FOLDER + "/" + UpdateWorkflowConstants.RUNNING_INGESTS_JSON); final ItemStatus response = plugin.execute(params, action); assertEquals(StatusCode.OK, response.getGlobalStatus()); JsonNode listRunning = getSavedWorkspaceObject( UpdateWorkflowConstants.PROCESSING_FOLDER + "/" + UpdateWorkflowConstants.RUNNING_INGESTS_JSON); ProcessDetail process = null; int numberOfProcesses = 0; for (final JsonNode objNode : listRunning) { numberOfProcesses++; process = JsonHandler.getFromJsonNode(objNode, ProcessDetail.class); } assertEquals(1, numberOfProcesses); assertEquals(pw.getOperationId(), process.getOperationId()); }
@Override public ItemStatus execute(WorkerParameters params, HandlerIO handler) { final ItemStatus itemStatus = new ItemStatus(HANDLER_ID); try { listRunningIngests(handler); itemStatus.increment(StatusCode.OK); } catch (ProcessingException e) { LOGGER.error("Processing exception", e); itemStatus.increment(StatusCode.FATAL); } catch (InvalidParseOperationException e) { LOGGER.error("Cannot parse json", e); itemStatus.increment(StatusCode.KO); } return new ItemStatus(HANDLER_ID).setItemsStatus(HANDLER_ID, itemStatus); }
ListRunningIngestsActionHandler extends ActionHandler { @Override public ItemStatus execute(WorkerParameters params, HandlerIO handler) { final ItemStatus itemStatus = new ItemStatus(HANDLER_ID); try { listRunningIngests(handler); itemStatus.increment(StatusCode.OK); } catch (ProcessingException e) { LOGGER.error("Processing exception", e); itemStatus.increment(StatusCode.FATAL); } catch (InvalidParseOperationException e) { LOGGER.error("Cannot parse json", e); itemStatus.increment(StatusCode.KO); } return new ItemStatus(HANDLER_ID).setItemsStatus(HANDLER_ID, itemStatus); } }
ListRunningIngestsActionHandler extends ActionHandler { @Override public ItemStatus execute(WorkerParameters params, HandlerIO handler) { final ItemStatus itemStatus = new ItemStatus(HANDLER_ID); try { listRunningIngests(handler); itemStatus.increment(StatusCode.OK); } catch (ProcessingException e) { LOGGER.error("Processing exception", e); itemStatus.increment(StatusCode.FATAL); } catch (InvalidParseOperationException e) { LOGGER.error("Cannot parse json", e); itemStatus.increment(StatusCode.KO); } return new ItemStatus(HANDLER_ID).setItemsStatus(HANDLER_ID, itemStatus); } ListRunningIngestsActionHandler(); @VisibleForTesting  ListRunningIngestsActionHandler(
        ProcessingManagementClientFactory processingManagementClientFactory); }
ListRunningIngestsActionHandler extends ActionHandler { @Override public ItemStatus execute(WorkerParameters params, HandlerIO handler) { final ItemStatus itemStatus = new ItemStatus(HANDLER_ID); try { listRunningIngests(handler); itemStatus.increment(StatusCode.OK); } catch (ProcessingException e) { LOGGER.error("Processing exception", e); itemStatus.increment(StatusCode.FATAL); } catch (InvalidParseOperationException e) { LOGGER.error("Cannot parse json", e); itemStatus.increment(StatusCode.KO); } return new ItemStatus(HANDLER_ID).setItemsStatus(HANDLER_ID, itemStatus); } ListRunningIngestsActionHandler(); @VisibleForTesting  ListRunningIngestsActionHandler(
        ProcessingManagementClientFactory processingManagementClientFactory); @Override ItemStatus execute(WorkerParameters params, HandlerIO handler); @Override void checkMandatoryIOParameter(HandlerIO handler); static final String getId(); }
ListRunningIngestsActionHandler extends ActionHandler { @Override public ItemStatus execute(WorkerParameters params, HandlerIO handler) { final ItemStatus itemStatus = new ItemStatus(HANDLER_ID); try { listRunningIngests(handler); itemStatus.increment(StatusCode.OK); } catch (ProcessingException e) { LOGGER.error("Processing exception", e); itemStatus.increment(StatusCode.FATAL); } catch (InvalidParseOperationException e) { LOGGER.error("Cannot parse json", e); itemStatus.increment(StatusCode.KO); } return new ItemStatus(HANDLER_ID).setItemsStatus(HANDLER_ID, itemStatus); } ListRunningIngestsActionHandler(); @VisibleForTesting  ListRunningIngestsActionHandler(
        ProcessingManagementClientFactory processingManagementClientFactory); @Override ItemStatus execute(WorkerParameters params, HandlerIO handler); @Override void checkMandatoryIOParameter(HandlerIO handler); static final String getId();  }