use of com.celements.blog.article.ArticleLoadParameter.SubscriptionMode in project celements-blog by celements.
the class ArticleLuceneQueryBuilderTest method testGetArticleSubsRestrictions_undecided_noEditRights.
@Test
public void testGetArticleSubsRestrictions_undecided_noEditRights() {
Set<SubscriptionMode> modes = new HashSet<>(Arrays.asList(SubscriptionMode.UNDECIDED));
boolean hasEditRights = false;
QueryRestrictionGroup ret = builder.getArticleSubsRestrictions(modes, docRef, hasEditRights);
assertNull(ret);
}
use of com.celements.blog.article.ArticleLoadParameter.SubscriptionMode in project celements-blog by celements.
the class ArticleLuceneQueryBuilderTest method testGetArticleSubsRestrictions_subscribed.
@Test
public void testGetArticleSubsRestrictions_subscribed() {
Set<SubscriptionMode> modes = new HashSet<>(Arrays.asList(SubscriptionMode.SUBSCRIBED));
boolean hasEditRights = true;
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_subscribed.
@Test
public void testGetArticleSubsRestrictions_undecided_subscribed() {
Set<SubscriptionMode> modes = new HashSet<>(Arrays.asList(SubscriptionMode.UNDECIDED, SubscriptionMode.SUBSCRIBED));
boolean hasEditRights = true;
QueryRestrictionGroup ret = builder.getArticleSubsRestrictions(modes, docRef, hasEditRights);
assertEquals(getUnsubsQuery(true), ret.getQueryString());
}
use of com.celements.blog.article.ArticleLoadParameter.SubscriptionMode in project celements-blog by celements.
the class ArticleLuceneQueryBuilderTest method testGetArticleSubsRestrictions_all.
@Test
public void testGetArticleSubsRestrictions_all() {
DocumentReference blogConfDocRef = new DocumentReference("wiki", "space", "blog");
Set<SubscriptionMode> modes = new HashSet<>(Arrays.asList(SubscriptionMode.SUBSCRIBED, SubscriptionMode.UNSUBSCRIBED, SubscriptionMode.UNDECIDED));
boolean hasEditRights = true;
QueryRestrictionGroup ret = builder.getArticleSubsRestrictions(modes, blogConfDocRef, hasEditRights);
assertEquals("", ret.getQueryString());
}
use of com.celements.blog.article.ArticleLoadParameter.SubscriptionMode in project celements-blog by celements.
the class ArticleLuceneQueryBuilderTest method testGetArticleSubsRestrictions_none.
@Test
public void testGetArticleSubsRestrictions_none() {
Set<SubscriptionMode> modes = Collections.emptySet();
boolean hasEditRights = true;
QueryRestrictionGroup ret = builder.getArticleSubsRestrictions(modes, docRef, hasEditRights);
assertNull(ret);
}
Aggregations