use of org.mamute.dto.UserPersonalInfo in project mamute by caelum.
the class UserPersonalInfoValidatorTest method should_not_validate_invalid_mail.
@Test
public void should_not_validate_invalid_mail() {
User artur = user("artur com seis caracteres", validEmail);
UserPersonalInfo info = new UserPersonalInfo(artur).withEmail("invalidEmail");
assertFalse(infoValidator.validate(info));
}
use of org.mamute.dto.UserPersonalInfo in project mamute by caelum.
the class UserPersonalInfoValidatorTest method should_validate_user_trying_to_update_name_after_allowed_time.
@Test
public void should_validate_user_trying_to_update_name_after_allowed_time() {
User artur = user("artur com seis caracteres", validEmail);
DateTimeUtils.setCurrentMillisFixed(new DateTime().plusDays(31).getMillis());
UserPersonalInfo info = new UserPersonalInfo(artur).withName(fromTrustedText("newName")).withEmail(artur.getEmail());
when(bundle.getMessage("date.joda.simple.pattern")).thenReturn("dd/MM/YYYY");
assertTrue(infoValidator.validate(info));
}
Aggregations