@Test
    public void testParseRestrictAll() {

        GroupParser parser = new LDAPGroupParser("cn", exampleBaseDn);

        // null input should be rejected as null
        assertNull(parser.parse(null));

        // Invalid DNs should be rejected as null
        assertNull(parser.parse(""));
        assertNull(parser.parse("foo"));

        // Valid DNs outside the base DN should be rejected as null
        assertNull(parser.parse("foo=bar"));
        assertNull(parser.parse("CN=baz,dc=example,dc=com"));

        // Valid DNs beneath the base DN but not using the correct attribute
        // should be rejected as null
        assertNull(parser.parse("ou=baz,dc=example,dc=net"));
        assertNull(parser.parse("ou=foo,cn=baz,dc=example,dc=net"));

        // Valid DNs beneath the base DN and using the correct attribute should
        // be accepted
        assertEquals("foo", parser.parse("cn=foo,DC=example,dc=net"));
        assertEquals("bar", parser.parse("CN=bar,OU=groups,dc=example,Dc=net"));

    }
Verifies that LDAPGroupParser correctly parses LDAP-based CAS groups
when restrictions are enforced on both LDAP attributes and the base DN.
extensions/guacamole-auth-sso/modules/guacamole-auth-sso-cas/src/test/java/org/apache/guacamole/auth/cas/group/LDAPGroupParserTest.java