assertEquals(5, searcher.getNbResults());
}
@Test
public void testSearchOffest() throws Exception {
KeywordsSearcher searcher = new KeywordsSearcher(isoLangMapper, thesaurusFinder);
KeywordSearchParamsBuilder params = new KeywordSearchParamsBuilder(isoLangMapper)
.addLang("eng")
.offset(5);
try {
params.build();
fail("Expected an IllegalStateException because offset is not allowed if no thesaurus is defined");
} catch (IllegalStateException e) {
// good
}
params.addThesaurus(thesaurus.getKey());
searcher.search(params.build());
assertEquals(keywords-5, searcher.getNbResults());
params.addThesaurus(thesaurusBlah.getKey());
try {
params.build();
fail("Expected an IllegalStateException because offset is not allowed if more than one thesaurus");
} catch (IllegalStateException e) {
// good
}