Search in sources :

Example 96 with User

use of org.mamute.model.User 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));
}
Also used : User(org.mamute.model.User) UserPersonalInfo(org.mamute.dto.UserPersonalInfo) DateTime(org.joda.time.DateTime) Test(org.junit.Test)

Example 97 with User

use of org.mamute.model.User in project mamute by caelum.

the class RetrieveKarmaTest method setUp.

@Before
public void setUp() {
    User moderator = user(null, null).asModerator();
    User user = user(null, null);
    retrieveKarma = new RetrieveKarma(new LoggedUser(moderator, null), null, null);
    retrieveKarmaWithoutModerator = new RetrieveKarma(new LoggedUser(user, null), null, null);
    question = question(null);
}
Also used : User(org.mamute.model.User) LoggedUser(org.mamute.model.LoggedUser) RetrieveKarma(org.mamute.model.flag.RetrieveKarma) LoggedUser(org.mamute.model.LoggedUser) Before(org.junit.Before)

Aggregations

User (org.mamute.model.User)97 Test (org.junit.Test)56 Question (org.mamute.model.Question)28 LoggedUser (org.mamute.model.LoggedUser)25 VRaptorTestResult (br.com.caelum.vraptor.test.VRaptorTestResult)9 UserFlow (br.com.caelum.vraptor.test.requestflow.UserFlow)9 Answer (org.mamute.model.Answer)9 LoginMethod (org.mamute.model.LoginMethod)9 Post (br.com.caelum.vraptor.Post)7 Before (org.junit.Before)7 Tag (org.mamute.model.Tag)7 QuestionInformation (org.mamute.model.QuestionInformation)6 Email (org.apache.commons.mail.Email)5 UserPersonalInfo (org.mamute.dto.UserPersonalInfo)5 ReputationEvent (org.mamute.model.ReputationEvent)5 ArrayList (java.util.ArrayList)4 Watcher (org.mamute.model.watch.Watcher)4 DateTime (org.joda.time.DateTime)3 Elements (org.jsoup.select.Elements)3 DaoManager (org.mamute.integration.util.DaoManager)3