@Test @Parameters(method = "convertValidationException_producesCorrectIssuesSummary_Parameters") public void convertValidationException_producesCorrectIssuesSummary( String name, ValidationException input, List<ConformanceIssue> want) { List<ConformanceIssue> got = JsonConformer.convertValidationException(input); assertArrayEquals(want.toArray(new ConformanceIssue[0]), got.toArray(new ConformanceIssue[0])); }
static List<ConformanceIssue> convertValidationException(ValidationException e) { ValidationException[] nonTrivialCauses = e.getCausingExceptions().stream() .filter(c -> !c.getPointerToViolation().equals("#")) .toArray(ValidationException[]::new); if (nonTrivialCauses.length > 0) { return Arrays.stream(nonTrivialCauses) .flatMap(ntc -> getLeafExceptions(null, ntc)) .distinct() .collect(Collectors.toList()); } return Collections.singletonList( new ConformanceIssue( e.getSchemaLocation(), e.getPointerToViolation(), e.toJSON().toString())); }
JsonConformer implements Conformer<JsonObject> { static List<ConformanceIssue> convertValidationException(ValidationException e) { ValidationException[] nonTrivialCauses = e.getCausingExceptions().stream() .filter(c -> !c.getPointerToViolation().equals("#")) .toArray(ValidationException[]::new); if (nonTrivialCauses.length > 0) { return Arrays.stream(nonTrivialCauses) .flatMap(ntc -> getLeafExceptions(null, ntc)) .distinct() .collect(Collectors.toList()); } return Collections.singletonList( new ConformanceIssue( e.getSchemaLocation(), e.getPointerToViolation(), e.toJSON().toString())); } }
JsonConformer implements Conformer<JsonObject> { static List<ConformanceIssue> convertValidationException(ValidationException e) { ValidationException[] nonTrivialCauses = e.getCausingExceptions().stream() .filter(c -> !c.getPointerToViolation().equals("#")) .toArray(ValidationException[]::new); if (nonTrivialCauses.length > 0) { return Arrays.stream(nonTrivialCauses) .flatMap(ntc -> getLeafExceptions(null, ntc)) .distinct() .collect(Collectors.toList()); } return Collections.singletonList( new ConformanceIssue( e.getSchemaLocation(), e.getPointerToViolation(), e.toJSON().toString())); } private  JsonConformer(Supplier<InputStream> stream); }
JsonConformer implements Conformer<JsonObject> { static List<ConformanceIssue> convertValidationException(ValidationException e) { ValidationException[] nonTrivialCauses = e.getCausingExceptions().stream() .filter(c -> !c.getPointerToViolation().equals("#")) .toArray(ValidationException[]::new); if (nonTrivialCauses.length > 0) { return Arrays.stream(nonTrivialCauses) .flatMap(ntc -> getLeafExceptions(null, ntc)) .distinct() .collect(Collectors.toList()); } return Collections.singletonList( new ConformanceIssue( e.getSchemaLocation(), e.getPointerToViolation(), e.toJSON().toString())); } private  JsonConformer(Supplier<InputStream> stream); @Override void initialize(); @Override List<ConformanceIssue> checkConformance(JsonObject value); }
JsonConformer implements Conformer<JsonObject> { static List<ConformanceIssue> convertValidationException(ValidationException e) { ValidationException[] nonTrivialCauses = e.getCausingExceptions().stream() .filter(c -> !c.getPointerToViolation().equals("#")) .toArray(ValidationException[]::new); if (nonTrivialCauses.length > 0) { return Arrays.stream(nonTrivialCauses) .flatMap(ntc -> getLeafExceptions(null, ntc)) .distinct() .collect(Collectors.toList()); } return Collections.singletonList( new ConformanceIssue( e.getSchemaLocation(), e.getPointerToViolation(), e.toJSON().toString())); } private  JsonConformer(Supplier<InputStream> stream); @Override void initialize(); @Override List<ConformanceIssue> checkConformance(JsonObject value); static final String SCHEMA_FORMAT; }