@Test
public void testFailedResultIsNotCached() {

    CompletableFuture<String> tokenFutureFailed = new CompletableFuture<>();
    tokenFutureFailed.completeExceptionally(new IOException("no token"));
    CompletableFuture<String> tokenFutureSuccess = CompletableFuture.completedFuture(TOKEN);
    expectTokenRequest(tokenFutureFailed, tokenFutureSuccess);
    tokenProvider.obtainAccessToken();
    AccessToken accessToken = tokenProvider.obtainAccessToken().join();
    assertThat(accessToken.getToken()).isEqualTo(TOKEN);
}