### Question:
DefaultGenericKieValidator implements GenericValidator { public List<ValidationMessage> validate(final Path path, final String content) { return validatorBuildService.validate(path, content) .stream() .filter(fromValidatedPath(path)) .collect(Collectors.toList()); } DefaultGenericKieValidator(); @Inject  DefaultGenericKieValidator(final ValidatorBuildService validatorBuildService); List<ValidationMessage> validate(final Path path,
                                            final String content); List<ValidationMessage> validate(final Path path);  }### Answer:
@Test public void testWorks() throws Exception { final Path path = resourcePath("/GuvnorM2RepoDependencyExample1/src/main/resources/rule2.drl"); final URL urlToValidate = this.getClass().getResource("/GuvnorM2RepoDependencyExample1/src/main/resources/rule2.drl"); final List<ValidationMessage> errors = validator.validate(path, Resources.toString(urlToValidate, Charset.forName("UTF-8"))); assertTrue(errors.isEmpty()); }
@Test public void validatingAnAlreadyInvalidAssetShouldReportErrors() throws Exception { final Path path = resourcePath("/BuilderExampleBrokenSyntax/src/main/resources/rule1.drl"); final URL urlToValidate = this.getClass().getResource("/BuilderExampleBrokenSyntax/src/main/resources/rule1.drl"); final List<ValidationMessage> errors1 = validator.validate(path, Resources.toString(urlToValidate, Charset.forName("UTF-8"))); final List<ValidationMessage> errors2 = validator.validate(path, Resources.toString(urlToValidate, Charset.forName("UTF-8"))); assertFalse(errors1.isEmpty()); assertFalse(errors2.isEmpty()); assertEquals(errors1.size(), errors2.size()); }