### Question:
Binsearch extends Indexer<String> { @Override protected String getAndStoreResultToDatabase(URI uri, IndexerApiAccessType apiAccessType) throws IndexerAccessException { return Failsafe.with(retry503policy) .onFailedAttempt(throwable -> logger.warn("Encountered 503 error. Will retry")) .get(() -> getAndStoreResultToDatabase(uri, String.class, apiAccessType)); }  @Override NfoResult getNfo(String guid);  }### Answer:
@Test(expected = FailsafeException.class) public void shouldRetryOn503() throws Exception { testee = spy(testee); doThrow(new IndexerAccessException("503")).when(testee).getAndStoreResultToDatabase(uriCaptor.capture(), any(), any()); testee.getAndStoreResultToDatabase(null, IndexerApiAccessType.NFO); }