@Test public void getAllRefreshTokensForUser(){ when(tokenRepository.getRefreshTokensByUserName(userName)).thenReturn(newHashSet(refreshToken)); Set<OAuth2RefreshTokenEntity> tokens = service.getAllRefreshTokensForUser(userName); assertEquals(1, tokens.size()); assertTrue(tokens.contains(refreshToken)); }
@Override public Set<OAuth2RefreshTokenEntity> getAllRefreshTokensForUser(String userName) { return tokenRepository.getRefreshTokensByUserName(userName); }
DefaultOAuth2ProviderTokenService implements OAuth2TokenEntityService { @Override public Set<OAuth2RefreshTokenEntity> getAllRefreshTokensForUser(String userName) { return tokenRepository.getRefreshTokensByUserName(userName); } }
DefaultOAuth2ProviderTokenService implements OAuth2TokenEntityService { @Override public Set<OAuth2RefreshTokenEntity> getAllRefreshTokensForUser(String userName) { return tokenRepository.getRefreshTokensByUserName(userName); }  }
DefaultOAuth2ProviderTokenService implements OAuth2TokenEntityService { @Override public Set<OAuth2RefreshTokenEntity> getAllRefreshTokensForUser(String userName) { return tokenRepository.getRefreshTokensByUserName(userName); }  @Override Set<OAuth2AccessTokenEntity> getAllAccessTokensForUser(String userName); @Override Set<OAuth2RefreshTokenEntity> getAllRefreshTokensForUser(String userName); @Override OAuth2AccessTokenEntity getAccessTokenById(Long id); @Override OAuth2RefreshTokenEntity getRefreshTokenById(Long id); @Override @Transactional(value="defaultTransactionManager") OAuth2AccessTokenEntity createAccessToken(OAuth2Authentication authentication); @Override @Transactional(value="defaultTransactionManager") OAuth2AccessTokenEntity refreshAccessToken(String refreshTokenValue, TokenRequest authRequest); @Override OAuth2Authentication loadAuthentication(String accessTokenValue); @Override OAuth2AccessTokenEntity readAccessToken(String accessTokenValue); @Override OAuth2AccessTokenEntity getAccessToken(OAuth2Authentication authentication); @Override OAuth2RefreshTokenEntity getRefreshToken(String refreshTokenValue); @Override @Transactional(value="defaultTransactionManager") void revokeRefreshToken(OAuth2RefreshTokenEntity refreshToken); @Override @Transactional(value="defaultTransactionManager") void revokeAccessToken(OAuth2AccessTokenEntity accessToken); @Override List<OAuth2AccessTokenEntity> getAccessTokensForClient(ClientDetailsEntity client); @Override List<OAuth2RefreshTokenEntity> getRefreshTokensForClient(ClientDetailsEntity client); @Override void clearExpiredTokens(); @Override @Transactional(value="defaultTransactionManager") OAuth2AccessTokenEntity saveAccessToken(OAuth2AccessTokenEntity accessToken); @Override @Transactional(value="defaultTransactionManager") OAuth2RefreshTokenEntity saveRefreshToken(OAuth2RefreshTokenEntity refreshToken); TokenEnhancer getTokenEnhancer(); void setTokenEnhancer(TokenEnhancer tokenEnhancer); @Override OAuth2AccessTokenEntity getRegistrationAccessTokenForClient(ClientDetailsEntity client); }
DefaultOAuth2ProviderTokenService implements OAuth2TokenEntityService { @Override public Set<OAuth2RefreshTokenEntity> getAllRefreshTokensForUser(String userName) { return tokenRepository.getRefreshTokensByUserName(userName); }  @Override Set<OAuth2AccessTokenEntity> getAllAccessTokensForUser(String userName); @Override Set<OAuth2RefreshTokenEntity> getAllRefreshTokensForUser(String userName); @Override OAuth2AccessTokenEntity getAccessTokenById(Long id); @Override OAuth2RefreshTokenEntity getRefreshTokenById(Long id); @Override @Transactional(value="defaultTransactionManager") OAuth2AccessTokenEntity createAccessToken(OAuth2Authentication authentication); @Override @Transactional(value="defaultTransactionManager") OAuth2AccessTokenEntity refreshAccessToken(String refreshTokenValue, TokenRequest authRequest); @Override OAuth2Authentication loadAuthentication(String accessTokenValue); @Override OAuth2AccessTokenEntity readAccessToken(String accessTokenValue); @Override OAuth2AccessTokenEntity getAccessToken(OAuth2Authentication authentication); @Override OAuth2RefreshTokenEntity getRefreshToken(String refreshTokenValue); @Override @Transactional(value="defaultTransactionManager") void revokeRefreshToken(OAuth2RefreshTokenEntity refreshToken); @Override @Transactional(value="defaultTransactionManager") void revokeAccessToken(OAuth2AccessTokenEntity accessToken); @Override List<OAuth2AccessTokenEntity> getAccessTokensForClient(ClientDetailsEntity client); @Override List<OAuth2RefreshTokenEntity> getRefreshTokensForClient(ClientDetailsEntity client); @Override void clearExpiredTokens(); @Override @Transactional(value="defaultTransactionManager") OAuth2AccessTokenEntity saveAccessToken(OAuth2AccessTokenEntity accessToken); @Override @Transactional(value="defaultTransactionManager") OAuth2RefreshTokenEntity saveRefreshToken(OAuth2RefreshTokenEntity refreshToken); TokenEnhancer getTokenEnhancer(); void setTokenEnhancer(TokenEnhancer tokenEnhancer); @Override OAuth2AccessTokenEntity getRegistrationAccessTokenForClient(ClientDetailsEntity client);  }