@Test
public void testValidateModel() throws Exception {

    try {
        validator.validateModel(TestValidateModel.builder().email("bad").build());
        fail("Expected DataValidationException");
    } catch (DataValidationException e) {
        assertEquals(1, e.getErrors().size());
    }
    assertTrue(validator.validateModel(TestValidateModel.builder().email("ok@example.com").build()));
}