RuleFlowProcessValidator implements ProcessValidator { protected void addErrorMessage(RuleFlowProcess process, Node node, List<ProcessValidationError> errors, String message) { String error = String.format("Node '%s' [%d] %s", node.getName(), node.getId(), message); errors.add(new ProcessValidationErrorImpl(process, error)); } private  RuleFlowProcessValidator(); static RuleFlowProcessValidator getInstance(); ProcessValidationError[] validateProcess(final RuleFlowProcess process); ProcessValidationError[] validateProcess(Process process); @Override boolean accept(Process process,
                          Resource resource); @Override boolean compilationSupported(); static final String ASSOCIATIONS; }
@Test void testAddErrorMessage() { when(node.getName()).thenReturn("nodeName"); when(node.getId()).thenReturn(Long.MAX_VALUE); validator.addErrorMessage(process, node, errors, "any message"); assertEquals(1, errors.size()); assertEquals("Node 'nodeName' [" + Long.MAX_VALUE + "] any message", errors.get(0).getMessage()); }