@Test(expected = IndexerProgramErrorException.class) public void shouldThrowProgramErrorCodeException() throws Exception { doReturn(new NewznabXmlError("200", "Whatever")).when(testee).getAndStoreResultToDatabase(any(), eq(Xml.class), eq(IndexerApiAccessType.SEARCH)); doNothing().when(testee).handleFailure(errorMessageCaptor.capture(), disabledPermanentlyCaptor.capture(), any(IndexerApiAccessType.class), any(), indexerApiAccessResultCaptor.capture()); testee.searchInternal(new SearchRequest(SearchSource.INTERNAL, SearchType.SEARCH, 0, 100), 0, 100); }
protected Xml getAndStoreResultToDatabase(URI uri, IndexerApiAccessType apiAccessType) throws IndexerAccessException { Xml response = getAndStoreResultToDatabase(uri, Xml.class, apiAccessType); if (response instanceof NewznabXmlError) { handleRssError((NewznabXmlError) response, uri.toString()); } else if (!(response instanceof NewznabXmlRoot)) { throw new UnknownResponseException("Indexer returned unknown response"); } return response; }
Newznab extends Indexer<Xml> { protected Xml getAndStoreResultToDatabase(URI uri, IndexerApiAccessType apiAccessType) throws IndexerAccessException { Xml response = getAndStoreResultToDatabase(uri, Xml.class, apiAccessType); if (response instanceof NewznabXmlError) { handleRssError((NewznabXmlError) response, uri.toString()); } else if (!(response instanceof NewznabXmlRoot)) { throw new UnknownResponseException("Indexer returned unknown response"); } return response; } }
Newznab extends Indexer<Xml> { protected Xml getAndStoreResultToDatabase(URI uri, IndexerApiAccessType apiAccessType) throws IndexerAccessException { Xml response = getAndStoreResultToDatabase(uri, Xml.class, apiAccessType); if (response instanceof NewznabXmlError) { handleRssError((NewznabXmlError) response, uri.toString()); } else if (!(response instanceof NewznabXmlRoot)) { throw new UnknownResponseException("Indexer returned unknown response"); } return response; }  }
Newznab extends Indexer<Xml> { protected Xml getAndStoreResultToDatabase(URI uri, IndexerApiAccessType apiAccessType) throws IndexerAccessException { Xml response = getAndStoreResultToDatabase(uri, Xml.class, apiAccessType); if (response instanceof NewznabXmlError) { handleRssError((NewznabXmlError) response, uri.toString()); } else if (!(response instanceof NewznabXmlRoot)) { throw new UnknownResponseException("Indexer returned unknown response"); } return response; }  @Override NfoResult getNfo(String guid); }
Newznab extends Indexer<Xml> { protected Xml getAndStoreResultToDatabase(URI uri, IndexerApiAccessType apiAccessType) throws IndexerAccessException { Xml response = getAndStoreResultToDatabase(uri, Xml.class, apiAccessType); if (response instanceof NewznabXmlError) { handleRssError((NewznabXmlError) response, uri.toString()); } else if (!(response instanceof NewznabXmlRoot)) { throw new UnknownResponseException("Indexer returned unknown response"); } return response; }  @Override NfoResult getNfo(String guid);  }