@Test
    void checkAuthzWithAttributeRequirementAsGroovy() throws Throwable {
        val authz = new DefaultRegisteredServiceAccessStrategy();
        val required = new HashMap<String, Set<String>>();
        required.put(CN, Set.of("groovy { return attributes.containsKey('name') && currentValues.contains('admin') }"));
        authz.setRequiredAttributes(required);
        var request = RegisteredServiceAccessStrategyRequest.builder().applicationContext(applicationContext)
            .attributes(Map.of(PHONE, List.of("1234567890")))
            .principalId(TEST).build();
        assertFalse(authz.authorizeRequest(request));
        request = request.withAttributes(Map.of(CN, List.of("admin"), "name", List.of("casuser")));
        assertTrue(authz.authorizeRequest(request));
    }
This is test cases for
{@link DefaultRegisteredServiceAccessStrategy}.

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