@Test public void testDone() { Mockito.when(genericJcrDataValidator.done()).thenReturn(Collections.singleton(new ValidationMessage(ValidationMessageSeverity.ERROR, "test1"))); Mockito.when(genericJcrDataValidator2.done()).thenReturn(Collections.singleton(new ValidationMessage(ValidationMessageSeverity.WARN, "test2"))); assertViolation(executor.done(), new ValidationViolation("genericjcrdataid", ValidationMessageSeverity.ERROR, "test1"), new ValidationViolation("genericjcrdataid2", ValidationMessageSeverity.WARN, "test2")); }
public @NotNull Collection<ValidationViolation> done() { Collection<ValidationViolation> allViolations = new LinkedList<>(); for (Map.Entry<String, Validator>entry : validatorsById.entrySet()) { try { Collection<ValidationMessage> violations = entry.getValue().done(); if (violations != null && !violations.isEmpty()) { allViolations.addAll(ValidationViolation.wrapMessages(entry.getKey(), violations, null, null, null, 0, 0)); } } catch (RuntimeException e) { throw new ValidatorException(entry.getKey(), e); } } return allViolations; }
ValidationExecutor { public @NotNull Collection<ValidationViolation> done() { Collection<ValidationViolation> allViolations = new LinkedList<>(); for (Map.Entry<String, Validator>entry : validatorsById.entrySet()) { try { Collection<ValidationMessage> violations = entry.getValue().done(); if (violations != null && !violations.isEmpty()) { allViolations.addAll(ValidationViolation.wrapMessages(entry.getKey(), violations, null, null, null, 0, 0)); } } catch (RuntimeException e) { throw new ValidatorException(entry.getKey(), e); } } return allViolations; } }
ValidationExecutor { public @NotNull Collection<ValidationViolation> done() { Collection<ValidationViolation> allViolations = new LinkedList<>(); for (Map.Entry<String, Validator>entry : validatorsById.entrySet()) { try { Collection<ValidationMessage> violations = entry.getValue().done(); if (violations != null && !violations.isEmpty()) { allViolations.addAll(ValidationViolation.wrapMessages(entry.getKey(), violations, null, null, null, 0, 0)); } } catch (RuntimeException e) { throw new ValidatorException(entry.getKey(), e); } } return allViolations; } ValidationExecutor(@NotNull Map<String, Validator> validatorsById); }
ValidationExecutor { public @NotNull Collection<ValidationViolation> done() { Collection<ValidationViolation> allViolations = new LinkedList<>(); for (Map.Entry<String, Validator>entry : validatorsById.entrySet()) { try { Collection<ValidationMessage> violations = entry.getValue().done(); if (violations != null && !violations.isEmpty()) { allViolations.addAll(ValidationViolation.wrapMessages(entry.getKey(), violations, null, null, null, 0, 0)); } } catch (RuntimeException e) { throw new ValidatorException(entry.getKey(), e); } } return allViolations; } ValidationExecutor(@NotNull Map<String, Validator> validatorsById); @NotNull Map<String, Validator> getAllValidatorsById(); @NotNull Map<String, Validator> getUnusedValidatorsById(); @NotNull Collection<ValidationViolation> validateMetaInf(@Nullable InputStream input, @NotNull Path filePath, @NotNull Path basePath); @NotNull Collection<ValidationViolation> validateJcrRoot(@Nullable InputStream input, @NotNull Path filePath, @NotNull Path basePath); @NotNull Collection<ValidationViolation> done(); static @NotNull String filePathToNodePath(@NotNull Path filePath); }
ValidationExecutor { public @NotNull Collection<ValidationViolation> done() { Collection<ValidationViolation> allViolations = new LinkedList<>(); for (Map.Entry<String, Validator>entry : validatorsById.entrySet()) { try { Collection<ValidationMessage> violations = entry.getValue().done(); if (violations != null && !violations.isEmpty()) { allViolations.addAll(ValidationViolation.wrapMessages(entry.getKey(), violations, null, null, null, 0, 0)); } } catch (RuntimeException e) { throw new ValidatorException(entry.getKey(), e); } } return allViolations; } ValidationExecutor(@NotNull Map<String, Validator> validatorsById); @NotNull Map<String, Validator> getAllValidatorsById(); @NotNull Map<String, Validator> getUnusedValidatorsById(); @NotNull Collection<ValidationViolation> validateMetaInf(@Nullable InputStream input, @NotNull Path filePath, @NotNull Path basePath); @NotNull Collection<ValidationViolation> validateJcrRoot(@Nullable InputStream input, @NotNull Path filePath, @NotNull Path basePath); @NotNull Collection<ValidationViolation> done(); static @NotNull String filePathToNodePath(@NotNull Path filePath);  }