Search in sources :

Example 1 with VoteDAO

use of org.mamute.dao.VoteDAO in project mamute by caelum.

the class VoteDAOTest method beforeTest.

@Before
public void beforeTest() {
    votes = new VoteDAO(session);
    currentUser = user("Current User", "currentUser@email.com");
    otherUser = user("Other User", "otherUser@email.com");
    session.save(otherUser);
    session.save(currentUser);
    tags.add(tag("bla"));
    for (Tag tag : tags) {
        session.save(tag);
    }
    InvisibleForUsersRule invisibleRule = new InvisibleForUsersRule(new LoggedUser(currentUser, null));
    votingMachine = new VotingMachine(votes, new KarmaCalculator(), new ReputationEventDAO(session, invisibleRule), new MassiveVote(), new RetrieveKarmaDownvote());
}
Also used : VotingMachine(org.mamute.model.vote.VotingMachine) RetrieveKarmaDownvote(org.mamute.controllers.RetrieveKarmaDownvote) ReputationEventDAO(org.mamute.dao.ReputationEventDAO) KarmaCalculator(org.mamute.reputation.rules.KarmaCalculator) LoggedUser(org.mamute.model.LoggedUser) MassiveVote(org.mamute.model.vote.MassiveVote) SuspectMassiveVote(org.mamute.dto.SuspectMassiveVote) VoteDAO(org.mamute.dao.VoteDAO) Tag(org.mamute.model.Tag) InvisibleForUsersRule(org.mamute.dao.InvisibleForUsersRule) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 RetrieveKarmaDownvote (org.mamute.controllers.RetrieveKarmaDownvote)1 InvisibleForUsersRule (org.mamute.dao.InvisibleForUsersRule)1 ReputationEventDAO (org.mamute.dao.ReputationEventDAO)1 VoteDAO (org.mamute.dao.VoteDAO)1 SuspectMassiveVote (org.mamute.dto.SuspectMassiveVote)1 LoggedUser (org.mamute.model.LoggedUser)1 Tag (org.mamute.model.Tag)1 MassiveVote (org.mamute.model.vote.MassiveVote)1 VotingMachine (org.mamute.model.vote.VotingMachine)1 KarmaCalculator (org.mamute.reputation.rules.KarmaCalculator)1