@Test public void should_return_KO_regex() throws Exception { TestHandlerIO handlerIO = new TestHandlerIO(); JsonNode query = JsonHandler.getFromInputStream(getClass().getResourceAsStream("/MassUpdateUnitsProcess/queryActionSetInternalFieldREGEX.json")); handlerIO.setJsonFromWorkspace("query.json", query); ItemStatus itemStatus = massUpdateCheck.execute(EMPTY_WORKER_PARAMETER, handlerIO); assertThat(itemStatus.getGlobalStatus()).isEqualTo(KO); }
@Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { List<String> internalKeyFields = getInternalActionKeyFields(handler.getJsonFromWorkspace("query.json")); if (!internalKeyFields.isEmpty()) { String message = String.format("Invalid DSL query: cannot contains '%s' internal field(s).", String.join(", ", internalKeyFields)); return buildItemStatusWithMessage(PLUGIN_NAME, KO, message); } return buildItemStatus(PLUGIN_NAME, OK, EventDetails.of("Check OK.")); } catch (Exception e) { LOGGER.error(e); return buildItemStatus(PLUGIN_NAME, KO, EventDetails.of("Check KO unexpected error.")); } }
MassUpdateCheck extends ActionHandler { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { List<String> internalKeyFields = getInternalActionKeyFields(handler.getJsonFromWorkspace("query.json")); if (!internalKeyFields.isEmpty()) { String message = String.format("Invalid DSL query: cannot contains '%s' internal field(s).", String.join(", ", internalKeyFields)); return buildItemStatusWithMessage(PLUGIN_NAME, KO, message); } return buildItemStatus(PLUGIN_NAME, OK, EventDetails.of("Check OK.")); } catch (Exception e) { LOGGER.error(e); return buildItemStatus(PLUGIN_NAME, KO, EventDetails.of("Check KO unexpected error.")); } } }
MassUpdateCheck extends ActionHandler { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { List<String> internalKeyFields = getInternalActionKeyFields(handler.getJsonFromWorkspace("query.json")); if (!internalKeyFields.isEmpty()) { String message = String.format("Invalid DSL query: cannot contains '%s' internal field(s).", String.join(", ", internalKeyFields)); return buildItemStatusWithMessage(PLUGIN_NAME, KO, message); } return buildItemStatus(PLUGIN_NAME, OK, EventDetails.of("Check OK.")); } catch (Exception e) { LOGGER.error(e); return buildItemStatus(PLUGIN_NAME, KO, EventDetails.of("Check KO unexpected error.")); } }  }
MassUpdateCheck extends ActionHandler { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { List<String> internalKeyFields = getInternalActionKeyFields(handler.getJsonFromWorkspace("query.json")); if (!internalKeyFields.isEmpty()) { String message = String.format("Invalid DSL query: cannot contains '%s' internal field(s).", String.join(", ", internalKeyFields)); return buildItemStatusWithMessage(PLUGIN_NAME, KO, message); } return buildItemStatus(PLUGIN_NAME, OK, EventDetails.of("Check OK.")); } catch (Exception e) { LOGGER.error(e); return buildItemStatus(PLUGIN_NAME, KO, EventDetails.of("Check KO unexpected error.")); } }  @Override ItemStatus execute(WorkerParameters param, HandlerIO handler); }
MassUpdateCheck extends ActionHandler { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { List<String> internalKeyFields = getInternalActionKeyFields(handler.getJsonFromWorkspace("query.json")); if (!internalKeyFields.isEmpty()) { String message = String.format("Invalid DSL query: cannot contains '%s' internal field(s).", String.join(", ", internalKeyFields)); return buildItemStatusWithMessage(PLUGIN_NAME, KO, message); } return buildItemStatus(PLUGIN_NAME, OK, EventDetails.of("Check OK.")); } catch (Exception e) { LOGGER.error(e); return buildItemStatus(PLUGIN_NAME, KO, EventDetails.of("Check KO unexpected error.")); } }  @Override ItemStatus execute(WorkerParameters param, HandlerIO handler);  }