@Test
public void testGetUpdateValidationErrors() throws Exception {

    List<ValidationError> errors = validator.getUpdateValidationErrors(null, fieldData);
    assertEquals(1, errors.size());
    Update<TestValidateModel> update = JsonHelper.update("{email:'bad'}", TestValidateModel.class);
    errors = validator.getUpdateValidationErrors(update, fieldData);
    assertEquals(1, errors.size());
    assertEquals("must be a well-formed email address", errors.get(0).getMessage());
    // attempt to modify a non-Updatable field
    update = JsonHelper.update("{type:'change'}", TestValidateModel.class);
    errors = validator.getUpdateValidationErrors(update, fieldData);
    assertEquals(1, errors.size());
    assertEquals("is not updatable", errors.get(0).getMessage());
    // attempt to unset a non-optional field
    update = JsonHelper.update("{email:null}", TestValidateModel.class);
    errors = validator.getUpdateValidationErrors(update, fieldData);
    assertEquals(1, errors.size());
    assertEquals("email: is required", errors.get(0).toString());
}