AccessTokenManagerImpl implements AccessTokenManager { @Override public Mono<Void> revoke(AccessToken token) { return accessTokenRepository.removeToken(token); } @Inject  AccessTokenManagerImpl(AccessTokenRepository accessTokenRepository); @Override Mono<AccessToken> grantAccessToken(Username username); @Override Mono<Username> getUsernameFromToken(AccessToken token); @Override Mono<Boolean> isValid(AccessToken token); @Override Mono<Void> revoke(AccessToken token);  }
@Test void revokeShouldThrowWhenNullToken() { assertThatNullPointerException() .isThrownBy(() -> Mono.from(accessTokenManager.revoke(null)).block()); }
@Test void revokeShouldNoopOnUnknownToken() { Mono.from(accessTokenManager.revoke(AccessToken.generate())).block(); }
@Test void revokeShouldNoopOnRevokingTwice() { AccessToken token = AccessToken.generate(); Mono.from(accessTokenManager.revoke(token)).block(); Mono.from(accessTokenManager.revoke(token)).block(); }