JdbcRevocableTokenProvisioning implements RevocableTokenProvisioning, SystemDeletable { @Override public RevocableToken delete(String id, int version, String zoneId) { RevocableToken previous = retrieve(id, false, zoneId); template.update(DELETE_QUERY, id, zoneId); return previous; } JdbcRevocableTokenProvisioning(JdbcTemplate jdbcTemplate,
                                          LimitSqlAdapter limitSqlAdapter,
                                          TimeService timeService); @Override List<RevocableToken> retrieveAll(String zoneId); RevocableToken retrieve(String id, boolean checkExpired, String zoneId); @Override RevocableToken retrieve(String id, String zoneId); @Override int deleteRefreshTokensForClientAndUserId(String clientId, String userId, String zoneId); @Override RevocableToken create(RevocableToken t, String zoneId); @Override RevocableToken update(String id, RevocableToken t, String zoneId); @Override RevocableToken delete(String id, int version, String zoneId); @Override int deleteByIdentityZone(String zoneId); @Override int deleteByClient(String clientId, String zoneId); @Override int deleteByUser(String userId, String zoneId); @Override Logger getLogger(); @Override List<RevocableToken> getUserTokens(String userId, String zoneId); @Override List<RevocableToken> getUserTokens(String userId, String clientId, String zoneId); @Override List<RevocableToken> getClientTokens(String clientId, String zoneId); void setMaxExpirationRuntime(long maxExpirationRuntime); void setTimeService(TimeService timeService);  }
@Test void delete() { jdbcRevocableTokenProvisioning.create(revocableToken, IdentityZoneHolder.get().getId()); jdbcRevocableTokenProvisioning.retrieve(revocableToken.getTokenId(), IdentityZoneHolder.get().getId()); jdbcRevocableTokenProvisioning.delete(revocableToken.getTokenId(), 8, IdentityZoneHolder.get().getId()); assertThrows(EmptyResultDataAccessException.class, () -> jdbcRevocableTokenProvisioning.retrieve(revocableToken.getTokenId(), IdentityZoneHolder.get().getId())); }