JdbcRevocableTokenProvisioning implements RevocableTokenProvisioning, SystemDeletable { @Override public RevocableToken update(String id, RevocableToken t, String zoneId) { template.update(UPDATE_QUERY, t.getClientId(), t.getUserId(), t.getFormat(), t.getResponseType().toString(), t.getIssuedAt(), t.getExpiresAt(), t.getScope(), t.getValue(), id, zoneId); return retrieve(id, false, zoneId); } 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 update() { jdbcRevocableTokenProvisioning.create(revocableToken, IdentityZoneHolder.get().getId()); RevocableToken toUpdate = jdbcRevocableTokenProvisioning.retrieve(revocableToken.getTokenId(), IdentityZoneHolder.get().getId()); toUpdate.setFormat("format") .setExpiresAt(0L) .setIssuedAt(Long.MAX_VALUE) .setClientId("new-client-id") .setScope("scope1,scope2,scope3") .setValue(buildRandomTokenValue(random)) .setUserId("new-user-id") .setZoneId("arbitrary-zone-id") .setResponseType(REFRESH_TOKEN); RevocableToken revocableToken = jdbcRevocableTokenProvisioning.update(toUpdate.getTokenId(), toUpdate, IdentityZoneHolder.get().getId()); assertTokensAreEqual(toUpdate, revocableToken); }