Search in sources :

Example 1 with ModeratorOrVisibleNewsFilter

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

the class ModeratorOrVisibleNewsFilterTest method should_not_add_filter_if_user_is_moderator.

@Test
public void should_not_add_filter_if_user_is_moderator() {
    LoggedUser user = new LoggedUser(user("leonardo", "leo@leo.com").asModerator(), null);
    ModeratorOrVisibleNewsFilter moderatorOrVisible = new ModeratorOrVisibleNewsFilter(user, null);
    moderatorOrVisible.addFilter("x", criteria);
    verify(criteria, never()).add(Mockito.any(Criterion.class));
}
Also used : ModeratorOrVisibleNewsFilter(org.mamute.dao.ModeratorOrVisibleNewsFilter) Criterion(org.hibernate.criterion.Criterion) LoggedUser(org.mamute.model.LoggedUser) Test(org.junit.Test)

Aggregations

Criterion (org.hibernate.criterion.Criterion)1 Test (org.junit.Test)1 ModeratorOrVisibleNewsFilter (org.mamute.dao.ModeratorOrVisibleNewsFilter)1 LoggedUser (org.mamute.model.LoggedUser)1