use of com.celements.blog.article.ArticleLoadParameter.SubscriptionMode in project celements-blog by celements.
the class ArticleLuceneQueryBuilderTest method testGetArticleSubsRestrictions_undecided_subscribed_noEditRights.
@Test
public void testGetArticleSubsRestrictions_undecided_subscribed_noEditRights() {
Set<SubscriptionMode> modes = new HashSet<>(Arrays.asList(SubscriptionMode.UNDECIDED, SubscriptionMode.SUBSCRIBED));
boolean hasEditRights = false;
QueryRestrictionGroup ret = builder.getArticleSubsRestrictions(modes, docRef, hasEditRights);
assertEquals(getSubsQuery(false), ret.getQueryString());
}
use of com.celements.blog.article.ArticleLoadParameter.SubscriptionMode in project celements-blog by celements.
the class ArticleLuceneQueryBuilderTest method testGetArticleSubsRestrictions_undecided.
@Test
public void testGetArticleSubsRestrictions_undecided() {
Set<SubscriptionMode> modes = new HashSet<>(Arrays.asList(SubscriptionMode.UNDECIDED));
boolean hasEditRights = true;
QueryRestrictionGroup ret = builder.getArticleSubsRestrictions(modes, docRef, hasEditRights);
assertEquals(getSubsUnsubsQuery(true), ret.getQueryString());
}
use of com.celements.blog.article.ArticleLoadParameter.SubscriptionMode in project celements-blog by celements.
the class ArticleLuceneQueryBuilderTest method testGetArticleSubsRestrictions_subscribed_unsubscribed.
@Test
public void testGetArticleSubsRestrictions_subscribed_unsubscribed() {
Set<SubscriptionMode> modes = new HashSet<>(Arrays.asList(SubscriptionMode.SUBSCRIBED, SubscriptionMode.UNSUBSCRIBED));
boolean hasEditRights = true;
QueryRestrictionGroup ret = builder.getArticleSubsRestrictions(modes, docRef, hasEditRights);
assertEquals(getSubsUnsubsQuery(false), ret.getQueryString());
}
use of com.celements.blog.article.ArticleLoadParameter.SubscriptionMode in project celements-blog by celements.
the class ArticleLuceneQueryBuilderTest method testGetArticleSubsRestrictions_undecided_unsubscribed.
@Test
public void testGetArticleSubsRestrictions_undecided_unsubscribed() {
Set<SubscriptionMode> modes = new HashSet<>(Arrays.asList(SubscriptionMode.UNDECIDED, SubscriptionMode.UNSUBSCRIBED));
boolean hasEditRights = true;
QueryRestrictionGroup ret = builder.getArticleSubsRestrictions(modes, docRef, hasEditRights);
assertEquals(getSubsQuery(true), ret.getQueryString());
}
use of com.celements.blog.article.ArticleLoadParameter.SubscriptionMode in project celements-blog by celements.
the class ArticleLuceneQueryBuilderTest method testGetArticleSubsRestrictions_unsubscribed_noEditRights.
@Test
public void testGetArticleSubsRestrictions_unsubscribed_noEditRights() {
Set<SubscriptionMode> modes = new HashSet<>(Arrays.asList(SubscriptionMode.UNSUBSCRIBED));
boolean hasEditRights = false;
QueryRestrictionGroup ret = builder.getArticleSubsRestrictions(modes, docRef, hasEditRights);
assertNull(ret);
}
Aggregations