@Test
    void verifyOperation() {
        val expiry = new MultifactorAuthenticationTrustRecordExpiry();

        val record = new MultifactorAuthenticationTrustRecord();
        record.setDeviceFingerprint(UUID.randomUUID().toString());
        record.setName("DeviceName");
        record.setPrincipal(UUID.randomUUID().toString());
        record.setId(1000);
        record.setRecordDate(ZonedDateTime.now(ZoneOffset.UTC).minusDays(1));
        record.setRecordKey(UUID.randomUUID().toString());

        assertEquals(Long.MAX_VALUE, expiry.expireAfterUpdate(record.getRecordKey(),
            record, System.currentTimeMillis(), 1000));

        record.setExpirationDate(DateTimeUtils.dateOf(ZonedDateTime.now(ZoneOffset.UTC).minusDays(1)));
        assertEquals(0, expiry.expireAfterUpdate(record.getRecordKey(),
            record, System.currentTimeMillis(), 1000));

        record.setExpirationDate(DateTimeUtils.dateOf(ZonedDateTime.now(ZoneOffset.UTC).plusDays(1)));
        assertTrue(expiry.expireAfterRead(record.getRecordKey(),
            record, System.currentTimeMillis(), 1000) > 0);
    }
This is {@link MultifactorAuthenticationTrustRecordExpiryTests}.

@author Misagh Moayyed
@since 7.2.0
support/cas-server-support-trusted-mfa-core/src/test/java/org/apereo/cas/trusted/authentication/storage/MultifactorAuthenticationTrustRecordExpiryTests.java