@Test
    void testEmptyCharArrayCredentials() throws NamingException {
        assertThrows(AuthenticationException.class, () -> {
            factory.setUrl("ldap://localhost:389");
            factory.getLdapContext("jcoder", new char[0]);
        });
    }
This is the only test that does not fake the JNDI environment.  It is provided for 100% test coverage.

@throws NamingException thrown because the host is always broken.
core/src/test/java/org/apache/shiro/realm/ldap/JndiLdapContextFactoryTest.java