// TODO Replace this by a event-based solution if that becomes available
Thread.sleep(500);
/* 1. SearchCondition: News coming from Feed that contains "feed2.xml" */
ISearchField field1 = fTypesFactory.createSearchField(IFeed.LINK, IFeed.class);
ISearchCondition cond1 = fTypesFactory.createSearchCondition(field1, SearchSpecifier.CONTAINS, "feed2.xml", true);
conditions.add(cond1);
/* 2. SearchCondition: News Description does not contain "Foo" */
ISearchField field2 = fTypesFactory.createSearchField(INews.DESCRIPTION, INews.class);
ISearchCondition cond2 = fTypesFactory.createSearchCondition(field2, SearchSpecifier.CONTAINS_NOT, "Foo", true);
conditions.add(cond2);
/* 3. SearchCondition: News State is NEW */
ISearchField field3 = fTypesFactory.createSearchField(INews.STATE, INews.class);
ISearchCondition cond3 = fTypesFactory.createSearchCondition(field3, SearchSpecifier.IS, State.NEW.name(), true);
conditions.add(cond3);
List<ISearchHit<NewsReference>> results = fModelSearch.searchNews(conditions);
assertEquals(2, results.size());