@Test
public void shouldKeepErrorOnNoSuccess() {

  // given
  final int count = 3;
  final JustRetryFailoverHandler justRetryFailoverHandler = new JustRetryFailoverHandler(count,
      Time.of(100L, TimeUnit.MILLISECONDS));
  final AtomicInteger countDown = new AtomicInteger(count);
  final RequestMethod<Object> requestMethod = new RequestMethod<Object>() {
    @Getter
    protected final String name = randomUUID().toString();
    @Override
    protected Object runInternal(List<Object> parameters) throws Exception {
      countDown.decrementAndGet();
      throw new UnsupportedOperationException();
    }
  };
  // then
  final Response<Object> response = Response.fail(new UnsupportedOperationException());
  final Response<Object> handled = justRetryFailoverHandler
      .handle(new TestInvocation<>(requestMethod), response);
  assertNotNull(handled.getError());
  assertEquals(0, countDown.get());
}