@Test
    void verifyOperation() throws Exception {
        val service = RegisteredServiceTestUtils.getRegisteredService();
        val authentication = RegisteredServiceTestUtils.getAuthentication();
        assertThrows(PrincipalException.class, () -> principalAccessStrategyEnforcer.authorize(
            RegisteredServicePrincipalAccessStrategyEnforcer.PrincipalAccessStrategyContext.builder()
                .registeredService(service)
                .principalId(authentication.getPrincipal().getId())
                .principalAttributes(CollectionUtils.merge(authentication.getAttributes(), authentication.getPrincipal().getAttributes()))
                .service(RegisteredServiceTestUtils.getService())
                .applicationContext(applicationContext)
                .build()));
    }
This is {@link DefaultRegisteredServicePrincipalAccessStrategyEnforcerTests}.

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