@Test public void testValidReference() { Agenda agenda = createAgenda(CUSTOMER_ID); agenda.setOperations(Arrays.asList( createOperation("Op1", "Op2.out"), createOperation("Op2") )); validator.validatePOST(createRequest(agenda)); }
@Override public void validatePOST(DataObjectRequest<Agenda> request) { super.validatePOST(request); validationIssues = new LinkedList<>(); Agenda agenda = request.getDataObject(); validateOperations(agenda); if(validationIssues.size() > 0) { int lastIssueIndex = Math.min(validationIssues.size(), MAX_ISSUES); throw new ValidationException(String.format("Validation Issues detected: %1$s%2$s", String.join(",", validationIssues.subList(0, lastIssueIndex)), lastIssueIndex < validationIssues.size() ? "[Truncating additional issues]" : "") ); } }
AgendaValidator extends DataObjectValidator<Agenda, DataObjectRequest<Agenda>> { @Override public void validatePOST(DataObjectRequest<Agenda> request) { super.validatePOST(request); validationIssues = new LinkedList<>(); Agenda agenda = request.getDataObject(); validateOperations(agenda); if(validationIssues.size() > 0) { int lastIssueIndex = Math.min(validationIssues.size(), MAX_ISSUES); throw new ValidationException(String.format("Validation Issues detected: %1$s%2$s", String.join(",", validationIssues.subList(0, lastIssueIndex)), lastIssueIndex < validationIssues.size() ? "[Truncating additional issues]" : "") ); } } }
AgendaValidator extends DataObjectValidator<Agenda, DataObjectRequest<Agenda>> { @Override public void validatePOST(DataObjectRequest<Agenda> request) { super.validatePOST(request); validationIssues = new LinkedList<>(); Agenda agenda = request.getDataObject(); validateOperations(agenda); if(validationIssues.size() > 0) { int lastIssueIndex = Math.min(validationIssues.size(), MAX_ISSUES); throw new ValidationException(String.format("Validation Issues detected: %1$s%2$s", String.join(",", validationIssues.subList(0, lastIssueIndex)), lastIssueIndex < validationIssues.size() ? "[Truncating additional issues]" : "") ); } }  }
AgendaValidator extends DataObjectValidator<Agenda, DataObjectRequest<Agenda>> { @Override public void validatePOST(DataObjectRequest<Agenda> request) { super.validatePOST(request); validationIssues = new LinkedList<>(); Agenda agenda = request.getDataObject(); validateOperations(agenda); if(validationIssues.size() > 0) { int lastIssueIndex = Math.min(validationIssues.size(), MAX_ISSUES); throw new ValidationException(String.format("Validation Issues detected: %1$s%2$s", String.join(",", validationIssues.subList(0, lastIssueIndex)), lastIssueIndex < validationIssues.size() ? "[Truncating additional issues]" : "") ); } }  @Override void validatePOST(DataObjectRequest<Agenda> request); AgendaValidator setJsonContext(JsonContext jsonContext); }
AgendaValidator extends DataObjectValidator<Agenda, DataObjectRequest<Agenda>> { @Override public void validatePOST(DataObjectRequest<Agenda> request) { super.validatePOST(request); validationIssues = new LinkedList<>(); Agenda agenda = request.getDataObject(); validateOperations(agenda); if(validationIssues.size() > 0) { int lastIssueIndex = Math.min(validationIssues.size(), MAX_ISSUES); throw new ValidationException(String.format("Validation Issues detected: %1$s%2$s", String.join(",", validationIssues.subList(0, lastIssueIndex)), lastIssueIndex < validationIssues.size() ? "[Truncating additional issues]" : "") ); } }  @Override void validatePOST(DataObjectRequest<Agenda> request); AgendaValidator setJsonContext(JsonContext jsonContext);  }