@Test public void givenProcessErrorWhenExecuteThenReturnResponseFATAL() throws Exception { action.addOutIOParameters(out); when(processManagementClient.listOperationsDetails(any())) .thenThrow(new VitamClientException("Process Management error")); final ItemStatus response = plugin.execute(params, action); assertEquals(StatusCode.FATAL, response.getGlobalStatus()); }
@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();  }