use of com.celements.search.lucene.query.QueryRestrictionGroup 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.search.lucene.query.QueryRestrictionGroup 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);
}
use of com.celements.search.lucene.query.QueryRestrictionGroup in project celements-blog by celements.
the class ArticleLuceneQueryBuilderTest method testGetArticleSubsRestrictions_subscribed_noEditRights.
@Test
public void testGetArticleSubsRestrictions_subscribed_noEditRights() {
Set<SubscriptionMode> modes = new HashSet<>(Arrays.asList(SubscriptionMode.SUBSCRIBED));
boolean hasEditRights = false;
QueryRestrictionGroup ret = builder.getArticleSubsRestrictions(modes, docRef, hasEditRights);
assertEquals(getSubsQuery(false), ret.getQueryString());
}
use of com.celements.search.lucene.query.QueryRestrictionGroup in project celements-blog by celements.
the class ArticleLuceneQueryBuilderTest method testGetDateRestrictions_future.
@Test
public void testGetDateRestrictions_future() {
Set<DateMode> modes = new HashSet<>(Arrays.asList(DateMode.FUTURE));
Date date = new Date();
boolean hasEditRights = true;
QueryRestrictionGroup ret = builder.getDateRestrictions(modes, date, hasEditRights);
assertEquals(getFutureQuery(date), ret.getQueryString());
}
use of com.celements.search.lucene.query.QueryRestrictionGroup in project celements-blog by celements.
the class ArticleLuceneQueryBuilderTest method testGetDateRestrictions_archived_noEditRights.
@Test
public void testGetDateRestrictions_archived_noEditRights() {
Set<DateMode> modes = new HashSet<>(Arrays.asList(DateMode.ARCHIVED));
Date date = new Date();
boolean hasEditRights = false;
QueryRestrictionGroup ret = builder.getDateRestrictions(modes, date, hasEditRights);
assertEquals(getArchivedQuery(date), ret.getQueryString());
}
Aggregations