I believe the test authorizeWhenPasswordAndAuthorizedAndTokenNotExpiredButClockSkewForcesExpiryThenReauthorize in class PasswordOAuth2AuthorizedClientProviderTests aims at testing the case when a token is not expired but discarded because of Clock Skew. Based on the comment, it seems the test has been added to verify the fix of gh-7511.

However, in the test, the token is already expired (regardless of Clock Skew) :

Instant expiresAt = now.minus(Duration.ofMinutes(1)); --> token expired 1 minute ago

I think it should be :

Instant expiresAt = now.plus(Duration.ofMinutes(1)); --> token expires in 1 minute

Comment From: eleftherias

Thanks for the report @H-LREB! Are you interested in submitting a Pull Request to fix the test?

Comment From: H-LREB

Sure! I will submit the PR later today.

Comment From: H-LREB

I submitted pull request.