@Test
public void testDoWithTokenSuccess() {

    CompletableFuture<String> tokenFuture = CompletableFuture.completedFuture(TOKEN);
    Function<AccessToken, CompletableFuture<Object>> func =
            token -> CompletableFuture.completedFuture(token.getToken());
    expectTokenRequest(tokenFuture);
    Object result = tokenProvider.doWithToken(func).join();
    assertThat(result).isEqualTo(TOKEN);
}