@Test void isValidShouldThrowOnNullToken() { assertThatNullPointerException() .isThrownBy(() -> accessTokenManager.isValid(null)); }
@Override public Mono<Boolean> isValid(AccessToken token) throws InvalidAccessToken { try { return getUsernameFromToken(token) .thenReturn(true); } catch (InvalidAccessToken e) { return Mono.just(false); } }
AccessTokenManagerImpl implements AccessTokenManager { @Override public Mono<Boolean> isValid(AccessToken token) throws InvalidAccessToken { try { return getUsernameFromToken(token) .thenReturn(true); } catch (InvalidAccessToken e) { return Mono.just(false); } } }
AccessTokenManagerImpl implements AccessTokenManager { @Override public Mono<Boolean> isValid(AccessToken token) throws InvalidAccessToken { try { return getUsernameFromToken(token) .thenReturn(true); } catch (InvalidAccessToken e) { return Mono.just(false); } } @Inject  AccessTokenManagerImpl(AccessTokenRepository accessTokenRepository); }
AccessTokenManagerImpl implements AccessTokenManager { @Override public Mono<Boolean> isValid(AccessToken token) throws InvalidAccessToken { try { return getUsernameFromToken(token) .thenReturn(true); } catch (InvalidAccessToken e) { return Mono.just(false); } } @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<Boolean> isValid(AccessToken token) throws InvalidAccessToken { try { return getUsernameFromToken(token) .thenReturn(true); } catch (InvalidAccessToken e) { return Mono.just(false); } } @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);  }