示例#1
0
 @Test
 public void incorrectEmail() {
   user = populateUser();
   user.setUsername("Hi_Mom!");
   userValidator.validate(user, errors);
   assertTrue(errors.hasErrors());
 }
示例#2
0
 public User populateUser() {
   Date date = new Date();
   User user = new User();
   user.setUsername("aac" + date.getTime() + "@mailinator.com");
   user.setPassword("darthVadar");
   user.setConfirmPassword("darthVadar");
   errors = new BeanPropertyBindingResult(user, "user");
   return user;
 }