use of org.gluu.oxauth.uma.authorization.UmaPCT in project oxAuth by GluuFederation.
the class UmaPctService method createPctAndPersist.
public UmaPCT createPctAndPersist(String clientId) {
UmaPCT pct = createPct(clientId);
persist(pct);
return pct;
}
use of org.gluu.oxauth.uma.authorization.UmaPCT in project oxAuth by GluuFederation.
the class CleanerTimerTest method umaPct_whichIsExpiredAndDeletable_MustBeRemoved.
@Test
public void umaPct_whichIsExpiredAndDeletable_MustBeRemoved() throws StringEncrypter.EncryptionException {
final Client client = createClient();
clientService.persist(client);
// 1. create pct
UmaPCT pct = umaPctService.createPct(client.getClientId());
umaPctService.persist(pct);
// 2. pct exists
assertNotNull(umaPctService.getByCode(pct.getCode()));
// 3. clean up
cleanerTimer.processImpl();
cacheService.clear();
// 4. pct exists
assertNotNull(umaPctService.getByCode(pct.getCode()));
final Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.MINUTE, -10);
pct.setExpirationDate(calendar.getTime());
umaPctService.merge(pct);
// 5. clean up
cleanerTimer.processImpl();
cacheService.clear();
// 6. no pct in persistence
assertNull(umaPctService.getByCode(pct.getCode()));
}
Aggregations