@Test public void getAllAccessTokensForUser(){ when(tokenRepository.getAccessTokensByUserName(userName)).thenReturn(newHashSet(accessToken)); Set<OAuth2AccessTokenEntity> tokens = service.getAllAccessTokensForUser(userName); assertEquals(1, tokens.size()); assertTrue(tokens.contains(accessToken)); }
@Override public Set<OAuth2AccessTokenEntity> getAllAccessTokensForUser(String userName) { return tokenRepository.getAccessTokensByUserName(userName); }
DefaultOAuth2ProviderTokenService implements OAuth2TokenEntityService { @Override public Set<OAuth2AccessTokenEntity> getAllAccessTokensForUser(String userName) { return tokenRepository.getAccessTokensByUserName(userName); } }
DefaultOAuth2ProviderTokenService implements OAuth2TokenEntityService { @Override public Set<OAuth2AccessTokenEntity> getAllAccessTokensForUser(String userName) { return tokenRepository.getAccessTokensByUserName(userName); }  }
DefaultOAuth2ProviderTokenService implements OAuth2TokenEntityService { @Override public Set<OAuth2AccessTokenEntity> getAllAccessTokensForUser(String userName) { return tokenRepository.getAccessTokensByUserName(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<OAuth2AccessTokenEntity> getAllAccessTokensForUser(String userName) { return tokenRepository.getAccessTokensByUserName(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);  }