@Test public void testValidatorSettings() throws ParserConfigurationException, SAXException { ValidatorSettings settings1 = new ValidatorSettingsImpl("option1", "value1"); validatorsSettings.put("id1", settings1); ValidatorSettings settings2 = new ValidatorSettingsImpl(true); validatorsSettings.put("id2", settings2); ValidatorSettings settings3 = new ValidatorSettingsImpl(ValidationMessageSeverity.INFO); validatorsSettings.put("id3", settings3); executorFactory.createValidationExecutor(context, true, true, validatorsSettings); Mockito.verify(validatorFactory1).createValidator(context, settings1); Mockito.verify(validatorFactory2, Mockito.never()).createValidator(Mockito.any(), Mockito.any()); Mockito.verify(validatorFactory3).createValidator(context, settings3); }
public @Nullable ValidationExecutor createValidationExecutor(@NotNull ValidationContext context, boolean isSubPackage, boolean enforceSubpackageValidation, Map<String, ? extends ValidatorSettings> validatorSettingsById) { Map<String, Validator> validatorsById = createValidators(context, isSubPackage, enforceSubpackageValidation, validatorSettingsById != null ? validatorSettingsById : Collections.emptyMap()); if (validatorsById.isEmpty()) { return null; } return new ValidationExecutor(validatorsById); }
ValidationExecutorFactory { public @Nullable ValidationExecutor createValidationExecutor(@NotNull ValidationContext context, boolean isSubPackage, boolean enforceSubpackageValidation, Map<String, ? extends ValidatorSettings> validatorSettingsById) { Map<String, Validator> validatorsById = createValidators(context, isSubPackage, enforceSubpackageValidation, validatorSettingsById != null ? validatorSettingsById : Collections.emptyMap()); if (validatorsById.isEmpty()) { return null; } return new ValidationExecutor(validatorsById); } }
ValidationExecutorFactory { public @Nullable ValidationExecutor createValidationExecutor(@NotNull ValidationContext context, boolean isSubPackage, boolean enforceSubpackageValidation, Map<String, ? extends ValidatorSettings> validatorSettingsById) { Map<String, Validator> validatorsById = createValidators(context, isSubPackage, enforceSubpackageValidation, validatorSettingsById != null ? validatorSettingsById : Collections.emptyMap()); if (validatorsById.isEmpty()) { return null; } return new ValidationExecutor(validatorsById); } ValidationExecutorFactory(ClassLoader classLoader);   ValidationExecutorFactory(Iterable<ValidatorFactory> validatorFactoriesUnsorted); }
ValidationExecutorFactory { public @Nullable ValidationExecutor createValidationExecutor(@NotNull ValidationContext context, boolean isSubPackage, boolean enforceSubpackageValidation, Map<String, ? extends ValidatorSettings> validatorSettingsById) { Map<String, Validator> validatorsById = createValidators(context, isSubPackage, enforceSubpackageValidation, validatorSettingsById != null ? validatorSettingsById : Collections.emptyMap()); if (validatorsById.isEmpty()) { return null; } return new ValidationExecutor(validatorsById); } ValidationExecutorFactory(ClassLoader classLoader);   ValidationExecutorFactory(Iterable<ValidatorFactory> validatorFactoriesUnsorted); @Nullable ValidationExecutor createValidationExecutor(@NotNull ValidationContext context, boolean isSubPackage, boolean enforceSubpackageValidation, Map<String, ? extends ValidatorSettings> validatorSettingsById); }
ValidationExecutorFactory { public @Nullable ValidationExecutor createValidationExecutor(@NotNull ValidationContext context, boolean isSubPackage, boolean enforceSubpackageValidation, Map<String, ? extends ValidatorSettings> validatorSettingsById) { Map<String, Validator> validatorsById = createValidators(context, isSubPackage, enforceSubpackageValidation, validatorSettingsById != null ? validatorSettingsById : Collections.emptyMap()); if (validatorsById.isEmpty()) { return null; } return new ValidationExecutor(validatorsById); } ValidationExecutorFactory(ClassLoader classLoader);   ValidationExecutorFactory(Iterable<ValidatorFactory> validatorFactoriesUnsorted); @Nullable ValidationExecutor createValidationExecutor(@NotNull ValidationContext context, boolean isSubPackage, boolean enforceSubpackageValidation, Map<String, ? extends ValidatorSettings> validatorSettingsById);  }