@Test
    void verifyTrustEngine() throws Throwable {
        var record = getMultifactorAuthenticationTrustRecord();
        record = getMfaTrustEngine().save(record);
        assertNotNull(getMfaTrustEngine().get(record.getId()));
        assertFalse(getMfaTrustEngine().getAll().isEmpty());
        assertFalse(getMfaTrustEngine().get(record.getPrincipal()).isEmpty());
        val now = ZonedDateTime.now(ZoneOffset.UTC).minusDays(2);
        assertFalse(getMfaTrustEngine().get(now).isEmpty());
        assertFalse(getMfaTrustEngine().get(record.getPrincipal(), now).isEmpty());

        getMfaTrustEngine().remove(DateTimeUtils.zonedDateTimeOf(record.getExpirationDate()).plusDays(1));
        getMfaTrustEngine().remove(record.getRecordKey());
        assertNull(getMfaTrustEngine().get(record.getId()));

        if (mfaTrustEngine instanceof final DisposableBean disposableBean) {
            disposableBean.destroy();
        }
    }
This is {@link AbstractMultifactorAuthenticationTrustStorageTests}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-trusted-mfa/src/test/java/org/apereo/cas/trusted/AbstractMultifactorAuthenticationTrustStorageTests.java