@Test public void shouldReturnCorrectSearchResults() throws Exception { NewznabXmlRoot root = RssBuilder.builder().items(Arrays.asList(RssItemBuilder.builder("title").build())).newznabResponse(0, 1).build(); when(indexerWebAccessMock.get(any(), eq(testee.config), any())).thenReturn(root); IndexerSearchResult indexerSearchResult = testee.searchInternal(new SearchRequest(SearchSource.INTERNAL, SearchType.SEARCH, 0, 100), 0, 100); assertThat(indexerSearchResult.getSearchResultItems().size(), is(1)); assertThat(indexerSearchResult.getTotalResults(), is(1)); assertThat(indexerSearchResult.isHasMoreResults(), is(false)); assertThat(indexerSearchResult.isTotalResultsKnown(), is(true)); }
@Override protected List<SearchResultItem> getSearchResultItems(Xml rssRoot, SearchRequest searchRequest) { List<SearchResultItem> searchResultItems = new ArrayList<>(); final NewznabXmlRoot newznabXmlRoot = (NewznabXmlRoot) rssRoot; checkForTooManyResults(searchRequest, newznabXmlRoot); for (NewznabXmlItem item : newznabXmlRoot.getRssChannel().getItems()) { try { SearchResultItem searchResultItem = createSearchResultItem(item); searchResultItems.add(searchResultItem); } catch (NzbHydraException e) { } } return searchResultItems; }
Newznab extends Indexer<Xml> { @Override protected List<SearchResultItem> getSearchResultItems(Xml rssRoot, SearchRequest searchRequest) { List<SearchResultItem> searchResultItems = new ArrayList<>(); final NewznabXmlRoot newznabXmlRoot = (NewznabXmlRoot) rssRoot; checkForTooManyResults(searchRequest, newznabXmlRoot); for (NewznabXmlItem item : newznabXmlRoot.getRssChannel().getItems()) { try { SearchResultItem searchResultItem = createSearchResultItem(item); searchResultItems.add(searchResultItem); } catch (NzbHydraException e) { } } return searchResultItems; } }
Newznab extends Indexer<Xml> { @Override protected List<SearchResultItem> getSearchResultItems(Xml rssRoot, SearchRequest searchRequest) { List<SearchResultItem> searchResultItems = new ArrayList<>(); final NewznabXmlRoot newznabXmlRoot = (NewznabXmlRoot) rssRoot; checkForTooManyResults(searchRequest, newznabXmlRoot); for (NewznabXmlItem item : newznabXmlRoot.getRssChannel().getItems()) { try { SearchResultItem searchResultItem = createSearchResultItem(item); searchResultItems.add(searchResultItem); } catch (NzbHydraException e) { } } return searchResultItems; }  }
Newznab extends Indexer<Xml> { @Override protected List<SearchResultItem> getSearchResultItems(Xml rssRoot, SearchRequest searchRequest) { List<SearchResultItem> searchResultItems = new ArrayList<>(); final NewznabXmlRoot newznabXmlRoot = (NewznabXmlRoot) rssRoot; checkForTooManyResults(searchRequest, newznabXmlRoot); for (NewznabXmlItem item : newznabXmlRoot.getRssChannel().getItems()) { try { SearchResultItem searchResultItem = createSearchResultItem(item); searchResultItems.add(searchResultItem); } catch (NzbHydraException e) { } } return searchResultItems; }  @Override NfoResult getNfo(String guid); }
Newznab extends Indexer<Xml> { @Override protected List<SearchResultItem> getSearchResultItems(Xml rssRoot, SearchRequest searchRequest) { List<SearchResultItem> searchResultItems = new ArrayList<>(); final NewznabXmlRoot newznabXmlRoot = (NewznabXmlRoot) rssRoot; checkForTooManyResults(searchRequest, newznabXmlRoot); for (NewznabXmlItem item : newznabXmlRoot.getRssChannel().getItems()) { try { SearchResultItem searchResultItem = createSearchResultItem(item); searchResultItems.add(searchResultItem); } catch (NzbHydraException e) { } } return searchResultItems; }  @Override NfoResult getNfo(String guid);  }