@Test
    void verifyConsentExpired() throws Throwable {
        val authentication = CoreAuthenticationTestUtils.getAuthentication(UUID.randomUUID().toString());
        val service = CoreAuthenticationTestUtils.getService();
        val consentService = RegisteredServiceTestUtils.getRegisteredService("consentService");
        val policy = new ReturnAllAttributeReleasePolicy();
        policy.setConsentPolicy(new DefaultRegisteredServiceConsentPolicy());
        consentService.setAttributeReleasePolicy(policy);
        consentEngine.storeConsentDecision(service, consentService,
            authentication, -20, ChronoUnit.MONTHS, ConsentReminderOptions.ATTRIBUTE_NAME);
        assertTrue(consentEngine.isConsentRequiredFor(service, consentService, authentication).isRequired());
    }
This is {@link DefaultConsentEngineTests}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-consent-core/src/test/java/org/apereo/cas/consent/DefaultConsentEngineTests.java