@Test void getUsernameShouldThrowWhenUnknownToken() { assertThatThrownBy(() -> Mono.from(accessTokenManager.getUsernameFromToken(AccessToken.generate())).block()) .isExactlyInstanceOf(InvalidAccessToken.class); }
@Override public Mono<Username> getUsernameFromToken(AccessToken token) throws InvalidAccessToken { return accessTokenRepository.getUsernameFromToken(token); }
AccessTokenManagerImpl implements AccessTokenManager { @Override public Mono<Username> getUsernameFromToken(AccessToken token) throws InvalidAccessToken { return accessTokenRepository.getUsernameFromToken(token); } }
AccessTokenManagerImpl implements AccessTokenManager { @Override public Mono<Username> getUsernameFromToken(AccessToken token) throws InvalidAccessToken { return accessTokenRepository.getUsernameFromToken(token); } @Inject  AccessTokenManagerImpl(AccessTokenRepository accessTokenRepository); }
AccessTokenManagerImpl implements AccessTokenManager { @Override public Mono<Username> getUsernameFromToken(AccessToken token) throws InvalidAccessToken { return accessTokenRepository.getUsernameFromToken(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); }
AccessTokenManagerImpl implements AccessTokenManager { @Override public Mono<Username> getUsernameFromToken(AccessToken token) throws InvalidAccessToken { return accessTokenRepository.getUsernameFromToken(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);  }