@Test
    void testJndiLookupFailsNoType() throws Exception {
        assertThrows(IllegalStateException.class, () -> {
            final String name = "my/jndi/resource";
            JndiObjectFactory<String> underTest = new JndiObjectFactory<String>() {
                @Override
                protected Object lookup(String jndiName) throws NamingException {
                    throw new NamingException("No resource named " + jndiName);
                }
            };

            underTest.setResourceName(name);

            underTest.getInstance();
        });
    }
This test makes the assumption that {@link JndiLocator} is tested elsewhere and only makes an attempt to test the
functionality added by {@link JndiObjectFactory}.
core/src/test/java/org/apache/shiro/jndi/JndiObjectFactoryTest.java