List of usage examples for org.springframework.validation BeanPropertyBindingResult getAllErrors
@Override
public List<ObjectError> getAllErrors()
From source file:org.oncoblocks.centromere.core.test.DataImportTests.java
@Test public void validationTest() throws Exception { EntrezGene gene = new EntrezGene(); BeanPropertyBindingResult bindingResult = new BeanPropertyBindingResult(gene, gene.getClass().getName()); validator.validate(gene, bindingResult); if (bindingResult.hasErrors()) { for (ObjectError error : bindingResult.getAllErrors()) { System.out.println(error.toString()); }/* w w w . j a v a 2 s . c o m*/ } else { fail("Validation did not catch missing field."); } }