@Test public void testGetAllAccessTokens(){ Set<OAuth2AccessTokenEntity> tokens = repository.getAllAccessTokens(); assertEquals(4, tokens.size()); }
@Override public Set<OAuth2AccessTokenEntity> getAllAccessTokens() { TypedQuery<OAuth2AccessTokenEntity> query = manager.createNamedQuery(OAuth2AccessTokenEntity.QUERY_ALL, OAuth2AccessTokenEntity.class); return new LinkedHashSet<>(query.getResultList()); }
JpaOAuth2TokenRepository implements OAuth2TokenRepository { @Override public Set<OAuth2AccessTokenEntity> getAllAccessTokens() { TypedQuery<OAuth2AccessTokenEntity> query = manager.createNamedQuery(OAuth2AccessTokenEntity.QUERY_ALL, OAuth2AccessTokenEntity.class); return new LinkedHashSet<>(query.getResultList()); } }
JpaOAuth2TokenRepository implements OAuth2TokenRepository { @Override public Set<OAuth2AccessTokenEntity> getAllAccessTokens() { TypedQuery<OAuth2AccessTokenEntity> query = manager.createNamedQuery(OAuth2AccessTokenEntity.QUERY_ALL, OAuth2AccessTokenEntity.class); return new LinkedHashSet<>(query.getResultList()); }  }
JpaOAuth2TokenRepository implements OAuth2TokenRepository { @Override public Set<OAuth2AccessTokenEntity> getAllAccessTokens() { TypedQuery<OAuth2AccessTokenEntity> query = manager.createNamedQuery(OAuth2AccessTokenEntity.QUERY_ALL, OAuth2AccessTokenEntity.class); return new LinkedHashSet<>(query.getResultList()); }  @Override Set<OAuth2AccessTokenEntity> getAllAccessTokens(); @Override Set<OAuth2RefreshTokenEntity> getAllRefreshTokens(); @Override OAuth2AccessTokenEntity getAccessTokenByValue(String accessTokenValue); @Override OAuth2AccessTokenEntity getAccessTokenById(Long id); @Override @Transactional(value="defaultTransactionManager") OAuth2AccessTokenEntity saveAccessToken(OAuth2AccessTokenEntity token); @Override @Transactional(value="defaultTransactionManager") void removeAccessToken(OAuth2AccessTokenEntity accessToken); @Override @Transactional(value="defaultTransactionManager") void clearAccessTokensForRefreshToken(OAuth2RefreshTokenEntity refreshToken); @Override OAuth2RefreshTokenEntity getRefreshTokenByValue(String refreshTokenValue); @Override OAuth2RefreshTokenEntity getRefreshTokenById(Long id); @Override @Transactional(value="defaultTransactionManager") OAuth2RefreshTokenEntity saveRefreshToken(OAuth2RefreshTokenEntity refreshToken); @Override @Transactional(value="defaultTransactionManager") void removeRefreshToken(OAuth2RefreshTokenEntity refreshToken); @Override @Transactional(value="defaultTransactionManager") void clearTokensForClient(ClientDetailsEntity client); @Override List<OAuth2AccessTokenEntity> getAccessTokensForClient(ClientDetailsEntity client); @Override List<OAuth2RefreshTokenEntity> getRefreshTokensForClient(ClientDetailsEntity client); @Override Set<OAuth2AccessTokenEntity> getAccessTokensByUserName(String name); @Override Set<OAuth2RefreshTokenEntity> getRefreshTokensByUserName(String name); @Override Set<OAuth2AccessTokenEntity> getAllExpiredAccessTokens(); @Override Set<OAuth2AccessTokenEntity> getAllExpiredAccessTokens(PageCriteria pageCriteria); @Override Set<OAuth2RefreshTokenEntity> getAllExpiredRefreshTokens(); @Override Set<OAuth2RefreshTokenEntity> getAllExpiredRefreshTokens(PageCriteria pageCriteria); @Override Set<OAuth2AccessTokenEntity> getAccessTokensForResourceSet(ResourceSet rs); @Override @Transactional(value="defaultTransactionManager") void clearDuplicateAccessTokens(); @Override @Transactional(value="defaultTransactionManager") void clearDuplicateRefreshTokens(); @Override List<OAuth2AccessTokenEntity> getAccessTokensForApprovedSite(ApprovedSite approvedSite); }
JpaOAuth2TokenRepository implements OAuth2TokenRepository { @Override public Set<OAuth2AccessTokenEntity> getAllAccessTokens() { TypedQuery<OAuth2AccessTokenEntity> query = manager.createNamedQuery(OAuth2AccessTokenEntity.QUERY_ALL, OAuth2AccessTokenEntity.class); return new LinkedHashSet<>(query.getResultList()); }  @Override Set<OAuth2AccessTokenEntity> getAllAccessTokens(); @Override Set<OAuth2RefreshTokenEntity> getAllRefreshTokens(); @Override OAuth2AccessTokenEntity getAccessTokenByValue(String accessTokenValue); @Override OAuth2AccessTokenEntity getAccessTokenById(Long id); @Override @Transactional(value="defaultTransactionManager") OAuth2AccessTokenEntity saveAccessToken(OAuth2AccessTokenEntity token); @Override @Transactional(value="defaultTransactionManager") void removeAccessToken(OAuth2AccessTokenEntity accessToken); @Override @Transactional(value="defaultTransactionManager") void clearAccessTokensForRefreshToken(OAuth2RefreshTokenEntity refreshToken); @Override OAuth2RefreshTokenEntity getRefreshTokenByValue(String refreshTokenValue); @Override OAuth2RefreshTokenEntity getRefreshTokenById(Long id); @Override @Transactional(value="defaultTransactionManager") OAuth2RefreshTokenEntity saveRefreshToken(OAuth2RefreshTokenEntity refreshToken); @Override @Transactional(value="defaultTransactionManager") void removeRefreshToken(OAuth2RefreshTokenEntity refreshToken); @Override @Transactional(value="defaultTransactionManager") void clearTokensForClient(ClientDetailsEntity client); @Override List<OAuth2AccessTokenEntity> getAccessTokensForClient(ClientDetailsEntity client); @Override List<OAuth2RefreshTokenEntity> getRefreshTokensForClient(ClientDetailsEntity client); @Override Set<OAuth2AccessTokenEntity> getAccessTokensByUserName(String name); @Override Set<OAuth2RefreshTokenEntity> getRefreshTokensByUserName(String name); @Override Set<OAuth2AccessTokenEntity> getAllExpiredAccessTokens(); @Override Set<OAuth2AccessTokenEntity> getAllExpiredAccessTokens(PageCriteria pageCriteria); @Override Set<OAuth2RefreshTokenEntity> getAllExpiredRefreshTokens(); @Override Set<OAuth2RefreshTokenEntity> getAllExpiredRefreshTokens(PageCriteria pageCriteria); @Override Set<OAuth2AccessTokenEntity> getAccessTokensForResourceSet(ResourceSet rs); @Override @Transactional(value="defaultTransactionManager") void clearDuplicateAccessTokens(); @Override @Transactional(value="defaultTransactionManager") void clearDuplicateRefreshTokens(); @Override List<OAuth2AccessTokenEntity> getAccessTokensForApprovedSite(ApprovedSite approvedSite);  }