use of org.mamute.dao.FlaggableDAO in project mamute by caelum.
the class FlaggableDAOTest method setup.
@Before
public void setup() {
flaggedInvisible.remove();
addFlags(commentWithOneFlag, 1, author);
addFlags(commentWithTwo, 2, author);
addFlags(flaggedInvisible, 2, author);
session.save(author);
session.save(anyone);
session.save(commentWithTwo);
session.save(flaggedInvisible);
session.save(commentWithOneFlag);
session.save(java);
session.save(question);
session.flush();
flaggables = new FlaggableDAO(session, meta);
questions = new QuestionDAO(session, new InvisibleForUsersRule(new LoggedUser(anyone, null)));
List<Class<? extends Flaggable>> moderatableTypes = new ArrayList<>();
moderatableTypes.add(Question.class);
moderatableTypes.add(Answer.class);
moderatableTypes.add(Comment.class);
moderatableTypes.add(News.class);
when(meta.getFlaggableTypes()).thenReturn(moderatableTypes);
}
Aggregations