@Test
    void verifyExpired() {
        val service = RegisteredServiceTestUtils.getRegisteredService();
        service.setExpirationPolicy(new DefaultRegisteredServiceExpirationPolicy(false,
            LocalDate.now(ZoneOffset.UTC).minusDays(1)));
        assertThrows(UnauthorizedServiceException.class, () ->
            RegisteredServiceAccessStrategyUtils.ensureServiceAccessIsAllowed(RegisteredServiceTestUtils.getService(), service));
    }
This is {@link RegisteredServiceAccessStrategyUtilsTests}.

@author Misagh Moayyed
@since 6.2.0
core/cas-server-core-services/src/test/java/org/apereo/cas/services/RegisteredServiceAccessStrategyUtilsTests.java