@Test void testFlushErrorWithPlainFormatter() throws RedPenException { PlainFormatter formatter = new PlainFormatter(); List<ValidationError> errors = new ArrayList<>(); setErrorList(errors); addLocalizedError(new Sentence("sentence", 1)); Map<Document, List<ValidationError>> docErrorsMap = new HashMap<>(); Document document = Document.builder().build(); docErrorsMap.put(document, errors); String result = formatter.format(docErrorsMap); Pattern p = Pattern.compile("foobar"); Matcher m = p.matcher(result); assertTrue(m.find()); }
public abstract void format(PrintWriter printWriter, Map<Document, List<ValidationError>> docErrorsMap) throws RedPenException, IOException;
Formatter { public abstract void format(PrintWriter printWriter, Map<Document, List<ValidationError>> docErrorsMap) throws RedPenException, IOException; }
Formatter { public abstract void format(PrintWriter printWriter, Map<Document, List<ValidationError>> docErrorsMap) throws RedPenException, IOException;  }
Formatter { public abstract void format(PrintWriter printWriter, Map<Document, List<ValidationError>> docErrorsMap) throws RedPenException, IOException;  abstract void format(PrintWriter printWriter, Map<Document, List<ValidationError>> docErrorsMap); abstract String formatError(Document document, ValidationError error); void format(OutputStream outputStream, Map<Document, List<ValidationError>> docErrorsMap); String format(Map<Document, List<ValidationError>> docErrorsMap); String format(Document document, List<ValidationError> errors); }
Formatter { public abstract void format(PrintWriter printWriter, Map<Document, List<ValidationError>> docErrorsMap) throws RedPenException, IOException;  abstract void format(PrintWriter printWriter, Map<Document, List<ValidationError>> docErrorsMap); abstract String formatError(Document document, ValidationError error); void format(OutputStream outputStream, Map<Document, List<ValidationError>> docErrorsMap); String format(Map<Document, List<ValidationError>> docErrorsMap); String format(Document document, List<ValidationError> errors);  }