Ejemplo n.º 1
0
 @Test
 public void incorrectEmail() {
   user = populateUser();
   user.setUsername("Hi_Mom!");
   userValidator.validate(user, errors);
   assertTrue(errors.hasErrors());
 }
Ejemplo n.º 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;
 }