@Test
public void testRetryableAfterDelayFinallyWorks() throws B2Exception {

    final Guts guts = new Guts(
            tooManyRequests(null),
            serviceUnavailable(null),
            requestTimeout(null),
            requestTimeout(null),
            tooManyRequests(null),
            serviceUnavailable(null),
            "yippee"
    );
    when(policy.gotRetryableAfterDelay(eq(OP), anyInt(), anyLong(), any())).thenReturn(3, 5, 7, 11, 13, 17);
    assertEquals("yippee", retryer.doRetry(OP, goodAuthCache, guts, policy));
    assertEquals(7, guts.getCallCount());
    verify(goodAuthCache, never()).clear();
    // this verifies that we use the answer from the policy to sleep.
    verify(sleeper, times(1)).sleepSeconds(3);
    verify(sleeper, times(1)).sleepSeconds(5);
    verify(sleeper, times(1)).sleepSeconds(7);
    verify(sleeper, times(1)).sleepSeconds(11);
    verify(sleeper, times(1)).sleepSeconds(13);
    verify(sleeper, times(1)).sleepSeconds(17);
    verifyNoMoreInteractions(sleeper);
}