use of nl.knaw.huygens.timbuctoo.core.dto.QuickSearch in project timbuctoo by HuygensING.
the class TimbuctooActionsGetTest method doQuickSearchReturnsTheValueOfDataStoreOperations.
@Test
public void doQuickSearchReturnsTheValueOfDataStoreOperations() {
List<QuickSearchResult> entities = Lists.newArrayList();
QuickSearch query = QuickSearch.fromQueryString("");
Collection collection = collWithCollectionName("coll");
int limit = 1;
when(dataStoreOperations.doQuickSearch(collection, query, limit)).thenReturn(entities);
List<QuickSearchResult> searchResult = instance.doQuickSearch(collection, query, null, limit);
assertThat(searchResult, is(sameInstance(entities)));
}
use of nl.knaw.huygens.timbuctoo.core.dto.QuickSearch in project timbuctoo by HuygensING.
the class TimbuctooActionsGetTest method doQuickSearchCallsDoKeywordQuickSearchWhenTheCollectionIsAKeywordCollection.
@Test
public void doQuickSearchCallsDoKeywordQuickSearchWhenTheCollectionIsAKeywordCollection() {
List<QuickSearchResult> entities = Lists.newArrayList();
QuickSearch query = QuickSearch.fromQueryString("");
String keywordType = "";
Collection collection = keywordCollWithCollectionName("coll");
int limit = 1;
when(dataStoreOperations.doKeywordQuickSearch(collection, keywordType, query, limit)).thenReturn(entities);
List<QuickSearchResult> searchResult = instance.doQuickSearch(collection, query, keywordType, limit);
assertThat(searchResult, is(sameInstance(entities)));
}
Aggregations