Closed mona2702 closed 5 years ago
If you want a single Pojo to be validated, you can do the following:
@Test
public void someTestMethod() {
Validator validator = ValidatorBuilder.create()
// Add Rules see com.openpojo.validation.rule.impl for more ...
.with(new SomeRule())
// Add Testers see com.openpojo.validation.test.impl for more ...
.with(new someTester())
.build();
PojoClass classToValidate = PojoClassFactory.getPojoClass(com.package.ClassToValidate);
validator.validate(classToValidate);
}
Another way is to use PojoClassFactory.getPojoClasses("package name", "filter to select just what you need");
Hi team, Can you please help , how to include selected pojo from a package and use directly with the validate method. how to provide directly the class in the param.