@Test
    void checkAuthzPrincipalWithAttrRequirementsWrongValue() throws Throwable {
        val reqAttrs = getRequiredAttributes();
        reqAttrs.put(GIVEN_NAME, Set.of("not present"));

        val authz = new DefaultRegisteredServiceAccessStrategy();
        authz.setRequireAllAttributes(true);
        authz.setRequiredAttributes(reqAttrs);

        assertFalse(authz.authorizeRequest(RegisteredServiceAccessStrategyRequest.builder().applicationContext(applicationContext)
            .principalId(TEST).attributes(getPrincipalAttributes()).build()));
    }
It is important that the non-matching attribute is not the first one, due to the
use of anyMatch and allMatch in the access strategy.
core/cas-server-core-services/src/test/java/org/apereo/cas/services/DefaultRegisteredServiceAccessStrategyTests.java